diff --git a/cmd/init.go b/cmd/init.go index 8edeadc426c..a66cf9a89c7 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -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) }, } ) diff --git a/signal/Dockerfile b/signal/Dockerfile new file mode 100644 index 00000000000..e09ad387e70 --- /dev/null +++ b/signal/Dockerfile @@ -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" ]