Commit graph

12893 commits

Author SHA1 Message Date
github-actions[bot]
aa1d929f54 docs: update changelog 2025-10-15 09:10:52 +00:00
Andras Bacsai
956c24de1a
Merge pull request #6758 from coollabsio/next
v4.0.0-beta.435
2025-10-15 11:09:51 +02:00
Andras Bacsai
23c1184e86
Merge pull request #6880 from coollabsio/andrasbacsai/fix-new-image-quick-action
fix: 'new image' quick action not progressing to resource selection
2025-10-15 10:51:21 +02:00
Andras Bacsai
73837058c3
Merge pull request #6879 from coollabsio/fix-docker-image-digest-cleanup
fix: improve Docker image digest handling and add auto-parse feature
2025-10-15 10:49:30 +02:00
Andras Bacsai
66cff9d9b8 fix: 'new image' quick action not progressing to resource selection
Fixed three issues preventing the "new image" quick action from working:

1. Frontend matching logic wasn't checking the quickcommand field
   - Added check for item.quickcommand in the matching logic
   - Now "new image" matches docker-image via its quickcommand "(type: new image)"

2. Search query remained populated after triggering selection flow
   - Clear searchQuery in navigateToResourceCreation() to show selection UI
   - This switches the UI from creatable items list to server selection

3. Redirect wasn't using Livewire's redirect method
   - Changed from redirect()->route() to $this->redirect(route())
   - Ensures proper Livewire component redirect behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 10:49:07 +02:00
Andras Bacsai
20b4288916 fix: improve Docker image digest handling and add auto-parse feature
- Replace manual regex parsing with DockerImageParser in ApplicationsController
- Fix double-decoration bug where image names like nginx@sha256:hash would
  become nginx:hash@sha256 causing malformed references
- Add auto-parse feature in Livewire DockerImage component
- Users can now paste complete references like nginx:stable@sha256:abc123...
  and fields auto-populate
- Update UI placeholder with examples: nginx, docker.io/nginx:latest,
  ghcr.io/user/app:v1.2.3, nginx:stable@sha256:abc123...
- Add comprehensive unit tests for auto-parse functionality
- All tests passing (20 tests, 73 assertions)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 10:19:01 +02:00
Andras Bacsai
d1379f666a
Merge pull request #6878 from coollabsio/fix-digest-tag-prefix
fix: use computed imageTag variable for digest-based Docker images
2025-10-15 10:12:50 +02:00
Andras Bacsai
3e2f124c83 fix: use computed imageTag variable for digest-based Docker images
The code was computing $imageTag with the 'sha256-' prefix for digest-based
images but then using $parser->getTag() directly when creating the Application,
which bypassed the prefix logic entirely.

This fix ensures that digest-based Docker images preserve their 'sha256-' prefix
by using the computed $imageTag variable instead of calling $parser->getTag()
directly.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 09:36:59 +02:00
Andras Bacsai
6d3c996ef3
Merge pull request #6869 from coollabsio/allow-at-sign-in-git-urls
fix(git): handle Git redirects and improve URL parsing for tangled.sh and other Git hosts
2025-10-15 09:15:35 +02:00
Andras Bacsai
81455b1b5f
Merge pull request #6863 from YaRissi/hetzner/cpu_vendor
feat(hetzner): add CPU vendor information to server types in Hetzner integration
2025-10-15 09:03:12 +02:00
Andras Bacsai
375aeccb6b fix: restore original run script functionality in conductor.json 2025-10-14 23:25:34 +02:00
Andras Bacsai
f9f1d87bf7 fix: update run script to use bun for development 2025-10-14 21:52:32 +02:00
Andras Bacsai
a9d899334f
Merge branch 'next' into allow-at-sign-in-git-urls 2025-10-14 20:46:08 +02:00
Andras Bacsai
7bdd53b3fb
Merge pull request #6871 from coollabsio/fix-static-publish-dir-slash
Fix static site publish directory double slash in build logs
2025-10-14 20:45:49 +02:00
Andras Bacsai
933a67645f
Update app/Jobs/ApplicationDeploymentJob.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-14 20:45:40 +02:00
Andras Bacsai
2692ef8a57
Merge pull request #6873 from coollabsio/dockerfile-env-fix
Fix: Pure Dockerfile deployment failing due to missing .env file
2025-10-14 20:44:37 +02:00
Andras Bacsai
b81baff4b1 fix: improve logging and add shell escaping for git ls-remote
Two improvements to Git deployment handling:

1. **ApplicationDeploymentJob.php**:
   - Fixed log message to show actual resolved commit SHA (`$this->commit`)
   - Previously showed `$this->application->git_commit_sha` which could be "HEAD"
   - Now displays the actual 40-character commit SHA that will be deployed

2. **Application.php (generateGitLsRemoteCommands)**:
   - Added `escapeshellarg()` for repository URL in 'other' deployment type
   - Prevents shell injection in git ls-remote commands
   - Complements existing shell escaping in `generateGitImportCommands`
   - Ensures consistent security across all Git operations

**Security Impact:**
- All Git commands now use properly escaped repository URLs
- Prevents command injection through malicious repository URLs
- Consistent escaping in both ls-remote and clone operations

**User Experience:**
- Deployment logs now show exact commit SHA being deployed
- More accurate debugging information for deployment issues

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 20:44:35 +02:00
Andras Bacsai
ebfc87753e
Merge branch 'next' into allow-at-sign-in-git-urls 2025-10-14 20:44:10 +02:00
Andras Bacsai
91e070b2c3 fix: add missing save_runtime_environment_variables() in deploy_simple_dockerfile
Fixes pure Dockerfile deployment failing with 'env file not found' error.

The deploy_simple_dockerfile() method was missing the call to
save_runtime_environment_variables() which creates the .env file
needed during the rolling update phase. This call is present in
all other deployment methods (dockerfile, dockercompose, nixpacks,
static) but was missing here.

This ensures the .env file exists when docker compose tries to
use --env-file during the rolling update.
2025-10-14 20:43:11 +02:00
Andras Bacsai
941afa3585
Merge pull request #6872 from coollabsio/andrasbacsai/db-general-auth-check
fix: add authorization checks to database Livewire components
2025-10-14 17:36:21 +02:00
Andras Bacsai
652f523f5b test: improve Git ls-remote parsing tests with uppercase SHA and negative cases
Enhanced test coverage to match production code regex pattern and prevent
false positives by adding comprehensive edge case testing.

**Changes:**

1. **Updated regex pattern to match production code**:
   - Changed from `/([0-9a-f]{40})\s*\t/` to `/\b([0-9a-fA-F]{40})(?=\s*\t)/`
   - Now handles both uppercase and lowercase hex characters (A-F and a-f)
   - Uses word boundary `\b` for more precise matching
   - Uses lookahead `(?=\s*\t)` instead of capturing whitespace

2. **Added uppercase SHA test**:
   - Tests extraction of uppercase commit SHA (196D3DF7...)
   - Normalizes to lowercase using `strtolower()` for comparison
   - Reflects Git's case-insensitive SHA handling

3. **Added negative test cases**:
   - Tests output with no commit SHA present (error messages only)
   - Tests output with tab but invalid SHA format
   - Ensures `null` is returned to prevent false positives

**Test Coverage:**
- 8 total tests (up from 5)
- Covers all positive cases (lowercase, uppercase, warnings, whitespace)
- Covers negative cases (missing SHA, invalid format)
- Regex pattern now exactly matches production code in ApplicationDeploymentJob.php:1908

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 17:34:26 +02:00
Andras Bacsai
e20327b9c4 fix: add authorization checks to database Livewire components
Added authorization checks to 11 database-related Livewire components
that were loading sensitive database configuration without verifying
user permissions.

Changes:
- Added authorize('view', $database) to all 8 database type General.php mount() methods
- Added authorization to Configuration.php before loading database
- Added authorization to BackupEdit.php before loading backup config
- Added authorization to Import.php before loading database resource

This prevents unauthorized users from accessing database credentials,
connection strings, and configuration details.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 17:33:42 +02:00
Andras Bacsai
f254af0459 security: escape all shell directory paths in Git deployment commands
Ensures all `cd` commands in Git deployment operations use properly escaped
directory paths via `escapeshellarg()` to prevent shell injection vulnerabilities
and handle special characters correctly.

**Changes:**

1. `setGitImportSettings()` method:
   - Added `$escapedBaseDir` variable for consistent path escaping
   - Replaced all 5 instances of `cd {$baseDir}` with `cd {$escapedBaseDir}`
   - Affects: commit checkout, submodules, and LFS operations

2. `generateGitImportCommands()` method (deploy_key type):
   - Replaced 3 instances in pull request handling for GitLab, GitHub/Gitea, Bitbucket

3. `generateGitImportCommands()` method (other type):
   - Replaced 3 instances in pull request handling for GitLab, GitHub/Gitea, Bitbucket

**Security Impact:**
- Prevents shell injection from malicious directory paths
- Fixes parsing issues with special characters (@, ~, spaces)
- Consistent escaping across all deployment types: source, deploy_key, other
- Complements existing URL escaping for comprehensive security

**Testing:**
- All existing unit tests pass (5/5 Git ls-remote parsing tests)
- Code formatted with Laravel Pint

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 17:23:28 +02:00
Andras Bacsai
123c849010
Merge branch 'next' into fix-static-publish-dir-slash 2025-10-14 17:17:06 +02:00
Andras Bacsai
1aea813b71 Fix static site publish directory double slash in build logs
- Strip leading slashes from publish_directory to prevent /app// paths
- Only add slash prefix if directory is not empty
- Ensures clean Docker COPY paths in build output
2025-10-14 17:15:41 +02:00
Andras Bacsai
a3d9ca5c5c
Merge pull request #6870 from coollabsio/fix-nullable-server-guards
fix: prevent TypeError in database General components with null server
2025-10-14 17:13:47 +02:00
Andras Bacsai
74c70b431c fix: prevent TypeError in database General components with null server
Nullable server + guard to avoid TypeError/NPE. Don't terminate the app, terminate the bug.

Changes:
- Made Server property nullable (?Server $server = null) in all 8 database General components
- Added guard clause in mount() to check for null server before accessing it
- Displays user-friendly error message when destination server is not configured
- Prevents crashes in methods like isLogDrainEnabled() and sslCertificates()

Fixed components:
- Mariadb, Dragonfly, Clickhouse, Keydb
- Mysql, Mongodb, Redis, Postgresql

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 17:04:48 +02:00
Andras Bacsai
893093fad3
Update app/Jobs/ApplicationDeploymentJob.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-14 15:21:38 +02:00
Andras Bacsai
bf00405971 fix(git): handle Git redirects and improve URL parsing for tangled.sh and other Git hosts
Fixes deployment failures when Git repositories redirect (e.g., tangled.sh → tangled.org)
and improves security by adding proper shell escaping for repository URLs.

**Root Cause:**
Git redirect warnings can appear on the same line as ls-remote output with no newline:
`warning: redirecting to https://tangled.org/...196d3df...	refs/heads/master`

The previous parsing logic split by newlines and extracted text before tabs, which
included the entire warning message instead of just the 40-character commit SHA.

**Changes:**

1. **Fixed commit SHA extraction** (ApplicationDeploymentJob.php):
   - Changed from line-based parsing to regex pattern matching
   - Uses `/([0-9a-f]{40})\s*\t/` to find valid 40-char hex commit SHA before tab
   - Handles warnings on same line, separate lines, multiple warnings, and whitespace
   - Added comprehensive Ray debug logs for troubleshooting

2. **Added security fix** (Application.php):
   - Added `escapeshellarg()` for repository URLs in 'other' deployment type
   - Prevents shell injection and fixes parsing issues with special characters like `@`
   - Added Ray debug logs for deployment type tracking

3. **Comprehensive test coverage** (GitLsRemoteParsingTest.php):
   - Tests normal output without warnings
   - Tests redirect warning on separate line
   - Tests redirect warning on same line (actual tangled.sh format)
   - Tests multiple warning lines
   - Tests extra whitespace handling

**Resolves:**
- Linear issue COOLGH-53: Valid git URLs are rejected as being invalid
- GitHub issue #6568: tangled.sh deployments failing
- Handles Git redirects universally for all Git hosting services

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 11:55:17 +02:00
Andras Bacsai
2aef2c383c
Merge pull request #6868 from coollabsio/handle-pr-process-statuses
Handle all ProcessStatus values in PR updates
2025-10-14 11:07:15 +02:00
Andras Bacsai
8408faf897 Handle all ProcessStatus values in ApplicationPullRequestUpdateJob
- Add support for QUEUED, KILLED, and CANCELLED statuses
- Replace if-elseif chain with match expression for better exhaustiveness
- Add appropriate emoji indicators for each status
- Ensure all ProcessStatus enum values are handled

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 11:05:42 +02:00
Andras Bacsai
040e2b4332 fix: enhance run script to remove existing containers before starting 2025-10-14 10:53:27 +02:00
Andras Bacsai
1cdd6fb876
Merge pull request #6867 from coollabsio/fix-service-refresh-issues
fix: prevent duplicate services on image change and enable real-time UI refresh
2025-10-14 10:20:51 +02:00
Andras Bacsai
ff054cfea9
Merge branch 'next' into fix-service-refresh-issues 2025-10-14 10:17:59 +02:00
Andras Bacsai
ce12c94709 fix: prevent duplicate services on image change and enable real-time UI refresh
This commit addresses two critical issues with Docker Compose service management:

## Issue 1: Duplicate Services Created on Image Change
When changing the image in a docker-compose file, the parser was creating new
ServiceApplication/ServiceDatabase records instead of updating existing ones.

**Root Cause**: The parsers used `firstOrCreate()` with `['name', 'image', 'service_id']`,
meaning any image change would create a new record.

**Fix**: Remove `image` from `firstOrCreate()` queries and update it separately after
finding or creating the service record.

**Changes**:
- `bootstrap/helpers/parsers.php` (serviceParser v3): Fixed in presave loop (lines 1188-1203)
  and main parsing loop (lines 1519-1539)
- `bootstrap/helpers/shared.php` (parseDockerComposeFile v2): Fixed null check logic
  (lines 1308-1348)

## Issue 2: UI Not Refreshing After Changes
When compose file or domain was modified, the Configuration component wasn't receiving
events to refresh its data, requiring manual page refresh to see updates.

**Root Cause**: The Configuration component wasn't listening for refresh events dispatched
by child components (StackForm, EditDomain).

**Fix**: Add event listeners and dispatchers to enable real-time UI updates.

**Changes**:
- `app/Livewire/Project/Service/Configuration.php`: Added listeners for `refreshServices`
  and `refresh` events (lines 36-37)
- `app/Livewire/Project/Service/EditDomain.php`: Added `refreshServices` dispatch (line 76)
- Note: `app/Livewire/Project/Service/StackForm.php` already had the dispatch

## Tests Added
- `tests/Unit/ServiceParserImageUpdateTest.php`: 4 tests verifying no duplicates created
- `tests/Unit/ServiceConfigurationRefreshTest.php`: 4 tests verifying event dispatching

All 8 new tests pass, and all existing unit tests continue to pass.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 10:12:36 +02:00
Andras Bacsai
03d4dd5cad
Merge pull request #6866 from coollabsio/conductor/hetzner-affiliation-link
feat: add Hetzner affiliate link to token form
2025-10-14 09:40:30 +02:00
Andras Bacsai
baabbc9fb4
Merge branch 'next' into conductor/hetzner-affiliation-link 2025-10-14 09:29:30 +02:00
Andras Bacsai
b911d2b281 feat: update Hetzner affiliate link text and URL
- Change URL to https://coolify.io/hetzner
- Add detailed explanation about credits (€10 for Coolify, €20 for new users)
- Clarify it's only for new accounts
- Improve text formatting with extra spacing
- Apply consistent messaging across both modal and full-page layouts
2025-10-14 09:28:01 +02:00
Andras Bacsai
d4b9b61cbd feat: add Hetzner affiliate link to token form
- Add affiliate link when users add their first Hetzner token
- Shows in both modal and full-page layouts
- Friendly messaging about supporting Coolify and getting credits
2025-10-14 09:25:10 +02:00
elmariss
9c79e2bfbc simplify the getCpuVendorInfo method 2025-10-13 22:41:13 +02:00
elmariss
ea584902ec feat: add CPU vendor information to server types in Hetzner integration 2025-10-13 22:21:35 +02:00
Andras Bacsai
009ac822ab
Merge pull request #6861 from coollabsio/fix-pgadmin-docker-network
fix: enable docker network connection for pgadmin service
2025-10-13 14:17:15 +02:00
Andras Bacsai
473fe6ffa3
Merge branch 'next' into fix-pgadmin-docker-network 2025-10-13 14:16:27 +02:00
Andras Bacsai
777cdc91f0 fix: enable docker network connection for pgadmin service 2025-10-13 14:13:40 +02:00
Andras Bacsai
8d403cc511
Merge pull request #6538 from AmirHosseinKarimi/fix/mattermost-docker-compose
fix(templates): remove mattermost healthcheck command according to lack of shell in new version
2025-10-13 13:40:17 +02:00
Andras Bacsai
fe91c25b14
Merge pull request #6557 from elalemanyo/template/once-campfire
feat(campfire): add template for Once Campfire
2025-10-13 13:39:43 +02:00
Andras Bacsai
0681f4d004
Merge pull request #6559 from halilim/add-service-gramps-web
feat(service): add Gramps Web template
2025-10-13 13:39:08 +02:00
Andras Bacsai
a1dfb31bf2
Merge pull request #6576 from itsneeku/patch-1
chore(service): update convex template and image
2025-10-13 13:38:40 +02:00
Andras Bacsai
7443b266d8
Merge pull request #6589 from htnminh/v4.x
fix(template/filebrowser): correct healthcheck for Filebrowser
2025-10-13 13:38:10 +02:00
Andras Bacsai
e875fed548
Merge pull request #6563 from ShadowArcanist/service/pgadmin
feat(service): add pgAdmin
2025-10-13 13:37:36 +02:00