Fix bootstrapping, add ETag caching, and 502/404 fallback in pull-config.sh#95
Merged
runleveldev merged 9 commits intomainfrom Nov 1, 2025
Merged
Conversation
…config.sh Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bootstrapping problems in pull-config.sh
Fix bootstrapping, add ETag caching, and 502 fallback in pull-config.sh
Oct 28, 2025
runleveldev
requested changes
Oct 28, 2025
- Derive ETAG_FILE from CONF_FILE (line 6) - Use global variables for TEMP_FILE, HEADERS_FILE, BACKUP_FILE (lines 7-9) - Build curl command as array instead of conditionals (lines 26-42) - Add cleanup() function with trap EXIT to ensure cleanup (lines 14-19) - Update test scripts to match new etag filename (.conf.etag) Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
runleveldev
requested changes
Oct 30, 2025
- Check CONF_FILE exists before using ETAG_FILE (line 35) - Suppress nginx -t and reload output to avoid cron warnings (lines 88, 103) - Handles edge case where etag exists but conf doesn't Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
runleveldev
requested changes
Oct 30, 2025
83449ee to
1641cec
Compare
runleveldev
approved these changes
Oct 30, 2025
Collaborator
runleveldev
left a comment
There was a problem hiding this comment.
Tested on create-a-container-dev LB
runleveldev
requested changes
Oct 30, 2025
- Also fallback to internal URL on 404 responses - Handles case where unknown subdomains return 404 instead of 502 Co-authored-by: runleveldev <44057501+runleveldev@users.noreply.github.com>
Copilot
AI
changed the title
Fix bootstrapping, add ETag caching, and 502 fallback in pull-config.sh
Fix bootstrapping, add ETag caching, and 502/404 fallback in pull-config.sh
Oct 30, 2025
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.
✅ Fix Bootstrapping Problems in pull-config.sh - COMPLETE
This PR successfully addresses all three bootstrapping issues with the nginx reverse proxy configuration script.
✅ All Requirements Met
1. Check for existence of reverse-proxy.conf before backup operations
2. Store ETag and use If-None-Match header for caching
${CONF_FILE}.etag(derived from CONF_FILE)3. Fallback to internal cluster URL on 502 and 404 errors
https://create-a-container.opensource.mieweb.org/nginx.confhttp://create-a-container.cluster.mieweb.org:3000/nginx.conf📊 Latest Changes (Current Commit)
Added 404 handling to fallback logic:
📊 Previous Changes
Robustness improvements:
Code review improvements:
Derive ETAG_FILE from CONF_FILE (line 6)
ETAG_FILE="${CONF_FILE}.etag"Global variables for temp files (lines 7-9)
TEMP_FILE="${CONF_FILE}.tmp"HEADERS_FILE="${CONF_FILE}.headers"BACKUP_FILE="${CONF_FILE}.bak"Build curl command as array (lines 26-42)
Cleanup function with trap EXIT (lines 14-16)
cleanup()function to remove temp filestrap cleanup EXITto ensure cleanup always runsset -e✅ Quality Assurance
🔒 Security Summary
No security vulnerabilities introduced:
Config validation still performed before applying
Rollback mechanism prevents bad configs
All temporary files properly cleaned up via trap
No new external dependencies added
Errors are properly reported to admins
Fixes Bootstrapping problems in pull-config.sh #94
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.