init reads its configuration from the repository root, and says so when it cannot #22

Closed
mi wants to merge 3 commits from mi/init-config-root AGit into main
3 Commits
Author SHA1 Message Date
mhoennigandClaude Opus 5 fb1db30f2a docs(prs): the init-config-resolution PR-doc
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 18:02:58 +02:00
mhoennigandClaude Opus 5 2cddd76c88 Read init's effective configuration from the repository root
`init --systemd` resolved the configuration through `Paths.get(".")` while
every other file it touches — the two generated config layers, an applied
fragment, the units, the .htaccess — goes through the git top level. The two
agree only when the process happens to run in the repository root; from a
subdirectory the command silently read a different repository's configuration
or none at all, so `--apply`'s promise that the fragment's port reaches the
generated unit did not hold, and the host integration was skipped as if no
publicBaseUrl were configured.

The root is passed down instead, matching every other caller of
`ConfigLoader.load`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 17:50:58 +02:00
mhoennigandClaude Opus 5 7fd473b88b Warn instead of silently defaulting when init cannot load the config
`init --systemd` read the effective configuration through a catch-all that
swallowed every exception and continued with a default `ServerConfig`. A
repository whose `.werkator.yml` failed validation for any reason then looked
exactly like one with no `publicBaseUrl`: the `.htaccess` and the maintenance
page were skipped without a word, during initial deployment setup of all times.

The fallback stays — the units are still generated — but the exception message
is now printed. The configuration is loaded once per run so the three readers
inside `createSystemdFiles` do not repeat the warning.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 17:47:16 +02:00