mirror of
https://github.com/netbirdio/netbird.git
synced 2025-04-16 23:48:31 +02:00
chore: add a bit more logs to the init command
This commit is contained in:
parent
19e43c6193
commit
682049b49c
13
cmd/init.go
13
cmd/init.go
@ -30,8 +30,17 @@ var (
|
|||||||
|
|
||||||
if wgKey == "" {
|
if wgKey == "" {
|
||||||
wgKey = generateKey()
|
wgKey = generateKey()
|
||||||
|
log.Warnf("there was no Wireguard private key specified, a new Wireguard key has been generated")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parsedKey, err := wgtypes.ParseKey(wgKey)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("invalid Wireguard private key %s", wgKey)
|
||||||
|
os.Exit(ExitSetupFailed)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Infof("my public Wireguard key is %s", parsedKey.PublicKey().String())
|
||||||
|
|
||||||
var stunTurnURLs []*ice.URL
|
var stunTurnURLs []*ice.URL
|
||||||
stuns := strings.Split(stunURLs, ",")
|
stuns := strings.Split(stunURLs, ",")
|
||||||
for _, url := range stuns {
|
for _, url := range stuns {
|
||||||
@ -80,11 +89,13 @@ var (
|
|||||||
WgIface: wgInterface,
|
WgIface: wgInterface,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := config.Write(configPath)
|
err = config.Write(configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("failed writing config to %s: %s", config, err.Error())
|
log.Errorf("failed writing config to %s: %s", config, err.Error())
|
||||||
os.Exit(ExitSetupFailed)
|
os.Exit(ExitSetupFailed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("a new config has been generated and written to %s", configPath)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
13
signal/Dockerfile
Normal file
13
signal/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM docker.io/golang:1.16 AS build
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
COPY go.mod .
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go mod download
|
||||||
|
RUN go install .
|
||||||
|
|
||||||
|
FROM gcr.io/distroless/base
|
||||||
|
COPY --from=build /go/bin/wiretrustee-hub /
|
||||||
|
ENTRYPOINT [ "/wiretrustee-hub" ]
|
Loading…
Reference in New Issue
Block a user