Move DefaultUnixAdminPath to config package
We can drop the soju package import. This shrinks down sojuctl's size significantly (18M to 3M).
This commit is contained in:
parent
4ca8dfa37d
commit
4c8e955946
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ config_path := $(SYSCONFDIR)/soju/config
|
|||||||
admin_socket_path := $(RUNDIR)/soju/admin
|
admin_socket_path := $(RUNDIR)/soju/admin
|
||||||
goflags := $(GOFLAGS) -ldflags=" \
|
goflags := $(GOFLAGS) -ldflags=" \
|
||||||
-X 'git.sr.ht/~emersion/soju/config.DefaultPath=$(config_path)' \
|
-X 'git.sr.ht/~emersion/soju/config.DefaultPath=$(config_path)' \
|
||||||
-X 'git.sr.ht/~emersion/soju.DefaultUnixAdminPath=$(admin_socket_path)'"
|
-X 'git.sr.ht/~emersion/soju/config.DefaultUnixAdminPath=$(admin_socket_path)'"
|
||||||
|
|
||||||
all: soju sojudb sojuctl doc/soju.1
|
all: soju sojudb sojuctl doc/soju.1
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ func main() {
|
|||||||
case "unix+admin":
|
case "unix+admin":
|
||||||
path := u.Path
|
path := u.Path
|
||||||
if path == "" {
|
if path == "" {
|
||||||
path = soju.DefaultUnixAdminPath
|
path = config.DefaultUnixAdminPath
|
||||||
}
|
}
|
||||||
ln, err := net.Listen("unix", path)
|
ln, err := net.Listen("unix", path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.sr.ht/~emersion/soju"
|
|
||||||
"gopkg.in/irc.v4"
|
"gopkg.in/irc.v4"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
@ -37,7 +36,7 @@ func run(ctx context.Context, cfg *config.Server, words []string) error {
|
|||||||
if u.Path != "" {
|
if u.Path != "" {
|
||||||
path = u.Path
|
path = u.Path
|
||||||
} else {
|
} else {
|
||||||
path = soju.DefaultUnixAdminPath
|
path = config.DefaultUnixAdminPath
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,10 @@ import (
|
|||||||
"git.sr.ht/~emersion/go-scfg"
|
"git.sr.ht/~emersion/go-scfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var DefaultPath string
|
var (
|
||||||
|
DefaultPath string
|
||||||
|
DefaultUnixAdminPath = "/run/soju/admin"
|
||||||
|
)
|
||||||
|
|
||||||
type IPSet []*net.IPNet
|
type IPSet []*net.IPNet
|
||||||
|
|
||||||
|
@ -516,3 +516,7 @@ character.
|
|||||||
Maintained by Simon Ser <contact@emersion.fr>, who is assisted by other
|
Maintained by Simon Ser <contact@emersion.fr>, who is assisted by other
|
||||||
open-source contributors. For more information about soju development, see
|
open-source contributors. For more information about soju development, see
|
||||||
<https://sr.ht/~emersion/soju>.
|
<https://sr.ht/~emersion/soju>.
|
||||||
|
|
||||||
|
# SEE ALSO
|
||||||
|
|
||||||
|
*sojuctl*(1)
|
||||||
|
@ -26,8 +26,6 @@ import (
|
|||||||
"git.sr.ht/~emersion/soju/identd"
|
"git.sr.ht/~emersion/soju/identd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var DefaultUnixAdminPath = "/run/soju/admin"
|
|
||||||
|
|
||||||
// TODO: make configurable
|
// TODO: make configurable
|
||||||
var retryConnectMinDelay = time.Minute
|
var retryConnectMinDelay = time.Minute
|
||||||
var retryConnectMaxDelay = 10 * time.Minute
|
var retryConnectMaxDelay = 10 * time.Minute
|
||||||
|
Loading…
Reference in New Issue
Block a user