Commit Graph
50 Commits
Author SHA1 Message Date
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
andrasbacsai 96c4f5b8da Fix styling 2024-07-25 11:31:59 +00:00
Andras Bacsai 6a4aa492c0 fix: random generated uuid will be full length (not 7 characters) 2024-07-25 13:31:01 +02:00
Andras Bacsai 2ea146333e fix: uuid in api docs type 2024-07-24 21:10:32 +02:00
Andras Bacsai 33b965d9db chore: more details 2024-07-09 13:59:54 +02:00
Andras Bacsai 2d3a6a4528 openapi work work 2024-07-09 10:45:10 +02:00
Andras Bacsai efa2ae5177 api api api api 2024-07-04 13:45:06 +02:00
Andras Bacsai b24a489c77 fix: api updates 2024-07-03 13:13:38 +02:00
Andras Bacsai 3c13f1ff61 feat: restart database
feat: public dbs stay public after restart
feat: patch database conf
2024-07-02 13:39:44 +02:00
Andras Bacsai c39d6dd407 feat: token permissions
feat: handle sensitive data
feat: handle read-only data
2024-07-02 12:15:58 +02:00
Andras Bacsai da6f2da3d0 feat: lots of api endpoints 2024-07-01 16:26:50 +02:00