Skip to content

Commit

Permalink
add no-gen-key flag to prevent key generation
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Oct 9, 2019
1 parent 3e4d51e commit f522c0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/tinc-boot/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Cmd struct {
Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"Boot node request timeout" default:"15s"`
Bin string `long:"bin" env:"BIN" description:"tinc-boot location" default:"/usr/local/bin/tinc-boot"`
NoBinCopy bool `long:"no-bin-copy" env:"NO_BIN_COPY" description:"Disable copy tinc-boot binary"`
NoGenKey bool `long:"no-gen-key" env:"NO_GEN_KEY" description:"Disable key generation"`
Port int `long:"port" env:"PORT" description:"Node port (first available will be got if not set)"`
Public []string `short:"a" alias:"addr" long:"public" env:"PUBLIC" description:"Public addresses that could be used for incoming connections"`
Standalone bool `long:"standalone" env:"STANDALONE" description:"Do not use bootnodes (usefull for very-very first initialization)"`
Expand Down Expand Up @@ -224,6 +225,9 @@ func (cmd *Cmd) boot() error {
}

func (cmd *Cmd) runKeyGen() error {
if cmd.NoGenKey {
return nil
}
keyCmd := exec.Command("tincd", "-c", cmd.Dir(), "-K", "4096")
keyCmd.Stdin = bytes.NewBufferString("\n\n")
keyCmd.Stdout = os.Stdout
Expand Down

0 comments on commit f522c0a

Please sign in to comment.