Commit graph

118 commits

Author SHA1 Message Date
Andras Bacsai
d9e39ba211 Merge remote-tracking branch 'origin/next' into env-var-descriptions 2026-02-28 00:09:54 +01:00
Andras Bacsai
0580af0d34 feat(healthchecks): add command health checks with input validation
Add support for command-based health checks in addition to HTTP-based checks:
- New health_check_type field supporting 'http' and 'cmd' values
- New health_check_command field with strict regex validation
- Updated allowedFields in create_application and update_by_uuid endpoints
- Validation rules include max 1000 characters and safe character whitelist
- Added feature tests for health check API endpoints
- Added unit tests for GithubAppPolicy and SharedEnvironmentVariablePolicy
2026-02-25 11:38:09 +01:00
Andras Bacsai
73170fdd33 chore: prepare for PR 2026-02-23 12:12:10 +01:00
Andras Bacsai
95e93ad899 chore: prepare for PR 2026-02-09 14:48:16 +01:00
Miroslav Banov
442d38c277
fix(api): infinite loop with github app with many repos (#8052)
Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com>
2026-01-27 22:00:02 +01:00
peaklabs-dev
b02e64beda
docs(api): improve app endpoint deprecation description 2026-01-16 18:24:12 +01:00
peaklabs-dev
e53c71908f
fix(api): if domains field is empty clear the fqdn column
- providing an empty string for `domains` allows the ability to remove all URLs from the domains field
2026-01-15 13:12:49 +01:00
peaklabs-dev
161e0d2b05
chore(api): improve current request error message 2026-01-14 15:37:02 +01:00
peaklabs-dev
6ca04b5613
feat(api): add more allowed fields
- added dockerfile_location as it is needed for Dockerfile deployments to work properly
- added is_spa as it makes sense together with is_static
- added is_auto_deploy_enabled and is_force_https_enabled
2026-01-14 15:28:02 +01:00
peaklabs-dev
8a1d76cd99
fix(api): is_static and docker network missing
- GitHub App and Private Deploy Key where missing is_static and connect_to_docker_network
2026-01-14 15:27:54 +01:00
peaklabs-dev
5f5c26d841
fix(api): check domain conflicts within the request 2026-01-14 15:22:30 +01:00
peaklabs-dev
754448d9d4
feat(api): improve docker_compose_domains
- add url conflict checking and force_domain_override support
- refactor docker_compose_domains URL validation function
2026-01-14 15:22:18 +01:00
peaklabs-dev
c66b6490e6
docs(api): improve domains API docs 2026-01-14 15:21:59 +01:00
peaklabs-dev
f4acf7ca10
refactor(api): application urls validation
- rename fqdn to urls as that is what it actually is
- improve URL validation to allow urls without a TLD
- improve error messages to make it clear that URLs are needed
- improve code by combining some actions
2026-01-14 15:21:44 +01:00
🏔️ Peak
3ff2743e01
fix(api): encoding checks (#7944) 2026-01-13 16:53:11 +01:00
peaklabs-dev
ce3cae3ff9
fix(api): applications post and patch endpoints
- remove `docker_compose_raw` from post and patch endpoints, as the compose file is sourced from git and should not be manually settable via the api
- improve the documentation for `docker_compose_domains` (URLs)
- enhanced array validation for `docker_compose_domains` by validating each array field and verifying which fields are allowed
- set a custom array validation error message, as the default message is not really clear
- show an error if the user attempts to set `domains` when the build pack is `dockercompose`
- validate that the `domains` in `docker_compose_domains` are proper URLs and include a valid scheme (`http` or `https`)
2026-01-12 22:08:05 +01:00
peaklabs-dev
7c0cb2f59d
fix(api): deprecate applications compose endpoint
- this endpoint is a duplicate of the services endpoint and also updates fields that do not exist which makes it unstable
2026-01-12 22:08:05 +01:00
peaklabs-dev
9253586f8f
refactor(api): update application create endpoints docs 2026-01-12 22:08:05 +01:00
peaklabs-dev
a0c307ac45
fix(api): add custom_network_aliases to allowed fields 2026-01-11 18:18:36 +01:00
Yassine Benh
31ba241d97
feat(api): add tag filtering on the applications list endpoint (#7360) 2026-01-10 20:22:29 +01:00
Daniele Luisetto
e9ef331def
feat(api): allow to escape special characters in labels (#7886) 2026-01-06 15:50:55 +01:00
Yassir
aeef97f295
fix(docs): api docs for bulk env update response (#7714) 2026-01-06 12:52:32 +01:00
Muhammed Mustafa AKŞAM
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 Bacsai
87f9ce0674 Add comment field support to environment variable API endpoints
API consumers can now create and update environment variables with
an optional comment field for documentation purposes. Changes include:
- Added comment validation (string, nullable, max 256 chars) to all env endpoints
- Updated ApplicationsController create_env and update_env_by_uuid
- Updated ServicesController create_env and update_env_by_uuid
- Updated openapi.json request schemas to document the comment field

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:53 +01:00
Andras Bacsai
5d38147899 feat(api): Improve OpenAPI spec and add rate limit handling for Hetzner
- Add 429 response with Retry-After header for Hetzner server creation
- Create RateLimitException for proper rate limit error handling
- Rename cloud_provider_token_id to cloud_provider_token_uuid with deprecation
- Fix prices array schema in server-types endpoint with proper items definition
- Add explicit default: true to autogenerate_domain properties
- Add timeout and retry options to Docker install curl commands
- Fix race condition in deployment status update using atomic query
2025-12-11 12:12:43 +01:00
Andras Bacsai
32e047e512 Fix API response to return fqdn instead of non-existent domains attribute
The Application model stores domain as 'fqdn' not 'domains'. The API response
was incorrectly using data_get($application, 'domains') which always returned
null. Fixed all 5 application creation endpoint responses.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 16:26:08 +01:00
Andras Bacsai
eb743cf690 Add autogenerate_domain API parameter for applications
Allows API consumers to control domain auto-generation behavior. When autogenerate_domain is true (default) and no custom domains are provided, the system auto-generates a domain using the server's wildcard domain or sslip.io fallback.

- Add autogenerate_domain parameter to all 5 application creation endpoints
- Add validation and allowlist rules
- Implement domain auto-generation logic across all application types
- Add comprehensive unit tests for the feature

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:16:04 +01:00
Andras Bacsai
4706bc23aa Refactor: Centralize service application prerequisites
Refactors the Appwrite and Beszel service-specific application settings
to use a centralized constant-based approach, following the same pattern
as NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK.

Changes:
- Added NEEDS_TO_DISABLE_GZIP constant for services requiring gzip disabled
- Added NEEDS_TO_DISABLE_STRIPPREFIX constant for services requiring stripprefix disabled
- Created applyServiceApplicationPrerequisites() helper function in bootstrap/helpers/services.php
- Updated all service creation flows to use the centralized helper:
  * app/Livewire/Project/Resource/Create.php (web handler)
  * app/Http/Controllers/Api/ServicesController.php (API handler - BUG FIX)
  * app/Livewire/Project/New/DockerCompose.php (custom compose handler)
  * app/Http/Controllers/Api/ApplicationsController.php (API custom compose handler)
- Added comprehensive unit tests for the new helper function

Benefits:
- Single source of truth for service prerequisites
- DRY - eliminates code duplication between web and API handlers
- Fixes bug where API-created services didn't get prerequisites applied
- Easy to extend for future services (just edit the constant)
- More maintainable and testable

Related commits: 3a94f1ea1 (Beszel), 02b18c86e (Appwrite)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:47:09 +01:00
Zach Silveira
b72f93faab fix api call booleans not being used 2025-10-26 11:25:44 -04: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
78031b991a fix: allow all environment variable fields in API endpoints
Fixes #6847

The API endpoints for environment variables were rejecting valid fields
like is_buildtime, is_runtime, is_multiline, and is_shown_once with
422 errors, even though the code was using these fields internally.

Changes:
- Added missing fields to $allowedFields in create_env()
- Added missing fields to $allowedFields in update_env_by_uuid()
- Updated allowed fields in create_bulk_envs()
- Added validation rules for is_runtime and is_buildtime

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 10:44:06 +02:00
Andras Bacsai
41a8ea870f feat(docker): refine Docker image processing in application creation
- Enhanced logic to process Docker image name and tag, including stripping 'sha256:' prefix and removing '@sha256' suffix.
- Implemented validation to check for valid SHA256 hashes and conditionally append '@sha256' to the image name.
- Defaulted the image tag to 'latest' if not provided, improving user experience and data integrity.
2025-10-03 11:49:20 +02:00
Andras Bacsai
a463a562ec fix(domains): trim whitespace from domains before validation 2025-09-22 12:51:23 +02:00
Andras Bacsai
f33df13c4e feat(environment): replace is_buildtime_only with is_runtime and is_buildtime flags for environment variables, updating related logic and views 2025-09-18 18:14:54 +02:00
Andras Bacsai
20ad2165e7 feat(environment): introduce 'is_buildtime_only' attribute to environment variables for improved build-time configuration 2025-09-11 17:38:16 +02:00
Andras Bacsai
5b3b4bbc43 refactor(environment): remove 'is_build_time' attribute from environment variable handling across the application to simplify configuration 2025-09-11 16:51:56 +02:00
Andras Bacsai
6e3e80f1c2 fix(api): add custom labels generation for applications with readonly container label setting enabled 2025-08-31 15:40:48 +02:00
Andras Bacsai
75b61a6b00 feat(domains): add force_domain_override option and enhance domain conflict detection responses 2025-08-28 11:21:30 +02:00
Andras Bacsai
b1334a1bc6 feat(auth): implement comprehensive authorization checks across API controllers 2025-08-23 18:51:10 +02:00
Andras Bacsai
8408205955 feat(validation): add custom validation rules for Git repository URLs and branches
- Introduced `ValidGitRepositoryUrl` and `ValidGitBranch` validation rules to ensure safe and valid input for Git repository URLs and branch names.
- Updated relevant Livewire components and API controllers to utilize the new validation rules, enhancing security against command injection and invalid inputs.
- Refactored existing validation logic to improve consistency and maintainability across the application.
2025-08-22 14:38:21 +02:00
🏔️ Peak
2a526c54d5
fix(docker): volumes get delete when stopping a service if Delete Unused Volumes is activated (#6317) 2025-08-04 21:15:56 +02:00
Nurdism
999a67cbda
feat(api): Add connect_to_docker_network setting to App creation API (#5691) 2025-05-27 15:07:31 +02:00
Andras Bacsai
6c7b64e96d refactor(applications): remove unused docker compose raw decoding 2025-05-20 14:11:59 +02:00
Andras Bacsai
cee9dfcf52 fix(api): enhance validation for docker_compose_raw in ApplicationsController
- Add checks to ensure docker_compose_raw is provided and correctly base64 encoded.
- Implement detailed error responses for validation failures to improve user feedback.
2025-05-19 13:30:31 +02:00
Andras Bacsai
38d9471de1 fix(api): validate docker_compose_raw input in ApplicationsController
- Ensure docker_compose_raw is provided and base64 encoded before processing.
- Return appropriate validation error messages for missing or incorrectly formatted input.
2025-05-19 13:29:23 +02:00
Andras Bacsai
78ef80f800 refactor 2025-04-23 13:22:01 +02:00
Andras Bacsai
4ea00cff31 refactor(applications): remove redundant error response in create_env method 2025-04-22 10:44:30 +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
Andrew Nagy
61c689d807
fix(api): Add back validateDataApplications (#5539) 2025-04-05 13:58:15 +02:00