skycoin / dmsg

dmsg
7 stars 17 forks source link

dmsg-server can't read config from file #216

Closed 0pcom closed 1 year ago

0pcom commented 1 year ago

this was built from develop branch image

[0pcom@host skywire-deployment]$  dmsg-server start -c dmsg-config.json
Version "unknown" built on "unknown" against commit "unknown"
[2023-05-05T13:02:06.84158968-05:00] FATAL [dmsg_srv]: parsing config failed, generating default one... error="no config location specified"
[0pcom@host skywire-deployment]$ ls dmsg-config.json
dmsg-config.json
[0pcom@host skywire-deployment]$  dmsg-server start -c $(pwd)/dmsg-config.json
Version "unknown" built on "unknown" against commit "unknown"
[2023-05-05T13:02:35.47603325-05:00] FATAL [dmsg_srv]: parsing config failed, generating default one... error="no config 
location specified"

$ dmsg-server start --help
Start Dmsg Server

Usage:
  dmsg-server start [flags]

Flags:
  -c, --config string       location of config file (STDIN to read from standard input) (default "config.json")
  -h, --help                help for start
  -m, --metrics string      address to serve metrics API from
      --stdin               whether to read config via stdin
      --syslog string       address in which to dial to syslog server
      --syslog-lvl string   minimum log level to report (default "debug")
      --syslog-net string   network in which to dial to syslog server (default "udp")
      --tag string          tag used for logging and metrics (default "dmsg_srv")

it works to pipe the config to stdin

cat dmsg-config.json | dmsg-server start -c STDIN
0pcom commented 1 year ago

it works as an argument, but not via flag, this is easily addressed