Skip to content

feat(service): install writes config.env, unit loads it via EnvironmentFile - #948

Merged
fclairamb merged 10 commits into
mainfrom
feat/config-env-installer
Nov 21, 2026
Merged

fclairamb merged 10 commits into
mainfrom
feat/config-env-installer

Conversation

@fclairamb

@fclairamb fclairamb commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Implements #947, requested by a user who tested the systemd install in an LXC (https://feddit.org/comment/16146954): prepare the first start with environment variables rather than YAML.

What changes

  • systemdUnit() adds EnvironmentFile=<data dir>/config.env to both system and user units.
  • serviceInstall writes a commented config.env starter (0600, chowned to the service user like the data folder). An existing config.env is never overwritten — it may hold what the operator set.
  • Completion output now prints Configuration (YAML) and Configuration (ENV) paths.
  • Docs (installation/linux): the data-folder tree, an ENV-only first-start example (SP_ADMIN_EMAIL, SP_DB_TYPE, SP_DB_URL — each SP_* overrides the matching config.yml key via the koanf env loader), and the drop-in/migration sections updated to reference the built-in file.

Tests

  • Unit expectations updated (system + user), install tests assert the file's mode/content and the EnvironmentFile= line, root install asserts the chown, reuse test asserts an operator's config.env survives reinstall.
  • writeConfigEnv error paths (Lstat failure, write failure, chown failure) are covered by TestWriteConfigEnvErrors, for the codecov/patch target.
  • go test . -run 'TestServiceInstall|TestSystemdUnit|TestServiceRun' green in a golang:1.27 Linux container (the linux-tagged tests do not run on the macOS dev host); GOOS=linux go vet clean.

Note: #939 (random first-boot password, SP_ADMIN_PASSWORD) is independent; once both land, the ENV-only first start covers the admin password too.

Source: https://feddit.org/comment/16146954

The systemd installer now writes a commented config.env next to config.yml
(0600, handed to the service user, never overwritten) and the unit loads it
with EnvironmentFile=, for both system and user units. The completion output
prints both configuration paths. Every SP_* variable overrides the matching
config.yml key, so the first start can be prepared with environment
variables alone (SP_ADMIN_EMAIL, SP_DB_TYPE, SP_DB_URL documented).

Requested by a user testing the LXC install:
https://feddit.org/comment/16146954

Closes #947

Co-Authored-By: Claude <[email protected]>
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.85%. Comparing base (6c09bae) to head (bd4dd05).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/cmd_service_linux.go 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #948      +/-   ##
==========================================
- Coverage   90.86%   90.85%   -0.01%     
==========================================
  Files        1399     1399              
  Lines      144656   144671      +15     
==========================================
+ Hits       131438   131447       +9     
- Misses      13210    13216       +6     
  Partials        8        8              
Files with missing lines Coverage Δ
server/cmd_service_systemd.go 100.00% <100.00%> (ø)
server/cmd_service_linux.go 94.73% <93.33%> (-0.17%) ⬇️

... and 22 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fclairamb
fclairamb merged commit e4b7fc4 into main Nov 21, 2026
37 checks passed
@fclairamb
fclairamb deleted the feat/config-env-installer branch November 21, 2026 12:04
fclairamb added a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.53.0](v0.52.0...v0.53.0)
(2026-11-22)


### Features

* **auth:** OIDC-only mode with IdP group admin roles
([#966](#966))
([1b51f89](1b51f89))
* **service:** install writes config.env, unit loads it via
EnvironmentFile
([#948](#948))
([e4b7fc4](e4b7fc4))


### Bug Fixes

* **aggregation:** drain the raw backlog in one run and log lag
([#978](#978))
([26b93cd](26b93cd))
* **deps:** update github.com/dop251/goja digest to 79d6ad3
([#972](#972))
([02c6821](02c6821))
* **deps:** update go dependencies (non-major)
([#955](#955))
([7dfbcd6](7dfbcd6))
* **deps:** update go dependencies (non-major)
([#968](#968))
([6c09bae](6c09bae))
* **deps:** update go dependencies (non-major)
([#979](#979))
([ee088b6](ee088b6))
* **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to
v2.9.0 ([#975](#975))
([1121e2e](1121e2e))
* **deps:** update module go.mongodb.org/mongo-driver/v2 to v2.10.1
([#950](#950))
([9e684c4](9e684c4))
* email validation, OAuth error display, translator crash guard, clone
slugs, watchdog pauses
([#959](#959))
([a20f951](a20f951))
* log OAuth code-exchange failures, show a refused sign-in on the
invitation page
([#974](#974))
([c4a8dca](c4a8dca))
* retry SMTP 4xx, 503 on agent auth DB errors, scope checkGroupUid to
the org ([#973](#973))
([88179aa](88179aa))
* **security:** block WebRTC around the browser egress proxy, survive an
invalid status page ?lang=
([#957](#957))
([79bdc82](79bdc82))
* **security:** keep OIDC-group admin grants revocable, mask resolved
channel references, contain browser popups
([#976](#976))
([6e0f09e](6e0f09e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant