fix(proxy,systemd): pin Caddy storage to data_dir, fix systemd unit#84
Merged
Conversation
- drop bogus /var/log/simpledeploy from ReadWritePaths; never created, broke namespace setup (status=226) - set Environment=HOME=/var/lib/simpledeploy so libs that consult $HOME hit a writable, allow-listed path (ProtectHome=true masks /root) - always pin Caddy storage to data_dir/caddy, not just tls.mode=local; auto mode previously fell back to $HOME/.local/share/caddy and silently broke ACME under the hardened unit - doc: directory-layout reflects single caddy storage path - doc: ubuntu install adds troubleshooting note + upgrade steps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
status=226/NAMESPACE(/var/log/simpledeploy: No such file or directory). The unit listed it inReadWritePathsbut nothing creates or writes it. Removed.tls.mode: auto(the documented default) silently breaks because Caddy/certmagic falls back to$HOME/.local/share/caddy=/root/.local/share/caddy, whichProtectHome=truemasks. Two-pronged fix:storagetodata_dir/caddyfor all TLS modes ininternal/proxy/proxy.go, not justlocal. ACME state now lands inside the documented data dir (also makes it covered by existing data_dir backups).Environment=HOME=/var/lib/simpledeployto the unit as a belt-and-suspenders for any other lib that consults$HOME(docker CLI config, future deps).docs/reference/directory-layout.mdupdated to reflect the single caddy storage path.docs/install/ubuntu.mdadds a troubleshooting note for users on existing installs.Test plan
go test ./internal/proxy/...passes; newTestBuildConfigTLSAutoStorageasserts storage is set in auto modego vet ./internal/...go test -short ./internal/...simpledeploy init,tls.mode: auto,systemctl enable --now simpledeploy, confirm active and/var/lib/simpledeploy/caddy/populated