Repository navigation
fix: leave /certs/cert.pem untouched so it can be mounted read-only - #140
Conversation
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3465b0a1-0a59-4308-84d4-0ba30fa4a4c8
📒 Files selected for processing: 2
README.mdstart.sh
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
When
/certs/cert.pemis mounted read-only, for example as a:robind mount or from a Kubernetes Secret, HaRP exits right after "Found /certs/cert.pem, HTTPS frontends remain enabled." withchmod: /certs/cert.pem: Read-only file system, becausestart.shrunschmod 644on the file whileset -eis active. With a Docker restart policy the container happens to start on the second attempt, since the generated config is reused and the chmod is skipped; with a tmpfs on/run/harp(as in AIO) or in Kubernetes it restarts forever. The chmod is not needed: HAProxy runs as root in this image and reads the file in any mode. On a writable mount it also changes the mode of the host's file to 644.Changes
start.shno longer changes the permissions of/certs/cert.pem.cannot open the fileafter the other processes have started.Setups with a writable mount behave as before, except that the file's mode is no longer changed. Files that earlier versions set to 644 keep that mode.