What needs to be done?
Summary
Raven ships four services — server, sasl, delivery, socketmap (cmd/) — but configuration is currently inconsistent: three different loaders, a --config flag that is silently ignored by two services, one service configured entirely through environment variables, and no per-service config files.
Goal: every service should load its configuration from its own dedicated config file, honored via --config, with no environment variables required.
Current State
| Service |
Loader |
--config flag |
Source of truth |
| server |
conf.LoadConfig() |
yes, but ignored |
hardcoded path search (config.go:46-50) + env vars |
| sasl |
conf.LoadConfig() |
yes, but ignored |
hardcoded path search + env vars |
| delivery |
config.LoadConfig(path) |
yes (honored) |
/etc/raven/delivery.yaml + DefaultConfig() |
| socketmap |
config.Load() |
none |
environment variables only (config.go:20-27) |
Only config/raven.yaml and config/delivery.yaml exist today; server and sasl share raven.yaml, and socketmap has no file at all.
Problems
1. Dead --config flag (bug). cmd/server and cmd/sasl pass --config, but conf.LoadConfig() takes no path and searches a hardcoded list — the flag has no effect.
2. No per-service config files. server/sasl share one file; socketmap has none.
3. Environment variables are required. Configuration is currently spread across env vars instead of files:
socketmap: SOCKETMAP_HOST, SOCKETMAP_PORT, THUNDER_HOST, THUNDER_PORT, CACHE_TTL_SECONDS, TOKEN_REFRESH_SECONDS
server/sasl (via internal/conf): THUNDER_DEVELOP_APP_ID, APPLICATION_ID, applicationId, IDP_FLOW_ACTION, IDP_SYSTEM_USERNAME, IDP_SYSTEM_PASSWORD
4. Three separate config implementations (internal/conf, internal/delivery/config, internal/socketmap/config) with inconsistent defaults and error handling.
Desired End State
Each service loads one dedicated config file:
config/server.yaml
config/sasl.yaml
config/delivery.yaml
config/socketmap.yaml
- Each service exposes a working
--config <path> flag that points to its own file (sane default under /etc/raven/<service>.yaml).
- No environment variables are required — every setting currently read from env (listed above) is moved into the appropriate service's config file.
- Each config file is fully self-describing, with a checked-in example and documentation in
docs/.
Proposed Direction
Acceptance Criteria
Notes / Best Practices Applied
- One config file per deployable service — clear ownership, independent deployment.
- Explicit
--config path over implicit path-search magic — reproducible, testable.
- Config-as-files over scattered env vars — auditable, versionable, no hidden runtime state; precedence kept simple:
--config file → code defaults.
What needs to be done?
Summary
Raven ships four services —
server,sasl,delivery,socketmap(cmd/) — but configuration is currently inconsistent: three different loaders, a--configflag that is silently ignored by two services, one service configured entirely through environment variables, and no per-service config files.Goal: every service should load its configuration from its own dedicated config file, honored via
--config, with no environment variables required.Current State
Only
config/raven.yamlandconfig/delivery.yamlexist today;serverandsaslshareraven.yaml, andsocketmaphas no file at all.Problems
1. Dead
--configflag (bug).cmd/serverandcmd/saslpass--config, butconf.LoadConfig()takes no path and searches a hardcoded list — the flag has no effect.2. No per-service config files.
server/saslshare one file;socketmaphas none.3. Environment variables are required. Configuration is currently spread across env vars instead of files:
socketmap:SOCKETMAP_HOST,SOCKETMAP_PORT,THUNDER_HOST,THUNDER_PORT,CACHE_TTL_SECONDS,TOKEN_REFRESH_SECONDSserver/sasl(viainternal/conf):THUNDER_DEVELOP_APP_ID,APPLICATION_ID,applicationId,IDP_FLOW_ACTION,IDP_SYSTEM_USERNAME,IDP_SYSTEM_PASSWORD4. Three separate config implementations (
internal/conf,internal/delivery/config,internal/socketmap/config) with inconsistent defaults and error handling.Desired End State
Each service loads one dedicated config file:
--config <path>flag that points to its own file (sane default under/etc/raven/<service>.yaml).docs/.Proposed Direction
internal/confthat accepts an explicit path from--configand applies code defaults — used by all four services (each with its own schema).server/saslso--configis actually honored (resolves problem 1).--configflag tosocketmap.os.Getenvlookups in non-test code.config/server.yaml,config/sasl.yaml,config/socketmap.yaml(and keepconfig/delivery.yaml); deprecate/splitconfig/raven.yaml.docs/.Acceptance Criteria
--config, with no env vars set.--config <path>is honored by all four services.os.Getenvcalls remain in service configuration code paths (non-test).Notes / Best Practices Applied
--configpath over implicit path-search magic — reproducible, testable.--configfile → code defaults.