chore: add a bit more logs to the init command

This commit is contained in:
braginini 2021-05-05 12:15:55 +02:00
parent 19e43c6193
commit 682049b49c
2 changed files with 25 additions and 1 deletions

View File

@ -30,8 +30,17 @@ var (
if wgKey == "" {
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
stuns := strings.Split(stunURLs, ",")
for _, url := range stuns {
@ -80,11 +89,13 @@ var (
WgIface: wgInterface,
}
err := config.Write(configPath)
err = config.Write(configPath)
if err != nil {
log.Errorf("failed writing config to %s: %s", config, err.Error())
os.Exit(ExitSetupFailed)
}
log.Infof("a new config has been generated and written to %s", configPath)
},
}
)

13
signal/Dockerfile Normal file
View 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" ]