Commit graph

13759 commits

Author SHA1 Message Date
Andras Bacsai
d27d697b37 fix: log warning on backup failure during name cleanup process 2025-11-27 10:51:19 +01:00
Andras Bacsai
b5666da342 test: add tests for shared environment variable spacing and resolution 2025-11-27 10:45:39 +01:00
Andras Bacsai
c2e1379ba8 feat: add availableSharedVariables method and enhance env-var-input component for better password handling 2025-11-27 10:23:46 +01:00
Andras Bacsai
e47e241da1 fix: update environment variable form to use consistent naming and improve checkbox logic 2025-11-27 09:39:16 +01:00
Andras Bacsai
0298ddffbd fix: ensure syncData is called with both true and false parameters in submit method 2025-11-27 09:26:54 +01:00
Andras Bacsai
2e1b68718d
fix: resolve Docker validation race conditions and sudo prefix bug (#7368) 2025-11-27 09:10:39 +01:00
Andras Bacsai
246e3cd8a2 fix: resolve Docker validation race conditions and sudo prefix bug
- Fix sudo prefix bug: Use word boundary matching to prevent 'do' keyword from matching 'docker' commands
- Add ensureProxyNetworksExist() helper to create networks before docker compose up
- Ensure networks exist synchronously before dispatching async proxy startup to prevent race conditions
- Update comprehensive unit tests for sudo parsing (50 tests passing)

This resolves issues where Docker commands failed to execute with sudo on non-root servers and where proxy networks were not created before the proxy container started.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 09:04:42 +01:00
Andras Bacsai
e5c7459284 fix: update version numbers to 4.0.0-beta.451 and 4.0.0-beta.452 2025-11-26 14:46:52 +01:00
Andras Bacsai
9aea159a24 feat: add functionality to sync releases.json and versions.json to GitHub in one PR 2025-11-26 14:43:25 +01:00
Andras Bacsai
50497eed0a
reduce: minimize logging in cleanup commands (#7356) 2025-11-26 14:20:42 +01:00
Andras Bacsai
c25272de8d reduce: minimize logging in cleanup commands
Reduce excessive logging in CleanupRedis and CleanupNames commands to output only a single summary line. Remove per-item logs and detailed status messages while keeping the final count of items cleaned up. Detail logs still available in dry-run mode for preview.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 14:19:13 +01:00
Andras Bacsai
1047110e01 fix: update coolify version numbers to 4.0.0-beta.450 and 4.0.0-beta.451 2025-11-26 14:05:37 +01:00
Andras Bacsai
d2d5bd4be8
feat: add Docker build cache preservation toggles (#7352) 2025-11-26 14:01:35 +01:00
Andras Bacsai
43bb2f34f4 docs: replace brittle line number references with maintainable method descriptions
Replace 6 line number references in deployment-architecture.md with descriptive
method-based references that remain accurate as code evolves.

Changes:
- Section 1 (Docker Build Cache): Replaced 4 line number refs (~line 1960, ~line 2340,
  ~line 3358, ~line 3530) with detailed method descriptions in ApplicationDeploymentJob.php
- Section 2 (content field): Replaced "line 717" with "parseCompose() function" reference
- Section 3 (is_directory field): Replaced "line 718" with "parseCompose() function" reference

Benefits:
- Documentation remains accurate when code changes
- More informative (explains WHAT methods do, not just WHERE)
- Search-friendly (developers can find methods by name)
- Future-proof (survives refactoring and code movement)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 13:52:27 +01:00
Andras Bacsai
71bf8a3265
fix: add bash control structure keywords to sudo processing (#7353) 2025-11-26 13:45:44 +01:00
Andras Bacsai
01635e8b80 fix: add bash control structure keywords to sudo command processing
Fixes issue #7346 where proxy startup failed on non-root servers due to
bash syntax errors when control structure keywords like 'for', 'do', 'done',
'break', and 'continue' were being prefixed with 'sudo'.

Added comprehensive exclusion list including for/while/until/case/select
loops, conditionals (if/then/else/elif/fi), and loop control keywords
(break/continue). Also excludes comment lines starting with '#'.

All 37 unit tests pass, including new tests for each bash control structure.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 13:44:53 +01:00
Andras Bacsai
7116711896 chore: update migration timestamp to 2025_11_26_124200
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 13:44:43 +01:00
Andras Bacsai
837391c31b feat: add Docker build cache preservation toggles and development logging
Add two new application settings to control Docker build cache invalidation:
- inject_build_args_to_dockerfile (default: true) - Skip Dockerfile ARG injection
- include_source_commit_in_build (default: false) - Exclude SOURCE_COMMIT from build context

These toggles let users preserve Docker cache when SOURCE_COMMIT or custom ARGs change frequently. Development-only logging shows which ARGs are being injected for debugging.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 13:42:02 +01:00
Andras Bacsai
5760b96536
fix: add -L flag to curl commands for CDN redirects (#7349) 2025-11-26 13:05:13 +01:00
Andras Bacsai
727c45a7dc fix: add -L flag to curl commands for CDN redirects
Fixes issue #7348 where curl fails to follow HTTP 302 redirects from the CDN
when fetching versions.json and docker-compose files. The -L flag instructs
curl to automatically follow redirects to the final destination URL, resolving
silent installation failures.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:57:03 +01:00
Andras Bacsai
1e0de06d03
fix: resolve uncloseable database restore modal (#7345) 2025-11-26 12:55:09 +01:00
Andras Bacsai
f6d8ad1775 feat: add support for syncing versions.json to GitHub repository via PR 2025-11-26 10:52:20 +01:00
Andras Bacsai
4f87b251b0 fix: update version number to 4.0.0-beta.450 2025-11-26 10:50:03 +01:00
Andras Bacsai
aa18c48823 fix: resolve uncloseable database restore modal on MariaDB import (#7335)
Fixes the "Snapshot missing on Livewire component" error that occurs when
toggling the "Backup includes all databases" checkbox during MariaDB database
import operations.

Root Cause:
- ActivityMonitor component was initialized without proper lifecycle hooks
- When parent Import component re-rendered (via checkbox toggle), the
  ActivityMonitor's Livewire snapshot became stale
- Missing null checks caused errors when querying with undefined activityId
- No state cleanup when slide-over closed, causing issues on subsequent opens

Changes:
- Add updatedActivityId() lifecycle hook to ActivityMonitor for proper hydration
- Add defensive null check in hydrateActivity() to prevent query errors
- Track activityId in Import component for state management
- Add slideOverClosed event dispatch in slide-over component
- Add event listener in Import component to reset activityId on close

Testing:
- Manually verify checkbox toggle doesn't trigger popup
- Verify actual restore operations work correctly
- Test both file-based and S3-based restore methods
- Ensure X button properly closes the modal
- Verify no console errors or Livewire warnings

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 10:43:07 +01:00
Andras Bacsai
68c5ebf221 fix: update version numbers to 4.0.0-beta.449 and 4.0.0-beta.450 2025-11-26 10:00:00 +01:00
Andras Bacsai
ce134cb8b1 fix: add authorization checks for environment and project views 2025-11-26 09:55:04 +01:00
Andras Bacsai
5f33ad74b5
fix: show shared env scopes dropdown even when no variables exist (#7342) 2025-11-26 09:47:40 +01:00
Andras Bacsai
118966e810 fix: show shared env scopes dropdown even when no variables exist
Previously, when no shared environment variables existed in any scope (team, project, environment), the dropdown would not appear at all when users typed '{{'. This made the feature appear broken.

Now the dropdown always shows the available scopes, and when a user selects a scope with no variables, they see a helpful "No shared variables found in {scope} scope" message with a link to add variables.

Changes:
- Removed isAutocompleteDisabled() method that blocked dropdown
- Removed early return check that prevented showing scopes
- Existing empty state handling already works correctly

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 09:44:36 +01:00
Andras Bacsai
413a0507fa
feat: developer view for shared environment variables (#7091) 2025-11-26 09:41:33 +01:00
Andras Bacsai
e71473d96c
refactor: fix variable scope in docker entrypoint parsing (#7341) 2025-11-26 09:40:40 +01:00
Andras Bacsai
c472786f6f Merge branch 'next' into feat/shared-dev-view 2025-11-26 09:37:45 +01:00
Andras Bacsai
ac14a32723 fix: dispatch success message after transaction commits
Move the success dispatch outside the DB transaction closure to ensure
it only fires after the transaction has successfully committed. Use
reference variable to track changes across the closure boundary.
2025-11-26 09:37:18 +01:00
Andras Bacsai
f3abc4a29f refactor: fix variable scope in docker entrypoint parsing
Improve variable initialization consistency in convertDockerRunToCompose()
function to match established patterns used for --gpus and --hostname.

Changes:
- Add explicit $value = null initialization in --entrypoint block
- Simplify conditional check from isset($value) to $value check
- Maintain semantic equivalence with zero behavior changes

This refactoring eliminates potential undefined variable warnings and
improves code maintainability by following the defensive pattern used
elsewhere in the file.

Also fixes namespace for RestoreDatabase command from App\Console\Commands
to App\Console\Commands\Cloud to match file location and prevent class
redeclaration errors.

Tests: All 20 tests in DockerCustomCommandsTest pass (25 assertions)
2025-11-26 09:32:09 +01:00
Andras Bacsai
1d277f28dd
feat: custom docker entrypoint (#7097) 2025-11-26 09:31:02 +01:00
Andras Bacsai
790e728619
fix: preserve Docker build cache by excluding dynamic variables (#7339) 2025-11-26 09:22:53 +01:00
Andras Bacsai
4e896cca05 fix: preserve Docker build cache by excluding dynamic variables from build-time contexts
- Remove COOLIFY_CONTAINER_NAME from build-time ARGs (timestamp-based, breaks cache)
- Use APP_KEY instead of random_bytes for COOLIFY_BUILD_SECRETS_HASH (deterministic)
- Add forBuildTime parameter to generate_coolify_env_variables() to control injection
- Keep COOLIFY_CONTAINER_NAME available at runtime for container identification
- Fix misleading log message about .env file purpose

Fixes #7040

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 09:16:32 +01:00
Andras Bacsai
f460bb63cc feat: update version numbers to 4.0.0-beta.448 and 4.0.0-beta.449 2025-11-25 17:06:37 +01:00
Andras Bacsai
55d0671612 feat: create migration for webhook notification settings and cloud init scripts tables 2025-11-25 17:06:16 +01:00
Andras Bacsai
9113ed714f feat: add validation methods for S3 bucket names, paths, and server paths; update import logic to prevent command injection 2025-11-25 16:40:35 +01:00
Andras Bacsai
6c030d96f2
fix: correct webhook notification settings migration and model (#7333) 2025-11-25 15:41:54 +01:00
Andras Bacsai
3bdcc06838 fix: prevent overwriting existing webhook notification settings during migration 2025-11-25 15:40:45 +01:00
Andras Bacsai
477738dd2f fix: update webhook notification settings migration to use updateOrInsert and add logging 2025-11-25 15:35:01 +01:00
Andras Bacsai
a3df33a4e0 fix: correct webhook notification settings migration and model
- Add missing traefik_outdated_webhook_notifications field to migration schema and population logic
- Remove incorrect docker_cleanup_webhook_notifications from model (split into success/failure variants)
- Consolidate webhook notification migrations from 2025_10_10 to 2025_11_25 for proper execution order
- Ensure all 15 notification fields are properly defined and consistent across migration, model, and Livewire component

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 15:18:43 +01:00
Andras Bacsai
17f4b126b1
feat: add environment variable autocomplete component (#7282) 2025-11-25 11:22:00 +01:00
Andras Bacsai
6613f7c6b8
Merge branch 'next' into env-var-autocomplete 2025-11-25 11:21:53 +01:00
Andras Bacsai
92dff0c0c7 fix: prevent divide-by-zero in env-var autocomplete navigation
Fixes a critical bug in the environment variable autocomplete component
where arrow key navigation could cause divide-by-zero errors when the
suggestions array is empty.

Changes:
- Add early guard in handleKeydown to check for empty suggestions array
  before performing modulo operations
- Remove unreachable "No suggestions" template that could never display
- Add validation to hide dropdown when user types third brace ({{{)
- Refactor add.blade.php to use @if directives instead of x-show for
  better performance and cleaner code

The fix ensures arrow keys do nothing when suggestions are empty,
preventing JavaScript errors while maintaining all existing functionality
including the scoped empty state messages with helpful links.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 10:55:37 +01:00
Andras Bacsai
c239bc708d
feat: S3 restore (#7085) 2025-11-25 10:31:50 +01:00
Andras Bacsai
875351188f feat: improve S3 restore path handling and validation state
- Add path attribute mutator to S3Storage model ensuring paths start with /
- Add updatedS3Path hook to normalize path and reset validation state on blur
- Add updatedS3StorageId hook to reset validation state when storage changes
- Add Enter key support to trigger file check from path input
- Use wire:model.live for S3 storage select, wire:model.blur for path input
- Improve shell escaping in restore job cleanup commands
- Fix isSafeTmpPath helper logic for directory validation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 10:18:30 +01:00
Andras Bacsai
4147cfa537 refactor: use Laravel route() helper for shared variable URLs
- Replace hardcoded URL paths in getScopeUrl() with Laravel's route() helper
- Add scopeUrls property to EnvVarInput component with named routes
- Pass projectUuid and environmentUuid to enable context-specific environment links
- Environment scope link now navigates to the specific project/environment shared variables page

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 10:12:17 +01:00
Andras Bacsai
6d8144c18c Merge remote-tracking branch 'origin/next' into s3-restore
Resolve merge conflicts in:
- bootstrap/helpers/shared.php (kept both formatBytes, isSafeTmpPath, and formatContainerStatus functions)
- database/migrations/2025_10_10_120002_create_cloud_init_scripts_table.php (added Schema::hasTable check)
- database/migrations/2025_10_10_120002_create_webhook_notification_settings_table.php (added Schema::hasTable check)
- resources/views/livewire/project/application/general.blade.php (formatting/whitespace)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 09:35:37 +01:00