Commit Graph
60 Commits
Author SHA1 Message Date
Andras Bacsai cf1e0e70c5 feat(deployments): cancel superseded deployments when a newer one is queued 2026-11-03 14:31:52 +01:00
Andras Bacsai d8fe02464b Merge remote-tracking branch 'origin/next' into automation/sync-main-to-next 2026-10-26 12:40:59 +01:00
Andras Bacsai 2796609e96 feat(access): add scoped grants for team members and API tokens (#12329) 2026-10-26 12:13:20 +01:00
Andras Bacsai 5227693885 fix(deployments): scope deployment queries to team applications (#12195) 2026-10-18 23:32:14 +02:00
Andras Bacsai 6cc6f1081d fix(deployments): advance the queue on all servers after a cancel
- A queued deployment on a deleted server no longer stops the queue;
  one deployment that fails to start does not stop the others
- Cancelling a deployment starts the queued deployments of the same
  application on all servers, as a finished deployment does
2026-10-05 23:10:52 +02:00
Andras Bacsai 0abf82e631 fix(api): limit pull request ids to the database integer range
A pull request id above 2147483647 caused a database error and a 500.

- Previews store: validate max 2147483647 (422)
- /deploy: return 400 for pr or pull_request_id out of range
- Preview show, logs, update, and delete: return 422 for ids out of range
- Document the maximum in the OpenAPI spec
2026-10-05 21:24:05 +02:00
Andras Bacsai 35c38b1dde fix(database): reject blocked starts before queueing operations
Check start prerequisites in database and deploy APIs and MCP controls.
Return HTTP 422 for blocked API starts and restarts. Show restart notices
and open UI logs only after an operation is queued.

Add API regression tests for blocked ClickHouse starts and restarts.
2026-10-05 14:59:59 +02:00
Andras Bacsai 88efc0716e fix: enforce resource team isolation and preserve ClickHouse data
Scope resource permissions and related records to the owning team across
team switches, cloning, deployments, and resource operations.

Merge ClickHouse volume mounts, preserve anonymous data volumes on stop,
and require adopting current data before starting or restarting.

Fix file storage deletion checks and add regression coverage.
2026-10-05 14:23:04 +02:00
Andras Bacsai 554bd354bf fix: support host storage paths and clean up cancelled deployments
Allow validated host file and directory mounts outside resource directories
while protecting external paths from deletion.

Clean up cancelled deployment containers and clear tracked process IDs.
Preserve legacy KeyDB and Dragonfly password parsing, accept server backup
paths without extension restrictions, and allow Compose variable proxy ports.
2026-10-05 11:08:52 +02:00
Andras Bacsai e172beaa30 feat(api): add endpoints to list, get, and open preview deployments
- GET /applications/{uuid}/previews and GET /applications/{uuid}/previews/{pull_request_id}
  return preview deployments (read ability).
- POST /applications/{uuid}/previews opens a preview for a pull request and queues its
  deployment, or redeploys an existing preview (deploy ability). It accepts git_type,
  commit (required for Bitbucket), docker_tag (Docker Image apps), force, and
  instant_deploy. GitHub App and GitLab App sources set git_type automatically.
- Fix POST /deploy with pull_request_id: pass the preview git_type to the deployment, so
  deploy-key and public-repository applications build the pull request instead of the
  base branch.
- Regenerate the OpenAPI spec (also adds the missing service_name logs parameter).
2026-10-04 00:52:17 +02:00
Andras BacsaiandClaude Opus 5.5 fbfe342f89 fix(databases): reserve start and restart atomically
Two parallel start requests both passed the in-progress check and got
200, because the start activity is created later by the queued action.
A per-database reservation (Cache::add, 600 s) is now taken before the
check, so the second request gets 409. The action releases it when it
creates its activity, skips, or fails. Restart, import, the deploy
API, MCP, and Livewire use the same reservation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 21:19:14 +02:00
Andras Bacsai 5152698757 fix(deployments): advance queue after cancellations (#11330) 2026-08-17 16:27:00 +02:00
Andras Bacsai 0633b543ee feat(api): require POST for state-changing endpoints
Make start/stop/restart, deploy, enable/disable, and server validate
POST-only, with GET returning 405. Server validate accepts optional
install and uses ValidateAndInstallServerJob. Update OpenAPI and tests.
2026-07-19 11:42:04 +02:00
Andras Bacsai ff976a134f Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-07-07 12:56:19 +02:00
Andras Bacsai 76a4c1484d fix(deploy): cast force param as boolean to prevent cache bust on every deploy (#9909) 2026-07-07 12:08:29 +02:00
Andras Bacsai 29c122b31a fix(api): return deployment UUID strings directly 2026-07-03 11:31:49 +02:00
Andras Bacsai f5ecdfa4ce Merge remote-tracking branch 'origin/next' into api-sensitive-data-scrubber 2026-06-15 13:29:25 +02:00
Andras Bacsai 062ad57740 fix(security): enforce team access on mutable actions
Authorize cloud provider token access, audit sensitive operations, and
standardize public IDs across deployment and resource flows.
2026-06-04 11:03:06 +02:00
Andras Bacsai 81a3bb0f07 fix(api): hide sensitive fields by default
Add model-level hidden fields for secrets, tokens, keys, notification
credentials, deployment logs, and environment values. Allow explicit
read:sensitive API access to reveal gated private keys and deployment logs,
and cover the behavior with feature and unit tests.
2026-05-11 21:18:07 +02:00
Josh Salway 08a12c392a fix(deploy): cast force param as boolean to prevent cache bust on every deploy
$request->input('force') ?? false reads "false" as a non-empty string,
which PHP coerces to true. Replace with $request->boolean() which uses
filter_var(FILTER_VALIDATE_BOOLEAN), correctly mapping "false" -> false.
2026-05-02 23:11:22 +10:00
Andras BacsaiandClaude Opus 4.7 a2096c6f68 feat(observability): add structured audit log channel for API and webhook events
Introduce a dedicated `audit` log channel (daily rotation, configurable retention via
LOG_AUDIT_DAYS) and a small `auditLog()` / `auditLogWebhookFailure()` helper used to
record state-changing API operations and webhook events.

Instrumented:

- API mutation endpoints (create / update / delete / start / stop / restart) across
  applications, services, databases (incl. backups, env vars, storage), servers,
  projects + environments, scheduled tasks, private keys, GitHub apps, cloud provider
  tokens, Hetzner server provisioning, instance enable/disable.
- Webhook signature verification outcomes for GitHub, GitLab, Bitbucket, Gitea and
  Stripe, plus the Sentinel push endpoint.
- Authentication and authorization outcomes via the global exception handler and
  the `ApiAbility` middleware (unauthenticated, ability-denied, policy-denied).

The helper is wrapped in try/catch so logging failures never affect the request
path. Successful operations log at `info`; suspicious/denied requests log at
`warning`. Operators wanting a failures-only feed can set `LOG_AUDIT_LEVEL=warning`.

Includes a feature test suite covering the helper, the webhook providers and the
new auth/authorization log paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 14:50:37 +02:00
Andras Bacsai 61f47cc7ee feat(deployments): support Docker image tags for preview deployments
Add end-to-end support for `docker_registry_image_tag` in preview and deployment queue flows.

- Extend deploy API to accept `pull_request_id` alias and `docker_tag` for preview deploys
- Persist preview-specific Docker tags on `application_previews` and `application_deployment_queues`
- Pass tag through `queue_application_deployment()` and de-duplicate queued jobs by tag
- Update deployment job logic to resolve and use preview Docker tags for dockerimage build packs
- Update Livewire previews UI/state to manage per-preview tags and manual preview/tag inputs
- Add migration for new tag columns and model fillable/casts updates
- Add feature and unit tests covering API behavior and tag resolution
2026-03-30 13:35:35 +02:00
Andras BacsaiandClaude Opus 4.6 e36622fdfb refactor: scope server and project queries to current team
Ensure Server and Project lookups in Livewire components and API
controllers use team-scoped queries (ownedByCurrentTeam / whereTeamId)
instead of unscoped find/where calls. This enforces consistent
multi-tenant isolation across all user-facing code paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:29:08 +01:00
Andras Bacsai 3819676555 fix(api): cast teamId to int in deployment authorization check
Ensure proper type comparison when verifying deployment team ownership.
Adds comprehensive feature tests for the GET /api/v1/deployments/{uuid} endpoint.
2026-03-12 13:25:10 +01:00
Andras Bacsai 73170fdd33 chore: prepare for PR 2026-02-23 12:12:10 +01:00
Muhammed Mustafa AKŞAMand🏔️ Peak 9b6d1613ed fix(docs): remove incorrect uuid format in openapi spec (#7419)
Co-authored-by: 🏔️ Peak <122374094+peaklabs-dev@users.noreply.github.com>
2026-01-04 16:16:19 +01:00
Andras BacsaiandClaude d019553809 Add Retry-After header to 429 rate limit responses
Adds Retry-After: 60 header to all deployment queue full responses,
helping webhook clients know when to retry their requests.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 11:02:29 +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 473c32270d Changes auto-committed by Conductor 2025-10-16 11:01:58 +02:00
Andras Bacsai 48d3b3d263 refactor(deployment): add validation for pull request existence in deployment process to enhance error handling 2025-09-10 14:31:29 +02:00
Andras Bacsai b1334a1bc6 feat(auth): implement comprehensive authorization checks across API controllers 2025-08-23 18:51:10 +02:00
Andras Bacsai 9c3817ee14 fix(deploy): update resource timestamp handling in deploy_resource method 2025-05-20 11:15:31 +02:00
Andras Bacsai 61cc49d317 fix(DeployController): update request handling to use input method and enhance OpenAPI description for deployment endpoint 2025-04-11 15:37:42 +02:00
Andras Bacsai d075241289 feat(Deployment): enhance queue_application_deployment to handle existing deployments and return appropriate status messages 2025-04-11 15:27:56 +02:00
Laurence 1e7b15ae77 enhance: Add missing UUID to openapi spec 2025-04-09 17:52:12 +01:00
Andras Bacsai 9f67633f2c feat(api): add endpoints for retrieving application logs and deployments 2025-03-31 17:38:54 +02:00
Andras Bacsai 107eb8836b Merge pull request #5444 from karan-vk/main
Feat(api): Add Pull Request deployment support to WebHooks
2025-03-31 17:34:02 +02:00
Andras Bacsai ee5c0f0413 fix(deploy): validate team ID before deployment 2025-03-31 17:33:01 +02:00
Andras Bacsaiandcoderabbitai[bot] d8248ba153 Update app/Http/Controllers/Api/DeployController.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-03-31 17:23:58 +02:00
Andras Bacsaiandcoderabbitai[bot] 99dd516d6b Update app/Http/Controllers/Api/DeployController.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-03-31 17:22:40 +02:00
Andras Bacsai adc3d95254 fix: only get apps for the current team 2025-03-31 16:52:51 +02:00
__m__ 3b04d3df91 feat(deployments): add list application deployments api route 2025-03-31 12:31:17 +01:00
Karan Vijayakumar f0a1abc55d fix(DeployController): cast 'pr' query parameter to integer
Ensure the 'pr' query parameter is consistently treated as an integer to avoid type-related issues in subsequent logic
2025-03-28 01:50:21 +09:00
Karan Vijayakumar 2947a9ff1d feat(deploy): add pull request ID parameter to deploy endpoint 2025-03-28 01:16:29 +09:00
Andras Bacsai 3fa7d03db7 fix: root + read:sensive could read senstive data with a middlewarew 2024-12-09 11:10:35 +01:00
Kael 6520235667 middleware should allow, not deny 2024-10-30 19:06:50 +11:00
Lucas Michot c5403b0b3f Always prefer ::class notation 2024-10-28 14:56:13 +01:00
Andras Bacsai 63729c7bbf Merge pull request #3373 from mattstein/api-project-description
feat: Expose project description in API response
2024-09-10 08:49:08 +02:00
Matt Stein 44d417c07e Fix user-facing string case. 2024-09-09 09:38:40 -07:00
Andras Bacsai 25480fe624 fix: openapi endpoint urls 2024-09-04 10:09:10 +02:00