GitHub
08/09/2026, 8:49 PMdebug.
Problem
Two issues prevented editing:
1. Only debug was editable — service, osquery, osctrld, batchWriter, and metrics were all marked Editable=false in the registry, so the frontend never showed Edit buttons for them.
2. Stale Editable flag in existing DB rows — Seed used ON CONFLICT DO NOTHING, so rows created before a section was marked editable kept Editable=false forever. The GET endpoints returned the stale DB flag, and the frontend used that flag to decide whether to show the Edit button — so even after updating the registry, existing deployments never saw the Edit button until the table was manually wiped.
Changes
Expanded editable sections (pkg/serviceconfig/serviceconfig.go)
| Section | TLS | API | Why |
| ----------- | --- | --- | ------------------------------- |
| service | ✅ | ✅ | Listener, port, log level, host |
| osquery | ✅ | ✅ | Feature toggles |
| osctrld | ✅ | — | osctrl integration toggle |
| batchWriter | ✅ | — | Batch tuning |
| metrics | ✅ | — | Prometheus endpoint |
| debug | ✅ | ✅ | HTTP debug dump |
Non-editable (secrets/credentials/auth/file paths): db, redis, tls, saml, oidc, jwt, configEndpoints, logger, carver.
Metadata sync on boot (pkg/serviceconfig/serviceconfig.go)
Seed now syncs the Editable and Info fields from the SectionRegistry to existing rows after the create-if-missing step. These are schema-level flags controlled by the code, not operator data, so they must always reflect the current registry — even for rows seeded by a previous boot with different flags. The Value and Source fields are never touched by the sync, preserving the create-if-missing guarantee for operator-edited content.
Tests (2 new in pkg/serviceconfig/serviceconfig_test.go)
• TestSeed_SyncsEditableFlagToExistingRows — verifies that re-seeding flips a stale Editable=false row to Editable=true when the registry says it's editable.
• TestSeed_SyncsInfoToExistingRows — verifies that re-seeding updates stale Info text on existing rows.
Validation
• go build ./... — clean
• go test ./... — all packages pass
• golangci-lint run ./pkg/serviceconfig/... — 0 issues
Security notes
• The sync only touches Editable and Info — never Value or Source, so DB-edited content is preserved.
• Connection/secret/auth sections (db, redis, tls, saml, oidc, jwt, configEndpoints, logger, carver) remain non-editable and can never be written through the API.
jmpsec/osctrlGitHub
08/09/2026, 8:59 PM