Commit Graph
17471 Commits
Author SHA1 Message Date
Andras Bacsai e7465000b3 fix(api): key unauthenticated rate limits by Cloudflare client IP
Use auth_rate_limit_ip() rather than $request->ip() for the api, 5 and
feedback rate limiters. On cloud, each client behind Cloudflare now gets
its own bucket instead of sharing the proxy's bucket. Self-hosted
instances ignore the CF-Connecting-IP header.

Add feature tests for per-client sentinel push buckets on cloud and for
ignoring the header on self-hosted.

Add scripts/restore-backup-vm.sh, which restores an instance backup into
an offline KVM VM to test database migrations. Bump the v4 version in
other/nightly/versions.json to sha-1e9add3.
2026-09-29 13:06:44 +02:00
Andras Bacsai 99c840922c fix(notifications): throttle repeated notifications per resource
High disk usage notifications were sent every ~10 minutes on Coolify Cloud
because the cache rate limiter did not hold across Sentinel-triggered checks.

- Add a notification_throttles table and NotificationThrottle helper that
  atomically records when a notification was sent for a resource.
- Add the ThrottledNotification contract; Team::notify() skips a throttled
  notification that was already sent within its interval.
- High disk usage: configurable per-server interval
  (server_disk_usage_notification_interval_hours, default 24h) in
  Server > Advanced and the servers API.
- Container restarted (coolify-proxy, database TCP proxy): at most one
  notification per hour per server/database during a restart loop.
- Move the unreachable and missing-backup markers into the new table and
  migrate existing data (servers.unreachable_notification_sent and
  scheduled_database_backups.missing_backup_notification_sent_at).
- Regenerate OpenAPI files.
2026-09-29 11:29:39 +02:00
Andras Bacsai 49086c82a8 fix(multi-server): block additional servers with a mismatched proxy (#12053) 2026-09-29 11:10:22 +02:00
Andras BacsaiandClaude Opus 5.5 3d763c1577 refactor(server-transfer): always claim on import and drop remote claim file
Import now always claims the server and rebinds Sentinel. Remove the
SSH-written ownership file, the write_remote/rebind_sentinel/claim
options, and the POST /servers/{uuid}/claim endpoint. The migrator now
fails when the target cannot take management. Disabling management
records transfer.management_disabled so the server shows as
transferable, and the transfer and import pages are simplified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:56:11 +02:00
Andras BacsaiandClaude Opus 5.5 1e9add3b42 fix(ui): show validation checkpoints as a vertical list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:54:57 +02:00
Andras BacsaiandClaude Opus 5.5 cbee84353e refactor(events): broadcast team events to an explicit team
Move the shared team id and team channel logic of 15 broadcast events
into a BroadcastsToTeam trait. Events no longer fall back to the session
team: the session team can differ from the resource team, and queued
jobs have no session.

Fix StopDatabaseProxy, which dispatched DatabaseProxyStopped without a
team, so the event was never broadcast from queued jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:46:16 +02:00
Andras Bacsai 65262e639e fix(installer): keep resource data ownership on reinstall and upgrade
install.sh ran chown -R 9999:root and chmod -R 700 on all of
/data/coolify on every run. This changed bind-mounted data of services,
applications, and databases, and reset the ownership that a non-root
SSH user needs.

Set owner and mode on /data/coolify and the resource directories only
when the installer creates them. Change only source, ssh, and images
recursively, because the coolify container uses them.

Also wait until the Docker daemon accepts connections after a restart,
because OpenRC returns before the daemon is ready.

Fixes #11945
2026-09-29 10:37:54 +02:00
Andras BacsaiandClaude Opus 5.5 3452faec87 fix(livewire): bind team broadcast listeners to the mounted team
Livewire rebuilds listener names from the session team on every event
call. After a team switch in another tab, open pages still listen on the
old team channel, so events failed with EventHandlerDoesNotExist (500),
or ran handlers that load resources scoped to the new team (404).

Store the team at mount and build team channel listeners from it. Events
for a team that is no longer the session team are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:31:32 +02:00
Andras Bacsai aae1e0c0e5 fix(ui): show Cloudflare token link as a button in integration token form 2026-09-29 10:22:07 +02:00
Andras Bacsai 5ecc689135 fix(help): show an error when feedback cannot be delivered
Without SMTP or Resend configured, the Help form posts to the Cloud
feedback API but ignored the response, so it always reported success.
Check the response and show an error on failure. The Cloud endpoint now
returns 502 when the Discord webhook fails.
2026-09-29 10:19:57 +02:00
Andras BacsaiandClaude Opus 5.5 639a07e4cb feat(s3): revalidate unusable S3 storages hourly
Re-test S3 storages marked unusable every hour so a storage that becomes
reachable again is usable without manual action. Failures keep the
storage unusable and reuse the existing once-per-outage email.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 10:16:09 +02:00
Andras Bacsai 452259aacc feat(scheduler): dispatch scheduled jobs by their stored next run time
The scheduled job manager checked every enabled schedule each minute and
evaluated its cron expression in PHP. On Coolify Cloud one run took more than
60 seconds, so runs overlapped and minutes were skipped.

Each schedule now stores its next due time:
- next_run_at on scheduled database backups, scheduled tasks, and volume
  backups, and docker_cleanup_next_run_at on server settings (UTC, indexed)
- model hooks calculate it when a schedule is created or its frequency or
  enabled flag changes; a server timezone change or a move to another server
  calculates it again for the affected schedules

The `scheduled:dispatch` command runs the manager every minute from the
scheduler, not from a queue. It selects only due rows and claims each
occurrence with an atomic update of next_run_at, together with its delivery
record, so parallel runs on several nodes never dispatch it twice.
- database and volume backups run once when they are late; tasks and Docker
  cleanups more than 10 minutes late are logged as missed
- a local time that occurs two times when the clocks go back runs once
- the migration continues each schedule after its last recorded occurrence and
  drops scheduled_job_states

Show the next run, in the server timezone, on the database backup, scheduled
task, volume backup, and Docker cleanup pages, or "Invalid frequency" when the
frequency cannot be calculated. scheduled:diagnostics now lists overdue
schedules and open deliveries.

Remove workarounds that are no longer needed: the queue overlap lock and its
stale-lock repair, the catch-up window, and debug-only logs.
2026-09-29 10:07:23 +02:00
Andras Bacsai 2928a27966 fix(docker): pass the application to the container lookup in scheduled tasks
af983a29d changed getCurrentApplicationContainerStatus() to take the
application model, but missed this caller. Scheduled tasks of an
application failed with a TypeError.
2026-09-29 09:59:51 +02:00
Andras Bacsai 0393d4e931 fix(ui): move deployments indicator into the sidebar
The floating bottom-left pill and its expanded list covered page content.

- Desktop: show a compact 'N deployments' row in the sticky sidebar footer
  (spinner with count badge when the sidebar is collapsed); the list opens
  to the right of the sidebar
- Mobile: show a spinner with the count in the top bar; the list opens
  below the top bar
- Poll only the copy visible at the current breakpoint (wire:poll.visible)
- Show the indicator on the dashboard too, and drop the path-based
  visibility logic and its navigate round trip
2026-09-29 09:58:54 +02:00
Andras Bacsai af983a29d8 refactor(docker): identify containers by resource UUID instead of numeric id
Container ownership labels now use UUIDs: coolify.applicationUuid,
coolify.serviceUuid, coolify.service.subUuid and coolify.databaseUuid.
Numeric ids differ between Coolify instances, so after a server transfer
the target could not find existing containers: redeploys left the old
container running and service statuses were wrong.

Containers are matched by UUID label first, then by the compose project
(Swarm: stack namespace), which is the resource UUID since July 2024, and
last by the older numeric id label. Existing containers keep working
without a redeploy and get the UUID labels on the next deploy or restart.
2026-09-29 09:57:56 +02:00
Andras Bacsai abf9915995 chore(deps): remove Laravel Nightwatch integration
Drop the laravel/nightwatch package and its agent service from the
development and production s6-overlay configs. Remove the related
environment variables, constants, phpunit setting, Boost skill
registration, and configure-nightwatch agent skills. Update the
container role script test to stop expecting the nightwatch-agent
service.
2026-09-28 21:16:11 +02:00
Andras Bacsai a1fe4b71d9 fix(deploy): write missing content files before compose up on any server
Call write_missing_content_files() at the start of start_by_compose_file()
so bind-mounted content files exist before `docker compose up` runs, which
would otherwise create them as empty directories. This also covers
Dockerfile deployments to additional servers that lack the files.

Add a feature test for a Dockerfile deployment to an additional server,
and note in lessons that long-lived Horizon workers must flush static
caches in Queue::before.
2026-09-28 17:04:01 +02:00
Andras Bacsai d28bc91ff5 fix(scheduler): read fresh server state in each job and log scheduling decisions
Horizon workers kept Server::findCached() results between jobs, so scheduled
database backups used stale reachability and subscription state. A backup that
was skipped with the stale state counted as done for that day. Flush the
Server identity map before each queue job.

Add debug logs for the full path of a scheduled run, so a multi-node cloud
instance shows where a run is lost:
- manager start delay, gap since the previous start, host, pid, memory, and
  a warning when the start is later than the catch-up window
- skip logs with the server state that was used and the current database state
- occurrence enqueued, claimed, rejected, completed and failed, with host and
  the delay since the due time; a warning when the previous run is still open
- count of occurrences still open after 15 minutes on each manager run
- database backup runs that end without a backup
- server connection state changes with the checking node and the SSH error

Also keep publishing pending occurrences when one of them fails.
2026-09-28 16:15:00 +02:00
Andras BacsaiandClaude Opus 5.5 86402ef926 fix(ui): clean up the server rows of multi-server applications
- Show the status summary next to the server name on the primary and additional server rows.
- Move Deploy, Make primary, Stop and Remove into one Actions dropdown per server row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 15:39:00 +02:00
Andras BacsaiandClaude Opus 5.5 7bd8baa7f0 fix(multi-server): make applications on several servers consistent
- Stop the application on every server, also when one server is not functional.
- Write file mounts on every server of the application, not only on the main server.
- Deploy the exact commit, rollback flag and image tag of the main deployment to the
  additional servers, so a rollback reverts all servers.
- Pull the pushed image on additional servers for inline Dockerfile applications
  instead of building it again on each server.
- Fail multi-server deployments without a Docker image name, also from webhooks and the API.
- Send one deployment notification after all servers finish (parent_deployment_uuid).
- Block persistent volumes on multi-server applications (API, Livewire, SQLite connect)
  and warn in the deployment log for existing applications that have both.
- Remove dead code in push_to_docker_registry().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 15:38:57 +02:00
Andras BacsaiandClaude Opus 5.5 1f0e2f74d0 fix(ui): replace native browser dialogs with confirmation modals
Use the Coolify confirmation modal instead of wire:confirm for server
management, server transfer and import, resource migration, and S3
backup disabling. Show a toast instead of alert() for a missing GitHub
App webhook endpoint. Add a test that blocks native dialogs in views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 15:37:20 +02:00
Andras BacsaiandClaude Opus 5.5 15909fa641 feat(server): move management toggle to connection header and show connection first
Replace the dev-only management ownership section with an Enable/Disable
management button in the Connection section header, and place the
Connection section above the Server overview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 14:56:42 +02:00
Andras Bacsai 2e67b70eec Merge remote-tracking branch 'origin/main' 2026-09-28 14:29:56 +02:00
Andras BacsaiandClaude Opus 5.5 f008e0593b fix(server): hide server IP addresses on the servers list
The dashboard redesign added an IP address column to the servers list
and put each server IP into the Alpine data, so the IP showed in the
page source. Remove the column and the value, and render the component
in the test instead of matching template strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 14:28:01 +02:00
Andras Bacsai 1e5cc98ef7 feat(server): add Docker images page with per-image delete (#11689)
Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
2026-09-28 14:25:41 +02:00
Andras Bacsai 0fec411b72 feat(server): confirm Docker image deletion with a typed reference modal
Replace the browser confirm on the Delete button with a two-step
confirmation modal. To delete, users now type the image reference.
The modal is shown only to users who can update the server. delete()
now accepts an optional password argument so it works with the modal's
submit action.
2026-09-28 14:21:17 +02:00
badnikhil 2e2d1d321c feat(server): add Docker images page with per-image delete
Adds an Images entry to the server sidebar that lists the Docker images
stored on that server: repository, tag, image ID, age, size and the
containers using each one. Images no container references are labelled
Unused and can be deleted individually; Docker's own reported total and
reclaimable size are shown above the table.
2026-09-28 14:21:17 +02:00
Andras BacsaiandClaude Opus 5.5 81af5892d7 test(api): cover the team update audit event
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 14:06:14 +02:00
Andras BacsaiandClaude Opus 5.5 7c21c330c9 fix(gitlab): check the private key before using it for git commands
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 14:06:14 +02:00
Andras BacsaiandClaude Opus 5.5 739d9e9d23 fix(permissions): show logs and task output only to admins and read:sensitive tokens
Container logs and scheduled-task commands and output are now shown only to
users who can edit the resource. The API returns them only to tokens with
the read:sensitive or root ability, the same as the MCP tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 13:20:59 +02:00
Andras BacsaiandClaude Opus 5.5 1ecd927ca3 fix(api): return the saved proxy configuration only with read:sensitive
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 13:10:25 +02:00
Andras BacsaiandClaude Opus 5.5 5ab6e1b245 fix(storage): show file mount content only to users who can edit the resource
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 12:53:39 +02:00
Andras BacsaiandClaude Opus 5.5 c6fd0a0b0d fix(shared-variables): show server variable values only to admins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 12:40:16 +02:00
Andras BacsaiandClaude Opus 5.5 1e910394fd fix(compose): show compose content only to users who can edit the resource
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 12:30:47 +02:00
Andras Bacsai 4ab0e89e24 feat(server): add dev-only toggle for server management ownership
Add a Management ownership switch to the server page, shown only in
development, that lets a user with update permission release or claim
control of a server from this Coolify instance. Claiming is blocked for
localhost and when the team is over its server limit. Both actions are
recorded in the audit log.

When ServerTransferClaimer claims a server, it now clears force_disabled
if the team is within its server limit, and it always saves settings,
not only when the sentinel is rebound.
2026-09-28 12:14:56 +02:00
Andras BacsaiandClaude Opus 5.5 350d8a6571 fix(databases): refresh database form values consistently
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 12:07:02 +02:00
Andras BacsaiandClaude Opus 5.5 0448c6ca51 refactor(http): remove the TrustHosts middleware that never checked the host
TrustHosts skipped its check while the cache key instance_settings_fqdn_host
was empty, and only the skipped check filled that key. So since e1fe58639
(October 2025) no release restricted the Host header. Turning it on now would
lock out users who reach Coolify by server IP or another name when the domain
or proxy is broken.

Links in emails and notifications do not use the Host header: base_url()
uses the configured FQDN or the server IP (see ResetPasswordUrlTest). So
remove the middleware, its cache key and its tests. TrustProxies is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 12:00:16 +02:00
Andras Bacsai 1f4006ac49 test: remove tests that do not exercise app code
Remove tests that copy app logic into the test, grep PHP source as
text, only check literals, constants, class_exists or PHP built-ins,
duplicate other tests, or are always skipped. Keep source checks that
guard security and authorization rules.

Rename a duplicate Pest helper so the full suite loads, drop the
missing v5/Browser path, and remove the CLAUDE.md symlink in favor of
AGENTS.md. Correct AGENTS.md: Dusk is not installed and the upgrade
script is scripts/upgrade.sh.
2026-09-28 11:55:56 +02:00
Andras BacsaiandClaude Opus 5.5 59788c59f0 fix(storage): refresh storage form values consistently
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:51:53 +02:00
Andras BacsaiandClaude Opus 5.5 dd7ad91ba2 fix(cleanup): delete old rows in batches and report the real count
cleanup:database used orderBy()->skip(10)->delete(). Laravel drops the offset
in a DELETE, so it deleted all old rows anyway, and the count query with the
offset printed 0 on PostgreSQL. Count without the offset, delete in batches of
1000 rows so a large table is not locked by one long DELETE, and write the
output through the command so it is captured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:50:32 +02:00
Andras BacsaiandClaude Opus 5.5 4145261b6e fix(api): validate delete_from_provider before deleting a server
Reject delete_from_provider values that are not booleans, and reject the
request when the team has no token for a linked cloud provider. Before,
both cases removed the server from Coolify but kept the cloud VM running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:42:48 +02:00
Andras BacsaiandClaude Opus 5.5 f885e1eeeb fix(deployments): do not print build-time values in development debug lines
With APP_ENV=local the deployment log showed every build-time value (raw,
stripped and escaped) and the old and new value of overrides. Print only the
key, the type and the value length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:42:03 +02:00
Andras BacsaiandClaude Opus 5.5 f540c49f68 fix(security): encrypt stored remote commands and remove them after the final attempt
remote_process() stored the full shell command as plain text in
activity_log and kept it for 60 days. Database starts store the compose file
with the database passwords, imports store S3 keys, and the Cloudflare
tunnel setup stores its token.

- Store the command encrypted. The queue worker decrypts it right before the
  SSH call and still reads plain commands of tasks queued before the upgrade.
- Remove the command when the task is finished: after a successful run, in
  failed() when no attempt is left, and for a stopped import. A failed attempt
  that the queue retries keeps it.
- Do not write a command preview into the error log.
- Migration: remove stored commands from activities that no longer run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:41:56 +02:00
Andras Bacsai aa61214233 feat(api): add delete_from_provider option to server delete endpoint (#12026) 2026-09-28 11:38:31 +02:00
Andras BacsaiandClaude Opus 5.5 f8b320ab40 fix(servers): validate the selected private key when adding a server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:35:46 +02:00
Andras BacsaiandClaude Opus 5.5 6c3249d324 fix(logs): track the All lines state locally and show loading in the lines control
The All button read $wire.numberOfLines, which does not update while the user
types or pastes a new number, so All stayed highlighted. Keep the state in
Alpine instead: All loads set it, and any input in the number field clears it
unless the value is -1.

Show a spinner in the All button while all logs load, and in place of the
Lines label while a new line count loads. Both keep their width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:18:57 +02:00
Andras BacsaiandClaude Opus 5.5 eed50d6781 fix(github): check the private key before generating app tokens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:18:29 +02:00
Andras BacsaiandClaude Opus 5.5 af19bd0a50 fix(sources): validate the selected private key on source settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:12:48 +02:00
Andras BacsaiandClaude Opus 5.5 1f7a011767 docs(ai): add lessons for browser test output and shared storage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:09:13 +02:00
Andras BacsaiandClaude Opus 5.5 986e93445e test: remove production seeder test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 11:09:13 +02:00