diff --git a/cmd/storagenode/entrypoint b/cmd/storagenode/entrypoint index 0ab066a84..d149e63c6 100755 --- a/cmd/storagenode/entrypoint +++ b/cmd/storagenode/entrypoint @@ -10,7 +10,7 @@ fi RUN_PARAMS="${RUN_PARAMS:-} --config-dir ${CONF_PATH}" -export STORJ_IDENTITY_SERVER_ADDRESS="${STORJ_IDENTITY_SERVER_ADDRESS:-$(hostname -i):7777}" +export STORJ_SERVER_ADDRESS="${STORJ_SERVER_ADDRESS:-$(hostname -i):7777}" if [ -n "${SATELLITE_ADDR:-}" ]; then RUN_PARAMS="${RUN_PARAMS} --kademlia.bootstrap-addr $SATELLITE_ADDR" diff --git a/cmd/storagenode/main.go b/cmd/storagenode/main.go index ccac15d57..e4a5f2a79 100644 --- a/cmd/storagenode/main.go +++ b/cmd/storagenode/main.go @@ -82,6 +82,7 @@ var ( ) const ( + // default server address, only for storage node defaultServerAddr = ":28967" ) @@ -160,15 +161,14 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) { } overrides := map[string]interface{}{ - "identity.cert-path": setupCfg.Identity.CertPath, - "identity.key-path": setupCfg.Identity.KeyPath, - "identity.server.address": defaultServerAddr, - "storage.path": filepath.Join(setupDir, "storage"), - "log.level": "info", + "log.level": "info", + } + serverAddress := cmd.Flag("server.address") + if !serverAddress.Changed { + overrides[serverAddress.Name] = defaultServerAddr } configFile := filepath.Join(setupDir, "config.yaml") - if setupCfg.SaveAllDefaults { err = process.SaveConfigWithAllDefaults(cmd.Flags(), configFile, overrides) } else { diff --git a/pkg/piecestore/psserver/config.go b/pkg/piecestore/psserver/config.go index 861d83b67..38f802fad 100644 --- a/pkg/piecestore/psserver/config.go +++ b/pkg/piecestore/psserver/config.go @@ -28,7 +28,7 @@ var ( // Config contains everything necessary for a server type Config struct { - Path string `user:"true" help:"path to store data in" default:"$CONFDIR"` + Path string `user:"true" help:"path to store data in" default:"$CONFDIR/storage"` AllocatedDiskSpace memory.Size `user:"true" help:"total allocated disk space in bytes" default:"1TiB"` AllocatedBandwidth memory.Size `user:"true" help:"total allocated bandwidth in bytes" default:"500GiB"` KBucketRefreshInterval time.Duration `help:"how frequently Kademlia bucket should be refreshed with node stats" default:"1h0m0s"` diff --git a/pkg/process/exec_conf.go b/pkg/process/exec_conf.go index 162d3366c..133a4b714 100644 --- a/pkg/process/exec_conf.go +++ b/pkg/process/exec_conf.go @@ -83,8 +83,10 @@ func saveConfig(flagset *pflag.FlagSet, outfile string, overrides map[string]int } value := f.Value.String() - if v, ok := overrides[k]; ok { - value = fmt.Sprintf("%v", v) + if overrides != nil { + if v, ok := overrides[k]; ok { + value = fmt.Sprintf("%v", v) + } } if f.Usage != "" { fmt.Fprintf(w, "# %s\n", f.Usage)