diff --git a/backend/app/api/main.go b/backend/app/api/main.go index 8b0c844..1389285 100644 --- a/backend/app/api/main.go +++ b/backend/app/api/main.go @@ -132,16 +132,16 @@ func run(cfg *config.Config) error { currencies.CollectDefaults(), } - if cfg.CurrencyConfig != "" { + if cfg.Options.CurrencyConfig != "" { log.Info(). - Str("path", cfg.CurrencyConfig). + Str("path", cfg.Options.CurrencyConfig). Msg("loading currency config file") - content, err := os.ReadFile(cfg.CurrencyConfig) + content, err := os.ReadFile(cfg.Options.CurrencyConfig) if err != nil { log.Fatal(). Err(err). - Str("path", cfg.CurrencyConfig). + Str("path", cfg.Options.CurrencyConfig). Msg("failed to read currency config file") } diff --git a/backend/internal/sys/config/conf.go b/backend/internal/sys/config/conf.go index 2602bc7..efc1871 100644 --- a/backend/internal/sys/config/conf.go +++ b/backend/internal/sys/config/conf.go @@ -17,8 +17,7 @@ const ( type Config struct { conf.Version - Mode string `yaml:"mode" conf:"default:development"` // development or production - CurrencyConfig string `yaml:"currencies"` + Mode string `yaml:"mode" conf:"default:development"` // development or production Web WebConfig `yaml:"web"` Storage Storage `yaml:"storage"` Log LoggerConf `yaml:"logger"` @@ -31,6 +30,7 @@ type Config struct { type Options struct { AllowRegistration bool `yaml:"disable_registration" conf:"default:true"` AutoIncrementAssetID bool `yaml:"auto_increment_asset_id" conf:"default:true"` + CurrencyConfig string `yaml:"currencies"` } type DebugConf struct {