Commit Graph
25 Commits
Author SHA1 Message Date
Andras BacsaiandClaude Opus 4.5 45f931ecc8 Add encrypted env var backup in metadata.json for rebuild rollbacks
- Store encrypted build and runtime environment variables in metadata.json
- Runtime vars duplicated in .env (plain text for docker compose) and
  metadata.json (encrypted backup for rebuild if .env deleted)
- Build vars only in metadata.json (needed for exact image reproduction)
- Add rollback_deployment_uuid column to track which deployment is being
  rolled back to during rebuild rollbacks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 15:26:23 +01:00
Andras Bacsai b227619cbf Enhance rollback functionality by improving image retention logic and updating deployment metadata handling 2025-12-27 15:26:23 +01:00
Andras BacsaiandClaude Opus 4.5 bb6dfe9f8c Add config hash to image tags for build-time env var rollback support
- Include 8-char config hash in Docker image tag to differentiate
  builds with same commit but different build-time env vars
- Pass production image name to SaveDeploymentSnapshot for accurate
  metadata storage
- Read image name from metadata in Rollback component instead of
  reconstructing from commit (which loses the config hash)
- Use isHighlighted for instant rollback button styling
- Add --force-recreate to ensure container restart picks up .env changes

This enables proper rollback when only build-time environment variables
changed between deployments, as each unique build configuration now
gets its own Docker image tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 15:25:55 +01:00
Andras BacsaiandClaude Opus 4.5 885fb20445 Implement versioned deployment snapshots for improved rollback
- Add SaveDeploymentSnapshot action to save docker-compose.yaml, .env,
  and metadata.json to versioned deployment directories
- Add CleanupOldDeployments action to enforce retention policy (last 5)
- Add helper functions for deployment directory paths
- Modify ApplicationDeploymentJob to save snapshots after deployment
- Rewrite Rollback component to show deployment history
- Support instant rollback (when image exists) and rebuild rollback

New directory structure on server:
/data/coolify/applications/{uuid}/deployments/{deployment_uuid}/
  - docker-compose.yaml
  - .env
  - metadata.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 15:25:55 +01:00
Andras Bacsai ef1abe17b8 refactor(redirect): replace redirect calls with redirectRoute helper for consistency 2025-12-26 13:29:59 +01:00
Andras BacsaiandGitHub 700550b26f Fix: Concurrent builds ignored & add deployment queue limit (#7488) 2025-12-11 11:03:02 +01:00
Andras BacsaiandClaude 511415770a Add server-level toggle to disable application image retention
Adds a new server-level setting that allows administrators to disable
per-application image retention globally for all applications on a server.
When enabled, Docker cleanup will only keep the currently running image
regardless of individual application retention settings.

Changes:
- Add migration for disable_application_image_retention boolean field
- Update ServerSetting model with cast
- Add checkbox in DockerCleanup page (Advanced section)
- Modify CleanupDocker action to check server-level setting
- Update Rollback page to show warning and disable inputs when server
  retention is disabled
- Add helper text noting server-level override capability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 12:22:20 +01:00
Andras BacsaiandClaude 4ed7a4238a Add per-application Docker image retention for rollback capability
Implement a per-application setting (`docker_images_to_keep`) in `application_settings` table to control how many Docker images are preserved during cleanup. The cleanup process now:

- Respects per-application retention settings (default: 2 images)
- Preserves the N most recent images per application for easy rollback
- Always deletes PR images and keeps the currently running image
- Dynamically excludes application images from general Docker image prune
- Cleans up non-Coolify unused images to prevent disk bloat

Fixes issues where cleanup would delete all images needed for rollback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 11:02:07 +01:00
Andras BacsaiandClaude 6d16f52143 Add deployment queue limit to prevent queue bombing
- Add configurable deployment_queue_limit server setting (default: 25)
- Check queue size before accepting new deployments
- Return 429 status for webhooks/API when queue is full (allows retry)
- Show error toast in UI when queue limit reached
- Add UI control in Server Advanced settings

Fixes #6708

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 13:52:27 +01:00
Andras Bacsai 40f108d6e1 feat(auth): implement authorization checks for application management 2025-08-22 16:47:59 +02:00
Andras Bacsai 1fe4dd722b Revert "rector: arrrrr"
This reverts commit 16c0cd10d8.
2025-01-07 15:31:43 +01:00
Andras Bacsai 16c0cd10d8 rector: arrrrr 2025-01-07 14:52:08 +01:00
peaklabs-dev 277fd78769 new uuid routes 2024-11-22 16:03:20 +01:00
andrasbacsaiandgithub-actions[bot] 96c4f5b8da Fix styling 2024-07-25 11:31:59 +00:00
Andras Bacsai 6a4aa492c0 fix: random generated uuid will be full length (not 7 characters) 2024-07-25 13:31:01 +02:00
Andras Bacsai 2c92cc40e1 refactor: Update code to use str() instead of Str::of() for string manipulation 2024-06-25 10:37:10 +02:00
Thijmenandgithub-actions[bot] d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai e2cd7fe17e fix: rollback feature 2024-04-17 15:30:08 +02:00
Andras Bacsai 4c0624f489 fix: remove lazy loading until bug figured out 2024-04-17 15:16:08 +02:00
Andras Bacsai 561e424a7d feat: dashboard live deployment view 2024-01-27 18:44:40 +01:00
Andras Bacsai e7cafe6850 fix: restrict concurrent deployments per server 2024-01-25 08:36:47 +01:00
Andras Bacsai 4c3907c296 refactor routes 2024-01-07 16:23:41 +01:00
Andras Bacsai f03aa57758 fix: routing, switch back to old one 2023-12-27 16:45:01 +01:00
Andras Bacsai f934dfef33 wip livewire migration 2023-12-07 22:56:55 +01:00
Andras Bacsai 718603e37e wip: migrate to livewire 3 2023-12-07 19:06:32 +01:00