Commit Graph

13845 Commits

Author SHA1 Message Date
Andras Bacsai 2302a70a44 Fix: Docker build args injection regex to support service names (#7433) 2025-12-01 13:47:08 +01:00
Andras Bacsai 2d8b446ced fix: bypass port validation when saving advanced checkboxes (#7435) 2025-12-01 13:46:46 +01:00
Andras Bacsai bf503861fc Add build args to Final Build Command Preview in UI
The "Final Build Command (Preview)" field now shows build arguments
that will be injected during deployment, matching the actual command
that runs. This provides transparency and helps users debug build issues.

Changes:
- Modified getDockerComposeBuildCommandPreviewProperty() to inject build args
- Uses same helper functions as deployment (generateDockerBuildArgs, injectDockerComposeBuildArgs)
- Respects use_build_secrets setting (build args only shown when disabled)
- Filters environment variables where is_buildtime = true

Example output:
docker compose -f ./docker-compose.yaml --env-file /artifacts/build-time.env build --build-arg FOO --build-arg BAR backend

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 13:45:14 +01:00
Andras Bacsai 7a28886c73 Merge branch 'next' into fix-port-modal-strip-prefixes 2025-12-01 13:43:41 +01:00
Andras Bacsai abb568c600 fix: bypass port validation when saving advanced checkboxes
Add instantSaveSettings() method to save gzip, stripprefix, and
exclude_from_status checkboxes without triggering port validation modal.
These settings don't require domain/port validation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 13:39:15 +01:00
Andras Bacsai 5af9be72ea Refactor: Replace DOCKER_TOKEN/USERNAME with DOCKERHUB_TOKEN/USERNAME (#7432) 2025-12-01 13:22:06 +01:00
Andras Bacsai 942f14fa7e Fix: Update version numbers for Coolify and nightly releases 2025-12-01 13:21:55 +01:00
Andras Bacsai d59c75c2b2 Fix: Docker build args injection regex to support service names
The regex pattern in injectDockerComposeBuildArgs() was too restrictive
and failed to match `docker compose build servicename` commands. Changed
the lookahead from `(?=\s+(?:--|-)|\s+(?:&&|\|\||;|\|)|$)` to the
simpler `(?=\s|$)` to allow any content after the build command,
including service names with hyphens/underscores and flags.

Also improved the ApplicationDeploymentJob to use the new helper function
and added comprehensive test coverage for service-specific builds.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 13:16:05 +01:00
Andras Bacsai 01442a0f55 Refactor: Replace DOCKER_TOKEN/USERNAME with DOCKERHUB_TOKEN/USERNAME
Rename GitHub Actions secrets from DOCKER_TOKEN and DOCKER_USERNAME to DOCKERHUB_TOKEN and DOCKERHUB_USERNAME across all Docker image build workflows for improved clarity and explicit Docker Hub identification.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 13:16:00 +01:00
Andras Bacsai e444008696 Fix: Rename Docker credentials to match Docker Hub naming conventions 2025-12-01 13:15:42 +01:00
Andras Bacsai a56fde7f12 Fix: Adjust badge positioning and enhance coolbox utility styles 2025-11-28 20:48:49 +01:00
Andras Bacsai 1dd2a81f89 Fix: Traefik proxy startup issues (#7400) 2025-11-28 20:39:28 +01:00
Andras Bacsai 627cec16fa Merge branch 'next' into fix-traefik-startup 2025-11-28 17:54:48 +01:00
Andras Bacsai cb0f2301f5 Fix: Traefik proxy startup issues - handle null versions and filter predefined networks
Fixes two critical issues preventing Traefik proxy startup:

1. TypeError when restarting proxy: Handle null return from get_traefik_versions()
   - Add null check before dispatching CheckTraefikVersionForServerJob
   - Log warning when version data is unavailable
   - Prevents: "Argument #2 must be of type array, null given"

2. Docker network error: Filter out predefined Docker networks
   - Add isDockerPredefinedNetwork() helper to centralize network filtering
   - Apply filtering in collectDockerNetworksByServer() before operations
   - Apply filtering in generateDefaultProxyConfiguration()
   - Prevents: "operation is not permitted on predefined default network"

Also: Move $cachedVersionsFile assignment after null check in Proxy.php

Tests: Added 7 new unit tests for network filtering function
All existing tests pass with no regressions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:53:26 +01:00
Andras Bacsai a25e553f88 Fix: Fragile service name parsing with hyphens (#7399) 2025-11-28 17:50:44 +01:00
Andras Bacsai 5598a2ada4 Improve manual update process with better user feedback (#7398) 2025-11-28 17:49:18 +01:00
Andras Bacsai b7fcb0f362 Fix Alpine state reference and remove unused property in upgrade modal
- Fix incorrect Alpine state reference: Changed `this.$wire.showProgress` to `this.showProgress` in upgrade.blade.php:155
- Remove unused `$showProgress` property from Upgrade.php Livewire component
- The backend property was never set or used; all progress tracking is handled by Alpine state
- This fixes potential race conditions where the guard condition was not working as intended

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:48:52 +01:00
Andras Bacsai 8c40cc607a Fix: Fragile service name parsing in applyServiceApplicationPrerequisites
Changed from `->before('-')` to `->beforeLast('-')` to correctly parse service
names with hyphens. This fixes prerequisite application for ~230+ services
containing hyphens in their template names (e.g., docker-registry,
elasticsearch-with-kibana).

Added comprehensive test coverage for hyphenated service names and fixed
existing tests to use realistic CUID2 UUID format. All unit tests pass.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:42:04 +01:00
Andras Bacsai 702be840b4 Improve manual update process with better user feedback
Add elapsed time tracking and time-aware status messages during updates to inform users about extended downtime. Fix variable scoping issues by properly declaring interval variables in Alpine.js component data, and add error handling for network failures during health checks. Users now see clear, reassuring messages at different stages: update progress, restart phase, and revival with elapsed time.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:57:31 +01:00
Andras Bacsai 4706bc23aa Refactor: Centralize service application prerequisites
Refactors the Appwrite and Beszel service-specific application settings
to use a centralized constant-based approach, following the same pattern
as NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK.

Changes:
- Added NEEDS_TO_DISABLE_GZIP constant for services requiring gzip disabled
- Added NEEDS_TO_DISABLE_STRIPPREFIX constant for services requiring stripprefix disabled
- Created applyServiceApplicationPrerequisites() helper function in bootstrap/helpers/services.php
- Updated all service creation flows to use the centralized helper:
  * app/Livewire/Project/Resource/Create.php (web handler)
  * app/Http/Controllers/Api/ServicesController.php (API handler - BUG FIX)
  * app/Livewire/Project/New/DockerCompose.php (custom compose handler)
  * app/Http/Controllers/Api/ApplicationsController.php (API custom compose handler)
- Added comprehensive unit tests for the new helper function

Benefits:
- Single source of truth for service prerequisites
- DRY - eliminates code duplication between web and API handlers
- Fixes bug where API-created services didn't get prerequisites applied
- Easy to extend for future services (just edit the constant)
- More maintainable and testable

Related commits: 3a94f1ea1 (Beszel), 02b18c86e (Appwrite)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:47:09 +01:00
Andras Bacsai b246cdffab Fix: Version downgrade prevention with cache validation (#7396) 2025-11-28 16:31:46 +01:00
Andras Bacsai 4052d1bd05 Refactor color classes from yellow to warning across the application
- Updated color classes in NotifyDemo.php to use warning colors.
- Added new warning color variables in app.css.
- Changed warning icon colors in callout.blade.php.
- Updated loading spinner and hover states in global-search.blade.php.
- Refactored warning messages and styles in project application views.
- Adjusted log display colors in get-logs.blade.php.
- Updated private key status indicators in index.blade.php.
- Changed hover and text colors for documentation links in cloudflare-tunnel.blade.php.
- Refactored server creation messages in by-hetzner.blade.php.
- Updated proxy warning button colors in proxy.blade.php.
- Changed loading spinner colors in show.blade.php.
- Updated deployment status colors in deployments.blade.php and show.blade.php.
2025-11-28 16:23:32 +01:00
Andras Bacsai cd10796612 Fix: Version downgrade prevention - validate cache and add running version checks
## Changes
- **CheckForUpdatesJob**: Add triple version comparison (CDN vs cache vs running)
  - Never allows version downgrade from currently running version
  - Uses data_set() for safer nested array mutation
  - Prevents incorrect new_version_available flag setting

- **UpdateCoolify**: Add cache validation before fallback
  - Validates cache against running version on CDN failure
  - Throws exception if cache is corrupted/older than running
  - Applies to both manual and automated updates

- **Tests**: Add comprehensive test coverage
  - tests/Unit/CheckForUpdatesJobTest.php (5 tests)
  - tests/Unit/UpdateCoolifyTest.php (3 tests)

## Impact
- Prevents all downgrade scenarios (CDN rollback, corrupted cache, etc.)
- Maintains backward compatibility
- Provides clear logging for debugging

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:05:41 +01:00
Andras Bacsai 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
Andras Bacsai 0d7f777814 fix: resolve webhook notification settings migration conflict (#7393) 2025-11-28 15:08:24 +01:00
Andras Bacsai 64d52a2af8 fix: update border color utility for input-sticky-active and coolbox components 2025-11-28 14:14:21 +01:00
Andras Bacsai e22afd43e8 fix: resolve webhook notification settings migration conflict
Add missing traefik_outdated_webhook_notifications column to the webhook_notification_settings table schema and add safety checks to the traefik migration to prevent errors when the table doesn't exist yet.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 14:03:05 +01:00
Andras Bacsai 0eefa64ce4 feat(ui): Improve new resource page UI layout and styling (#7291) 2025-11-28 14:01:17 +01:00
Andras Bacsai d0600e079e fix: remove redundant condition for displaying databases in resource selection 2025-11-28 14:00:34 +01:00
Andras Bacsai 66386e6013 fix(docker): migrate database start actions from --time to -t flag (#7390) 2025-11-28 14:00:02 +01:00
Andras Bacsai d905ae107b Refactor UI components to use 'coolbox' class for consistent styling across various views
- Updated dashboard, destination, project, and server views to replace 'box' class with 'coolbox' for improved visual consistency.
- Modified links and buttons in shared variables and scheduled tasks views to utilize 'coolbox' class.
- Ensured all relevant components reflect the new styling approach, enhancing user experience and interface coherence.
2025-11-28 13:55:54 +01:00
Andras Bacsai 995e3d554d Merge branch 'next' into fix-docker-time-database-v2 2025-11-28 13:28:26 +01:00
Andras Bacsai 2c16727075 feat(ui): Logs color highlight based on log level (#7288) 2025-11-28 13:27:51 +01:00
Andras Bacsai f42d076f31 Merge branch 'next' into fix-docker-time-database-v2 2025-11-28 13:12:00 +01:00
Andras Bacsai c136724838 fix(docker): migrate database start actions from --time to -t flag
Migrates 8 database start action files from deprecated --time=10 to compatible -t 10 flag for Docker v28+ compatibility. Also updates test expectations in StopProxyTest.php.

Docker deprecated the --time flag in v28.0. The -t shorthand works on all Docker versions (pre-28 and 28+), ensuring backward and forward compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 11:18:12 +01:00
Andras Bacsai 751f8dbd8d Revert "fix(docker): migrate database start actions from --time to -t flag" (#7389) 2025-11-28 11:16:06 +01:00
Andras Bacsai 9503da60b4 Revert "fix(docker): migrate database start actions from --time to -t flag" 2025-11-28 11:15:55 +01:00
Andras Bacsai 2898448fe2 fix(docker): migrate database start actions from --time to -t flag (#7388) 2025-11-28 11:15:24 +01:00
Andras Bacsai 5b7a6d9a76 fix(docker): migrate database start actions from --time to -t flag
Migrates 8 database start action files from deprecated --time=10 to compatible -t 10 flag for Docker v28+ compatibility. Also updates test expectations in StopProxyTest.php.

Docker deprecated the --time flag in v28.0. The -t shorthand works on all Docker versions (pre-28 and 28+), ensuring backward and forward compatibility.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 11:08:20 +01:00
Andras Bacsai 3a94f1ea18 Fix:(service) Beszel realtime feature not working (#7366) 2025-11-28 11:08:12 +01:00
Andras Bacsai a95a4129c8 Merge branch 'next' into shadow/fix-service-beszel 2025-11-28 11:08:01 +01:00
Andras Bacsai 02b18c86e0 Fix:(service) Appwrite too many redirects error (#7364) 2025-11-28 11:07:41 +01:00
Andras Bacsai 25a96ad662 fix(docker): replace deprecated --time flag with -t for full compatibility across Docker versions (#6807) 2025-11-28 10:47:19 +01:00
Andras Bacsai 0209bb63e2 fix: prevent duplicate environment variables in buildtime.env and support nixpacks plan variable overrides (#7373) 2025-11-28 10:39:32 +01:00
Andras Bacsai e5280fd3ad feat: add predefined network connection for pgAdmin and postgresus services 2025-11-28 10:29:13 +01:00
Andras Bacsai 1d054b23b8 Merge branch 'next' into shadow/fix-docker-time-command 2025-11-28 10:25:42 +01:00
Andras Bacsai 83f9fd8e20 fix(ui): incorrect caddy proxy config file path on proxy page (#6722) 2025-11-28 10:24:01 +01:00
Andras Bacsai 74e38ffc6a Feat:(service) Add postgresus to predefined docker networks by default (#7367) 2025-11-28 10:21:13 +01:00
Andras Bacsai c4ebf951fa Merge branch 'next' into shadow/improve-service-postgresus 2025-11-28 10:18:45 +01:00
Andras Bacsai a4e4cc2c17 fix: update service creation logic to only connect pgAdmin to Docker network 2025-11-28 10:17:27 +01:00