[TASK] Config: give each service its own dedicated config file and remove env-var dependency
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- go, yaml
- Ambito
- backend, infrastructure
Direzione di ricerca
Start by reading the service entry points under cmd/server, cmd/sasl, cmd/delivery, and cmd/socketmap, then trace their loaders in internal/conf, internal/delivery/config, and internal/socketmap/config. Check the existing config/raven.yaml and config/delivery.yaml plus the non-test environment lookups to map each setting to a service. Done means all four services honor --config, have self-describing example files and docs, and can start without environment variables.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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_SECONDSserver/sasl(viainternal/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
- [ ] Define a per-service config schema (struct + YAML) for each of the four services.
- [ ] Consolidate loading into a shared helper in
internal/confthat accepts an explicit path from--configand applies code defaults — used by all four services (each with its own schema). - [ ] Fix
server/saslso--configis actually honored (resolves problem 1). - [ ] Add a
--configflag tosocketmap. - [ ] Move all env-var settings into the corresponding config files and remove the
os.Getenvlookups in non-test code. - [ ] Add example files
config/server.yaml,config/sasl.yaml,config/socketmap.yaml(and keepconfig/delivery.yaml); deprecate/splitconfig/raven.yaml. - [ ] Document each service's config in
docs/.
Acceptance Criteria
- [ ] Each service starts solely from its own config file via
--config, with no env vars set. - [ ]
--config <path>is honored by all four services. - [ ] No
os.Getenvcalls remain in service configuration code paths (non-test). - [ ] Example config file and docs exist for every service.
Notes / Best Practices Applied
- One config file per deployable service — clear ownership, independent deployment.
- Explicit
--configpath over implicit path-search magic — reproducible, testable. - Config-as-files over scattered env vars — auditable, versionable, no hidden runtime state; precedence kept simple:
--configfile → code defaults.
- Lingua principale
- Go
- Stelle
- 12
- Fork
- 13
- Merge medio
- 2g 3h
- PR unite (30g)
- 8
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenGovMail/raven
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenGovMail/raven#338 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] UNSELECT accepts extra arguments instead of returning BADForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenGovMail/raven#322 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] NAMESPACE accepts extra arguments instead of returning BADForse già presa @tharinfernando l’ha presa 1 giorno fa. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenGovMail/raven#321 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenGovMail/raven#320 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenGovMail/raven#319 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenGovMail/raven
Issue simili
-
Add rebaseWhen: conflicted to major Go module Renovate updatesForse già presa @WadekarPrashant l’ha presa oggi. Apertaenhancement feature good first issue ready-for-triage triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
konflux-ci/build-definitions#3943 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
-
Typos Check fails when the typos binary download failsForse già presa @akshat-kumar-singhal l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nats-io/nats-server#8966 ·
I maintainer di solito rispondono entro 1 giorno
-
cmd/fix, x/tools/go/analysis/passes/modernize: mapsloop moves comments out of the range operandForse già presa @muratmirgun l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno