From da5019240f0ab032a9852e8c6d008e065ac589fc Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Thu, 13 Jul 2023 14:39:14 -0600 Subject: [PATCH 1/2] all: ignore hostd config file --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a1d0443e..7e24bf4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ bin/ .DS_Store -.vscode \ No newline at end of file +.vscode +hostd.yml \ No newline at end of file From 09cbd1bad772675f8aad2a6fa1ec2429c133edc2 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Thu, 13 Jul 2023 14:39:23 -0600 Subject: [PATCH 2/2] cmd: fix log data directory --- cmd/hostd/main.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/hostd/main.go b/cmd/hostd/main.go index f5ef2bb3..c42c9c1c 100644 --- a/cmd/hostd/main.go +++ b/cmd/hostd/main.go @@ -169,10 +169,6 @@ func main() { // attempt to load the config file first, command line flags will override // any values set in the config file mustLoadConfig() - // set the log path to the data dir if it is not already set - if len(config.Log.Path) == 0 { - config.Log.Path = config.DataDir - } // global flag.StringVar(&config.Name, "name", config.Name, "a friendly name for the host, only used for display") @@ -215,6 +211,13 @@ func main() { mustSetAPIPassword() mustSetWalletkey() + // set the log path to the data dir if it is not already set note: this + // musst happen after CLI flags are parsed so that the data directory can be + // specified via the command line + if len(config.Log.Path) == 0 { + config.Log.Path = config.DataDir + } + var seed [32]byte if err := wallet.SeedFromPhrase(&seed, config.RecoveryPhrase); err != nil { log.Fatalln("failed to load wallet:", err)