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
Owner

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

`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>
mi added 2 commits 2026-09-04 18:02:09 +02:00
`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>
`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>
mi added 1 commit 2026-09-04 18:03:01 +02:00
mi marked the pull request as ready for review 2026-09-04 19:36:47 +02:00
Author
Owner

branch was merged bypassing GitEA

branch was merged bypassing GitEA
mi closed this pull request 2026-09-04 19:40:55 +02:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkator#22