Skip to content

systemd installer: generate config.env + EnvironmentFile for ENV-based first-boot setup #947

Closed

Description

@fclairamb

From a user comment on the feddit.org project post (https://feddit.org/post/38184275, comment https://feddit.org/comment/16146954, 2026-11-19), after testing solidping service install in an LXC:

Umgebungsvariablen kann man dann doch auch super nutzen, um den ersten Start vorzubereiten. Ich denke, die Möglichkeit würde gut angenommen werden, ENVs sind schöner zu setzen als Yaml :D

He proposes the installer write a config.env next to config.yml and wire EnvironmentFile= into the unit, e.g.:

Configuration (YAML): /var/lib/solidping/config.yml
Configuration (ENV): /var/lib/solidping/config.env
[Service]
EnvironmentFile=/var/lib/solidping/config.env

What already exists: runtime ENV config via koanf (SP_*), SP_ADMIN_EMAIL/SP_AUTH_ADMIN_EMAIL for the seeded admin, and PR #939 adds SP_ADMIN_PASSWORD + the random first-boot password. What is missing: the installer (server/cmd_service_linux.go, systemdUnit()) only writes config.yml and the unit has no EnvironmentFile; the completion output does not mention an ENV path.

Task: installer generates a commented config.env (0600, same owner as config.yml — it will hold secrets), adds EnvironmentFile= to the unit, prints the ENV path in the completion output, and the docs show an ENV-only first-boot example (admin email/password, DB URL, OIDC). His example unit also carries hardening flags worth comparing against ours (UMask=0077, NoNewPrivileges, PrivateTmp, ProtectSystem=strict, ReadWritePaths, AmbientCapabilities=CAP_NET_RAW CAP_NET_BIND_SERVICE).

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

Activity

  1. fclairamb commented on Nov 19, 2026

    @fclairamb
    OwnerAuthor

    Implemented in #948 (feat/config-env-installer): the installer writes a commented config.env (0600, service-user owned, never overwritten), the unit loads it via EnvironmentFile= for both system and user units, the completion output prints both paths, and the docs show an ENV-only first start. Linux tests green in a golang:1.27 container.

  2. fclairamb commented on Nov 21, 2026

    @fclairamb
    OwnerAuthor

    Done in #948, merged into main. It will ship in the next release (after v0.52.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions