Andras Bacsai and Claude Opus 5.5
dbc3fb91bf
fix(cdn): fetch versions.json once per hour, spread evenly across instances
...
- Retry CDN requests only for transient errors and honor Retry-After
(Cloudflare error 1200 sends 60 s), with jitter.
- Read helper and Sentinel versions from the local versions.json, which
the hourly update check refreshes, instead of fetching per job/server.
- Replace the random 0-600 s delay with a stable per-instance offset
inside the cron interval (max 1 h).
- Manual update checks and upgrades make one CDN attempt only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
2026-10-21 18:10:48 +02:00
e3d4411ff2
chore: merge main into release/v4.5 ( #12192 )
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com >
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com >
Co-authored-by: Furox <177975472+Furox-Art@users.noreply.github.com >
Co-authored-by: johandenhollander <johan.den.hollander@finalist.nl >
Co-authored-by: João Cruz <161638790+SrJooJ@users.noreply.github.com >
Co-authored-by: Saim Hashmi <hashmisaim037@gmail.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-18 23:43:20 +02:00
Andras Bacsai and Claude
d9774d2968
Fix: Prevent version downgrades and centralize CDN configuration ( #7383 )
...
## Root Cause
Between Nov 25-26, a CDN redirect was added without curl's `-L` flag,
causing version cache corruption and automatic downgrades.
## Three Critical Bugs Fixed
### Bug #1 : CheckForUpdatesJob could overwrite newer cached version
- Problem: CDN serving older version would overwrite local cache
- Solution: Smart version merge - keep max Coolify version, update other components
- Location: app/Jobs/CheckForUpdatesJob.php:33-52
### Bug #2 : Manual updates bypassed downgrade protection
- Problem: Downgrade guard only applied to auto-updates
- Solution: Always block downgrades for both manual and auto-updates
- Location: app/Actions/Server/UpdateCoolify.php:65-75
### Bug #3 : Updates used stale local cache
- Problem: Never validated cache against CDN at update time
- Solution: Fetch fresh CDN data before executing updates
- Location: app/Actions/Server/UpdateCoolify.php:34-49
## Additional Improvement: Centralized CDN Configuration
Added three new config keys for easy CDN management:
- `cdn_url` - Base CDN URL (default: https://cdn.coollabs.io )
- `versions_url` - Full versions.json URL
- `upgrade_script_url` - Full upgrade.sh URL
All configurable via environment variables:
```bash
CDN_URL=https://cdn.coolify.io
VERSIONS_URL=https://custom-cdn.example.com/versions.json
UPGRADE_SCRIPT_URL=https://custom-cdn.example.com/upgrade.sh
```
## Files Modified
- config/constants.php - CDN configuration
- app/Jobs/CheckForUpdatesJob.php - Smart version merge + centralized URL
- app/Actions/Server/UpdateCoolify.php - Downgrade protection + fresh fetch + centralized URLs
- app/Jobs/CheckHelperImageJob.php - Centralized URL
- bootstrap/helpers/shared.php - Centralized URL
## Testing
- ✅ All modified files pass Pint formatting
- ✅ 78 unit tests pass (2 pre-existing failures unrelated to changes)
## Impact
- No breaking changes - defaults to current CDN
- Easy CDN migration via environment variables
- Prevents all downgrade scenarios
- Maintains independent Sentinel/Helper/Traefik updates
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-28 15:20:33 +01:00
Lucas Michot
8e1444eaa7
Get rid of many useless blank lines
2024-10-31 17:44:01 +01:00
Andras Bacsai
2809083f61
Refactor Redis password handling and migration to use environment variables
2024-10-21 13:43:34 +02:00
Andras Bacsai
e8c7d7f972
fix: pull helper image on helper_version change
2024-10-21 12:06:13 +02:00