docker: marker-based base.conf generation + robust sed escaping - #95
Draft
MrLenin wants to merge 1 commit into
Draft
docker: marker-based base.conf generation + robust sed escaping#95MrLenin wants to merge 1 commit into
MrLenin wants to merge 1 commit into
Conversation
Two entrypoint fixes: - Generation policy keyed on a marker comment stamped as the first line of every base.conf this script generates: absent -> generate; marker present -> regenerate (env + template are the source of truth); marker absent -> user-managed, never touched. Previously an unconditional cp clobbered a volume-mounted hand-edited base.conf on every container start. Generation goes through a temp file so a mid-generation crash can't leave a half-substituted marker-less conf behind. - The substitution sed uses '|' as its delimiter but only escaped '/' and '&' in values: a value containing '|' or a backslash corrupted the conf silently. Escape backslash first, then '&' and the delimiter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Companion to evilnet/x3#58's entrypoint hardening — same two fixes for the ircd's Docker entrypoint:
cp'd the template overbase.confon every start, clobbering a volume-mounted hand-edited config. Now every generated conf carries a first-line marker comment: no conf → generate; marker present → regenerate (env + template stay the source of truth); marker absent → user-managed, never touched. Generation goes through a temp file so a mid-generation crash can't leave a half-substituted, marker-less conf that would then be mistaken for user-managed.|as its delimiter but only escaped/and&— a value containing|or a backslash silently corrupted the generated config. Backslash is escaped first, then&and the delimiter.🤖 Generated with Claude Code