An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(api): secure proxy config, clone volumes, and rollback tags (#11003)
Andras Bacsaie560bdf9e089
diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.phpindex c2592d7f9b..5ad3aa09df 100644--- a/app/Http/Controllers/Api/ApplicationsController.php+++ b/app/Http/Controllers/Api/ApplicationsController.php@@ -17,6 +17,8 @@ use App\Models\LocalPersistentVolume;use App\Models\PrivateKey;use App\Models\Project;use App\Models\Server;+use App\Models\StandaloneDocker;+use App\Models\SwarmDocker;use App\Rules\DockerImageFormat;use App\Rules\ValidGitBranch;use App\Rules\ValidGitRepositoryUrl;@@ -49,6 +51,14 @@ class ApplicationsController extends Controller'is_gzip_enabled','is_stripprefix_enabled','is_raw_compose_deployment_enabled',+ 'is_log_drain_enabled',+ 'is_gpu_enabled',+ 'gpu_driver',+ 'gpu_count',+ 'gpu_device_ids',+ 'gpu_options',+ 'is_consistent_container_name_enabled',+ 'custom_internal_name',];private const BOOLEAN_APPLICATION_SETTING_FIELDS = [@@ -63,6 +73,9 @@ class ApplicationsController extends Controller'is_gzip_enabled','is_stripprefix_enabled','is_raw_compose_deployment_enabled',+ 'is_log_drain_enabled',+ 'is_gpu_enabled',+ 'is_consistent_container_name_enabled',];protected function findTaggableResource(string $uuid, int|string $teamId): mixed@@ -368,6 +381,16 @@ class ApplicationsController extends Controller'is_gzip_enabled' => ['type' => 'boolean', 'description' => 'Enable gzip compression.'],'is_stripprefix_enabled' => ['type' => 'boolean', 'description' => 'Enable path prefix stripping.'],'is_raw_compose_deployment_enabled' => ['type' => 'boolean', 'description' => 'Deploy the raw Docker Compose definition.'],+ 'is_log_drain_enabled' => ['type' => 'boolean', 'description' => 'Enable log drain for the application.'],+ 'is_gpu_enabled' => ['type' => 'boolean', 'description' => 'Enable GPU support.'],+ 'gpu_driver' => ['type' => 'string', 'nullable' => true, 'description' => 'GPU driver name.'],+ 'gpu_count' => ['type' => 'string', 'nullable' => true, 'description' => 'Number of GPUs to allocate.'],+ 'gpu_device_ids' => ['type' => 'string', 'nullable' => true, 'description' => 'Comma-separated GPU device IDs.'],+ 'gpu_options' => ['type' => 'string', 'nullable' => true, 'description' => 'Additional GPU options.'],+ 'is_consistent_container_name_enabled' => ['type' => 'boolean', 'description' => 'Use a consistent container name across deployments.'],+ 'custom_internal_name' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom internal container name.'],+ 'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'minimum' => 0, 'description' => 'Maximum container restart count before stopping.'],'is_http_basic_auth_enabled' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'],'http_basic_auth_username' => ['type' => 'string', 'nullable' => true, 'description' => 'Username for HTTP Basic Authentication'],'http_basic_auth_password' => ['type' => 'string', 'nullable' => true, 'description' => 'Password for HTTP Basic Authentication'],@@ -550,6 +573,16 @@ class ApplicationsController extends Controller'is_gzip_enabled' => ['type' => 'boolean', 'description' => 'Enable gzip compression.'],'is_stripprefix_enabled' => ['type' => 'boolean', 'description' => 'Enable path prefix stripping.'],'is_raw_compose_deployment_enabled' => ['type' => 'boolean', 'description' => 'Deploy the raw Docker Compose definition.'],+ 'is_log_drain_enabled' => ['type' => 'boolean', 'description' => 'Enable log drain for the application.'],+ 'is_gpu_enabled' => ['type' => 'boolean', 'description' => 'Enable GPU support.'],+ 'gpu_driver' => ['type' => 'string', 'nullable' => true, 'description' => 'GPU driver name.'],+ 'gpu_count' => ['type' => 'string', 'nullable' => true, 'description' => 'Number of GPUs to allocate.'],+ 'gpu_device_ids' => ['type' => 'string', 'nullable' => true, 'description' => 'Comma-separated GPU device IDs.'],+ 'gpu_options' => ['type' => 'string', 'nullable' => true, 'description' => 'Additional GPU options.'],+ 'is_consistent_container_name_enabled' => ['type' => 'boolean', 'description' => 'Use a consistent container name across deployments.'],+ 'custom_internal_name' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom internal container name.'],+ 'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'minimum' => 0, 'description' => 'Maximum container restart count before stopping.'],'is_http_basic_auth_enabled' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'],'http_basic_auth_username' => ['type' => 'string', 'nullable' => true, 'description' => 'Username for HTTP Basic Authentication'],'http_basic_auth_password' => ['type' => 'string', 'nullable' => true, 'description' => 'Password for HTTP Basic Authentication'],@@ -732,6 +765,16 @@ class ApplicationsController extends Controller'is_gzip_enabled' => ['type' => 'boolean', 'description' => 'Enable gzip compression.'],'is_stripprefix_enabled' => ['type' => 'boolean', 'description' => 'Enable path prefix stripping.'],'is_raw_compose_deployment_enabled' => ['type' => 'boolean', 'description' => 'Deploy the raw Docker Compose definition.'],+ 'is_log_drain_enabled' => ['type' => 'boolean', 'description' => 'Enable log drain for the application.'],+ 'is_gpu_enabled' => ['type' => 'boolean', 'description' => 'Enable GPU support.'],+ 'gpu_driver' => ['type' => 'string', 'nullable' => true, 'description' => 'GPU driver name.'],+ 'gpu_count' => ['type' => 'string', 'nullable' => true, 'description' => 'Number of GPUs to allocate.'],+ 'gpu_device_ids' => ['type' => 'string', 'nullable' => true, 'description' => 'Comma-separated GPU device IDs.'],+ 'gpu_options' => ['type' => 'string', 'nullable' => true, 'description' => 'Additional GPU options.'],+ 'is_consistent_container_name_enabled' => ['type' => 'boolean', 'description' => 'Use a consistent container name across deployments.'],+ 'custom_internal_name' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom internal container name.'],+ 'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'minimum' => 0, 'description' => 'Maximum container restart count before stopping.'],'is_http_basic_auth_enabled' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'],'http_basic_auth_username' => ['type' => 'string', 'nullable' => true, 'description' => 'Username for HTTP Basic Authentication'],'http_basic_auth_password' => ['type' => 'string', 'nullable' => true, 'description' => 'Password for HTTP Basic Authentication'],@@ -886,6 +929,16 @@ class ApplicationsController extends Controller'is_gzip_enabled' => ['type' => 'boolean', 'description' => 'Enable gzip compression.'],'is_stripprefix_enabled' => ['type' => 'boolean', 'description' => 'Enable path prefix stripping.'],'is_raw_compose_deployment_enabled' => ['type' => 'boolean', 'description' => 'Deploy the raw Docker Compose definition.'],+ 'is_log_drain_enabled' => ['type' => 'boolean', 'description' => 'Enable log drain for the application.'],+ 'is_gpu_enabled' => ['type' => 'boolean', 'description' => 'Enable GPU support.'],+ 'gpu_driver' => ['type' => 'string', 'nullable' => true, 'description' => 'GPU driver name.'],+ 'gpu_count' => ['type' => 'string', 'nullable' => true, 'description' => 'Number of GPUs to allocate.'],+ 'gpu_device_ids' => ['type' => 'string', 'nullable' => true, 'description' => 'Comma-separated GPU device IDs.'],+ 'gpu_options' => ['type' => 'string', 'nullable' => true, 'description' => 'Additional GPU options.'],+ 'is_consistent_container_name_enabled' => ['type' => 'boolean', 'description' => 'Use a consistent container name across deployments.'],+ 'custom_internal_name' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom internal container name.'],+ 'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'minimum' => 0, 'description' => 'Maximum container restart count before stopping.'],'is_http_basic_auth_enabled' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'],'http_basic_auth_username' => ['type' => 'string', 'nullable' => true, 'description' => 'Username for HTTP Basic Authentication'],'http_basic_auth_password' => ['type' => 'string', 'nullable' => true, 'description' => 'Password for HTTP Basic Authentication'],@@ -1036,6 +1089,16 @@ class ApplicationsController extends Controller'is_gzip_enabled' => ['type' => 'boolean', 'description' => 'Enable gzip compression.'],'is_stripprefix_enabled' => ['type' => 'boolean', 'description' => 'Enable path prefix stripping.'],'is_raw_compose_deployment_enabled' => ['type' => 'boolean', 'description' => 'Deploy the raw Docker Compose definition.'],+ 'is_log_drain_enabled' => ['type' => 'boolean', 'description' => 'Enable log drain for the application.'],+ 'is_gpu_enabled' => ['type' => 'boolean', 'description' => 'Enable GPU support.'],+ 'gpu_driver' => ['type' => 'string', 'nullable' => true, 'description' => 'GPU driver name.'],+ 'gpu_count' => ['type' => 'string', 'nullable' => true, 'description' => 'Number of GPUs to allocate.'],+ 'gpu_device_ids' => ['type' => 'string', 'nullable' => true, 'description' => 'Comma-separated GPU device IDs.'],+ 'gpu_options' => ['type' => 'string', 'nullable' => true, 'description' => 'Additional GPU options.'],+ 'is_consistent_container_name_enabled' => ['type' => 'boolean', 'description' => 'Use a consistent container name across deployments.'],+ 'custom_internal_name' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom internal container name.'],+ 'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'minimum' => 0, 'description' => 'Maximum container restart count before stopping.'],'is_http_basic_auth_enabled' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'],'http_basic_auth_username' => ['type' => 'string', 'nullable' => true, 'description' => 'Username for HTTP Basic Authentication'],'http_basic_auth_password' => ['type' => 'string', 'nullable' => true, 'description' => 'Password for HTTP Basic Authentication'],@@ -1120,7 +1183,7 @@ class ApplicationsController extends Controllerif ($return instanceof JsonResponse) {return $return;}- $allowedFields = ['project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'is_static', 'is_spa', 'is_auto_deploy_enabled', 'is_force_https_enabled', 'is_preview_deployments_enabled', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'private_key_uuid', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'custom_network_aliases', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_type', 'health_check_command', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'redirect', 'github_app_uuid', 'instant_deploy', 'dockerfile', 'dockerfile_location', 'docker_compose_location', 'docker_compose_raw', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'watch_paths', 'use_build_server', 'use_build_secrets', 'static_image', 'custom_nginx_configuration', 'is_http_basic_auth_enabled', 'http_basic_auth_username', 'http_basic_auth_password', 'connect_to_docker_network', 'force_domain_override', 'autogenerate_domain', 'is_container_label_escape_enabled', 'tags', 'is_preserve_repository_enabled', ...self::APPLICATION_SETTING_FIELDS];+ $allowedFields = ['project_uuid', 'environment_name', 'environment_uuid', 'server_uuid', 'destination_uuid', 'type', 'name', 'description', 'is_static', 'is_spa', 'is_auto_deploy_enabled', 'is_force_https_enabled', 'is_preview_deployments_enabled', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'private_key_uuid', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'custom_network_aliases', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_type', 'health_check_command', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'redirect', 'github_app_uuid', 'instant_deploy', 'dockerfile', 'dockerfile_location', 'docker_compose_location', 'docker_compose_raw', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'watch_paths', 'use_build_server', 'use_build_secrets', 'static_image', 'custom_nginx_configuration', 'is_http_basic_auth_enabled', 'http_basic_auth_username', 'http_basic_auth_password', 'connect_to_docker_network', 'force_domain_override', 'autogenerate_domain', 'is_container_label_escape_enabled', 'tags', 'is_preserve_repository_enabled', 'preview_url_template', 'max_restart_count', ...self::APPLICATION_SETTING_FIELDS];$validator = customApiValidator($request->all(), ['name' => 'string|max:255',@@ -2603,6 +2666,16 @@ class ApplicationsController extends Controller'is_gzip_enabled' => ['type' => 'boolean', 'description' => 'Enable gzip compression.'],'is_stripprefix_enabled' => ['type' => 'boolean', 'description' => 'Enable path prefix stripping.'],'is_raw_compose_deployment_enabled' => ['type' => 'boolean', 'description' => 'Deploy the raw Docker Compose definition.'],+ 'is_log_drain_enabled' => ['type' => 'boolean', 'description' => 'Enable log drain for the application.'],+ 'is_gpu_enabled' => ['type' => 'boolean', 'description' => 'Enable GPU support.'],+ 'gpu_driver' => ['type' => 'string', 'nullable' => true, 'description' => 'GPU driver name.'],+ 'gpu_count' => ['type' => 'string', 'nullable' => true, 'description' => 'Number of GPUs to allocate.'],+ 'gpu_device_ids' => ['type' => 'string', 'nullable' => true, 'description' => 'Comma-separated GPU device IDs.'],+ 'gpu_options' => ['type' => 'string', 'nullable' => true, 'description' => 'Additional GPU options.'],+ 'is_consistent_container_name_enabled' => ['type' => 'boolean', 'description' => 'Use a consistent container name across deployments.'],+ 'custom_internal_name' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom internal container name.'],+ 'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'minimum' => 0, 'description' => 'Maximum container restart count before stopping.'],'connect_to_docker_network' => ['type' => 'boolean', 'description' => 'The flag to connect the service to the predefined Docker network.'],'force_domain_override' => ['type' => 'boolean', 'description' => 'Force domain usage even if conflicts are detected. Default is false.'],'is_container_label_escape_enabled' => ['type' => 'boolean', 'default' => true, 'description' => 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'],@@ -2692,7 +2765,7 @@ class ApplicationsController extends Controller$this->authorize('update', $application);$server = $application->destination->server;- $allowedFields = ['name', 'description', 'is_static', 'is_spa', 'is_auto_deploy_enabled', 'is_force_https_enabled', 'is_preview_deployments_enabled', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'static_image', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'custom_network_aliases', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_type', 'health_check_command', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'watch_paths', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'dockerfile_location', 'dockerfile_target_build', 'docker_compose_location', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'redirect', 'instant_deploy', 'use_build_server', 'use_build_secrets', 'custom_nginx_configuration', 'is_http_basic_auth_enabled', 'http_basic_auth_username', 'http_basic_auth_password', 'connect_to_docker_network', 'force_domain_override', 'is_container_label_escape_enabled', 'is_preserve_repository_enabled', ...self::APPLICATION_SETTING_FIELDS];+ $allowedFields = ['name', 'description', 'is_static', 'is_spa', 'is_auto_deploy_enabled', 'is_force_https_enabled', 'is_preview_deployments_enabled', 'domains', 'git_repository', 'git_branch', 'git_commit_sha', 'docker_registry_image_name', 'docker_registry_image_tag', 'build_pack', 'static_image', 'install_command', 'build_command', 'start_command', 'ports_exposes', 'ports_mappings', 'custom_network_aliases', 'base_directory', 'publish_directory', 'health_check_enabled', 'health_check_type', 'health_check_command', 'health_check_path', 'health_check_port', 'health_check_host', 'health_check_method', 'health_check_return_code', 'health_check_scheme', 'health_check_response_text', 'health_check_interval', 'health_check_timeout', 'health_check_retries', 'health_check_start_period', 'limits_memory', 'limits_memory_swap', 'limits_memory_swappiness', 'limits_memory_reservation', 'limits_cpus', 'limits_cpuset', 'limits_cpu_shares', 'custom_labels', 'custom_docker_run_options', 'post_deployment_command', 'post_deployment_command_container', 'pre_deployment_command', 'pre_deployment_command_container', 'watch_paths', 'manual_webhook_secret_github', 'manual_webhook_secret_gitlab', 'manual_webhook_secret_bitbucket', 'manual_webhook_secret_gitea', 'dockerfile_location', 'dockerfile_target_build', 'docker_compose_location', 'docker_compose_custom_start_command', 'docker_compose_custom_build_command', 'docker_compose_domains', 'redirect', 'instant_deploy', 'use_build_server', 'use_build_secrets', 'custom_nginx_configuration', 'is_http_basic_auth_enabled', 'http_basic_auth_username', 'http_basic_auth_password', 'connect_to_docker_network', 'force_domain_override', 'is_container_label_escape_enabled', 'is_preserve_repository_enabled', 'preview_url_template', 'max_restart_count', ...self::APPLICATION_SETTING_FIELDS];$validationRules = ['name' => 'string|max:255',@@ -5149,4 +5222,548 @@ class ApplicationsController extends Controller{return $this->deleteTag($request);}++ #[OA\Post(+ summary: 'Clone',+ description: 'Clone an application to a destination owned by the authenticated team.',+ path: '/applications/{uuid}/clone',+ operationId: 'clone-application-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['destination_uuid'],+ properties: [+ new OA\Property(property: 'destination_uuid', type: 'string', description: 'UUID of the destination to clone into.'),+ new OA\Property(property: 'name', type: 'string', nullable: true, description: 'Optional name for the cloned application.'),+ new OA\Property(property: 'clone_volumes', type: 'boolean', default: false, description: 'Whether to clone volume data.'),+ ]+ )+ ),+ responses: [+ new OA\Response(+ response: 201,+ description: 'Application cloned.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'uuid', type: 'string'),+ new OA\Property(property: 'message', type: 'string', example: 'Application cloned.'),+ ]+ )+ ),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function clone_by_uuid(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = customApiValidator($request->all(), [+ 'destination_uuid' => 'required|string',+ 'name' => 'string|max:255|nullable',+ 'clone_volumes' => 'boolean',+ ]);+ $allowedFields = ['destination_uuid', 'name', 'clone_volumes'];+ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ $this->authorize('update', $application);++ $destination = StandaloneDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first()+ ?? SwarmDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first();++ if (! $destination || ! $destination->server?->canHostResources()) {+ return response()->json(['message' => 'Destination not found.'], 404);+ }++ $overrides = ['uuid' => new_public_id()];+ if ($request->filled('name')) {+ $overrides['name'] = $request->string('name')->toString();+ }++ $newApplication = clone_application(+ $application,+ $destination,+ $overrides,+ $request->boolean('clone_volumes', false),+ );++ auditLog('api.application.cloned', [+ 'team_id' => $teamId,+ 'source_uuid' => $application->uuid,+ 'application_uuid' => $newApplication->uuid,+ 'application_name' => $newApplication->name,+ 'destination_uuid' => $destination->uuid,+ 'clone_volumes' => $request->boolean('clone_volumes', false),+ ]);++ return response()->json([+ 'uuid' => $newApplication->uuid,+ 'message' => 'Application cloned.',+ ], 201);+ }++ #[OA\Get(+ summary: 'List Rollback Images',+ description: 'List available Docker images for rolling back an application. Returns an empty list when the server is unavailable or remote inspection is not possible.',+ path: '/applications/{uuid}/rollback-images',+ operationId: 'list-application-rollback-images',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Rollback images.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'current', type: 'string', nullable: true),+ new OA\Property(+ property: 'images',+ type: 'array',+ items: new OA\Items(+ type: 'object',+ properties: [+ new OA\Property(property: 'tag', type: 'string'),+ new OA\Property(property: 'created_at', type: 'string'),+ new OA\Property(property: 'is_current', type: 'boolean'),+ ]+ )+ ),+ ]+ )+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function rollback_images(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ $this->authorize('view', $application);++ $current = null;+ $images = [];++ try {+ $server = $application->destination?->server;+ if ($server && $server->isFunctional()) {+ $image = $application->docker_registry_image_name ?? $application->uuid;+ $output = instant_remote_process([+ "docker inspect --format='{{.Config.Image}}' {$application->uuid}",+ ], $server, throwError: false);+ $current = self::currentRollbackImageTag(str($output)->trim()->toString());++ $output = instant_remote_process([+ "docker images --format '{{.Repository}}#{{.Tag}}#{{.CreatedAt}}'",+ ], $server);+ $images = str($output)->trim()->explode("\n")->filter(function ($item) use ($image) {+ $repository = str($item)->before('#')->toString();++ // Exact repository match only — avoid substring collisions across images.+ return $repository === $image;+ })->map(function ($item) use ($current) {+ $parts = str($item)->explode('#');++ return [+ 'tag' => $parts[1] ?? null,+ 'created_at' => $parts[2] ?? null,+ 'is_current' => ($parts[1] ?? null) === $current,+ ];+ })->values()->all();+ }+ } catch (\Throwable) {+ $current = null;+ $images = [];+ }++ return response()->json([+ 'current' => $current,+ 'images' => $images,+ ]);+ }++ private static function currentRollbackImageTag(string $imageReference): ?string+ {+ if (str_contains($imageReference, '@')) {+ return null;+ }++ $lastColon = strrpos($imageReference, ':');+ $lastSlash = strrpos($imageReference, '/');++ if ($lastColon === false || ($lastSlash !== false && $lastColon < $lastSlash)) {+ return null;+ }++ return substr($imageReference, $lastColon + 1) ?: null;+ }++ #[OA\Post(+ summary: 'Rollback',+ description: 'Queue a rollback deployment for an application to a previous image commit/tag.',+ path: '/applications/{uuid}/rollback',+ operationId: 'rollback-application-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['commit'],+ properties: [+ new OA\Property(property: 'commit', type: 'string', description: 'Image tag / commit to roll back to.'),+ ]+ )+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Rollback deployment queued.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'message', type: 'string'),+ new OA\Property(property: 'deployment_uuid', type: 'string'),+ ]+ )+ ),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function rollback_by_uuid(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = customApiValidator($request->all(), [+ 'commit' => 'required|string',+ ]);+ $allowedFields = ['commit'];+ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ $this->authorize('deploy', $application);++ try {+ $commit = validateGitRef($request->string('commit')->toString(), 'rollback commit');+ } catch (\Throwable $e) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => ['commit' => [$e->getMessage()]],+ ], 422);+ }++ $deployment_uuid = new_public_id();+ $result = queue_application_deployment(+ application: $application,+ deployment_uuid: $deployment_uuid,+ commit: $commit,+ rollback: true,+ force_rebuild: false,+ is_api: true,+ );++ if ($result['status'] === 'queue_full') {+ return response()->json(['message' => $result['message'] ?? 'Deployment queue full.'], 400);+ }++ if ($result['status'] === 'skipped') {+ return response()->json(['message' => $result['message']], 200);+ }++ auditLog('api.application.rollback', [+ 'team_id' => $teamId,+ 'application_uuid' => $application->uuid,+ 'application_name' => $application->name,+ 'deployment_uuid' => $deployment_uuid,+ 'commit' => $commit,+ ]);++ return response()->json([+ 'message' => 'Rollback deployment queued.',+ 'deployment_uuid' => $deployment_uuid,+ ]);+ }++ #[OA\Get(+ summary: 'List Destinations',+ description: 'List primary and additional destinations for a standalone application.',+ path: '/applications/{uuid}/destinations',+ operationId: 'list-application-destinations',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Application destinations.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function destinations(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ $this->authorize('view', $application);++ $destinations = collect();+ $primary = $application->destination;+ if ($primary) {+ $destinations->push([+ 'uuid' => $primary->uuid,+ 'name' => $primary->name,+ 'network' => $primary->network ?? null,+ 'server_uuid' => $primary->server?->uuid,+ 'server_id' => $primary->server_id,+ 'is_primary' => true,+ ]);+ }++ foreach ($application->additional_networks as $network) {+ $destinations->push([+ 'uuid' => $network->uuid,+ 'name' => $network->name,+ 'network' => $network->network ?? null,+ 'server_uuid' => $network->server?->uuid,+ 'server_id' => $network->pivot->server_id ?? $network->server_id,+ 'is_primary' => false,+ ]);+ }++ return response()->json($destinations->values());+ }++ #[OA\Post(+ summary: 'Add Destination',+ description: 'Attach an additional standalone Docker destination to an application.',+ path: '/applications/{uuid}/destinations',+ operationId: 'add-application-destination',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['destination_uuid'],+ properties: [+ new OA\Property(property: 'destination_uuid', type: 'string'),+ ]+ )+ ),+ responses: [+ new OA\Response(response: 201, description: 'Destination attached.'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function add_destination(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = customApiValidator($request->all(), [+ 'destination_uuid' => 'required|string',+ ]);+ $extraFields = array_diff(array_keys($request->all()), ['destination_uuid']);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ $this->authorize('update', $application);++ $destination = StandaloneDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first();+ if (! $destination || ! $destination->server?->canHostResources()) {+ return response()->json(['message' => 'Destination not found.'], 404);+ }++ if ($application->destination_id === $destination->id && $application->destination_type === $destination->getMorphClass()) {+ return response()->json(['message' => 'Destination is already the primary destination.'], 422);+ }++ if ($application->additional_networks()->where('standalone_dockers.id', $destination->id)->exists()) {+ return response()->json(['message' => 'Destination is already attached.'], 422);+ }++ if ($application->destination?->server_id === $destination->server_id) {+ return response()->json(['message' => 'Cannot attach a destination on the same server as the primary destination.'], 422);+ }++ if ($application->additional_servers?->pluck('id')->contains($destination->server_id)) {+ return response()->json(['message' => 'A destination on this server is already attached.'], 422);+ }++ $application->additional_networks()->attach($destination->id, ['server_id' => $destination->server_id]);++ auditLog('api.application.destination_added', [+ 'team_id' => $teamId,+ 'application_uuid' => $application->uuid,+ 'destination_uuid' => $destination->uuid,+ ]);++ return response()->json([+ 'message' => 'Destination attached.',+ 'uuid' => $destination->uuid,+ ], 201);+ }++ #[OA\Delete(+ summary: 'Remove Destination',+ description: 'Detach an additional destination from an application.',+ path: '/applications/{uuid}/destinations/{destination_uuid}',+ operationId: 'remove-application-destination',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'destination_uuid', in: 'path', required: true, description: 'UUID of the destination.', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Destination detached.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function remove_destination(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $application = Application::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ $this->authorize('update', $application);++ $destinationUuid = $request->route('destination_uuid');+ $destination = StandaloneDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $destinationUuid)->first();+ if (! $destination) {+ return response()->json(['message' => 'Destination not found.'], 404);+ }++ if ($application->destination_id === $destination->id && $application->destination_type === $destination->getMorphClass()) {+ return response()->json(['message' => 'Cannot remove the primary destination.'], 422);+ }++ $attached = $application->additional_networks()->where('standalone_dockers.id', $destination->id)->first();+ if (! $attached) {+ return response()->json(['message' => 'Destination not found.'], 404);+ }++ $application->additional_networks()+ ->wherePivot('server_id', $attached->pivot->server_id)+ ->detach($destination->id);++ auditLog('api.application.destination_removed', [+ 'team_id' => $teamId,+ 'application_uuid' => $application->uuid,+ 'destination_uuid' => $destination->uuid,+ ]);++ return response()->json(['message' => 'Destination detached.']);+ }}diff --git a/app/Http/Controllers/Api/CloudInitScriptsController.php b/app/Http/Controllers/Api/CloudInitScriptsController.phpnew file mode 100644index 0000000000..4b53636e2f--- /dev/null+++ b/app/Http/Controllers/Api/CloudInitScriptsController.php@@ -0,0 +1,281 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Models\CloudInitScript;+use App\Rules\ValidCloudInitYaml;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class CloudInitScriptsController extends Controller+{+ private function removeSensitiveData(CloudInitScript $script): array+ {+ $script->makeHidden(['id', 'team_id']);++ if (request()->attributes->get('can_read_sensitive', false) === true) {+ $script->makeVisible(['script']);+ }++ return serializeApiResponse($script)->all();+ }++ #[OA\Get(+ summary: 'List Cloud-init Scripts',+ description: 'List all cloud-init scripts for the authenticated team.',+ path: '/cloud-init-scripts',+ operationId: 'list-cloud-init-scripts',+ security: [['bearerAuth' => []]],+ tags: ['Cloud-init Scripts'],+ responses: [+ new OA\Response(response: 200, description: 'Cloud-init scripts for the team.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ ]+ )]+ public function index(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $this->authorize('viewAny', CloudInitScript::class);++ $scripts = CloudInitScript::where('team_id', $teamId)+ ->orderByDesc('created_at')+ ->get()+ ->map(fn (CloudInitScript $script) => $this->removeSensitiveData($script));++ return response()->json($scripts);+ }++ #[OA\Post(+ summary: 'Create Cloud-init Script',+ description: 'Create a new cloud-init script for the authenticated team.',+ path: '/cloud-init-scripts',+ operationId: 'create-cloud-init-script',+ security: [['bearerAuth' => []]],+ tags: ['Cloud-init Scripts'],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['name', 'script'],+ properties: [+ new OA\Property(property: 'name', type: 'string'),+ new OA\Property(property: 'script', type: 'string', description: 'Bash script (#!) or cloud-config YAML.'),+ ]+ )+ ),+ responses: [+ new OA\Response(response: 201, description: 'Cloud-init script created.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function store(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $this->authorize('create', CloudInitScript::class);++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = customApiValidator($request->all(), [+ 'name' => 'required|string|max:255',+ 'script' => ['required', 'string', new ValidCloudInitYaml],+ ]);+ $extraFields = array_diff(array_keys($request->all()), ['name', 'script']);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $script = CloudInitScript::create([+ 'team_id' => $teamId,+ 'name' => $request->string('name')->toString(),+ 'script' => $request->string('script')->toString(),+ ]);++ auditLog('api.cloud_init_script.created', [+ 'team_id' => $teamId,+ 'cloud_init_script_uuid' => $script->uuid,+ 'cloud_init_script_name' => $script->name,+ ]);++ return response()->json($this->removeSensitiveData($script), 201);+ }++ #[OA\Get(+ summary: 'Get Cloud-init Script',+ description: 'Get a cloud-init script by UUID.',+ path: '/cloud-init-scripts/{uuid}',+ operationId: 'get-cloud-init-script-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Cloud-init Scripts'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Cloud-init script.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function show(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $script = CloudInitScript::where('team_id', $teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $script) {+ return response()->json(['message' => 'Cloud-init script not found.'], 404);+ }++ $this->authorize('view', $script);++ return response()->json($this->removeSensitiveData($script));+ }++ #[OA\Patch(+ summary: 'Update Cloud-init Script',+ description: 'Update a cloud-init script by UUID.',+ path: '/cloud-init-scripts/{uuid}',+ operationId: 'update-cloud-init-script-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Cloud-init Scripts'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'name', type: 'string'),+ new OA\Property(property: 'script', type: 'string'),+ ]+ )+ ),+ responses: [+ new OA\Response(response: 200, description: 'Cloud-init script updated.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ if ($request->all() === []) {+ return response()->json(['message' => 'At least one field must be provided.'], 422);+ }++ $script = CloudInitScript::where('team_id', $teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $script) {+ return response()->json(['message' => 'Cloud-init script not found.'], 404);+ }++ $this->authorize('update', $script);++ $validator = customApiValidator($request->all(), [+ 'name' => 'string|max:255',+ 'script' => ['string', new ValidCloudInitYaml],+ ]);+ $extraFields = array_diff(array_keys($request->all()), ['name', 'script']);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $script->update($request->only(['name', 'script']));++ auditLog('api.cloud_init_script.updated', [+ 'team_id' => $teamId,+ 'cloud_init_script_uuid' => $script->uuid,+ 'cloud_init_script_name' => $script->name,+ 'changed_fields' => array_values(array_intersect(['name', 'script'], array_keys($request->all()))),+ ]);++ return response()->json($this->removeSensitiveData($script->fresh()));+ }++ #[OA\Delete(+ summary: 'Delete Cloud-init Script',+ description: 'Delete a cloud-init script by UUID.',+ path: '/cloud-init-scripts/{uuid}',+ operationId: 'delete-cloud-init-script-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Cloud-init Scripts'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Cloud-init script deleted.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function destroy(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $script = CloudInitScript::where('team_id', $teamId)->where('uuid', $request->route('uuid'))->first();+ if (! $script) {+ return response()->json(['message' => 'Cloud-init script not found.'], 404);+ }++ $this->authorize('delete', $script);++ $uuid = $script->uuid;+ $name = $script->name;+ $script->delete();++ auditLog('api.cloud_init_script.deleted', [+ 'team_id' => $teamId,+ 'cloud_init_script_uuid' => $uuid,+ 'cloud_init_script_name' => $name,+ ]);++ return response()->json(['message' => 'Cloud-init script deleted.']);+ }+}diff --git a/app/Http/Controllers/Api/DatabasesController.php b/app/Http/Controllers/Api/DatabasesController.phpindex 41af38a724..d9953fa9c9 100644--- a/app/Http/Controllers/Api/DatabasesController.php+++ b/app/Http/Controllers/Api/DatabasesController.php@@ -11,6 +11,7 @@ use App\Enums\NewDatabaseTypes;use App\Http\Controllers\Controller;use App\Jobs\DatabaseBackupJob;use App\Jobs\DeleteResourceJob;+use App\Jobs\VolumeCloneJob;use App\Models\EnvironmentVariable;use App\Models\LocalFileVolume;use App\Models\LocalPersistentVolume;@@ -18,11 +19,14 @@ use App\Models\Project;use App\Models\S3Storage;use App\Models\ScheduledDatabaseBackup;use App\Models\Server;+use App\Models\StandaloneDocker;use App\Models\StandalonePostgresql;+use App\Models\SwarmDocker;use App\Support\ValidationPatterns;use Illuminate\Database\Eloquent\Model;use Illuminate\Http\JsonResponse;use Illuminate\Http\Request;+use Illuminate\Support\Facades\Bus;use Illuminate\Support\Facades\DB;use OpenApi\Attributes as OA;@@ -4648,4 +4652,220 @@ class DatabasesController extends Controller{return $this->deleteTag($request);}++ #[OA\Post(+ summary: 'Clone',+ description: 'Clone a database to a destination owned by the authenticated team.',+ path: '/databases/{uuid}/clone',+ operationId: 'clone-database-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Databases'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the database.', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['destination_uuid'],+ properties: [+ new OA\Property(property: 'destination_uuid', type: 'string'),+ new OA\Property(property: 'name', type: 'string', nullable: true),+ new OA\Property(property: 'clone_volumes', type: 'boolean', default: false),+ ]+ )+ ),+ responses: [+ new OA\Response(response: 201, description: 'Database cloned.'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function clone_by_uuid(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = customApiValidator($request->all(), [+ 'destination_uuid' => 'required|string',+ 'name' => 'string|max:255|nullable',+ 'clone_volumes' => 'boolean',+ ]);+ $allowedFields = ['destination_uuid', 'name', 'clone_volumes'];+ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $database = queryDatabaseByUuidWithinTeam($request->route('uuid'), $teamId);+ if (! $database) {+ return response()->json(['message' => 'Database not found.'], 404);+ }++ $this->authorize('update', $database);++ $destination = StandaloneDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first()+ ?? SwarmDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first();++ if (! $destination || ! $destination->server?->canHostResources()) {+ return response()->json(['message' => 'Destination not found.'], 404);+ }++ $uuid = new_public_id();+ $name = $request->filled('name')+ ? $request->string('name')->toString()+ : $database->name.'-clone-'.$uuid;+ $cloneVolumeData = $request->boolean('clone_volumes', false);++ $newDatabase = $database->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'uuid' => $uuid,+ 'name' => $name,+ 'status' => 'exited',+ 'started_at' => null,+ 'destination_id' => $destination->id,+ 'destination_type' => $destination->getMorphClass(),+ ]);+ $newDatabase->save();++ foreach ($database->tags as $tag) {+ $newDatabase->tags()->attach($tag->id);+ }++ $newDatabase->persistentStorages()->delete();+ $pendingVolumeClones = [];+ $sourceServer = $database->destination?->server;+ $targetServer = $newDatabase->destination?->server;++ foreach ($database->persistentStorages()->get() as $volume) {+ $originalName = $volume->name;+ $newName = match (true) {+ str_starts_with($originalName, 'postgres-data-') => 'postgres-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'mysql-data-') => 'mysql-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'redis-data-') => 'redis-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'clickhouse-data-') => 'clickhouse-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'mariadb-data-') => 'mariadb-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'mongodb-data-') => 'mongodb-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'keydb-data-') => 'keydb-data-'.$newDatabase->uuid,+ str_starts_with($originalName, 'dragonfly-data-') => 'dragonfly-data-'.$newDatabase->uuid,+ str_starts_with($volume->name, $database->uuid) => str($volume->name)->replace($database->uuid, $newDatabase->uuid)->toString(),+ default => $newDatabase->uuid.'-'.$volume->name,+ };++ $newPersistentVolume = $volume->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ 'uuid',+ ])->fill([+ 'name' => $newName,+ 'resource_id' => $newDatabase->id,+ ]);+ $newPersistentVolume->save();++ if ($cloneVolumeData) {+ $pendingVolumeClones[] = [+ 'source' => $volume->name,+ 'target' => $newPersistentVolume->name,+ 'model' => $newPersistentVolume,+ ];+ }+ }++ // Stop once, clone all volumes, then start once — avoids per-volume stop/start races.+ if ($pendingVolumeClones !== [] && $sourceServer && $targetServer) {+ try {+ $chain = [+ function () use ($database) {+ StopDatabase::run($database);+ },+ ];++ foreach ($pendingVolumeClones as $clone) {+ $chain[] = new VolumeCloneJob(+ $clone['source'],+ $clone['target'],+ $sourceServer,+ $targetServer,+ $clone['model'],+ );+ }++ $chain[] = function () use ($database) {+ StartDatabase::run($database);+ };++ Bus::chain($chain)->onQueue('high')->dispatch();+ } catch (\Exception $e) {+ \Log::error('Failed to queue database volume clone for '.$database->uuid.': '.$e->getMessage());+ }+ }++ foreach ($database->fileStorages()->get() as $storage) {+ $storage->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'resource_id' => $newDatabase->id,+ ])->save();+ }++ foreach ($database->scheduledBackups()->get() as $backup) {+ $backup->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'uuid' => new_public_id(),+ 'database_id' => $newDatabase->id,+ 'database_type' => $newDatabase->getMorphClass(),+ 'team_id' => $teamId,+ ])->save();+ }++ foreach ($database->environment_variables()->get() as $environmentVariable) {+ $environmentVariable->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'resourceable_id' => $newDatabase->id,+ 'resourceable_type' => $newDatabase->getMorphClass(),+ ])->save();+ }++ auditLog('api.database.cloned', [+ 'team_id' => $teamId,+ 'source_uuid' => $database->uuid,+ 'database_uuid' => $newDatabase->uuid,+ 'database_name' => $newDatabase->name,+ 'destination_uuid' => $destination->uuid,+ 'clone_volumes' => $cloneVolumeData,+ ]);++ return response()->json([+ 'uuid' => $newDatabase->uuid,+ 'message' => 'Database cloned.',+ ], 201);+ }}diff --git a/app/Http/Controllers/Api/DestinationsController.php b/app/Http/Controllers/Api/DestinationsController.phpindex a745ea5d2f..53b4ef8b15 100644--- a/app/Http/Controllers/Api/DestinationsController.php+++ b/app/Http/Controllers/Api/DestinationsController.php@@ -274,6 +274,84 @@ class DestinationsController extends Controller|| in_array($driverCode, ['19', '1062', '2067'], true);}+ #[OA\Patch(+ summary: 'Update destination',+ description: 'Update a Docker network destination name. Network cannot be changed via the API.',+ path: '/destinations/{uuid}',+ operationId: 'update-destination-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Destinations'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Destination UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'name', type: 'string', maxLength: 255),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Destination updated.',+ content: new OA\JsonContent(ref: '#/components/schemas/Destination'),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function update(Request $request, string $uuid): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $allowed = ['name'];++ $validator = customApiValidator($request->all(), [+ 'name' => 'required|string|max:255',+ ]);+ $extra = array_diff(array_keys($request->all()), $allowed);+ if ($validator->fails() || ! empty($extra)) {+ $errors = $validator->errors();+ if (! empty($extra)) {+ foreach ($extra as $field) {+ $errors->add($field, 'This field is not allowed.');+ }+ }++ return response()->json(['message' => 'Validation failed.', 'errors' => $errors], 422);+ }++ $destination = $this->findDestinationForTeam($teamId, $uuid);++ $this->authorize('update', $destination);++ $destination->update(['name' => $request->input('name')]);+ $destination->load('server:id,uuid');++ auditLog('api.destination.updated', [+ 'team_id' => $teamId,+ 'destination_uuid' => $destination->uuid,+ 'destination_name' => $destination->name,+ 'destination_type' => $destination instanceof SwarmDocker ? 'swarm' : 'standalone',+ 'server_uuid' => $destination->server?->uuid,+ 'changed_fields' => ['name'],+ ]);++ return response()->json($this->transform($destination));+ }+#[OA\Delete(summary: 'Delete destination',description: 'Delete an unused Docker network destination.',diff --git a/app/Http/Controllers/Api/NotificationsController.php b/app/Http/Controllers/Api/NotificationsController.phpnew file mode 100644index 0000000000..99d0cb8971--- /dev/null+++ b/app/Http/Controllers/Api/NotificationsController.php@@ -0,0 +1,511 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Models\DiscordNotificationSettings;+use App\Models\EmailNotificationSettings;+use App\Models\PushoverNotificationSettings;+use App\Models\SlackNotificationSettings;+use App\Models\Team;+use App\Models\TelegramNotificationSettings;+use App\Models\WebhookNotificationSettings;+use App\Rules\SafeWebhookUrl;+use Illuminate\Database\Eloquent\Model;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class NotificationsController extends Controller+{+ /**+ * @return array{model: class-string<Model>, rules: array<string, mixed>}+ */+ private function channelConfig(string $channel): array+ {+ return match ($channel) {+ 'email' => [+ 'model' => EmailNotificationSettings::class,+ 'rules' => [+ 'smtp_enabled' => 'sometimes|boolean',+ 'smtp_from_address' => 'sometimes|nullable|email',+ 'smtp_from_name' => 'sometimes|nullable|string|max:255',+ 'smtp_recipients' => 'sometimes|nullable|string|max:1000',+ 'smtp_host' => 'sometimes|nullable|string|max:255',+ 'smtp_port' => 'sometimes|nullable|integer|min:1|max:65535',+ 'smtp_encryption' => 'sometimes|nullable|string|in:starttls,tls,none',+ 'smtp_username' => 'sometimes|nullable|string|max:255',+ 'smtp_password' => 'sometimes|nullable|string|max:255',+ 'smtp_timeout' => 'sometimes|nullable|integer|min:0',+ 'resend_enabled' => 'sometimes|boolean',+ 'resend_api_key' => 'sometimes|nullable|string|max:255',+ 'use_instance_email_settings' => 'sometimes|boolean',+ 'deployment_success_email_notifications' => 'sometimes|boolean',+ 'deployment_failure_email_notifications' => 'sometimes|boolean',+ 'status_change_email_notifications' => 'sometimes|boolean',+ 'backup_success_email_notifications' => 'sometimes|boolean',+ 'backup_failure_email_notifications' => 'sometimes|boolean',+ 'scheduled_task_success_email_notifications' => 'sometimes|boolean',+ 'scheduled_task_failure_email_notifications' => 'sometimes|boolean',+ 'docker_cleanup_success_email_notifications' => 'sometimes|boolean',+ 'docker_cleanup_failure_email_notifications' => 'sometimes|boolean',+ 'server_disk_usage_email_notifications' => 'sometimes|boolean',+ 'server_reachable_email_notifications' => 'sometimes|boolean',+ 'server_unreachable_email_notifications' => 'sometimes|boolean',+ 'server_patch_email_notifications' => 'sometimes|boolean',+ 'traefik_outdated_email_notifications' => 'sometimes|boolean',+ ],+ ],+ 'discord' => [+ 'model' => DiscordNotificationSettings::class,+ 'rules' => [+ 'discord_enabled' => 'sometimes|boolean',+ 'discord_webhook_url' => ['sometimes', 'nullable', 'string', new SafeWebhookUrl],+ 'deployment_success_discord_notifications' => 'sometimes|boolean',+ 'deployment_failure_discord_notifications' => 'sometimes|boolean',+ 'status_change_discord_notifications' => 'sometimes|boolean',+ 'backup_success_discord_notifications' => 'sometimes|boolean',+ 'backup_failure_discord_notifications' => 'sometimes|boolean',+ 'scheduled_task_success_discord_notifications' => 'sometimes|boolean',+ 'scheduled_task_failure_discord_notifications' => 'sometimes|boolean',+ 'docker_cleanup_success_discord_notifications' => 'sometimes|boolean',+ 'docker_cleanup_failure_discord_notifications' => 'sometimes|boolean',+ 'server_disk_usage_discord_notifications' => 'sometimes|boolean',+ 'server_reachable_discord_notifications' => 'sometimes|boolean',+ 'server_unreachable_discord_notifications' => 'sometimes|boolean',+ 'server_patch_discord_notifications' => 'sometimes|boolean',+ 'traefik_outdated_discord_notifications' => 'sometimes|boolean',+ 'discord_ping_enabled' => 'sometimes|boolean',+ ],+ ],+ 'slack' => [+ 'model' => SlackNotificationSettings::class,+ 'rules' => [+ 'slack_enabled' => 'sometimes|boolean',+ 'slack_webhook_url' => ['sometimes', 'nullable', 'string', new SafeWebhookUrl],+ 'deployment_success_slack_notifications' => 'sometimes|boolean',+ 'deployment_failure_slack_notifications' => 'sometimes|boolean',+ 'status_change_slack_notifications' => 'sometimes|boolean',+ 'backup_success_slack_notifications' => 'sometimes|boolean',+ 'backup_failure_slack_notifications' => 'sometimes|boolean',+ 'scheduled_task_success_slack_notifications' => 'sometimes|boolean',+ 'scheduled_task_failure_slack_notifications' => 'sometimes|boolean',+ 'docker_cleanup_success_slack_notifications' => 'sometimes|boolean',+ 'docker_cleanup_failure_slack_notifications' => 'sometimes|boolean',+ 'server_disk_usage_slack_notifications' => 'sometimes|boolean',+ 'server_reachable_slack_notifications' => 'sometimes|boolean',+ 'server_unreachable_slack_notifications' => 'sometimes|boolean',+ 'server_patch_slack_notifications' => 'sometimes|boolean',+ 'traefik_outdated_slack_notifications' => 'sometimes|boolean',+ ],+ ],+ 'telegram' => [+ 'model' => TelegramNotificationSettings::class,+ 'rules' => [+ 'telegram_enabled' => 'sometimes|boolean',+ 'telegram_token' => 'sometimes|nullable|string|max:255',+ 'telegram_chat_id' => 'sometimes|nullable|string|max:255',+ 'deployment_success_telegram_notifications' => 'sometimes|boolean',+ 'deployment_failure_telegram_notifications' => 'sometimes|boolean',+ 'status_change_telegram_notifications' => 'sometimes|boolean',+ 'backup_success_telegram_notifications' => 'sometimes|boolean',+ 'backup_failure_telegram_notifications' => 'sometimes|boolean',+ 'scheduled_task_success_telegram_notifications' => 'sometimes|boolean',+ 'scheduled_task_failure_telegram_notifications' => 'sometimes|boolean',+ 'docker_cleanup_success_telegram_notifications' => 'sometimes|boolean',+ 'docker_cleanup_failure_telegram_notifications' => 'sometimes|boolean',+ 'server_disk_usage_telegram_notifications' => 'sometimes|boolean',+ 'server_reachable_telegram_notifications' => 'sometimes|boolean',+ 'server_unreachable_telegram_notifications' => 'sometimes|boolean',+ 'server_patch_telegram_notifications' => 'sometimes|boolean',+ 'traefik_outdated_telegram_notifications' => 'sometimes|boolean',+ 'telegram_notifications_deployment_success_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_deployment_failure_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_status_change_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_backup_success_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_backup_failure_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_scheduled_task_success_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_scheduled_task_failure_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_docker_cleanup_success_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_docker_cleanup_failure_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_server_disk_usage_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_server_reachable_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_server_unreachable_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_server_patch_thread_id' => 'sometimes|nullable|string|max:255',+ 'telegram_notifications_traefik_outdated_thread_id' => 'sometimes|nullable|string|max:255',+ ],+ ],+ 'pushover' => [+ 'model' => PushoverNotificationSettings::class,+ 'rules' => [+ 'pushover_enabled' => 'sometimes|boolean',+ 'pushover_user_key' => 'sometimes|nullable|string|max:255',+ 'pushover_api_token' => 'sometimes|nullable|string|max:255',+ 'deployment_success_pushover_notifications' => 'sometimes|boolean',+ 'deployment_failure_pushover_notifications' => 'sometimes|boolean',+ 'status_change_pushover_notifications' => 'sometimes|boolean',+ 'backup_success_pushover_notifications' => 'sometimes|boolean',+ 'backup_failure_pushover_notifications' => 'sometimes|boolean',+ 'scheduled_task_success_pushover_notifications' => 'sometimes|boolean',+ 'scheduled_task_failure_pushover_notifications' => 'sometimes|boolean',+ 'docker_cleanup_success_pushover_notifications' => 'sometimes|boolean',+ 'docker_cleanup_failure_pushover_notifications' => 'sometimes|boolean',+ 'server_disk_usage_pushover_notifications' => 'sometimes|boolean',+ 'server_reachable_pushover_notifications' => 'sometimes|boolean',+ 'server_unreachable_pushover_notifications' => 'sometimes|boolean',+ 'server_patch_pushover_notifications' => 'sometimes|boolean',+ 'traefik_outdated_pushover_notifications' => 'sometimes|boolean',+ ],+ ],+ 'webhook' => [+ 'model' => WebhookNotificationSettings::class,+ 'rules' => [+ 'webhook_enabled' => 'sometimes|boolean',+ 'webhook_url' => ['sometimes', 'nullable', 'string', new SafeWebhookUrl],+ 'deployment_success_webhook_notifications' => 'sometimes|boolean',+ 'deployment_failure_webhook_notifications' => 'sometimes|boolean',+ 'status_change_webhook_notifications' => 'sometimes|boolean',+ 'backup_success_webhook_notifications' => 'sometimes|boolean',+ 'backup_failure_webhook_notifications' => 'sometimes|boolean',+ 'scheduled_task_success_webhook_notifications' => 'sometimes|boolean',+ 'scheduled_task_failure_webhook_notifications' => 'sometimes|boolean',+ 'docker_cleanup_success_webhook_notifications' => 'sometimes|boolean',+ 'docker_cleanup_failure_webhook_notifications' => 'sometimes|boolean',+ 'server_disk_usage_webhook_notifications' => 'sometimes|boolean',+ 'server_reachable_webhook_notifications' => 'sometimes|boolean',+ 'server_unreachable_webhook_notifications' => 'sometimes|boolean',+ 'server_patch_webhook_notifications' => 'sometimes|boolean',+ 'traefik_outdated_webhook_notifications' => 'sometimes|boolean',+ ],+ ],+ default => throw new \InvalidArgumentException("Unknown notification channel [{$channel}]."),+ };+ }++ /**+ * @return list<string>+ */+ private function allowedFields(string $channel): array+ {+ $config = $this->channelConfig($channel);+ /** @var Model $model */+ $model = new $config['model'];++ return array_values(array_filter(+ $model->getFillable(),+ fn (string $field): bool => $field !== 'team_id'+ ));+ }++ private function serializeSettings(Model $settings): array+ {+ exposeSensitiveFields($settings);++ $settings->makeHidden(['team']);++ return serializeApiResponse($settings)->toArray();+ }++ private function resolveSettings(string $channel, int $teamId): Model+ {+ $config = $this->channelConfig($channel);+ $modelClass = $config['model'];++ /** @var Model $settings */+ $settings = $modelClass::query()->firstOrCreate(['team_id' => $teamId]);+ $settings->setRelation('team', Team::query()->findOrFail($teamId));++ return $settings;+ }++ private function showChannel(string $channel): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $settings = $this->resolveSettings($channel, $teamId);+ $this->authorize('view', $settings);++ return response()->json($this->serializeSettings($settings));+ }++ private function updateChannel(Request $request, string $channel): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $allowedFields = $this->allowedFields($channel);+ $body = $request->json()->all();+ $config = $this->channelConfig($channel);++ $validator = customApiValidator($body, $config['rules']);++ $extraFields = array_diff(array_keys($body), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ if (! empty($extraFields)) {+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $settings = $this->resolveSettings($channel, $teamId);+ $this->authorize('update', $settings);++ $settings->fill(array_intersect_key($body, array_flip($allowedFields)));+ $settings->save();++ auditLog("api.notifications.{$channel}.updated", [+ 'team_id' => $teamId,+ 'changed_fields' => array_values(array_intersect($allowedFields, array_keys($body))),+ ]);++ $settings->refresh();+ $settings->setRelation('team', Team::query()->findOrFail($teamId));++ return response()->json($this->serializeSettings($settings));+ }++ #[OA\Get(+ summary: 'Get email notification settings',+ description: 'Get the current team email notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.',+ path: '/notifications/email',+ operationId: 'get-current-team-email-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Email notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ ]+ )]+ public function email(Request $request): JsonResponse+ {+ return $this->showChannel('email');+ }++ #[OA\Patch(+ summary: 'Update email notification settings',+ description: 'Update the current team email notification settings.',+ path: '/notifications/email',+ operationId: 'update-current-team-email-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Updated email notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update_email(Request $request): JsonResponse+ {+ return $this->updateChannel($request, 'email');+ }++ #[OA\Get(+ summary: 'Get Discord notification settings',+ description: 'Get the current team Discord notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.',+ path: '/notifications/discord',+ operationId: 'get-current-team-discord-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Discord notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ ]+ )]+ public function discord(Request $request): JsonResponse+ {+ return $this->showChannel('discord');+ }++ #[OA\Patch(+ summary: 'Update Discord notification settings',+ description: 'Update the current team Discord notification settings.',+ path: '/notifications/discord',+ operationId: 'update-current-team-discord-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Updated Discord notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update_discord(Request $request): JsonResponse+ {+ return $this->updateChannel($request, 'discord');+ }++ #[OA\Get(+ summary: 'Get Slack notification settings',+ description: 'Get the current team Slack notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.',+ path: '/notifications/slack',+ operationId: 'get-current-team-slack-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Slack notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ ]+ )]+ public function slack(Request $request): JsonResponse+ {+ return $this->showChannel('slack');+ }++ #[OA\Patch(+ summary: 'Update Slack notification settings',+ description: 'Update the current team Slack notification settings.',+ path: '/notifications/slack',+ operationId: 'update-current-team-slack-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Updated Slack notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update_slack(Request $request): JsonResponse+ {+ return $this->updateChannel($request, 'slack');+ }++ #[OA\Get(+ summary: 'Get Telegram notification settings',+ description: 'Get the current team Telegram notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.',+ path: '/notifications/telegram',+ operationId: 'get-current-team-telegram-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Telegram notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ ]+ )]+ public function telegram(Request $request): JsonResponse+ {+ return $this->showChannel('telegram');+ }++ #[OA\Patch(+ summary: 'Update Telegram notification settings',+ description: 'Update the current team Telegram notification settings.',+ path: '/notifications/telegram',+ operationId: 'update-current-team-telegram-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Updated Telegram notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update_telegram(Request $request): JsonResponse+ {+ return $this->updateChannel($request, 'telegram');+ }++ #[OA\Get(+ summary: 'Get Pushover notification settings',+ description: 'Get the current team Pushover notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.',+ path: '/notifications/pushover',+ operationId: 'get-current-team-pushover-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Pushover notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ ]+ )]+ public function pushover(Request $request): JsonResponse+ {+ return $this->showChannel('pushover');+ }++ #[OA\Patch(+ summary: 'Update Pushover notification settings',+ description: 'Update the current team Pushover notification settings.',+ path: '/notifications/pushover',+ operationId: 'update-current-team-pushover-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Updated Pushover notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update_pushover(Request $request): JsonResponse+ {+ return $this->updateChannel($request, 'pushover');+ }++ #[OA\Get(+ summary: 'Get webhook notification settings',+ description: 'Get the current team webhook notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.',+ path: '/notifications/webhook',+ operationId: 'get-current-team-webhook-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Webhook notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ ]+ )]+ public function webhook(Request $request): JsonResponse+ {+ return $this->showChannel('webhook');+ }++ #[OA\Patch(+ summary: 'Update webhook notification settings',+ description: 'Update the current team webhook notification settings.',+ path: '/notifications/webhook',+ operationId: 'update-current-team-webhook-notifications',+ security: [['bearerAuth' => []]],+ tags: ['Notifications'],+ responses: [+ new OA\Response(response: 200, description: 'Updated webhook notification settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 403, description: 'Forbidden.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update_webhook(Request $request): JsonResponse+ {+ return $this->updateChannel($request, 'webhook');+ }+}diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.phpindex ea3b54e808..64bf26c1bb 100644--- a/app/Http/Controllers/Api/ProjectController.php+++ b/app/Http/Controllers/Api/ProjectController.php@@ -682,6 +682,155 @@ class ProjectController extends Controller])->setStatusCode(201);}+ #[OA\Patch(+ summary: 'Update Environment',+ description: 'Update environment by name or UUID within a project.',+ path: '/projects/{uuid}/environments/{environment_name_or_uuid}',+ operationId: 'update-environment',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['Projects'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ description: 'Environment fields to update.',+ content: new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'name' => ['type' => 'string', 'description' => 'The name of the environment.'],+ 'description' => ['type' => 'string', 'description' => 'The description of the environment.'],+ ],+ ),+ ),+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Environment updated.',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'uuid' => ['type' => 'string', 'example' => 'env123'],+ 'name' => ['type' => 'string', 'example' => 'staging'],+ 'description' => ['type' => 'string', 'example' => 'Staging environment'],+ ]+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 400,+ ref: '#/components/responses/400',+ ),+ new OA\Response(+ response: 404,+ description: 'Project or environment not found.',+ ),+ new OA\Response(+ response: 409,+ description: 'Environment with this name already exists.',+ ),+ new OA\Response(+ response: 422,+ ref: '#/components/responses/422',+ ),+ ]+ )]+ public function update_environment(Request $request)+ {+ $allowedFields = ['name', 'description'];++ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = Validator::make($request->all(), [+ 'name' => ValidationPatterns::nameRules(required: false),+ 'description' => ValidationPatterns::descriptionRules(),+ ], ValidationPatterns::combinedMessages());++ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ if (! empty($extraFields)) {+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ if (! $request->uuid) {+ return response()->json(['message' => 'Project UUID is required.'], 422);+ }+ if (! $request->environment_name_or_uuid) {+ return response()->json(['message' => 'Environment name or UUID is required.'], 422);+ }++ $project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();+ if (! $project) {+ return response()->json(['message' => 'Project not found.'], 404);+ }++ $environment = $project->environments()->whereName($request->environment_name_or_uuid)->first();+ if (! $environment) {+ $environment = $project->environments()->whereUuid($request->environment_name_or_uuid)->first();+ }+ if (! $environment) {+ return response()->json(['message' => 'Environment not found.'], 404);+ }++ $this->authorize('update', $environment);++ if ($request->filled('name') && $request->name !== $environment->name) {+ $existingEnvironment = $project->environments()+ ->where('name', $request->name)+ ->where('id', '!=', $environment->id)+ ->first();+ if ($existingEnvironment) {+ return response()->json(['message' => 'Environment with this name already exists.'], 409);+ }+ }++ $environment->update($request->only($allowedFields));++ auditLog('api.project.environment_updated', [+ 'team_id' => $teamId,+ 'project_uuid' => $project->uuid,+ 'environment_uuid' => $environment->uuid,+ 'environment_name' => $environment->name,+ 'changed_fields' => array_values(array_intersect($allowedFields, array_keys($request->all()))),+ ]);++ return response()->json([+ 'uuid' => $environment->uuid,+ 'name' => $environment->name,+ 'description' => $environment->description,+ ]);+ }+#[OA\Delete(summary: 'Delete Environment',description: 'Delete environment by name or UUID. Environment must be empty.',diff --git a/app/Http/Controllers/Api/S3StoragesController.php b/app/Http/Controllers/Api/S3StoragesController.phpnew file mode 100644index 0000000000..c2ad48c51d--- /dev/null+++ b/app/Http/Controllers/Api/S3StoragesController.php@@ -0,0 +1,566 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Models\S3Storage;+use App\Rules\SafeWebhookUrl;+use App\Rules\ValidS3BucketName;+use App\Support\ValidationPatterns;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class S3StoragesController extends Controller+{+ private function removeSensitiveData(S3Storage $storage)+ {+ $storage->makeHidden([+ 'id',+ ]);++ if (request()->attributes->get('can_read_sensitive', false) === true) {+ $storage->makeVisible([+ 'key',+ 'secret',+ ]);+ }++ return serializeApiResponse($storage);+ }++ /**+ * @return array{valid: bool, error: string|null}+ */+ private function validateStorageConnection(S3Storage $storage): array+ {+ try {+ $storage->testConnection(shouldSave: true);++ return ['valid' => true, 'error' => null];+ } catch (\Throwable $e) {+ return ['valid' => false, 'error' => $e->getMessage()];+ }+ }++ /**+ * @param array<string, mixed> $body+ * @param array<int, string> $allowedFields+ * @param array<string, mixed> $rules+ */+ private function validateBody(array $body, array $allowedFields, array $rules): ?JsonResponse+ {+ $validator = customApiValidator($body, $rules);++ $extraFields = array_diff(array_keys($body), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ if (! empty($extraFields)) {+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ return null;+ }++ #[OA\Get(+ summary: 'List S3 Storages',+ description: 'List all S3 storages for the authenticated team.',+ path: '/s3-storages',+ operationId: 'list-s3-storages',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['S3 Storages'],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Get all S3 storages.',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'array',+ items: new OA\Items(+ type: 'object',+ properties: [+ 'uuid' => ['type' => 'string'],+ 'name' => ['type' => 'string'],+ 'description' => ['type' => 'string', 'nullable' => true],+ 'endpoint' => ['type' => 'string'],+ 'bucket' => ['type' => 'string'],+ 'region' => ['type' => 'string'],+ 'is_usable' => ['type' => 'boolean'],+ 'team_id' => ['type' => 'integer'],+ 'created_at' => ['type' => 'string'],+ 'updated_at' => ['type' => 'string'],+ ]+ )+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 400,+ ref: '#/components/responses/400',+ ),+ ]+ )]+ public function index(Request $request)+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $storages = S3Storage::ownedByCurrentTeamAPI($teamId)+ ->get()+ ->map(function ($storage) {+ return $this->removeSensitiveData($storage);+ });++ return response()->json($storages);+ }++ #[OA\Get(+ summary: 'Get S3 Storage',+ description: 'Get S3 storage by UUID.',+ path: '/s3-storages/{uuid}',+ operationId: 'get-s3-storage-by-uuid',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['S3 Storages'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'S3 Storage UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Get S3 storage by UUID',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'uuid' => ['type' => 'string'],+ 'name' => ['type' => 'string'],+ 'description' => ['type' => 'string', 'nullable' => true],+ 'endpoint' => ['type' => 'string'],+ 'bucket' => ['type' => 'string'],+ 'region' => ['type' => 'string'],+ 'is_usable' => ['type' => 'boolean'],+ 'team_id' => ['type' => 'integer'],+ 'created_at' => ['type' => 'string'],+ 'updated_at' => ['type' => 'string'],+ ]+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 404,+ ref: '#/components/responses/404',+ ),+ ]+ )]+ public function show(Request $request)+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $storage = S3Storage::ownedByCurrentTeamAPI($teamId)+ ->whereUuid($request->uuid)+ ->first();++ if (is_null($storage)) {+ return response()->json(['message' => 'S3 storage not found.'], 404);+ }+ $this->authorize('view', $storage);++ return response()->json($this->removeSensitiveData($storage));+ }++ #[OA\Post(+ summary: 'Create S3 Storage',+ description: 'Create a new S3 storage configuration for the authenticated team.',+ path: '/s3-storages',+ operationId: 'create-s3-storage',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['S3 Storages'],+ requestBody: new OA\RequestBody(+ required: true,+ description: 'S3 storage details',+ content: new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ required: ['name', 'endpoint', 'bucket', 'region', 'key', 'secret'],+ properties: [+ 'name' => ['type' => 'string', 'example' => 'My S3 Storage', 'description' => 'A friendly name for the storage.'],+ 'description' => ['type' => 'string', 'nullable' => true, 'description' => 'Optional description.'],+ 'endpoint' => ['type' => 'string', 'example' => 'https://s3.us-east-1.amazonaws.com', 'description' => 'S3-compatible endpoint URL.'],+ 'bucket' => ['type' => 'string', 'example' => 'my-bucket', 'description' => 'S3 bucket name.'],+ 'region' => ['type' => 'string', 'example' => 'us-east-1', 'description' => 'S3 region.'],+ 'key' => ['type' => 'string', 'description' => 'Access key.'],+ 'secret' => ['type' => 'string', 'description' => 'Secret key.'],+ 'is_usable' => ['type' => 'boolean', 'description' => 'Whether the storage is marked usable.'],+ ],+ ),+ ),+ ),+ responses: [+ new OA\Response(+ response: 201,+ description: 'S3 storage created.',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'uuid' => ['type' => 'string', 'example' => 'og888os', 'description' => 'The UUID of the S3 storage.'],+ ]+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 400,+ ref: '#/components/responses/400',+ ),+ new OA\Response(+ response: 422,+ ref: '#/components/responses/422',+ ),+ ]+ )]+ public function store(Request $request)+ {+ $allowedFields = ['name', 'description', 'endpoint', 'bucket', 'region', 'key', 'secret', 'is_usable'];++ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }+ $this->authorize('create', [S3Storage::class]);++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $body = $request->json()->all();++ $validationError = $this->validateBody($body, $allowedFields, [+ 'name' => ValidationPatterns::nameRules(),+ 'description' => ValidationPatterns::descriptionRules(),+ 'endpoint' => ['required', 'string', 'max:255', new SafeWebhookUrl],+ 'bucket' => ['required', new ValidS3BucketName],+ 'region' => 'required|string|max:255',+ 'key' => 'required|string|max:255',+ 'secret' => 'required|string|max:255',+ 'is_usable' => 'sometimes|boolean',+ ]);+ if ($validationError instanceof JsonResponse) {+ return $validationError;+ }++ $storage = S3Storage::create([+ 'team_id' => $teamId,+ 'name' => $body['name'],+ 'description' => $body['description'] ?? null,+ 'endpoint' => $body['endpoint'],+ 'bucket' => $body['bucket'],+ 'region' => $body['region'],+ 'key' => $body['key'],+ 'secret' => $body['secret'],+ 'is_usable' => $body['is_usable'] ?? false,+ ]);++ auditLog('api.s3_storage.created', [+ 'team_id' => $teamId,+ 's3_storage_uuid' => $storage->uuid,+ 's3_storage_name' => $storage->name,+ ]);++ return response()->json([+ 'uuid' => $storage->uuid,+ ])->setStatusCode(201);+ }++ #[OA\Patch(+ summary: 'Update S3 Storage',+ description: 'Update S3 storage by UUID.',+ path: '/s3-storages/{uuid}',+ operationId: 'update-s3-storage-by-uuid',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['S3 Storages'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'S3 Storage UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ description: 'S3 storage fields to update.',+ content: new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'name' => ['type' => 'string', 'description' => 'A friendly name for the storage.'],+ 'description' => ['type' => 'string', 'nullable' => true, 'description' => 'Optional description.'],+ 'endpoint' => ['type' => 'string', 'description' => 'S3-compatible endpoint URL.'],+ 'bucket' => ['type' => 'string', 'description' => 'S3 bucket name.'],+ 'region' => ['type' => 'string', 'description' => 'S3 region.'],+ 'key' => ['type' => 'string', 'description' => 'Access key.'],+ 'secret' => ['type' => 'string', 'description' => 'Secret key.'],+ 'is_usable' => ['type' => 'boolean', 'description' => 'Whether the storage is marked usable.'],+ ],+ ),+ ),+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'S3 storage updated.',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'uuid' => ['type' => 'string'],+ ]+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 404,+ ref: '#/components/responses/404',+ ),+ new OA\Response(+ response: 422,+ ref: '#/components/responses/422',+ ),+ ]+ )]+ public function update(Request $request)+ {+ $allowedFields = ['name', 'description', 'endpoint', 'bucket', 'region', 'key', 'secret', 'is_usable'];++ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $body = $request->json()->all();++ $validationError = $this->validateBody($body, $allowedFields, [+ 'name' => ValidationPatterns::nameRules(required: false),+ 'description' => ValidationPatterns::descriptionRules(),+ 'endpoint' => ['sometimes', 'string', 'max:255', new SafeWebhookUrl],+ 'bucket' => ['sometimes', new ValidS3BucketName],+ 'region' => 'sometimes|string|max:255',+ 'key' => 'sometimes|string|max:255',+ 'secret' => 'sometimes|string|max:255',+ 'is_usable' => 'sometimes|boolean',+ ]);+ if ($validationError instanceof JsonResponse) {+ return $validationError;+ }++ $storage = S3Storage::ownedByCurrentTeamAPI($teamId)->whereUuid($request->route('uuid'))->first();+ if (! $storage) {+ return response()->json(['message' => 'S3 storage not found.'], 404);+ }+ $this->authorize('update', $storage);++ $storage->update(array_intersect_key($body, array_flip($allowedFields)));++ auditLog('api.s3_storage.updated', [+ 'team_id' => $teamId,+ 's3_storage_uuid' => $storage->uuid,+ 's3_storage_name' => $storage->name,+ 'changed_fields' => array_values(array_intersect($allowedFields, array_keys($body))),+ ]);++ return response()->json([+ 'uuid' => $storage->uuid,+ ]);+ }++ #[OA\Delete(+ summary: 'Delete S3 Storage',+ description: 'Delete S3 storage by UUID.',+ path: '/s3-storages/{uuid}',+ operationId: 'delete-s3-storage-by-uuid',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['S3 Storages'],+ parameters: [+ new OA\Parameter(+ name: 'uuid',+ in: 'path',+ description: 'UUID of the S3 storage.',+ required: true,+ schema: new OA\Schema(+ type: 'string',+ )+ ),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'S3 storage deleted.',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'message' => ['type' => 'string', 'example' => 'S3 storage deleted.'],+ ]+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 404,+ ref: '#/components/responses/404',+ ),+ ]+ )]+ public function destroy(Request $request)+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ if (! $request->uuid) {+ return response()->json(['message' => 'UUID is required.'], 422);+ }++ $storage = S3Storage::ownedByCurrentTeamAPI($teamId)->whereUuid($request->uuid)->first();++ if (! $storage) {+ return response()->json(['message' => 'S3 storage not found.'], 404);+ }+ $this->authorize('delete', $storage);++ $storageUuid = $storage->uuid;+ $storageName = $storage->name;+ $storage->delete();++ auditLog('api.s3_storage.deleted', [+ 'team_id' => $teamId,+ 's3_storage_uuid' => $storageUuid,+ 's3_storage_name' => $storageName,+ ]);++ return response()->json(['message' => 'S3 storage deleted.']);+ }++ #[OA\Post(+ summary: 'Validate S3 Storage',+ description: 'Validate an S3 storage connection using ListObjectsV2.',+ path: '/s3-storages/{uuid}/validate',+ operationId: 'validate-s3-storage-by-uuid',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['S3 Storages'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'S3 Storage UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'S3 storage validation result.',+ content: [+ new OA\MediaType(+ mediaType: 'application/json',+ schema: new OA\Schema(+ type: 'object',+ properties: [+ 'valid' => ['type' => 'boolean', 'example' => true],+ 'message' => ['type' => 'string', 'example' => 'S3 storage connection is valid.'],+ ]+ )+ ),+ ]),+ new OA\Response(+ response: 401,+ ref: '#/components/responses/401',+ ),+ new OA\Response(+ response: 404,+ ref: '#/components/responses/404',+ ),+ ]+ )]+ public function validateStorage(Request $request)+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $storage = S3Storage::ownedByCurrentTeamAPI($teamId)->whereUuid($request->uuid)->first();++ if (! $storage) {+ return response()->json(['message' => 'S3 storage not found.'], 404);+ }+ $this->authorize('validateConnection', $storage);++ $validation = $this->validateStorageConnection($storage);++ auditLog('api.s3_storage.validated', [+ 'team_id' => $teamId,+ 's3_storage_uuid' => $storage->uuid,+ 's3_storage_name' => $storage->name,+ 'valid' => $validation['valid'],+ ]);++ return response()->json([+ 'valid' => $validation['valid'],+ 'message' => $validation['valid'] ? 'S3 storage connection is valid.' : $validation['error'],+ ]);+ }+}diff --git a/app/Http/Controllers/Api/ScheduledTasksController.php b/app/Http/Controllers/Api/ScheduledTasksController.phpindex d7b1099186..c0eff20521 100644--- a/app/Http/Controllers/Api/ScheduledTasksController.php+++ b/app/Http/Controllers/Api/ScheduledTasksController.php@@ -3,6 +3,7 @@namespace App\Http\Controllers\Api;use App\Http\Controllers\Controller;+use App\Jobs\ScheduledTaskJob;use App\Models\Application;use App\Models\ScheduledTask;use App\Models\Service;@@ -224,6 +225,28 @@ class ScheduledTasksController extends Controllerreturn response()->json($executions);}+ private function executeTask(Request $request, Application|Service $resource): JsonResponse+ {+ $this->authorize('update', $resource);++ $task = $resource->scheduled_tasks()->where('uuid', $request->task_uuid)->first();+ if (! $task) {+ return response()->json(['message' => 'Scheduled task not found.'], 404);+ }++ ScheduledTaskJob::dispatch($task);++ auditLog('api.scheduled_task.executed', [+ 'team_id' => getTeamIdFromToken(),+ 'task_uuid' => $task->uuid,+ 'task_name' => $task->name,+ 'resource_type' => $resource instanceof Application ? 'application' : 'service',+ 'resource_uuid' => $resource->uuid,+ ]);++ return response()->json(['message' => 'Scheduled task execution queued.']);+ }+#[OA\Get(summary: 'List Tasks',description: 'List all scheduled tasks for an application.',@@ -949,4 +972,68 @@ class ScheduledTasksController extends Controllerreturn $this->getExecutions($request, $service);}++ #[OA\Post(+ summary: 'Execute Task',+ description: 'Queue immediate execution of a scheduled task for an application.',+ path: '/applications/{uuid}/scheduled-tasks/{task_uuid}/execute',+ operationId: 'execute-scheduled-task-by-application-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Scheduled Tasks'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the application.', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'task_uuid', in: 'path', required: true, description: 'UUID of the scheduled task.', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Scheduled task execution queued.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function execute_scheduled_task_by_application_uuid(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $application = $this->resolveApplication($request, $teamId);+ if (! $application) {+ return response()->json(['message' => 'Application not found.'], 404);+ }++ return $this->executeTask($request, $application);+ }++ #[OA\Post(+ summary: 'Execute Task',+ description: 'Queue immediate execution of a scheduled task for a service.',+ path: '/services/{uuid}/scheduled-tasks/{task_uuid}/execute',+ operationId: 'execute-scheduled-task-by-service-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Scheduled Tasks'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the service.', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'task_uuid', in: 'path', required: true, description: 'UUID of the scheduled task.', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Scheduled task execution queued.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function execute_scheduled_task_by_service_uuid(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $service = $this->resolveService($request, $teamId);+ if (! $service) {+ return response()->json(['message' => 'Service not found.'], 404);+ }++ return $this->executeTask($request, $service);+ }}diff --git a/app/Http/Controllers/Api/ServerCloudflareTunnelController.php b/app/Http/Controllers/Api/ServerCloudflareTunnelController.phpnew file mode 100644index 0000000000..76be721714--- /dev/null+++ b/app/Http/Controllers/Api/ServerCloudflareTunnelController.php@@ -0,0 +1,269 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Models\Server;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class ServerCloudflareTunnelController extends Controller+{+ private const ALLOWED_FIELDS = [+ 'is_cloudflare_tunnel',+ ];++ private function findServerForTeam(int $teamId, string $uuid): ?Server+ {+ return Server::whereTeamId($teamId)->whereUuid($uuid)->first();+ }++ private function transform(Server $server): array+ {+ return [+ 'is_cloudflare_tunnel' => (bool) $server->settings->is_cloudflare_tunnel,+ 'ip' => $server->ip,+ 'ip_previous' => $server->ip_previous,+ ];+ }++ #[OA\Get(+ summary: 'Get Cloudflare Tunnel settings',+ description: 'Get Cloudflare Tunnel settings for a server owned by the authenticated team.',+ path: '/servers/{uuid}/cloudflare-tunnel',+ operationId: 'get-server-cloudflare-tunnel',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Cloudflare Tunnel settings.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'is_cloudflare_tunnel', type: 'boolean'),+ new OA\Property(property: 'ip', type: 'string'),+ new OA\Property(property: 'ip_previous', type: 'string', nullable: true),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function show(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('view', $server);++ return response()->json($this->transform($server));+ }++ #[OA\Patch(+ summary: 'Update Cloudflare Tunnel settings',+ description: 'Update stored Cloudflare Tunnel settings for a server. Does not run remote cloudflared configuration; use enable/disable for the manual UI actions.',+ path: '/servers/{uuid}/cloudflare-tunnel',+ operationId: 'update-server-cloudflare-tunnel',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'is_cloudflare_tunnel', type: 'boolean'),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(response: 200, description: 'Updated Cloudflare Tunnel settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function update(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ if ($server->isLocalhost()) {+ return response()->json(['message' => 'Cloudflare Tunnel cannot be configured on the localhost server.'], 422);+ }++ $validator = customApiValidator($request->all(), [+ 'is_cloudflare_tunnel' => 'required|boolean',+ ]);+ $extraFields = array_diff(array_keys($request->all()), self::ALLOWED_FIELDS);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $enabled = $request->boolean('is_cloudflare_tunnel');+ $server->settings->is_cloudflare_tunnel = $enabled;+ $server->settings->save();++ if (! $enabled && $server->ip_previous) {+ $server->update(['ip' => $server->ip_previous]);+ }++ auditLog('api.server.cloudflare_tunnel.updated', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ 'is_cloudflare_tunnel' => $enabled,+ ]);++ return response()->json($this->transform($server->refresh()));+ }++ #[OA\Post(+ summary: 'Enable Cloudflare Tunnel (manual)',+ description: 'Manually mark Cloudflare Tunnel as enabled for a server (matches UI manual enable). Does not deploy cloudflared remotely.',+ path: '/servers/{uuid}/cloudflare-tunnel/enable',+ operationId: 'enable-server-cloudflare-tunnel',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Cloudflare Tunnel enabled.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function enable(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ if ($server->isLocalhost()) {+ return response()->json(['message' => 'Cloudflare Tunnel cannot be configured on the localhost server.'], 422);+ }++ $server->settings->is_cloudflare_tunnel = true;+ $server->settings->save();++ auditLog('api.server.cloudflare_tunnel.enabled', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ ]);++ return response()->json([+ 'message' => 'Cloudflare Tunnel enabled.',+ ...$this->transform($server->refresh()),+ ]);+ }++ #[OA\Post(+ summary: 'Disable Cloudflare Tunnel',+ description: 'Mark Cloudflare Tunnel as disabled and restore ip_previous when available. Does not remove the remote cloudflared container.',+ path: '/servers/{uuid}/cloudflare-tunnel/disable',+ operationId: 'disable-server-cloudflare-tunnel',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Cloudflare Tunnel disabled.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function disable(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ if ($server->isLocalhost()) {+ return response()->json(['message' => 'Cloudflare Tunnel cannot be configured on the localhost server.'], 422);+ }++ $server->settings->is_cloudflare_tunnel = false;+ $server->settings->save();++ $message = 'Cloudflare Tunnel disabled.';+ if ($server->ip_previous) {+ $server->update(['ip' => $server->ip_previous]);+ $message .= ' Server IP restored to its previous IP address.';+ } else {+ $message .= ' Action required: Update the server IP address to its real IP address if needed.';+ }++ auditLog('api.server.cloudflare_tunnel.disabled', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ ]);++ return response()->json([+ 'message' => $message,+ ...$this->transform($server->refresh()),+ ]);+ }+}diff --git a/app/Http/Controllers/Api/ServerDockerCleanupController.php b/app/Http/Controllers/Api/ServerDockerCleanupController.phpnew file mode 100644index 0000000000..2c0a15da2f--- /dev/null+++ b/app/Http/Controllers/Api/ServerDockerCleanupController.php@@ -0,0 +1,356 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Jobs\DockerCleanupJob;+use App\Models\Server;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class ServerDockerCleanupController extends Controller+{+ private const ALLOWED_FIELDS = [+ 'docker_cleanup_frequency',+ 'docker_cleanup_threshold',+ 'force_docker_cleanup',+ 'delete_unused_volumes',+ 'delete_unused_networks',+ 'disable_application_image_retention',+ ];++ private function findServerForTeam(int $teamId, string $uuid): ?Server+ {+ return Server::whereTeamId($teamId)->whereUuid($uuid)->first();+ }++ private function transform(Server $server): array+ {+ $settings = $server->settings;++ return [+ 'docker_cleanup_frequency' => $settings->docker_cleanup_frequency,+ 'docker_cleanup_threshold' => (int) $settings->docker_cleanup_threshold,+ 'force_docker_cleanup' => (bool) $settings->force_docker_cleanup,+ 'delete_unused_volumes' => (bool) $settings->delete_unused_volumes,+ 'delete_unused_networks' => (bool) $settings->delete_unused_networks,+ 'disable_application_image_retention' => (bool) $settings->disable_application_image_retention,+ ];+ }++ #[OA\Get(+ summary: 'Get Docker cleanup settings',+ description: 'Get Docker cleanup settings for a server owned by the authenticated team.',+ path: '/servers/{uuid}/docker-cleanup',+ operationId: 'get-server-docker-cleanup',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Docker cleanup settings.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'docker_cleanup_frequency', type: 'string'),+ new OA\Property(property: 'docker_cleanup_threshold', type: 'integer'),+ new OA\Property(property: 'force_docker_cleanup', type: 'boolean'),+ new OA\Property(property: 'delete_unused_volumes', type: 'boolean'),+ new OA\Property(property: 'delete_unused_networks', type: 'boolean'),+ new OA\Property(property: 'disable_application_image_retention', type: 'boolean'),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function show(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('view', $server);++ return response()->json($this->transform($server));+ }++ #[OA\Patch(+ summary: 'Update Docker cleanup settings',+ description: 'Update Docker cleanup settings for a server owned by the authenticated team.',+ path: '/servers/{uuid}/docker-cleanup',+ operationId: 'update-server-docker-cleanup',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'docker_cleanup_frequency', type: 'string', description: 'Cron / human frequency expression.'),+ new OA\Property(property: 'docker_cleanup_threshold', type: 'integer', minimum: 1, maximum: 99),+ new OA\Property(property: 'force_docker_cleanup', type: 'boolean'),+ new OA\Property(property: 'delete_unused_volumes', type: 'boolean'),+ new OA\Property(property: 'delete_unused_networks', type: 'boolean'),+ new OA\Property(property: 'disable_application_image_retention', type: 'boolean'),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Updated Docker cleanup settings.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'docker_cleanup_frequency', type: 'string'),+ new OA\Property(property: 'docker_cleanup_threshold', type: 'integer'),+ new OA\Property(property: 'force_docker_cleanup', type: 'boolean'),+ new OA\Property(property: 'delete_unused_volumes', type: 'boolean'),+ new OA\Property(property: 'delete_unused_networks', type: 'boolean'),+ new OA\Property(property: 'disable_application_image_retention', type: 'boolean'),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function update(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ $validator = customApiValidator($request->all(), [+ 'docker_cleanup_frequency' => 'string',+ 'docker_cleanup_threshold' => 'integer|min:1|max:99',+ 'force_docker_cleanup' => 'boolean',+ 'delete_unused_volumes' => 'boolean',+ 'delete_unused_networks' => 'boolean',+ 'disable_application_image_retention' => 'boolean',+ ]);++ $extraFields = array_diff(array_keys($request->all()), self::ALLOWED_FIELDS);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ if ($request->has('docker_cleanup_frequency') && ! validate_cron_expression($request->docker_cleanup_frequency)) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => ['docker_cleanup_frequency' => ['Invalid Cron / Human expression for Docker Cleanup Frequency.']],+ ], 422);+ }++ $settings = $server->settings;+ foreach (self::ALLOWED_FIELDS as $field) {+ if ($request->has($field)) {+ $settings->{$field} = $request->input($field);+ }+ }+ $settings->save();++ auditLog('api.server.docker_cleanup.updated', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ 'changed_fields' => array_values(array_intersect(self::ALLOWED_FIELDS, array_keys($request->all()))),+ ]);++ return response()->json($this->transform($server->refresh()));+ }++ #[OA\Post(+ summary: 'Run Docker cleanup',+ description: 'Dispatch a manual Docker cleanup job for a server owned by the authenticated team.',+ path: '/servers/{uuid}/docker-cleanup/run',+ operationId: 'run-server-docker-cleanup',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: false,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'delete_unused_volumes', type: 'boolean'),+ new OA\Property(property: 'delete_unused_networks', type: 'boolean'),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Docker cleanup job dispatched.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'message', type: 'string', example: 'Manual cleanup job started.'),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function run(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ $validator = customApiValidator($request->all(), [+ 'delete_unused_volumes' => 'boolean',+ 'delete_unused_networks' => 'boolean',+ ]);+ $extraFields = array_diff(array_keys($request->all()), ['delete_unused_volumes', 'delete_unused_networks']);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $deleteUnusedVolumes = $request->has('delete_unused_volumes')+ ? $request->boolean('delete_unused_volumes')+ : (bool) $server->settings->delete_unused_volumes;+ $deleteUnusedNetworks = $request->has('delete_unused_networks')+ ? $request->boolean('delete_unused_networks')+ : (bool) $server->settings->delete_unused_networks;++ DockerCleanupJob::dispatch($server, true, $deleteUnusedVolumes, $deleteUnusedNetworks);++ auditLog('api.server.docker_cleanup.run', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ 'delete_unused_volumes' => $deleteUnusedVolumes,+ 'delete_unused_networks' => $deleteUnusedNetworks,+ ]);++ return response()->json([+ 'message' => 'Manual cleanup job started. Depending on the amount of data, this might take a while.',+ ]);+ }++ #[OA\Get(+ summary: 'List Docker cleanup executions',+ description: 'List recent Docker cleanup execution logs for a server owned by the authenticated team.',+ path: '/servers/{uuid}/docker-cleanup/executions',+ operationId: 'list-server-docker-cleanup-executions',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Recent Docker cleanup executions.',+ content: new OA\JsonContent(+ type: 'array',+ items: new OA\Items(+ properties: [+ new OA\Property(property: 'uuid', type: 'string'),+ new OA\Property(property: 'status', type: 'string'),+ new OA\Property(property: 'message', type: 'string', nullable: true),+ new OA\Property(property: 'finished_at', type: 'string', nullable: true),+ new OA\Property(property: 'created_at', type: 'string'),+ new OA\Property(property: 'updated_at', type: 'string'),+ ],+ type: 'object',+ ),+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function executions(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('view', $server);++ $executions = $server->dockerCleanupExecutions()+ ->orderBy('created_at', 'desc')+ ->take(20)+ ->get()+ ->map(fn ($execution) => [+ 'uuid' => $execution->uuid,+ 'status' => $execution->status,+ 'message' => $execution->message,+ 'finished_at' => $execution->finished_at,+ 'created_at' => $execution->created_at,+ 'updated_at' => $execution->updated_at,+ ])+ ->values();++ return response()->json($executions);+ }+}diff --git a/app/Http/Controllers/Api/ServerLogDrainsController.php b/app/Http/Controllers/Api/ServerLogDrainsController.phpnew file mode 100644index 0000000000..e56d6dfb2c--- /dev/null+++ b/app/Http/Controllers/Api/ServerLogDrainsController.php@@ -0,0 +1,248 @@+<?php++namespace App\Http\Controllers\Api;++use App\Actions\Server\StartLogDrain;+use App\Actions\Server\StopLogDrain;+use App\Http\Controllers\Controller;+use App\Models\Server;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class ServerLogDrainsController extends Controller+{+ private const ALLOWED_FIELDS = [+ 'is_logdrain_newrelic_enabled',+ 'logdrain_newrelic_license_key',+ 'logdrain_newrelic_base_uri',+ 'is_logdrain_axiom_enabled',+ 'logdrain_axiom_dataset_name',+ 'logdrain_axiom_api_key',+ 'is_logdrain_custom_enabled',+ 'logdrain_custom_config',+ 'logdrain_custom_config_parser',+ ];++ private function findServerForTeam(int $teamId, string $uuid): ?Server+ {+ return Server::whereTeamId($teamId)->whereUuid($uuid)->first();+ }++ private function canReadSensitive(): bool+ {+ return request()->attributes->get('can_read_sensitive', false) === true;+ }++ private function transform(Server $server): array+ {+ $settings = $server->settings;+ $payload = [+ 'is_logdrain_newrelic_enabled' => (bool) $settings->is_logdrain_newrelic_enabled,+ 'logdrain_newrelic_base_uri' => $settings->logdrain_newrelic_base_uri,+ 'is_logdrain_axiom_enabled' => (bool) $settings->is_logdrain_axiom_enabled,+ 'logdrain_axiom_dataset_name' => $settings->logdrain_axiom_dataset_name,+ 'is_logdrain_custom_enabled' => (bool) $settings->is_logdrain_custom_enabled,+ ];++ if ($this->canReadSensitive()) {+ $payload['logdrain_newrelic_license_key'] = $settings->logdrain_newrelic_license_key;+ $payload['logdrain_axiom_api_key'] = $settings->logdrain_axiom_api_key;+ $payload['logdrain_custom_config'] = $settings->logdrain_custom_config;+ $payload['logdrain_custom_config_parser'] = $settings->logdrain_custom_config_parser;+ }++ return $payload;+ }++ #[OA\Get(+ summary: 'Get log drain settings',+ description: 'Get log drain settings for a server owned by the authenticated team. Sensitive fields require the read:sensitive or root token ability.',+ path: '/servers/{uuid}/log-drains',+ operationId: 'get-server-log-drains',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Log drain settings.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'is_logdrain_newrelic_enabled', type: 'boolean'),+ new OA\Property(property: 'logdrain_newrelic_license_key', type: 'string', description: 'Only present with read:sensitive.'),+ new OA\Property(property: 'logdrain_newrelic_base_uri', type: 'string', nullable: true),+ new OA\Property(property: 'is_logdrain_axiom_enabled', type: 'boolean'),+ new OA\Property(property: 'logdrain_axiom_dataset_name', type: 'string', nullable: true),+ new OA\Property(property: 'logdrain_axiom_api_key', type: 'string', description: 'Only present with read:sensitive.'),+ new OA\Property(property: 'is_logdrain_custom_enabled', type: 'boolean'),+ new OA\Property(property: 'logdrain_custom_config', type: 'string', description: 'Only present with read:sensitive.'),+ new OA\Property(property: 'logdrain_custom_config_parser', type: 'string', description: 'Only present with read:sensitive.'),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function show(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('view', $server);++ return response()->json($this->transform($server));+ }++ #[OA\Patch(+ summary: 'Update log drain settings',+ description: 'Update New Relic, Axiom, or custom log drain settings for a server owned by the authenticated team.',+ path: '/servers/{uuid}/log-drains',+ operationId: 'update-server-log-drains',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'is_logdrain_newrelic_enabled', type: 'boolean'),+ new OA\Property(property: 'logdrain_newrelic_license_key', type: 'string'),+ new OA\Property(property: 'logdrain_newrelic_base_uri', type: 'string'),+ new OA\Property(property: 'is_logdrain_axiom_enabled', type: 'boolean'),+ new OA\Property(property: 'logdrain_axiom_dataset_name', type: 'string'),+ new OA\Property(property: 'logdrain_axiom_api_key', type: 'string'),+ new OA\Property(property: 'is_logdrain_custom_enabled', type: 'boolean'),+ new OA\Property(property: 'logdrain_custom_config', type: 'string'),+ new OA\Property(property: 'logdrain_custom_config_parser', type: 'string'),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(response: 200, description: 'Updated log drain settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function update(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ $validator = customApiValidator($request->all(), [+ 'is_logdrain_newrelic_enabled' => 'boolean',+ 'logdrain_newrelic_license_key' => ['nullable', 'string', 'regex:/^[a-zA-Z0-9_\-\.]+$/'],+ 'logdrain_newrelic_base_uri' => 'nullable|url',+ 'is_logdrain_axiom_enabled' => 'boolean',+ 'logdrain_axiom_dataset_name' => ['nullable', 'string', 'regex:/^[a-zA-Z0-9_\-\.]+$/'],+ 'logdrain_axiom_api_key' => ['nullable', 'string', 'regex:/^[a-zA-Z0-9_\-\.]+$/'],+ 'is_logdrain_custom_enabled' => 'boolean',+ 'logdrain_custom_config' => 'nullable|string',+ 'logdrain_custom_config_parser' => 'nullable|string',+ ]);++ $extraFields = array_diff(array_keys($request->all()), self::ALLOWED_FIELDS);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $settings = $server->settings;+ foreach (self::ALLOWED_FIELDS as $field) {+ if ($request->has($field)) {+ $settings->{$field} = $request->input($field);+ }+ }++ // Conditional required fields when enabling a drain type (matches Livewire).+ if ($settings->is_logdrain_newrelic_enabled) {+ $errors = [];+ if (blank($settings->logdrain_newrelic_license_key)) {+ $errors['logdrain_newrelic_license_key'] = ['The New Relic license key is required when New Relic log drain is enabled.'];+ }+ if (blank($settings->logdrain_newrelic_base_uri)) {+ $errors['logdrain_newrelic_base_uri'] = ['The New Relic base URI is required when New Relic log drain is enabled.'];+ }+ if ($errors !== []) {+ return response()->json(['message' => 'Validation failed.', 'errors' => $errors], 422);+ }+ }+ if ($settings->is_logdrain_axiom_enabled) {+ $errors = [];+ if (blank($settings->logdrain_axiom_dataset_name)) {+ $errors['logdrain_axiom_dataset_name'] = ['The Axiom dataset name is required when Axiom log drain is enabled.'];+ }+ if (blank($settings->logdrain_axiom_api_key)) {+ $errors['logdrain_axiom_api_key'] = ['The Axiom API key is required when Axiom log drain is enabled.'];+ }+ if ($errors !== []) {+ return response()->json(['message' => 'Validation failed.', 'errors' => $errors], 422);+ }+ }+ if ($settings->is_logdrain_custom_enabled && blank($settings->logdrain_custom_config)) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => [+ 'logdrain_custom_config' => ['The custom log drain config is required when custom log drain is enabled.'],+ ],+ ], 422);+ }++ $settings->save();+ $server->refresh();++ // Match Livewire instantSave: start or stop the drain service after settings change.+ if ($server->isLogDrainEnabled()) {+ StartLogDrain::dispatch($server);+ } else {+ StopLogDrain::dispatch($server);+ }++ auditLog('api.server.log_drains.updated', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ 'changed_fields' => array_values(array_intersect(self::ALLOWED_FIELDS, array_keys($request->all()))),+ ]);++ return response()->json($this->transform($server));+ }+}diff --git a/app/Http/Controllers/Api/ServerProxyController.php b/app/Http/Controllers/Api/ServerProxyController.phpnew file mode 100644index 0000000000..6b1e86b78d--- /dev/null+++ b/app/Http/Controllers/Api/ServerProxyController.php@@ -0,0 +1,422 @@+<?php++namespace App\Http\Controllers\Api;++use App\Actions\Proxy\SaveProxyConfiguration;+use App\Enums\ProxyTypes;+use App\Http\Controllers\Controller;+use App\Jobs\RestartProxyJob;+use App\Models\Server;+use App\Rules\SafeExternalUrl;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class ServerProxyController extends Controller+{+ private function teamIdOrAbort(): int|JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ return $teamId;+ }++ private function findServerForTeam(int $teamId, string $uuid): ?Server+ {+ return Server::whereTeamId($teamId)->whereUuid($uuid)->first();+ }++ private function canReadSensitive(): bool+ {+ return request()->attributes->get('can_read_sensitive', false) === true;+ }++ /**+ * @return array{+ * proxy_type: string|null,+ * status: string|null,+ * redirect_enabled: bool,+ * redirect_url: string|null,+ * generate_exact_labels: bool,+ * configuration?: string|null+ * }+ */+ private function payload(Server $server, bool $includeConfiguration = true): array+ {+ $payload = [+ 'proxy_type' => $server->proxyType(),+ 'status' => data_get($server->proxy, 'status'),+ 'redirect_enabled' => (bool) data_get($server->proxy, 'redirect_enabled', true),+ 'redirect_url' => data_get($server->proxy, 'redirect_url'),+ 'generate_exact_labels' => (bool) ($server->settings->generate_exact_labels ?? false),+ ];++ // Proxy compose can contain secrets; only expose with read:sensitive (and admin) like other APIs.+ if ($includeConfiguration && $this->canReadSensitive()) {+ // Prefer DB-stored config only — never SSH or regenerate for GET.+ $configuration = $server->proxy->get('last_saved_proxy_configuration');+ $payload['configuration'] = filled($configuration) ? $configuration : null;+ }++ return $payload;+ }++ #[OA\Get(+ summary: 'Get server proxy',+ description: 'Get proxy settings for a server owned by the authenticated team. The raw proxy configuration is only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner, and only when already stored in the database (no remote fetch).',+ path: '/servers/{uuid}/proxy',+ operationId: 'get-server-proxy',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Server proxy settings.',+ content: new OA\JsonContent(+ type: 'object',+ properties: [+ new OA\Property(property: 'proxy_type', type: 'string', nullable: true, example: 'TRAEFIK'),+ new OA\Property(property: 'status', type: 'string', nullable: true, example: 'running'),+ new OA\Property(property: 'redirect_enabled', type: 'boolean', example: true),+ new OA\Property(property: 'redirect_url', type: 'string', nullable: true, example: 'https://example.com'),+ new OA\Property(property: 'generate_exact_labels', type: 'boolean', example: false),+ new OA\Property(property: 'configuration', type: 'string', nullable: true, description: 'Docker Compose proxy configuration when stored in the database. Only present with read:sensitive.'),+ ]+ )+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function show(Request $request, string $uuid): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $server = $this->findServerForTeam($teamId, $uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('view', $server);++ return response()->json($this->payload($server));+ }++ #[OA\Patch(+ summary: 'Update server proxy',+ description: 'Update proxy redirect settings, exact labels generation, and optionally the proxy type for a team-owned server.',+ path: '/servers/{uuid}/proxy',+ operationId: 'update-server-proxy',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ type: 'object',+ properties: [+ new OA\Property(property: 'redirect_enabled', type: 'boolean'),+ new OA\Property(property: 'redirect_url', type: 'string', nullable: true, description: 'Public http(s) redirect URL, or null to clear.'),+ new OA\Property(property: 'generate_exact_labels', type: 'boolean'),+ new OA\Property(property: 'proxy_type', type: 'string', enum: ['traefik', 'caddy', 'nginx', 'none'], description: 'Proxy type (case-insensitive).'),+ ]+ )+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Proxy settings updated.',+ content: new OA\JsonContent(+ type: 'object',+ properties: [+ new OA\Property(property: 'proxy_type', type: 'string', nullable: true),+ new OA\Property(property: 'status', type: 'string', nullable: true),+ new OA\Property(property: 'redirect_enabled', type: 'boolean'),+ new OA\Property(property: 'redirect_url', type: 'string', nullable: true),+ new OA\Property(property: 'generate_exact_labels', type: 'boolean'),+ new OA\Property(property: 'configuration', type: 'string', nullable: true),+ ]+ )+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function update(Request $request, string $uuid): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $allowedFields = ['redirect_enabled', 'redirect_url', 'generate_exact_labels', 'proxy_type'];+ $validator = customApiValidator($request->all(), [+ 'redirect_enabled' => 'boolean',+ 'redirect_url' => ['nullable', 'string', new SafeExternalUrl],+ 'generate_exact_labels' => 'boolean',+ 'proxy_type' => 'string|nullable',+ ]);++ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $server = $this->findServerForTeam($teamId, $uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ if ($request->has('proxy_type') && filled($request->proxy_type)) {+ $validProxyTypes = collect(ProxyTypes::cases())->map(fn (ProxyTypes $type) => str($type->value)->lower());+ if (! $validProxyTypes->contains(str($request->proxy_type)->lower())) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => ['proxy_type' => ['Invalid proxy type.']],+ ], 422);+ }+ }++ $changedFields = array_values(array_intersect($allowedFields, array_keys($request->all())));+ $redirectChanged = false;++ if ($request->has('redirect_enabled')) {+ $server->proxy->redirect_enabled = $request->boolean('redirect_enabled');+ $redirectChanged = true;+ }++ if ($request->exists('redirect_url')) {+ $server->proxy->redirect_url = $request->input('redirect_url') ?: null;+ $redirectChanged = true;+ }++ if ($redirectChanged) {+ $server->save();+ }++ if ($request->has('generate_exact_labels')) {+ $server->settings->generate_exact_labels = $request->boolean('generate_exact_labels');+ $server->settings->save();+ }++ if ($request->has('proxy_type') && filled($request->proxy_type)) {+ $server->changeProxy($request->proxy_type, async: true);+ $server->refresh();+ }++ // Apply redirect file on the server only when reachable (DB settings always saved above).+ if ($redirectChanged && $server->isFunctional()) {+ $server->setupDefaultRedirect();+ }++ auditLog('api.server.proxy.updated', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ 'changed_fields' => $changedFields,+ ]);++ return response()->json($this->payload($server->fresh()));+ }++ #[OA\Put(+ summary: 'Save server proxy configuration',+ description: 'Save the raw proxy Docker Compose configuration for a team-owned server. Multi-line configuration must be base64 encoded (same pattern as other compose payloads).',+ path: '/servers/{uuid}/proxy/configuration',+ operationId: 'save-server-proxy-configuration',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['configuration'],+ type: 'object',+ properties: [+ new OA\Property(+ property: 'configuration',+ type: 'string',+ description: 'Proxy docker-compose YAML. Prefer base64 encoding for multi-line content.'+ ),+ ]+ )+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Proxy configuration saved.',+ content: new OA\JsonContent(+ type: 'object',+ properties: [+ new OA\Property(property: 'message', type: 'string', example: 'Proxy configuration saved.'),+ new OA\Property(property: 'proxy_type', type: 'string', nullable: true),+ new OA\Property(property: 'status', type: 'string', nullable: true),+ new OA\Property(property: 'redirect_enabled', type: 'boolean'),+ new OA\Property(property: 'redirect_url', type: 'string', nullable: true),+ new OA\Property(property: 'generate_exact_labels', type: 'boolean'),+ new OA\Property(property: 'configuration', type: 'string', nullable: true),+ ]+ )+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function saveConfiguration(Request $request, string $uuid): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $allowedFields = ['configuration'];+ $validator = customApiValidator($request->all(), [+ 'configuration' => 'required|string',+ ]);++ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $server = $this->findServerForTeam($teamId, $uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ $configuration = $request->input('configuration');+ if (isBase64Encoded($configuration)) {+ $decoded = base64_decode($configuration, true);+ if ($decoded === false || mb_detect_encoding($decoded, 'UTF-8', true) === false) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => [+ 'configuration' => ['The configuration should be valid base64-encoded UTF-8 text.'],+ ],+ ], 422);+ }+ $configuration = $decoded;+ }++ if (! filled(trim($configuration))) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => [+ 'configuration' => ['The configuration field is required.'],+ ],+ ], 422);+ }++ SaveProxyConfiguration::run($server, $configuration);++ auditLog('api.server.proxy.configuration_saved', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ ]);++ $payload = $this->payload($server->fresh());+ $payload['message'] = 'Proxy configuration saved.';++ return response()->json($payload);+ }++ #[OA\Post(+ summary: 'Restart server proxy',+ description: 'Queue a proxy restart for a team-owned server.',+ path: '/servers/{uuid}/proxy/restart',+ operationId: 'restart-server-proxy',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Proxy restart queued.',+ content: new OA\JsonContent(+ type: 'object',+ properties: [+ new OA\Property(property: 'message', type: 'string', example: 'Proxy restart queued.'),+ ]+ )+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function restart(Request $request, string $uuid): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $server = $this->findServerForTeam($teamId, $uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('manageProxy', $server);++ RestartProxyJob::dispatch($server);++ auditLog('api.server.proxy.restarted', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ ]);++ return response()->json(['message' => 'Proxy restart queued.']);+ }+}diff --git a/app/Http/Controllers/Api/ServerSentinelController.php b/app/Http/Controllers/Api/ServerSentinelController.phpnew file mode 100644index 0000000000..f52bdb4c39--- /dev/null+++ b/app/Http/Controllers/Api/ServerSentinelController.php@@ -0,0 +1,226 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Models\Server;+use App\Models\ServerSetting;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class ServerSentinelController extends Controller+{+ private const ALLOWED_FIELDS = [+ 'is_sentinel_enabled',+ 'is_metrics_enabled',+ 'is_sentinel_debug_enabled',+ 'sentinel_token',+ 'sentinel_metrics_refresh_rate_seconds',+ 'sentinel_metrics_history_days',+ 'sentinel_push_interval_seconds',+ 'sentinel_custom_url',+ ];++ private function findServerForTeam(int $teamId, string $uuid): ?Server+ {+ return Server::whereTeamId($teamId)->whereUuid($uuid)->first();+ }++ private function canReadSensitive(): bool+ {+ return request()->attributes->get('can_read_sensitive', false) === true;+ }++ private function transform(Server $server): array+ {+ $settings = $server->settings;+ $payload = [+ 'is_sentinel_enabled' => (bool) $settings->is_sentinel_enabled,+ 'is_metrics_enabled' => (bool) $settings->is_metrics_enabled,+ 'is_sentinel_debug_enabled' => (bool) $settings->is_sentinel_debug_enabled,+ 'sentinel_metrics_refresh_rate_seconds' => (int) $settings->sentinel_metrics_refresh_rate_seconds,+ 'sentinel_metrics_history_days' => (int) $settings->sentinel_metrics_history_days,+ 'sentinel_push_interval_seconds' => (int) $settings->sentinel_push_interval_seconds,+ 'sentinel_updated_at' => $server->sentinel_updated_at,+ ];++ if ($this->canReadSensitive()) {+ $payload['sentinel_token'] = $settings->sentinel_token;+ $payload['sentinel_custom_url'] = $settings->sentinel_custom_url;+ }++ return $payload;+ }++ #[OA\Get(+ summary: 'Get Sentinel settings',+ description: 'Get Sentinel settings for a server owned by the authenticated team. sentinel_token and sentinel_custom_url require the read:sensitive or root token ability.',+ path: '/servers/{uuid}/sentinel',+ operationId: 'get-server-sentinel',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Sentinel settings.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'is_sentinel_enabled', type: 'boolean'),+ new OA\Property(property: 'is_metrics_enabled', type: 'boolean'),+ new OA\Property(property: 'is_sentinel_debug_enabled', type: 'boolean'),+ new OA\Property(property: 'sentinel_token', type: 'string', description: 'Only present with read:sensitive.'),+ new OA\Property(property: 'sentinel_metrics_refresh_rate_seconds', type: 'integer'),+ new OA\Property(property: 'sentinel_metrics_history_days', type: 'integer'),+ new OA\Property(property: 'sentinel_push_interval_seconds', type: 'integer'),+ new OA\Property(property: 'sentinel_custom_url', type: 'string', description: 'Only present with read:sensitive.'),+ new OA\Property(property: 'sentinel_updated_at', type: 'string', nullable: true),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function show(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('view', $server);++ return response()->json($this->transform($server));+ }++ #[OA\Patch(+ summary: 'Update Sentinel settings',+ description: 'Update Sentinel settings for a server owned by the authenticated team. Changing token/metrics timing fields may restart Sentinel.',+ path: '/servers/{uuid}/sentinel',+ operationId: 'update-server-sentinel',+ security: [['bearerAuth' => []]],+ tags: ['Servers'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'is_sentinel_enabled', type: 'boolean'),+ new OA\Property(property: 'is_metrics_enabled', type: 'boolean'),+ new OA\Property(property: 'is_sentinel_debug_enabled', type: 'boolean'),+ new OA\Property(property: 'sentinel_token', type: 'string'),+ new OA\Property(property: 'sentinel_metrics_refresh_rate_seconds', type: 'integer', minimum: 1),+ new OA\Property(property: 'sentinel_metrics_history_days', type: 'integer', minimum: 1),+ new OA\Property(property: 'sentinel_push_interval_seconds', type: 'integer', minimum: 10),+ new OA\Property(property: 'sentinel_custom_url', type: 'string', nullable: true),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(response: 200, description: 'Updated Sentinel settings.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function update(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $server = $this->findServerForTeam($teamId, $request->uuid);+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ $this->authorize('update', $server);++ $validator = customApiValidator($request->all(), [+ 'is_sentinel_enabled' => 'boolean',+ 'is_metrics_enabled' => 'boolean',+ 'is_sentinel_debug_enabled' => 'boolean',+ 'sentinel_token' => ['string', 'max:500', 'regex:/\A[a-zA-Z0-9._\-+=\/]+\z/'],+ 'sentinel_metrics_refresh_rate_seconds' => 'integer|min:1',+ 'sentinel_metrics_history_days' => 'integer|min:1',+ 'sentinel_push_interval_seconds' => 'integer|min:10',+ 'sentinel_custom_url' => 'nullable|url',+ ]);++ $extraFields = array_diff(array_keys($request->all()), self::ALLOWED_FIELDS);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ if ($request->has('sentinel_token') && ! ServerSetting::isValidSentinelToken($request->input('sentinel_token'))) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => ['sentinel_token' => ['Invalid sentinel token characters.']],+ ], 422);+ }++ $settings = $server->settings;+ $enablingSentinel = $request->has('is_sentinel_enabled')+ && $request->boolean('is_sentinel_enabled')+ && ! $settings->is_sentinel_enabled;++ if ($enablingSentinel && $server->isBuildServer()) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => ['is_sentinel_enabled' => ['Sentinel cannot be enabled on build servers.']],+ ], 422);+ }++ foreach (self::ALLOWED_FIELDS as $field) {+ if ($request->has($field)) {+ $settings->{$field} = $request->input($field);+ }+ }++ // Disabling Sentinel also clears related toggles (matches Livewire toggleSentinel).+ if ($request->has('is_sentinel_enabled') && ! $request->boolean('is_sentinel_enabled')) {+ $settings->is_metrics_enabled = false;+ $settings->is_sentinel_debug_enabled = false;+ }++ $settings->save();++ auditLog('api.server.sentinel.updated', [+ 'team_id' => $teamId,+ 'server_uuid' => $server->uuid,+ 'server_name' => $server->name,+ 'changed_fields' => array_values(array_intersect(self::ALLOWED_FIELDS, array_keys($request->all()))),+ ]);++ return response()->json($this->transform($server->refresh()));+ }+}diff --git a/app/Http/Controllers/Api/ServersController.php b/app/Http/Controllers/Api/ServersController.phpindex 278c7714d1..4ba90afe2c 100644--- a/app/Http/Controllers/Api/ServersController.php+++ b/app/Http/Controllers/Api/ServersController.php@@ -663,7 +663,7 @@ class ServersController extends Controller)]public function update_server(Request $request){- $allowedFields = ['name', 'description', 'ip', 'port', 'user', 'private_key_uuid', 'is_build_server', 'instant_validate', 'proxy_type', 'concurrent_builds', 'dynamic_timeout', 'deployment_queue_limit', 'server_disk_usage_notification_threshold', 'server_disk_usage_check_frequency', 'connection_timeout'];+ $allowedFields = ['name', 'description', 'ip', 'port', 'user', 'private_key_uuid', 'is_build_server', 'instant_validate', 'proxy_type', 'concurrent_builds', 'dynamic_timeout', 'deployment_queue_limit', 'server_disk_usage_notification_threshold', 'server_disk_usage_check_frequency', 'connection_timeout', 'is_terminal_enabled'];$teamId = getTeamIdFromToken();if (is_null($teamId)) {@@ -690,6 +690,7 @@ class ServersController extends Controller'server_disk_usage_notification_threshold' => 'integer|min:1|max:100','server_disk_usage_check_frequency' => 'string','connection_timeout' => 'integer|min:1|max:300',+ 'is_terminal_enabled' => 'boolean|nullable',], [...ValidationPatterns::serverUsernameMessages(),]);@@ -751,6 +752,12 @@ class ServersController extends Controller]);}+ if ($request->has('is_terminal_enabled')) {+ $server->settings()->update([+ 'is_terminal_enabled' => $request->boolean('is_terminal_enabled'),+ ]);+ }+$advancedSettings = $request->only(['concurrent_builds', 'dynamic_timeout', 'deployment_queue_limit', 'server_disk_usage_notification_threshold', 'server_disk_usage_check_frequency', 'connection_timeout']);if (! empty($advancedSettings)) {$server->settings()->update(array_filter($advancedSettings, fn ($value) => ! is_null($value)));diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.phpindex 9945dfcf9a..11a6294f4a 100644--- a/app/Http/Controllers/Api/ServicesController.php+++ b/app/Http/Controllers/Api/ServicesController.php@@ -7,17 +7,21 @@ use App\Actions\Service\StartService;use App\Actions\Service\StopService;use App\Http\Controllers\Controller;use App\Jobs\DeleteResourceJob;+use App\Jobs\VolumeCloneJob;use App\Models\EnvironmentVariable;use App\Models\LocalFileVolume;use App\Models\LocalPersistentVolume;use App\Models\Project;use App\Models\Server;use App\Models\Service;+use App\Models\StandaloneDocker;+use App\Models\SwarmDocker;use App\Support\ValidationPatterns;use Illuminate\Database\Eloquent\Model;use Illuminate\Http\JsonResponse;use Illuminate\Http\Request;use Illuminate\Support\Collection;+use Illuminate\Support\Facades\Bus;use Illuminate\Support\Facades\Validator;use OpenApi\Attributes as OA;use Symfony\Component\Yaml\Yaml;@@ -3075,4 +3079,241 @@ class ServicesController extends Controller{return $this->deleteTag($request);}++ #[OA\Post(+ summary: 'Clone',+ description: 'Clone a service to a destination owned by the authenticated team.',+ path: '/services/{uuid}/clone',+ operationId: 'clone-service-by-uuid',+ security: [['bearerAuth' => []]],+ tags: ['Services'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'UUID of the service.', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['destination_uuid'],+ properties: [+ new OA\Property(property: 'destination_uuid', type: 'string'),+ new OA\Property(property: 'name', type: 'string', nullable: true),+ new OA\Property(property: 'clone_volumes', type: 'boolean', default: false),+ ]+ )+ ),+ responses: [+ new OA\Response(response: 201, description: 'Service cloned.'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function clone_by_uuid(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = customApiValidator($request->all(), [+ 'destination_uuid' => 'required|string',+ 'name' => 'string|max:255|nullable',+ 'clone_volumes' => 'boolean',+ ]);+ $allowedFields = ['destination_uuid', 'name', 'clone_volumes'];+ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $service = Service::whereRelation('environment.project.team', 'id', $teamId)->whereUuid($request->route('uuid'))->first();+ if (! $service) {+ return response()->json(['message' => 'Service not found.'], 404);+ }++ $this->authorize('update', $service);++ $destination = StandaloneDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first()+ ?? SwarmDocker::ownedByCurrentTeamAPI($teamId)->where('uuid', $request->destination_uuid)->first();++ if (! $destination || ! $destination->server?->canHostResources()) {+ return response()->json(['message' => 'Destination not found.'], 404);+ }++ $uuid = new_public_id();+ $name = $request->filled('name')+ ? $request->string('name')->toString()+ : $service->name.'-clone-'.$uuid;+ $cloneVolumeData = $request->boolean('clone_volumes', false);++ $newService = $service->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'uuid' => $uuid,+ 'name' => $name,+ 'destination_id' => $destination->id,+ 'destination_type' => $destination->getMorphClass(),+ 'server_id' => $destination->server_id,+ ]);+ $newService->save();++ foreach ($service->tags as $tag) {+ $newService->tags()->attach($tag->id);+ }++ foreach ($service->scheduled_tasks()->get() as $task) {+ $task->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'uuid' => new_public_id(),+ 'service_id' => $newService->id,+ 'team_id' => $teamId,+ ])->save();+ }++ foreach ($service->environment_variables()->get() as $environmentVariable) {+ $environmentVariable->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'resourceable_id' => $newService->id,+ 'resourceable_type' => $newService->getMorphClass(),+ ])->save();+ }++ // Create applications/databases (and their volumes) for the clone first.+ // Child rows are not copied by Service::replicate().+ $newService->parse();+ $newService->refresh();++ $sourceApplicationsByName = $service->applications()->get()->keyBy('name');+ $sourceDatabasesByName = $service->databases()->get()->keyBy('name');+ $pendingVolumeClones = [];+ $sourceServer = $service->destination?->server;+ $targetServer = $newService->destination?->server;++ foreach ($newService->applications()->get() as $application) {+ $application->fill(['status' => 'exited'])->save();++ $sourceApplication = $sourceApplicationsByName->get($application->name);+ if (! $sourceApplication) {+ continue;+ }++ if ($cloneVolumeData) {+ $targetVolumesByMount = $application->persistentStorages()->get()->keyBy('mount_path');+ foreach ($sourceApplication->persistentStorages()->get() as $sourceVolume) {+ $targetVolume = $targetVolumesByMount->get($sourceVolume->mount_path);+ if (! $targetVolume) {+ continue;+ }++ $pendingVolumeClones[] = [+ 'source' => $sourceVolume->name,+ 'target' => $targetVolume->name,+ 'model' => $targetVolume,+ ];+ }+ }+ }++ foreach ($newService->databases()->get() as $database) {+ $database->fill(['status' => 'exited'])->save();++ $sourceDatabase = $sourceDatabasesByName->get($database->name);+ if (! $sourceDatabase) {+ continue;+ }++ if ($cloneVolumeData) {+ $targetVolumesByMount = $database->persistentStorages()->get()->keyBy('mount_path');+ foreach ($sourceDatabase->persistentStorages()->get() as $sourceVolume) {+ $targetVolume = $targetVolumesByMount->get($sourceVolume->mount_path);+ if (! $targetVolume) {+ continue;+ }++ $pendingVolumeClones[] = [+ 'source' => $sourceVolume->name,+ 'target' => $targetVolume->name,+ 'model' => $targetVolume,+ ];+ }+ }++ foreach ($sourceDatabase->scheduledBackups()->get() as $backup) {+ $backup->replicate([+ 'id',+ 'created_at',+ 'updated_at',+ ])->fill([+ 'uuid' => new_public_id(),+ 'database_id' => $database->id,+ 'database_type' => $database->getMorphClass(),+ 'team_id' => $teamId,+ ])->save();+ }+ }++ if ($cloneVolumeData && $pendingVolumeClones !== [] && $sourceServer && $targetServer) {+ try {+ $chain = [+ function () use ($service) {+ StopService::run($service);+ },+ ];++ foreach ($pendingVolumeClones as $clone) {+ $chain[] = new VolumeCloneJob(+ $clone['source'],+ $clone['target'],+ $sourceServer,+ $targetServer,+ $clone['model'],+ );+ }++ $chain[] = function () use ($service) {+ StartService::run($service);+ };++ Bus::chain($chain)->onQueue('high')->dispatch();+ } catch (\Exception $e) {+ \Log::error('Failed to queue service volume clone for '.$service->uuid.': '.$e->getMessage());+ }+ }++ auditLog('api.service.cloned', [+ 'team_id' => $teamId,+ 'source_uuid' => $service->uuid,+ 'service_uuid' => $newService->uuid,+ 'service_name' => $newService->name,+ 'destination_uuid' => $destination->uuid,+ 'clone_volumes' => $cloneVolumeData,+ ]);++ return response()->json([+ 'uuid' => $newService->uuid,+ 'message' => 'Service cloned.',+ ], 201);+ }}diff --git a/app/Http/Controllers/Api/SharedEnvironmentVariablesController.php b/app/Http/Controllers/Api/SharedEnvironmentVariablesController.phpnew file mode 100644index 0000000000..3149c80b18--- /dev/null+++ b/app/Http/Controllers/Api/SharedEnvironmentVariablesController.php@@ -0,0 +1,907 @@+<?php++namespace App\Http\Controllers\Api;++use App\Http\Controllers\Controller;+use App\Models\Environment;+use App\Models\Project;+use App\Models\Server;+use App\Models\SharedEnvironmentVariable;+use App\Support\ValidationPatterns;+use Illuminate\Http\JsonResponse;+use Illuminate\Http\Request;+use OpenApi\Attributes as OA;++class SharedEnvironmentVariablesController extends Controller+{+ private const ALLOWED_FIELDS = ['key', 'value', 'is_literal', 'is_multiline', 'is_shown_once', 'comment'];++ private function removeSensitiveData(SharedEnvironmentVariable $env): mixed+ {+ $env->makeHidden([+ 'team_id',+ 'project_id',+ 'environment_id',+ 'server_id',+ 'version',+ ]);++ if (request()->attributes->get('can_read_sensitive', false) === true) {+ $env->makeVisible(['value']);+ }++ if ($env->is_shown_once ?? false) {+ $env->makeHidden(['value']);+ }++ return serializeApiResponse($env);+ }++ private function teamIdOrAbort(): int|JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ return $teamId;+ }++ private function validateEnvPayload(Request $request, bool $requireKey = true): JsonResponse|true+ {+ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ if ($request->has('key')) {+ $request->merge(['key' => ValidationPatterns::normalizeEnvironmentVariableKey((string) $request->key)]);+ }++ $validator = customApiValidator($request->all(), [+ 'key' => ValidationPatterns::environmentVariableKeyRules(required: $requireKey),+ 'value' => 'string|nullable',+ 'is_literal' => 'boolean',+ 'is_multiline' => 'boolean',+ 'is_shown_once' => 'boolean',+ 'comment' => 'string|nullable|max:256',+ ]);++ $extraFields = array_diff(array_keys($request->all()), self::ALLOWED_FIELDS);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ if (! empty($extraFields)) {+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ if (! $requireKey && $request->all() === []) {+ return response()->json(['message' => 'At least one field must be provided.'], 422);+ }++ return true;+ }++ private function findEnvInScope(int $teamId, int|string $envId, string $type, array $scope = []): ?SharedEnvironmentVariable+ {+ $query = SharedEnvironmentVariable::ownedByCurrentTeamAPI($teamId)+ ->where('type', $type)+ ->where('id', $envId);++ if (array_key_exists('project_id', $scope)) {+ $query->where('project_id', $scope['project_id']);+ }+ if (array_key_exists('environment_id', $scope)) {+ $query->where('environment_id', $scope['environment_id']);+ }+ if (array_key_exists('server_id', $scope)) {+ $query->where('server_id', $scope['server_id']);+ }++ return $query->first();+ }++ private function keyExistsInScope(int $teamId, string $key, string $type, array $scope = [], ?int $exceptId = null): bool+ {+ $query = SharedEnvironmentVariable::ownedByCurrentTeamAPI($teamId)+ ->where('type', $type)+ ->where('key', $key);++ if (array_key_exists('project_id', $scope)) {+ $query->where('project_id', $scope['project_id']);+ } else {+ $query->whereNull('project_id');+ }+ if (array_key_exists('environment_id', $scope)) {+ $query->where('environment_id', $scope['environment_id']);+ } else {+ $query->whereNull('environment_id');+ }+ if (array_key_exists('server_id', $scope)) {+ $query->where('server_id', $scope['server_id']);+ } else {+ $query->whereNull('server_id');+ }++ if ($exceptId !== null) {+ $query->where('id', '!=', $exceptId);+ }++ return $query->exists();+ }++ private function listEnvs(int $teamId, string $type, array $scope = []): JsonResponse+ {+ $query = SharedEnvironmentVariable::ownedByCurrentTeamAPI($teamId)+ ->where('type', $type)+ ->orderBy('id');++ if (array_key_exists('project_id', $scope)) {+ $query->where('project_id', $scope['project_id']);+ }+ if (array_key_exists('environment_id', $scope)) {+ $query->where('environment_id', $scope['environment_id']);+ }+ if (array_key_exists('server_id', $scope)) {+ $query->where('server_id', $scope['server_id']);+ }++ $envs = $query->get()->map(fn (SharedEnvironmentVariable $env) => $this->removeSensitiveData($env));++ return response()->json($envs);+ }++ private function createEnv(Request $request, int $teamId, string $type, array $attributes = []): JsonResponse+ {+ $validated = $this->validateEnvPayload($request, requireKey: true);+ if ($validated instanceof JsonResponse) {+ return $validated;+ }++ $this->authorize('create', SharedEnvironmentVariable::class);++ $scope = array_filter([+ 'project_id' => $attributes['project_id'] ?? null,+ 'environment_id' => $attributes['environment_id'] ?? null,+ 'server_id' => $attributes['server_id'] ?? null,+ ], fn ($value) => ! is_null($value));++ if ($this->keyExistsInScope($teamId, $request->key, $type, $scope)) {+ return response()->json([+ 'message' => 'Environment variable already exists. Use PATCH request to update it.',+ ], 409);+ }++ $env = SharedEnvironmentVariable::create([+ 'key' => $request->key,+ 'value' => $request->value,+ 'is_literal' => $request->boolean('is_literal'),+ 'is_multiline' => $request->boolean('is_multiline'),+ 'is_shown_once' => $request->boolean('is_shown_once'),+ 'comment' => $request->comment,+ 'type' => $type,+ 'team_id' => $teamId,+ 'project_id' => $attributes['project_id'] ?? null,+ 'environment_id' => $attributes['environment_id'] ?? null,+ 'server_id' => $attributes['server_id'] ?? null,+ ]);++ auditLog('api.shared_env.created', [+ 'team_id' => $teamId,+ 'env_id' => $env->id,+ 'env_key' => $env->key,+ 'type' => $type,+ ]);++ return response()->json([+ 'id' => $env->id,+ ], 201);+ }++ private function updateEnv(Request $request, int $teamId, int|string $envId, string $type, array $scope = []): JsonResponse+ {+ $env = $this->findEnvInScope($teamId, $envId, $type, $scope);+ if (! $env) {+ return response()->json(['message' => 'Environment variable not found.'], 404);+ }++ $this->authorize('update', $env);++ $validated = $this->validateEnvPayload($request, requireKey: false);+ if ($validated instanceof JsonResponse) {+ return $validated;+ }++ if ($request->has('key') && $request->key !== $env->key) {+ if ($this->keyExistsInScope($teamId, $request->key, $type, $scope, exceptId: $env->id)) {+ return response()->json([+ 'message' => 'Environment variable already exists with this key.',+ ], 409);+ }+ $env->key = $request->key;+ }++ if ($request->has('value')) {+ $env->value = $request->value;+ }+ if ($request->has('is_literal')) {+ $env->is_literal = $request->boolean('is_literal');+ }+ if ($request->has('is_multiline')) {+ $env->is_multiline = $request->boolean('is_multiline');+ }+ if ($request->has('is_shown_once')) {+ $env->is_shown_once = $request->boolean('is_shown_once');+ }+ if ($request->has('comment')) {+ $env->comment = $request->comment;+ }++ $env->save();++ auditLog('api.shared_env.updated', [+ 'team_id' => $teamId,+ 'env_id' => $env->id,+ 'env_key' => $env->key,+ 'type' => $type,+ ]);++ return response()->json($this->removeSensitiveData($env->fresh()));+ }++ private function deleteEnv(int $teamId, int|string $envId, string $type, array $scope = []): JsonResponse+ {+ $env = $this->findEnvInScope($teamId, $envId, $type, $scope);+ if (! $env) {+ return response()->json(['message' => 'Environment variable not found.'], 404);+ }++ $this->authorize('delete', $env);++ $envKey = $env->key;+ $envIdValue = $env->id;+ $env->delete();++ auditLog('api.shared_env.deleted', [+ 'team_id' => $teamId,+ 'env_id' => $envIdValue,+ 'env_key' => $envKey,+ 'type' => $type,+ ]);++ return response()->json([+ 'message' => 'Environment variable deleted.',+ ]);+ }++ private function resolveProject(int $teamId, string $uuid): Project|JsonResponse+ {+ $project = Project::whereTeamId($teamId)->whereUuid($uuid)->first();+ if (! $project) {+ return response()->json(['message' => 'Project not found.'], 404);+ }++ return $project;+ }++ private function resolveServer(int $teamId, string $uuid): Server|JsonResponse+ {+ $server = Server::whereTeamId($teamId)->whereUuid($uuid)->first();+ if (! $server) {+ return response()->json(['message' => 'Server not found.'], 404);+ }++ return $server;+ }++ private function resolveEnvironment(Project $project, string $environmentNameOrUuid): Environment|JsonResponse+ {+ $environment = $project->environments()->whereName($environmentNameOrUuid)->first();+ if (! $environment) {+ $environment = $project->environments()->whereUuid($environmentNameOrUuid)->first();+ }+ if (! $environment) {+ return response()->json(['message' => 'Environment not found.'], 404);+ }++ return $environment;+ }++ // ── Team ──────────────────────────────────────────────────────────++ #[OA\Get(+ summary: 'List Team Shared Envs',+ description: 'List shared environment variables for the current team (type=team).',+ path: '/team/envs',+ operationId: 'list-team-shared-envs',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ responses: [+ new OA\Response(response: 200, description: 'Team shared environment variables.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ ],+ )]+ public function team_envs(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $this->authorize('viewAny', SharedEnvironmentVariable::class);++ return $this->listEnvs($teamId, 'team');+ }++ #[OA\Post(+ summary: 'Create Team Shared Env',+ description: 'Create a shared environment variable for the current team (type=team).',+ path: '/team/envs',+ operationId: 'create-team-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['key'],+ properties: [+ new OA\Property(property: 'key', type: 'string'),+ new OA\Property(property: 'value', type: 'string', nullable: true),+ new OA\Property(property: 'is_literal', type: 'boolean'),+ new OA\Property(property: 'is_multiline', type: 'boolean'),+ new OA\Property(property: 'is_shown_once', type: 'boolean'),+ new OA\Property(property: 'comment', type: 'string', nullable: true),+ ],+ ),+ ),+ responses: [+ new OA\Response(response: 201, description: 'Environment variable created.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 409, description: 'Environment variable already exists.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function team_create_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ return $this->createEnv($request, $teamId, 'team');+ }++ #[OA\Patch(+ summary: 'Update Team Shared Env',+ description: 'Update a team shared environment variable by id.',+ path: '/team/envs/{env_id}',+ operationId: 'update-team-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable updated.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function team_update_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ return $this->updateEnv($request, $teamId, $request->route('env_id'), 'team');+ }++ #[OA\Delete(+ summary: 'Delete Team Shared Env',+ description: 'Delete a team shared environment variable by id.',+ path: '/team/envs/{env_id}',+ operationId: 'delete-team-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable deleted.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function team_delete_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ return $this->deleteEnv($teamId, $request->route('env_id'), 'team');+ }++ // ── Project ───────────────────────────────────────────────────────++ #[OA\Get(+ summary: 'List Project Shared Envs',+ description: 'List shared environment variables for a project (type=project).',+ path: '/projects/{uuid}/envs',+ operationId: 'list-project-shared-envs',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Project shared environment variables.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function project_envs(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $this->authorize('view', $project);++ return $this->listEnvs($teamId, 'project', ['project_id' => $project->id]);+ }++ #[OA\Post(+ summary: 'Create Project Shared Env',+ description: 'Create a shared environment variable for a project (type=project).',+ path: '/projects/{uuid}/envs',+ operationId: 'create-project-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 201, description: 'Environment variable created.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 409, description: 'Environment variable already exists.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function project_create_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $this->authorize('view', $project);++ return $this->createEnv($request, $teamId, 'project', ['project_id' => $project->id]);+ }++ #[OA\Patch(+ summary: 'Update Project Shared Env',+ description: 'Update a project shared environment variable by id.',+ path: '/projects/{uuid}/envs/{env_id}',+ operationId: 'update-project-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable updated.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function project_update_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $this->authorize('view', $project);++ return $this->updateEnv(+ $request,+ $teamId,+ $request->route('env_id'),+ 'project',+ ['project_id' => $project->id],+ );+ }++ #[OA\Delete(+ summary: 'Delete Project Shared Env',+ description: 'Delete a project shared environment variable by id.',+ path: '/projects/{uuid}/envs/{env_id}',+ operationId: 'delete-project-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable deleted.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function project_delete_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $this->authorize('view', $project);++ return $this->deleteEnv(+ $teamId,+ $request->route('env_id'),+ 'project',+ ['project_id' => $project->id],+ );+ }++ // ── Environment ───────────────────────────────────────────────────++ #[OA\Get(+ summary: 'List Environment Shared Envs',+ description: 'List shared environment variables for a project environment (type=environment).',+ path: '/projects/{uuid}/environments/{environment_name_or_uuid}/envs',+ operationId: 'list-environment-shared-envs',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment shared environment variables.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function environment_envs(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $environment = $this->resolveEnvironment($project, $request->route('environment_name_or_uuid'));+ if ($environment instanceof JsonResponse) {+ return $environment;+ }++ $this->authorize('view', $project);++ return $this->listEnvs($teamId, 'environment', ['environment_id' => $environment->id]);+ }++ #[OA\Post(+ summary: 'Create Environment Shared Env',+ description: 'Create a shared environment variable for a project environment (type=environment).',+ path: '/projects/{uuid}/environments/{environment_name_or_uuid}/envs',+ operationId: 'create-environment-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 201, description: 'Environment variable created.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 409, description: 'Environment variable already exists.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function environment_create_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $environment = $this->resolveEnvironment($project, $request->route('environment_name_or_uuid'));+ if ($environment instanceof JsonResponse) {+ return $environment;+ }++ $this->authorize('view', $project);++ return $this->createEnv($request, $teamId, 'environment', ['environment_id' => $environment->id]);+ }++ #[OA\Patch(+ summary: 'Update Environment Shared Env',+ description: 'Update an environment shared environment variable by id.',+ path: '/projects/{uuid}/environments/{environment_name_or_uuid}/envs/{env_id}',+ operationId: 'update-environment-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable updated.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function environment_update_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $environment = $this->resolveEnvironment($project, $request->route('environment_name_or_uuid'));+ if ($environment instanceof JsonResponse) {+ return $environment;+ }++ $this->authorize('view', $project);++ return $this->updateEnv(+ $request,+ $teamId,+ $request->route('env_id'),+ 'environment',+ ['environment_id' => $environment->id],+ );+ }++ #[OA\Delete(+ summary: 'Delete Environment Shared Env',+ description: 'Delete an environment shared environment variable by id.',+ path: '/projects/{uuid}/environments/{environment_name_or_uuid}/envs/{env_id}',+ operationId: 'delete-environment-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Project UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'environment_name_or_uuid', in: 'path', required: true, description: 'Environment name or UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable deleted.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function environment_delete_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $project = $this->resolveProject($teamId, $request->route('uuid'));+ if ($project instanceof JsonResponse) {+ return $project;+ }++ $environment = $this->resolveEnvironment($project, $request->route('environment_name_or_uuid'));+ if ($environment instanceof JsonResponse) {+ return $environment;+ }++ $this->authorize('view', $project);++ return $this->deleteEnv(+ $teamId,+ $request->route('env_id'),+ 'environment',+ ['environment_id' => $environment->id],+ );+ }++ // ── Server ────────────────────────────────────────────────────────++ #[OA\Get(+ summary: 'List Server Shared Envs',+ description: 'List shared environment variables for a server (type=server).',+ path: '/servers/{uuid}/envs',+ operationId: 'list-server-shared-envs',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Server shared environment variables.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function server_envs(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $server = $this->resolveServer($teamId, $request->route('uuid'));+ if ($server instanceof JsonResponse) {+ return $server;+ }++ $this->authorize('view', $server);++ return $this->listEnvs($teamId, 'server', ['server_id' => $server->id]);+ }++ #[OA\Post(+ summary: 'Create Server Shared Env',+ description: 'Create a shared environment variable for a server (type=server).',+ path: '/servers/{uuid}/envs',+ operationId: 'create-server-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 201, description: 'Environment variable created.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 409, description: 'Environment variable already exists.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function server_create_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $server = $this->resolveServer($teamId, $request->route('uuid'));+ if ($server instanceof JsonResponse) {+ return $server;+ }++ $this->authorize('view', $server);++ return $this->createEnv($request, $teamId, 'server', ['server_id' => $server->id]);+ }++ #[OA\Patch(+ summary: 'Update Server Shared Env',+ description: 'Update a server shared environment variable by id.',+ path: '/servers/{uuid}/envs/{env_id}',+ operationId: 'update-server-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable updated.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ],+ )]+ public function server_update_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $server = $this->resolveServer($teamId, $request->route('uuid'));+ if ($server instanceof JsonResponse) {+ return $server;+ }++ $this->authorize('view', $server);++ return $this->updateEnv(+ $request,+ $teamId,+ $request->route('env_id'),+ 'server',+ ['server_id' => $server->id],+ );+ }++ #[OA\Delete(+ summary: 'Delete Server Shared Env',+ description: 'Delete a server shared environment variable by id.',+ path: '/servers/{uuid}/envs/{env_id}',+ operationId: 'delete-server-shared-env',+ security: [['bearerAuth' => []]],+ tags: ['Shared Environment Variables'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server UUID', schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'env_id', in: 'path', required: true, description: 'Shared env id (integer).', schema: new OA\Schema(type: 'integer')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Environment variable deleted.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ],+ )]+ public function server_delete_env(Request $request): JsonResponse+ {+ $teamId = $this->teamIdOrAbort();+ if (! is_int($teamId)) {+ return $teamId;+ }++ $server = $this->resolveServer($teamId, $request->route('uuid'));+ if ($server instanceof JsonResponse) {+ return $server;+ }++ $this->authorize('view', $server);++ return $this->deleteEnv(+ $teamId,+ $request->route('env_id'),+ 'server',+ ['server_id' => $server->id],+ );+ }+}diff --git a/app/Http/Controllers/Api/TagsController.php b/app/Http/Controllers/Api/TagsController.phpindex 173a8ab7bc..af1e51728f 100644--- a/app/Http/Controllers/Api/TagsController.php+++ b/app/Http/Controllers/Api/TagsController.php@@ -4,8 +4,10 @@ namespace App\Http\Controllers\Api;use App\Http\Controllers\Controller;use App\Models\Tag;+use Illuminate\Database\QueryException;use Illuminate\Http\JsonResponse;use Illuminate\Http\Request;+use Illuminate\Support\Facades\Validator;use OpenApi\Attributes as OA;class TagsController extends Controller@@ -20,6 +22,57 @@ class TagsController extends Controller];}+ private function normalizeTagName(string $name): string+ {+ return strtolower(trim(strip_tags($name)));+ }++ private function validateTagWriteRequest(Request $request, array $allowedFields = ['name']): array|JsonResponse+ {+ $return = validateIncomingRequest($request);+ if ($return instanceof JsonResponse) {+ return $return;+ }++ $validator = Validator::make($request->all(), [+ 'name' => 'required|string|min:2|max:255',+ ]);++ $extraFields = array_diff(array_keys($request->all()), $allowedFields);+ if ($validator->fails() || ! empty($extraFields)) {+ $errors = $validator->errors();+ if (! empty($extraFields)) {+ foreach ($extraFields as $field) {+ $errors->add($field, 'This field is not allowed.');+ }+ }++ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => $errors,+ ], 422);+ }++ $name = $this->normalizeTagName((string) $request->input('name'));+ if (mb_strlen($name) < 2) {+ return response()->json([+ 'message' => 'Validation failed.',+ 'errors' => ['name' => ['The tag name must be at least 2 characters after sanitization.']],+ ], 422);+ }++ return ['name' => $name];+ }++ private function isUniqueConstraintViolation(QueryException $exception): bool+ {+ $sqlState = $exception->errorInfo[0] ?? null;+ $driverCode = (string) ($exception->errorInfo[1] ?? $exception->getCode());++ return in_array($sqlState, ['23000', '23505'], true)+ || in_array($driverCode, ['19', '1062', '2067'], true);+ }+#[OA\Get(summary: 'List',description: 'List all tags for the current team.',@@ -58,4 +111,209 @@ class TagsController extends Controllerreturn response()->json($tags->map(self::serializeTag(...)));}++ #[OA\Post(+ summary: 'Create',+ description: 'Create a tag for the current team.',+ path: '/tags',+ operationId: 'create-tag',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['Tags'],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['name'],+ properties: [+ new OA\Property(property: 'name', type: 'string', minLength: 2, maxLength: 255),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(+ response: 201,+ description: 'Tag created.',+ content: new OA\JsonContent(ref: '#/components/schemas/Tag'),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 409, description: 'Tag with this name already exists.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function create(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $this->authorize('create', Tag::class);++ $validated = $this->validateTagWriteRequest($request);+ if ($validated instanceof JsonResponse) {+ return $validated;+ }++ if (Tag::where('team_id', $teamId)->where('name', $validated['name'])->exists()) {+ return response()->json(['message' => 'Tag with this name already exists.'], 409);+ }++ try {+ $tag = Tag::create([+ 'name' => $validated['name'],+ 'team_id' => $teamId,+ ]);+ } catch (QueryException $exception) {+ if ($this->isUniqueConstraintViolation($exception)) {+ return response()->json(['message' => 'Tag with this name already exists.'], 409);+ }++ throw $exception;+ }++ auditLog('api.tag.created', [+ 'team_id' => $teamId,+ 'tag_uuid' => $tag->uuid,+ 'tag_name' => $tag->name,+ ]);++ return response()->json(self::serializeTag($tag), 201);+ }++ #[OA\Patch(+ summary: 'Update',+ description: 'Update a tag name for the current team.',+ path: '/tags/{uuid}',+ operationId: 'update-tag-by-uuid',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['Tags'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Tag UUID', schema: new OA\Schema(type: 'string')),+ ],+ requestBody: new OA\RequestBody(+ required: true,+ content: new OA\JsonContent(+ required: ['name'],+ properties: [+ new OA\Property(property: 'name', type: 'string', minLength: 2, maxLength: 255),+ ],+ type: 'object',+ ),+ ),+ responses: [+ new OA\Response(+ response: 200,+ description: 'Tag updated.',+ content: new OA\JsonContent(ref: '#/components/schemas/Tag'),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 400, ref: '#/components/responses/400'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ new OA\Response(response: 409, description: 'Tag with this name already exists.'),+ new OA\Response(response: 422, ref: '#/components/responses/422'),+ ]+ )]+ public function update(Request $request, string $uuid): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $validated = $this->validateTagWriteRequest($request);+ if ($validated instanceof JsonResponse) {+ return $validated;+ }++ $tag = Tag::where('team_id', $teamId)->where('uuid', $uuid)->first();+ if (! $tag) {+ return response()->json(['message' => 'Tag not found.'], 404);+ }++ $this->authorize('update', $tag);++ if ($validated['name'] !== $tag->name+ && Tag::where('team_id', $teamId)->where('name', $validated['name'])->where('id', '!=', $tag->id)->exists()) {+ return response()->json(['message' => 'Tag with this name already exists.'], 409);+ }++ try {+ $tag->update(['name' => $validated['name']]);+ } catch (QueryException $exception) {+ if ($this->isUniqueConstraintViolation($exception)) {+ return response()->json(['message' => 'Tag with this name already exists.'], 409);+ }++ throw $exception;+ }++ auditLog('api.tag.updated', [+ 'team_id' => $teamId,+ 'tag_uuid' => $tag->uuid,+ 'tag_name' => $tag->name,+ 'changed_fields' => ['name'],+ ]);++ return response()->json(self::serializeTag($tag->refresh()));+ }++ #[OA\Delete(+ summary: 'Delete',+ description: 'Delete a tag for the current team. Detaches the tag from all resources via cascade.',+ path: '/tags/{uuid}',+ operationId: 'delete-tag-by-uuid',+ security: [+ ['bearerAuth' => []],+ ],+ tags: ['Tags'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Tag UUID', schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(+ response: 200,+ description: 'Tag deleted.',+ content: new OA\JsonContent(+ properties: [+ new OA\Property(property: 'message', type: 'string', example: 'Tag deleted.'),+ ],+ type: 'object',+ ),+ ),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function delete(Request $request, string $uuid): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $tag = Tag::where('team_id', $teamId)->where('uuid', $uuid)->first();+ if (! $tag) {+ return response()->json(['message' => 'Tag not found.'], 404);+ }++ $this->authorize('delete', $tag);++ $tagUuid = $tag->uuid;+ $tagName = $tag->name;+ // taggables rows cascade-delete via FK on tag_id+ $tag->delete();++ auditLog('api.tag.deleted', [+ 'team_id' => $teamId,+ 'tag_uuid' => $tagUuid,+ 'tag_name' => $tagName,+ ]);++ return response()->json(['message' => 'Tag deleted.']);+ }}diff --git a/app/Http/Controllers/Api/TeamController.php b/app/Http/Controllers/Api/TeamController.phpindex d473995339..35e01c8314 100644--- a/app/Http/Controllers/Api/TeamController.php+++ b/app/Http/Controllers/Api/TeamController.php@@ -184,9 +184,9 @@ class TeamController extends Controller#[OA\Get(summary: 'Authenticated Team',- description: 'Get currently authenticated team.',- path: '/teams/current',- operationId: 'get-current-team',+ description: 'Get the team bound to the API token.',+ path: '/team',+ operationId: 'get-token-team',security: [['bearerAuth' => []],],@@ -194,7 +194,7 @@ class TeamController extends Controllerresponses: [new OA\Response(response: 200,- description: 'Current Team.',+ description: 'Team bound to the API token.',content: new OA\JsonContent(ref: '#/components/schemas/Team')),new OA\Response(response: 401,@@ -224,9 +224,9 @@ class TeamController extends Controller#[OA\Get(summary: 'Authenticated Team Members',- description: 'Get currently authenticated team members.',- path: '/teams/current/members',- operationId: 'get-current-team-members',+ description: 'Get members of the team bound to the API token.',+ path: '/team/members',+ operationId: 'get-token-team-members',security: [['bearerAuth' => []],],@@ -234,7 +234,7 @@ class TeamController extends Controllerresponses: [new OA\Response(response: 200,- description: 'Currently authenticated team members.',+ description: 'Members of the team bound to the API token.',content: [new OA\MediaType(mediaType: 'application/json',diff --git a/app/Http/Controllers/Api/VolumeBackupsController.php b/app/Http/Controllers/Api/VolumeBackupsController.phpindex e30cdad385..e51bf31f8e 100644--- a/app/Http/Controllers/Api/VolumeBackupsController.php+++ b/app/Http/Controllers/Api/VolumeBackupsController.php@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;use App\Actions\Shared\DeleteScheduledVolumeBackup;use App\Http\Controllers\Controller;+use App\Jobs\VolumeBackupJob;use App\Models\Application;use App\Models\LocalFileVolume;use App\Models\LocalPersistentVolume;@@ -442,4 +443,103 @@ class VolumeBackupsController extends Controller'timeout' => $backup->timeout,];}++ #[OA\Post(+ summary: 'Run application storage backup',+ description: 'Queue an immediate volume backup for an application storage that has a schedule.',+ path: '/applications/{uuid}/storages/{storage_uuid}/backups/run',+ operationId: 'run-application-storage-backup',+ security: [['bearerAuth' => []]],+ tags: ['Applications'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'storage_uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Storage backup queued.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ #[OA\Post(+ summary: 'Run database storage backup',+ description: 'Queue an immediate volume backup for a database storage that has a schedule.',+ path: '/databases/{uuid}/storages/{storage_uuid}/backups/run',+ operationId: 'run-database-storage-backup',+ security: [['bearerAuth' => []]],+ tags: ['Databases'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'storage_uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Storage backup queued.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ #[OA\Post(+ summary: 'Run service storage backup',+ description: 'Queue an immediate volume backup for a service storage that has a schedule.',+ path: '/services/{uuid}/storages/{storage_uuid}/backups/run',+ operationId: 'run-service-storage-backup',+ security: [['bearerAuth' => []]],+ tags: ['Services'],+ parameters: [+ new OA\Parameter(name: 'uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ new OA\Parameter(name: 'storage_uuid', in: 'path', required: true, schema: new OA\Schema(type: 'string')),+ ],+ responses: [+ new OA\Response(response: 200, description: 'Storage backup queued.'),+ new OA\Response(response: 401, ref: '#/components/responses/401'),+ new OA\Response(response: 404, ref: '#/components/responses/404'),+ ]+ )]+ public function run(Request $request): JsonResponse+ {+ $teamId = getTeamIdFromToken();+ if (is_null($teamId)) {+ return invalidTokenResponse();+ }++ $resourceType = $request->route('resource_type');+ $resource = $this->findResource($resourceType, $request->route('uuid'), $teamId);+ if (! $resource) {+ return response()->json([+ 'message' => match ($resourceType) {+ 'application' => 'Application not found.',+ 'database' => 'Database not found.',+ 'service' => 'Service not found.',+ default => 'Resource not found.',+ },+ ], 404);+ }++ $this->authorize('update', $resource);++ $storage = $this->findStorage($resource, $request->route('storage_uuid'));+ if (! $storage) {+ return response()->json(['message' => 'Storage not found.'], 404);+ }++ $backup = $storage->scheduledBackups()->first();+ if (! $backup) {+ return response()->json(['message' => 'Storage backup schedule not found.'], 404);+ }++ VolumeBackupJob::dispatch($backup);++ auditLog('api.volume_backup.run', [+ 'team_id' => $teamId,+ 'resource_type' => $resourceType,+ 'resource_uuid' => $resource->uuid,+ 'storage_uuid' => $storage->uuid,+ 'backup_uuid' => $backup->uuid,+ ]);++ return response()->json([+ 'message' => 'Storage backup queued.',+ 'uuid' => $backup->uuid,+ ]);+ }}diff --git a/app/Models/Application.php b/app/Models/Application.phpindex eff03b175f..ce86ba13b2 100644--- a/app/Models/Application.php+++ b/app/Models/Application.php@@ -74,6 +74,7 @@ use Symfony\Component\Yaml\Yaml;'limits_cpu_shares' => ['type' => 'integer', 'description' => 'CPU shares.'],'status' => ['type' => 'string', 'description' => 'Application status.'],'preview_url_template' => ['type' => 'string', 'description' => 'Preview URL template.'],+ 'max_restart_count' => ['type' => 'integer', 'description' => 'Maximum container restart count before stopping.'],'destination_type' => ['type' => 'string', 'description' => 'Destination type.'],'destination_id' => ['type' => 'integer', 'description' => 'Destination identifier.'],'source_id' => ['type' => 'integer', 'nullable' => true, 'description' => 'Source identifier.'],diff --git a/app/Models/SharedEnvironmentVariable.php b/app/Models/SharedEnvironmentVariable.phpindex 8bb2412403..c70bf9f08a 100644--- a/app/Models/SharedEnvironmentVariable.php+++ b/app/Models/SharedEnvironmentVariable.php@@ -39,6 +39,14 @@ class SharedEnvironmentVariable extends Model'value' => 'encrypted',];+ /**+ * Scope shared environment variables to a team (API token team_id).+ */+ public static function ownedByCurrentTeamAPI(int $teamId)+ {+ return static::where('team_id', $teamId);+ }+protected function key(): Attribute{return Attribute::make(diff --git a/app/Policies/TagPolicy.php b/app/Policies/TagPolicy.phpnew file mode 100644index 0000000000..7c19d5f1b4--- /dev/null+++ b/app/Policies/TagPolicy.php@@ -0,0 +1,65 @@+<?php++namespace App\Policies;++use App\Models\Tag;+use App\Models\User;++class TagPolicy+{+ /**+ * Determine whether the user can view any models.+ */+ public function viewAny(User $user): bool+ {+ return true;+ }++ /**+ * Determine whether the user can view the model.+ */+ public function view(User $user, Tag $tag): bool+ {+ return $user->teams->contains('id', $tag->team_id);+ }++ /**+ * Determine whether the user can create models.+ */+ public function create(User $user): bool+ {+ return $user->isAdmin();+ }++ /**+ * Determine whether the user can update the model.+ */+ public function update(User $user, Tag $tag): bool+ {+ return $user->isAdminOfTeam((int) $tag->team_id);+ }++ /**+ * Determine whether the user can delete the model.+ */+ public function delete(User $user, Tag $tag): bool+ {+ return $user->isAdminOfTeam((int) $tag->team_id);+ }++ /**+ * Determine whether the user can restore the model.+ */+ public function restore(User $user, Tag $tag): bool+ {+ return false;+ }++ /**+ * Determine whether the user can permanently delete the model.+ */+ public function forceDelete(User $user, Tag $tag): bool+ {+ return false;+ }+}diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.phpindex 7bc8f162d5..f68e465163 100644--- a/app/Providers/AuthServiceProvider.php+++ b/app/Providers/AuthServiceProvider.php@@ -35,6 +35,7 @@ use App\Models\StandaloneMysql;use App\Models\StandalonePostgresql;use App\Models\StandaloneRedis;use App\Models\SwarmDocker;+use App\Models\Tag;use App\Models\Team;use App\Models\TelegramNotificationSettings;use App\Models\V5\Application as V5Application;@@ -66,6 +67,7 @@ use App\Policies\ServicePolicy;use App\Policies\SharedEnvironmentVariablePolicy;use App\Policies\StandaloneDockerPolicy;use App\Policies\SwarmDockerPolicy;+use App\Policies\TagPolicy;use App\Policies\TeamPolicy;use App\Policies\V5\ApplicationPolicy as V5ApplicationPolicy;use App\Policies\V5\ClusterPolicy as V5ClusterPolicy;@@ -134,6 +136,7 @@ class AuthServiceProvider extends ServiceProvider// Cloud provider policiesCloudProviderToken::class => CloudProviderTokenPolicy::class,CloudInitScript::class => CloudInitScriptPolicy::class,+ Tag::class => TagPolicy::class,// V5 policies - scoped to the current team resolved from the requestV5Application::class => V5ApplicationPolicy::class,diff --git a/app/Rules/SafeWebhookUrl.php b/app/Rules/SafeWebhookUrl.phpindex 478b051970..0316da0bc1 100644--- a/app/Rules/SafeWebhookUrl.php+++ b/app/Rules/SafeWebhookUrl.php@@ -216,9 +216,23 @@ class SafeWebhookUrl implements ValidationRule$customDnsServers = $this->customDnsServers();if ($customDnsServers !== []) {- return $this->resolveHostWithCustomDnsServers($host, $customDnsServers);+ $customResolvedIps = $this->resolveHostWithCustomDnsServers($host, $customDnsServers);+ // Fall back to the system resolver when custom DNS has no answer so+ // docker/internal hostnames (e.g. coolify-minio) still work with an+ // instance-level public DNS server configured.+ if ($customResolvedIps !== []) {+ return $customResolvedIps;+ }}+ return $this->resolveHostWithSystemDns($host);+ }++ /**+ * @return array<int, string>+ */+ protected function resolveHostWithSystemDns(string $host): array+ {$records = @dns_get_record($host, DNS_A | DNS_AAAA);if ($records === false) {$records = [];@@ -249,7 +263,7 @@ class SafeWebhookUrl implements ValidationRule* @param array<int, string> $dnsServers* @return array<int, string>*/- private function resolveHostWithCustomDnsServers(string $host, array $dnsServers): array+ protected function resolveHostWithCustomDnsServers(string $host, array $dnsServers): array{$ips = [];diff --git a/bootstrap/helpers/api.php b/bootstrap/helpers/api.phpindex e314ead82b..60ec07aa89 100644--- a/bootstrap/helpers/api.php+++ b/bootstrap/helpers/api.php@@ -129,6 +129,16 @@ function sharedDataApplications()'is_gzip_enabled' => 'boolean','is_stripprefix_enabled' => 'boolean','is_raw_compose_deployment_enabled' => 'boolean',+ 'is_log_drain_enabled' => 'boolean',+ 'is_gpu_enabled' => 'boolean',+ 'gpu_driver' => 'string|nullable',+ 'gpu_count' => 'string|nullable',+ 'gpu_device_ids' => 'string|nullable',+ 'gpu_options' => 'string|nullable',+ 'is_consistent_container_name_enabled' => 'boolean',+ 'custom_internal_name' => 'string|nullable',+ 'preview_url_template' => 'string',+ 'max_restart_count' => 'integer|min:0','stop_grace_period' => 'nullable|integer|min:'.MIN_STOP_GRACE_PERIOD_SECONDS.'|max:'.MAX_STOP_GRACE_PERIOD_SECONDS,'docker_images_to_keep' => 'integer|min:0|max:100','static_image' => Rule::enum(StaticImageTypes::class),@@ -310,6 +320,14 @@ function removeUnnecessaryFieldsFromRequest(Request $request)$request->offsetUnset('is_gzip_enabled');$request->offsetUnset('is_stripprefix_enabled');$request->offsetUnset('is_raw_compose_deployment_enabled');+ $request->offsetUnset('is_log_drain_enabled');+ $request->offsetUnset('is_gpu_enabled');+ $request->offsetUnset('gpu_driver');+ $request->offsetUnset('gpu_count');+ $request->offsetUnset('gpu_device_ids');+ $request->offsetUnset('gpu_options');+ $request->offsetUnset('is_consistent_container_name_enabled');+ $request->offsetUnset('custom_internal_name');$request->offsetUnset('docker_compose_raw');$request->offsetUnset('tags');}diff --git a/openapi.json b/openapi.jsonindex 47060a4b05..4e9a12d1fc 100644--- a/openapi.json+++ b/openapi.json@@ -442,6 +442,52 @@"type": "boolean","description": "Deploy the raw Docker Compose definition."},+ "is_log_drain_enabled": {+ "type": "boolean",+ "description": "Enable log drain for the application."+ },+ "is_gpu_enabled": {+ "type": "boolean",+ "description": "Enable GPU support."+ },+ "gpu_driver": {+ "type": "string",+ "nullable": true,+ "description": "GPU driver name."+ },+ "gpu_count": {+ "type": "string",+ "nullable": true,+ "description": "Number of GPUs to allocate."+ },+ "gpu_device_ids": {+ "type": "string",+ "nullable": true,+ "description": "Comma-separated GPU device IDs."+ },+ "gpu_options": {+ "type": "string",+ "nullable": true,+ "description": "Additional GPU options."+ },+ "is_consistent_container_name_enabled": {+ "type": "boolean",+ "description": "Use a consistent container name across deployments."+ },+ "custom_internal_name": {+ "type": "string",+ "nullable": true,+ "description": "Custom internal container name."+ },+ "preview_url_template": {+ "type": "string",+ "description": "Preview URL template."+ },+ "max_restart_count": {+ "type": "integer",+ "minimum": 0,+ "description": "Maximum container restart count before stopping."+ },"is_http_basic_auth_enabled": {"type": "boolean","description": "HTTP Basic Authentication enabled."@@ -965,6 +1011,52 @@"type": "boolean","description": "Deploy the raw Docker Compose definition."},+ "is_log_drain_enabled": {+ "type": "boolean",+ "description": "Enable log drain for the application."+ },+ "is_gpu_enabled": {+ "type": "boolean",+ "description": "Enable GPU support."+ },+ "gpu_driver": {+ "type": "string",+ "nullable": true,+ "description": "GPU driver name."+ },+ "gpu_count": {+ "type": "string",+ "nullable": true,+ "description": "Number of GPUs to allocate."+ },+ "gpu_device_ids": {+ "type": "string",+ "nullable": true,+ "description": "Comma-separated GPU device IDs."+ },+ "gpu_options": {+ "type": "string",+ "nullable": true,+ "description": "Additional GPU options."+ },+ "is_consistent_container_name_enabled": {+ "type": "boolean",+ "description": "Use a consistent container name across deployments."+ },+ "custom_internal_name": {+ "type": "string",+ "nullable": true,+ "description": "Custom internal container name."+ },+ "preview_url_template": {+ "type": "string",+ "description": "Preview URL template."+ },+ "max_restart_count": {+ "type": "integer",+ "minimum": 0,+ "description": "Maximum container restart count before stopping."+ },"is_http_basic_auth_enabled": {"type": "boolean","description": "HTTP Basic Authentication enabled."@@ -1488,6 +1580,52 @@"type": "boolean","description": "Deploy the raw Docker Compose definition."},+ "is_log_drain_enabled": {+ "type": "boolean",+ "description": "Enable log drain for the application."+ },+ "is_gpu_enabled": {+ "type": "boolean",+ "description": "Enable GPU support."+ },+ "gpu_driver": {+ "type": "string",+ "nullable": true,+ "description": "GPU driver name."+ },+ "gpu_count": {+ "type": "string",+ "nullable": true,+ "description": "Number of GPUs to allocate."+ },+ "gpu_device_ids": {+ "type": "string",+ "nullable": true,+ "description": "Comma-separated GPU device IDs."+ },+ "gpu_options": {+ "type": "string",+ "nullable": true,+ "description": "Additional GPU options."+ },+ "is_consistent_container_name_enabled": {+ "type": "boolean",+ "description": "Use a consistent container name across deployments."+ },+ "custom_internal_name": {+ "type": "string",+ "nullable": true,+ "description": "Custom internal container name."+ },+ "preview_url_template": {+ "type": "string",+ "description": "Preview URL template."+ },+ "max_restart_count": {+ "type": "integer",+ "minimum": 0,+ "description": "Maximum container restart count before stopping."+ },"is_http_basic_auth_enabled": {"type": "boolean","description": "HTTP Basic Authentication enabled."@@ -1916,6 +2054,52 @@"type": "boolean","description": "Deploy the raw Docker Compose definition."},+ "is_log_drain_enabled": {+ "type": "boolean",+ "description": "Enable log drain for the application."+ },+ "is_gpu_enabled": {+ "type": "boolean",+ "description": "Enable GPU support."+ },+ "gpu_driver": {+ "type": "string",+ "nullable": true,+ "description": "GPU driver name."+ },+ "gpu_count": {+ "type": "string",+ "nullable": true,+ "description": "Number of GPUs to allocate."+ },+ "gpu_device_ids": {+ "type": "string",+ "nullable": true,+ "description": "Comma-separated GPU device IDs."+ },+ "gpu_options": {+ "type": "string",+ "nullable": true,+ "description": "Additional GPU options."+ },+ "is_consistent_container_name_enabled": {+ "type": "boolean",+ "description": "Use a consistent container name across deployments."+ },+ "custom_internal_name": {+ "type": "string",+ "nullable": true,+ "description": "Custom internal container name."+ },+ "preview_url_template": {+ "type": "string",+ "description": "Preview URL template."+ },+ "max_restart_count": {+ "type": "integer",+ "minimum": 0,+ "description": "Maximum container restart count before stopping."+ },"is_http_basic_auth_enabled": {"type": "boolean","description": "HTTP Basic Authentication enabled."@@ -2324,6 +2508,52 @@"type": "boolean","description": "Deploy the raw Docker Compose definition."},+ "is_log_drain_enabled": {+ "type": "boolean",+ "description": "Enable log drain for the application."+ },+ "is_gpu_enabled": {+ "type": "boolean",+ "description": "Enable GPU support."+ },+ "gpu_driver": {+ "type": "string",+ "nullable": true,+ "description": "GPU driver name."+ },+ "gpu_count": {+ "type": "string",+ "nullable": true,+ "description": "Number of GPUs to allocate."+ },+ "gpu_device_ids": {+ "type": "string",+ "nullable": true,+ "description": "Comma-separated GPU device IDs."+ },+ "gpu_options": {+ "type": "string",+ "nullable": true,+ "description": "Additional GPU options."+ },+ "is_consistent_container_name_enabled": {+ "type": "boolean",+ "description": "Use a consistent container name across deployments."+ },+ "custom_internal_name": {+ "type": "string",+ "nullable": true,+ "description": "Custom internal container name."+ },+ "preview_url_template": {+ "type": "string",+ "description": "Preview URL template."+ },+ "max_restart_count": {+ "type": "integer",+ "minimum": 0,+ "description": "Maximum container restart count before stopping."+ },"is_http_basic_auth_enabled": {"type": "boolean","description": "HTTP Basic Authentication enabled."@@ -2967,6 +3197,52 @@"type": "boolean","description": "Deploy the raw Docker Compose definition."},+ "is_log_drain_enabled": {+ "type": "boolean",+ "description": "Enable log drain for the application."+ },+ "is_gpu_enabled": {+ "type": "boolean",+ "description": "Enable GPU support."+ },+ "gpu_driver": {+ "type": "string",+ "nullable": true,+ "description": "GPU driver name."+ },+ "gpu_count": {+ "type": "string",+ "nullable": true,+ "description": "Number of GPUs to allocate."+ },+ "gpu_device_ids": {+ "type": "string",+ "nullable": true,+ "description": "Comma-separated GPU device IDs."+ },+ "gpu_options": {+ "type": "string",+ "nullable": true,+ "description": "Additional GPU options."+ },+ "is_consistent_container_name_enabled": {+ "type": "boolean",+ "description": "Use a consistent container name across deployments."+ },+ "custom_internal_name": {+ "type": "string",+ "nullable": true,+ "description": "Custom internal container name."+ },+ "preview_url_template": {+ "type": "string",+ "description": "Preview URL template."+ },+ "max_restart_count": {+ "type": "integer",+ "minimum": 0,+ "description": "Maximum container restart count before stopping."+ },"connect_to_docker_network": {"type": "boolean","description": "The flag to connect the service to the predefined Docker network."@@ -4380,107 +4656,49 @@]}},- "\/cloud-tokens": {- "get": {+ "\/applications\/{uuid}\/clone": {+ "post": {"tags": [- "Cloud Tokens"+ "Applications"],- "summary": "List Cloud Provider Tokens",- "description": "List all cloud provider tokens for the authenticated team.",- "operationId": "list-cloud-tokens",- "responses": {- "200": {- "description": "Get all cloud provider tokens.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "properties": {- "uuid": {- "type": "string"- },- "name": {- "type": "string"- },- "provider": {- "type": "string",- "enum": [- "hetzner",- "digitalocean",- "vultr"- ]- },- "team_id": {- "type": "integer"- },- "servers_count": {- "type": "integer"- },- "created_at": {- "type": "string"- },- "updated_at": {- "type": "string"- }- },- "type": "object"- }- }- }- }- },- "401": {- "$ref": "#\/components\/responses\/401"- },- "400": {- "$ref": "#\/components\/responses\/400"- }- },- "security": [+ "summary": "Clone",+ "description": "Clone an application to a destination owned by the authenticated team.",+ "operationId": "clone-application-by-uuid",+ "parameters": [{- "bearerAuth": []+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }}- ]- },- "post": {- "tags": [- "Cloud Tokens"],- "summary": "Create Cloud Provider Token",- "description": "Create a new cloud provider token. The token will be validated before being stored.",- "operationId": "create-cloud-token","requestBody": {- "description": "Cloud provider token details","required": true,"content": {"application\/json": {"schema": {"required": [- "provider",- "token",- "name"+ "destination_uuid"],"properties": {- "provider": {- "type": "string",- "enum": [- "hetzner",- "digitalocean",- "vultr"- ],- "example": "hetzner",- "description": "The cloud provider."- },- "token": {- "type": "string",- "example": "your-api-token-here",- "description": "The API token for the cloud provider."+ "destination_uuid": {+ "description": "UUID of the destination to clone into.",+ "type": "string"},"name": {- "type": "string",- "example": "My Hetzner Token",- "description": "A friendly name for the token."+ "description": "Optional name for the cloned application.",+ "type": [+ "string",+ "null"+ ]+ },+ "clone_volumes": {+ "description": "Whether to clone volume data.",+ "type": "boolean",+ "default": false}},"type": "object"@@ -4490,15 +4708,17 @@},"responses": {"201": {- "description": "Cloud provider token created.",+ "description": "Application cloned.","content": {"application\/json": {"schema": {"properties": {"uuid": {+ "type": "string"+ },+ "message": {"type": "string",- "example": "og888os",- "description": "The UUID of the token."+ "example": "Application cloned."}},"type": "object"@@ -4506,11 +4726,14 @@}}},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"},"422": {"$ref": "#\/components\/responses\/422"@@ -4523,19 +4746,19 @@]}},- "\/cloud-tokens\/{uuid}": {+ "\/applications\/{uuid}\/rollback-images": {"get": {"tags": [- "Cloud Tokens"+ "Applications"],- "summary": "Get Cloud Provider Token",- "description": "Get cloud provider token by UUID.",- "operationId": "get-cloud-token-by-uuid",+ "summary": "List Rollback Images",+ "description": "List available Docker images for rolling back an application. Returns an empty list when the server is unavailable or remote inspection is not possible.",+ "operationId": "list-application-rollback-images","parameters": [{"name": "uuid","in": "path",- "description": "Token UUID",+ "description": "UUID of the application.","required": true,"schema": {"type": "string"@@ -4544,31 +4767,33 @@],"responses": {"200": {- "description": "Get cloud provider token by UUID",+ "description": "Rollback images.","content": {"application\/json": {"schema": {"properties": {- "uuid": {- "type": "string"- },- "name": {- "type": "string"- },- "provider": {- "type": "string"- },- "team_id": {- "type": "integer"- },- "servers_count": {- "type": "integer"- },- "created_at": {- "type": "string"+ "current": {+ "type": [+ "string",+ "null"+ ]},- "updated_at": {- "type": "string"+ "images": {+ "type": "array",+ "items": {+ "properties": {+ "tag": {+ "type": "string"+ },+ "created_at": {+ "type": "string"+ },+ "is_current": {+ "type": "boolean"+ }+ },+ "type": "object"+ }}},"type": "object"@@ -4588,35 +4813,58 @@"bearerAuth": []}]- },- "delete": {+ }+ },+ "\/applications\/{uuid}\/rollback": {+ "post": {"tags": [- "Cloud Tokens"+ "Applications"],- "summary": "Delete Cloud Provider Token",- "description": "Delete cloud provider token by UUID. Cannot delete if token is used by any servers.",- "operationId": "delete-cloud-token-by-uuid",+ "summary": "Rollback",+ "description": "Queue a rollback deployment for an application to a previous image commit\/tag.",+ "operationId": "rollback-application-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the cloud provider token.",+ "description": "UUID of the application.","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "commit"+ ],+ "properties": {+ "commit": {+ "description": "Image tag \/ commit to roll back to.",+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "Cloud provider token deleted.",+ "description": "Rollback deployment queued.","content": {"application\/json": {"schema": {"properties": {"message": {- "type": "string",- "example": "Cloud provider token deleted."+ "type": "string"+ },+ "deployment_uuid": {+ "type": "string"}},"type": "object"@@ -4624,11 +4872,51 @@}}},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/applications\/{uuid}\/destinations": {+ "get": {+ "tags": [+ "Applications"+ ],+ "summary": "List Destinations",+ "description": "List primary and additional destinations for a standalone application.",+ "operationId": "list-application-destinations",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Application destinations."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"},"404": {"$ref": "#\/components\/responses\/404"@@ -4640,18 +4928,18 @@}]},- "patch": {+ "post": {"tags": [- "Cloud Tokens"+ "Applications"],- "summary": "Update Cloud Provider Token",- "description": "Update cloud provider token name.",- "operationId": "update-cloud-token-by-uuid",+ "summary": "Add Destination",+ "description": "Attach an additional standalone Docker destination to an application.",+ "operationId": "add-application-destination","parameters": [{"name": "uuid","in": "path",- "description": "Token UUID",+ "description": "UUID of the application.","required": true,"schema": {"type": "string"@@ -4659,15 +4947,16 @@}],"requestBody": {- "description": "Cloud provider token updated.","required": true,"content": {"application\/json": {"schema": {+ "required": [+ "destination_uuid"+ ],"properties": {- "name": {- "type": "string",- "description": "The friendly name for the token."+ "destination_uuid": {+ "type": "string"}},"type": "object"@@ -4676,20 +4965,11 @@}},"responses": {- "200": {- "description": "Cloud provider token updated.",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string"- }- },- "type": "object"- }- }- }+ "201": {+ "description": "Destination attached."+ },+ "400": {+ "$ref": "#\/components\/responses\/400"},"401": {"$ref": "#\/components\/responses\/401"@@ -4708,19 +4988,28 @@]}},- "\/cloud-tokens\/{uuid}\/validate": {- "post": {+ "\/applications\/{uuid}\/destinations\/{destination_uuid}": {+ "delete": {"tags": [- "Cloud Tokens"+ "Applications"],- "summary": "Validate Cloud Provider Token",- "description": "Validate a cloud provider token against the provider API.",- "operationId": "validate-cloud-token-by-uuid",+ "summary": "Remove Destination",+ "description": "Detach an additional destination from an application.",+ "operationId": "remove-application-destination","parameters": [{"name": "uuid","in": "path",- "description": "Token UUID",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "destination_uuid",+ "in": "path",+ "description": "UUID of the destination.","required": true,"schema": {"type": "string"@@ -4729,30 +5018,16 @@],"responses": {"200": {- "description": "Token validation result.",- "content": {- "application\/json": {- "schema": {- "properties": {- "valid": {- "type": "boolean",- "example": true- },- "message": {- "type": "string",- "example": "Token is valid."- }- },- "type": "object"- }- }- }+ "description": "Destination detached."},"401": {"$ref": "#\/components\/responses\/401"},"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -4762,31 +5037,23 @@]}},- "\/databases": {+ "\/cloud-init-scripts": {"get": {"tags": [- "Databases"+ "Cloud-init Scripts"],- "summary": "List",- "description": "List all databases.",- "operationId": "list-databases",+ "summary": "List Cloud-init Scripts",+ "description": "List all cloud-init scripts for the authenticated team.",+ "operationId": "list-cloud-init-scripts","responses": {"200": {- "description": "Get all databases",- "content": {- "application\/json": {- "schema": {- "type": "string"- },- "example": "Content is very complex. Will be implemented later."- }- }+ "description": "Cloud-init scripts for the team."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "403": {+ "description": "Forbidden."}},"security": [@@ -4794,142 +5061,30 @@"bearerAuth": []}]- }- },- "\/databases\/{uuid}\/backups": {- "get": {+ },+ "post": {"tags": [- "Databases"- ],- "summary": "Get",- "description": "Get backups details by database UUID.",- "operationId": "get-database-backups-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "responses": {- "200": {- "description": "Get all backups for a database",- "content": {- "application\/json": {- "schema": {- "type": "string"- },- "example": "Content is very complex. Will be implemented later."- }- }- },- "401": {- "$ref": "#\/components\/responses\/401"- },- "400": {- "$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"- }- },- "security": [- {- "bearerAuth": []- }- ]- },- "post": {- "tags": [- "Databases"- ],- "summary": "Create Backup",- "description": "Create a new scheduled backup configuration for a database",- "operationId": "create-database-backup",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }+ "Cloud-init Scripts"],+ "summary": "Create Cloud-init Script",+ "description": "Create a new cloud-init script for the authenticated team.",+ "operationId": "create-cloud-init-script","requestBody": {- "description": "Backup configuration data","required": true,"content": {"application\/json": {"schema": {"required": [- "frequency"+ "name",+ "script"],"properties": {- "frequency": {- "type": "string",- "description": "Backup frequency (cron expression or: every_minute, hourly, daily, weekly, monthly, yearly)"- },- "enabled": {- "type": "boolean",- "description": "Whether the backup is enabled",- "default": true- },- "save_s3": {- "type": "boolean",- "description": "Whether to save backups to S3",- "default": false- },- "s3_storage_uuid": {- "type": "string",- "description": "S3 storage UUID (required if save_s3 is true)"- },- "databases_to_backup": {- "type": "string",- "description": "Comma separated list of databases to backup"- },- "dump_all": {- "type": "boolean",- "description": "Whether to dump all databases",- "default": false- },- "backup_now": {- "type": "boolean",- "description": "Whether to trigger backup immediately after creation"- },- "database_backup_retention_amount_locally": {- "type": "integer",- "description": "Number of backups to retain locally"- },- "database_backup_retention_days_locally": {- "type": "integer",- "description": "Number of days to retain backups locally"- },- "database_backup_retention_max_storage_locally": {- "type": "number",- "description": "Max storage (GB) for local backups"- },- "database_backup_retention_amount_s3": {- "type": "integer",- "description": "Number of backups to retain in S3"- },- "database_backup_retention_days_s3": {- "type": "integer",- "description": "Number of days to retain backups in S3"- },- "database_backup_retention_max_storage_s3": {- "type": "number",- "description": "Max storage (GB) for S3 backups"+ "name": {+ "type": "string"},- "timeout": {- "type": "integer",- "description": "Backup job timeout in seconds (min: 60, max: 36000)",- "default": 3600+ "script": {+ "description": "Bash script (#!) or cloud-config YAML.",+ "type": "string"}},"type": "object"@@ -4939,34 +5094,13 @@},"responses": {"201": {- "description": "Backup configuration created successfully",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string",- "format": "uuid",- "example": "550e8400-e29b-41d4-a716-446655440000"- },- "message": {- "type": "string",- "example": "Backup configuration created successfully."- }- },- "type": "object"- }- }- }+ "description": "Cloud-init script created."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."},"422": {"$ref": "#\/components\/responses\/422"@@ -4979,19 +5113,18 @@]}},- "\/databases\/{uuid}": {+ "\/cloud-init-scripts\/{uuid}": {"get": {"tags": [- "Databases"+ "Cloud-init Scripts"],- "summary": "Get",- "description": "Get database by UUID.",- "operationId": "get-database-by-uuid",+ "summary": "Get Cloud-init Script",+ "description": "Get a cloud-init script by UUID.",+ "operationId": "get-cloud-init-script-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the database.","required": true,"schema": {"type": "string"@@ -5000,21 +5133,13 @@],"responses": {"200": {- "description": "Get all databases",- "content": {- "application\/json": {- "schema": {- "type": "string"- },- "example": "Content is very complex. Will be implemented later."- }- }+ "description": "Cloud-init script."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "403": {+ "description": "Forbidden."},"404": {"$ref": "#\/components\/responses\/404"@@ -5028,84 +5153,30 @@},"delete": {"tags": [- "Databases"+ "Cloud-init Scripts"],- "summary": "Delete",- "description": "Delete database by UUID.",- "operationId": "delete-database-by-uuid",+ "summary": "Delete Cloud-init Script",+ "description": "Delete a cloud-init script by UUID.",+ "operationId": "delete-cloud-init-script-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the database.","required": true,"schema": {"type": "string"}- },- {- "name": "delete_configurations",- "in": "query",- "description": "Delete configurations.",- "required": false,- "schema": {- "type": "boolean",- "default": true- }- },- {- "name": "delete_volumes",- "in": "query",- "description": "Delete volumes.",- "required": false,- "schema": {- "type": "boolean",- "default": true- }- },- {- "name": "docker_cleanup",- "in": "query",- "description": "Run docker cleanup.",- "required": false,- "schema": {- "type": "boolean",- "default": true- }- },- {- "name": "delete_connected_networks",- "in": "query",- "description": "Delete connected networks.",- "required": false,- "schema": {- "type": "boolean",- "default": true- }}],"responses": {"200": {- "description": "Database deleted.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Database deleted."- }- },- "type": "object"- }- }- }+ "description": "Cloud-init script deleted."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "403": {+ "description": "Forbidden."},"404": {"$ref": "#\/components\/responses\/404"@@ -5119,16 +5190,15 @@},"patch": {"tags": [- "Databases"+ "Cloud-init Scripts"],- "summary": "Update",- "description": "Update database by UUID.",- "operationId": "update-database-by-uuid",+ "summary": "Update Cloud-init Script",+ "description": "Update a cloud-init script by UUID.",+ "operationId": "update-cloud-init-script-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the database.","required": true,"schema": {"type": "string"@@ -5136,200 +5206,16 @@}],"requestBody": {- "description": "Database data","required": true,"content": {"application\/json": {"schema": {"properties": {"name": {- "type": "string",- "description": "Name of the database"- },- "description": {- "type": "string",- "description": "Description of the database"- },- "image": {- "type": "string",- "description": "Docker Image of the database"- },- "is_public": {- "type": "boolean",- "description": "Is the database public?"- },- "public_port": {- "type": "integer",- "description": "Public port of the database"- },- "public_port_timeout": {- "type": "integer",- "description": "Public port timeout in seconds (default: 3600)"- },- "limits_memory": {- "type": "string",- "description": "Memory limit of the database"- },- "limits_memory_swap": {- "type": "string",- "description": "Memory swap limit of the database"- },- "limits_memory_swappiness": {- "type": "integer",- "description": "Memory swappiness of the database"+ "type": "string"},- "limits_memory_reservation": {- "type": "string",- "description": "Memory reservation of the database"- },- "limits_cpus": {- "type": "string",- "description": "CPU limit of the database"- },- "limits_cpuset": {- "type": "string",- "description": "CPU set of the database"- },- "limits_cpu_shares": {- "type": "integer",- "description": "CPU shares of the database"- },- "postgres_user": {- "type": "string",- "description": "PostgreSQL user"- },- "postgres_password": {- "type": "string",- "description": "PostgreSQL password"- },- "postgres_db": {- "type": "string",- "description": "PostgreSQL database"- },- "postgres_initdb_args": {- "type": "string",- "description": "PostgreSQL initdb args"- },- "postgres_host_auth_method": {- "type": "string",- "description": "PostgreSQL host auth method"- },- "postgres_conf": {- "type": "string",- "description": "PostgreSQL conf"- },- "clickhouse_admin_user": {- "type": "string",- "description": "Clickhouse admin user"- },- "clickhouse_admin_password": {- "type": "string",- "description": "Clickhouse admin password"- },- "dragonfly_password": {- "type": "string",- "description": "DragonFly password"- },- "redis_password": {- "type": "string",- "description": "Redis password"- },- "redis_conf": {- "type": "string",- "description": "Redis conf"- },- "keydb_password": {- "type": "string",- "description": "KeyDB password"- },- "keydb_conf": {- "type": "string",- "description": "KeyDB conf"- },- "mariadb_conf": {- "type": "string",- "description": "MariaDB conf"- },- "mariadb_root_password": {- "type": "string",- "description": "MariaDB root password"- },- "mariadb_user": {- "type": "string",- "description": "MariaDB user"- },- "mariadb_password": {- "type": "string",- "description": "MariaDB password"- },- "mariadb_database": {- "type": "string",- "description": "MariaDB database"- },- "mongo_conf": {- "type": "string",- "description": "Mongo conf"- },- "mongo_initdb_root_username": {- "type": "string",- "description": "Mongo initdb root username"- },- "mongo_initdb_root_password": {- "type": "string",- "description": "Mongo initdb root password"- },- "mongo_initdb_database": {- "type": "string",- "description": "Mongo initdb init database"- },- "mysql_root_password": {- "type": "string",- "description": "MySQL root password"- },- "mysql_password": {- "type": "string",- "description": "MySQL password"- },- "mysql_user": {- "type": "string",- "description": "MySQL user"- },- "mysql_database": {- "type": "string",- "description": "MySQL database"- },- "mysql_conf": {- "type": "string",- "description": "MySQL conf"- },- "health_check_enabled": {- "type": "boolean",- "description": "Enable the database healthcheck probe.",- "default": true- },- "health_check_interval": {- "type": "integer",- "description": "Healthcheck interval in seconds.",- "minimum": 1,- "default": 15- },- "health_check_timeout": {- "type": "integer",- "description": "Healthcheck timeout in seconds.",- "minimum": 1,- "default": 5- },- "health_check_retries": {- "type": "integer",- "description": "Healthcheck retries count.",- "minimum": 1,- "default": 5- },- "health_check_start_period": {- "type": "integer",- "description": "Healthcheck start period in seconds.",- "minimum": 0,- "default": 5+ "script": {+ "type": "string"}},"type": "object"@@ -5339,13 +5225,13 @@},"responses": {"200": {- "description": "Database updated"+ "description": "Cloud-init script updated."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "403": {+ "description": "Forbidden."},"404": {"$ref": "#\/components\/responses\/404"@@ -5361,174 +5247,107 @@]}},- "\/databases\/{uuid}\/backups\/{scheduled_backup_uuid}": {- "delete": {+ "\/cloud-tokens": {+ "get": {"tags": [- "Databases"- ],- "summary": "Delete backup configuration",- "description": "Deletes a backup configuration and all its executions.",- "operationId": "delete-backup-configuration-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "scheduled_backup_uuid",- "in": "path",- "description": "UUID of the backup configuration to delete",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "delete_s3",- "in": "query",- "description": "Whether to delete all backup files from S3",- "required": false,- "schema": {- "type": "boolean",- "default": false- }- }+ "Cloud Tokens"],+ "summary": "List Cloud Provider Tokens",+ "description": "List all cloud provider tokens for the authenticated team.",+ "operationId": "list-cloud-tokens","responses": {"200": {- "description": "Backup configuration deleted.",+ "description": "Get all cloud provider tokens.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string",- "example": "Backup configuration and all executions deleted."- }- },- "type": "object"+ "type": "array",+ "items": {+ "properties": {+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "provider": {+ "type": "string",+ "enum": [+ "hetzner",+ "digitalocean",+ "vultr"+ ]+ },+ "team_id": {+ "type": "integer"+ },+ "servers_count": {+ "type": "integer"+ },+ "created_at": {+ "type": "string"+ },+ "updated_at": {+ "type": "string"+ }+ },+ "type": "object"+ }}}}},- "404": {- "description": "Backup configuration not found.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Backup configuration not found."- }- },- "type": "object"- }- }- }- }- },- "security": [+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [{"bearerAuth": []}]},- "patch": {+ "post": {"tags": [- "Databases"- ],- "summary": "Update",- "description": "Update a specific backup configuration for a given database, identified by its UUID and the backup ID",- "operationId": "update-database-backup",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "scheduled_backup_uuid",- "in": "path",- "description": "UUID of the backup configuration.",- "required": true,- "schema": {- "type": "string"- }- }+ "Cloud Tokens"],+ "summary": "Create Cloud Provider Token",+ "description": "Create a new cloud provider token. The token will be validated before being stored.",+ "operationId": "create-cloud-token","requestBody": {- "description": "Database backup configuration data",+ "description": "Cloud provider token details","required": true,"content": {"application\/json": {"schema": {+ "required": [+ "provider",+ "token",+ "name"+ ],"properties": {- "save_s3": {- "type": "boolean",- "description": "Whether data is saved in s3 or not"- },- "s3_storage_uuid": {+ "provider": {"type": "string",- "description": "S3 storage UUID"- },- "backup_now": {- "type": "boolean",- "description": "Whether to take a backup now or not"- },- "enabled": {- "type": "boolean",- "description": "Whether the backup is enabled or not"+ "enum": [+ "hetzner",+ "digitalocean",+ "vultr"+ ],+ "example": "hetzner",+ "description": "The cloud provider."},- "databases_to_backup": {+ "token": {"type": "string",- "description": "Comma separated list of databases to backup"- },- "dump_all": {- "type": "boolean",- "description": "Whether all databases are dumped or not"+ "example": "your-api-token-here",+ "description": "The API token for the cloud provider."},- "frequency": {+ "name": {"type": "string",- "description": "Frequency of the backup"- },- "database_backup_retention_amount_locally": {- "type": "integer",- "description": "Retention amount of the backup locally"- },- "database_backup_retention_days_locally": {- "type": "integer",- "description": "Retention days of the backup locally"- },- "database_backup_retention_max_storage_locally": {- "type": "number",- "description": "Max storage of the backup locally"- },- "database_backup_retention_amount_s3": {- "type": "integer",- "description": "Retention amount of the backup in s3"- },- "database_backup_retention_days_s3": {- "type": "integer",- "description": "Retention days of the backup in s3"- },- "database_backup_retention_max_storage_s3": {- "type": "number",- "description": "Max storage of the backup in S3"- },- "timeout": {- "type": "integer",- "description": "Backup job timeout in seconds (min: 60, max: 36000)",- "default": 3600+ "example": "My Hetzner Token",+ "description": "A friendly name for the token."}},"type": "object"@@ -5537,8 +5356,22 @@}},"responses": {- "200": {- "description": "Database backup configuration updated"+ "201": {+ "description": "Cloud provider token created.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string",+ "example": "og888os",+ "description": "The UUID of the token."+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"@@ -5546,9 +5379,6 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"- },"422": {"$ref": "#\/components\/responses\/422"}@@ -5560,143 +5390,106 @@]}},- "\/databases\/postgresql": {- "post": {+ "\/cloud-tokens\/{uuid}": {+ "get": {"tags": [- "Databases"+ "Cloud Tokens"],- "summary": "Create (PostgreSQL)",- "description": "Create a new PostgreSQL database.",- "operationId": "create-database-postgresql",- "requestBody": {- "description": "Database data",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],- "properties": {- "server_uuid": {- "type": "string",- "description": "UUID of the server"- },- "project_uuid": {- "type": "string",- "description": "UUID of the project"- },- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ "summary": "Get Cloud Provider Token",+ "description": "Get cloud provider token by UUID.",+ "operationId": "get-cloud-token-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Token UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Get cloud provider token by UUID",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "team_id": {+ "type": "integer"+ },+ "servers_count": {+ "type": "integer"+ },+ "created_at": {+ "type": "string"+ },+ "updated_at": {+ "type": "string"+ }},- "environment_uuid": {- "type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "delete": {+ "tags": [+ "Cloud Tokens"+ ],+ "summary": "Delete Cloud Provider Token",+ "description": "Delete cloud provider token by UUID. Cannot delete if token is used by any servers.",+ "operationId": "delete-cloud-token-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the cloud provider token.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Cloud provider token deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Cloud provider token deleted."+ }},- "postgres_user": {- "type": "string",- "description": "PostgreSQL user"- },- "postgres_password": {- "type": "string",- "description": "PostgreSQL password"- },- "postgres_db": {- "type": "string",- "description": "PostgreSQL database"- },- "postgres_initdb_args": {- "type": "string",- "description": "PostgreSQL initdb args"- },- "postgres_host_auth_method": {- "type": "string",- "description": "PostgreSQL host auth method"- },- "postgres_conf": {- "type": "string",- "description": "PostgreSQL conf"- },- "destination_uuid": {- "type": "string",- "description": "UUID of the destination if the server has multiple destinations"- },- "name": {- "type": "string",- "description": "Name of the database"- },- "description": {- "type": "string",- "description": "Description of the database"- },- "image": {- "type": "string",- "description": "Docker Image of the database"- },- "is_public": {- "type": "boolean",- "description": "Is the database public?"- },- "public_port": {- "type": "integer",- "description": "Public port of the database"- },- "public_port_timeout": {- "type": "integer",- "description": "Public port timeout in seconds (default: 3600)"- },- "limits_memory": {- "type": "string",- "description": "Memory limit of the database"- },- "limits_memory_swap": {- "type": "string",- "description": "Memory swap limit of the database"- },- "limits_memory_swappiness": {- "type": "integer",- "description": "Memory swappiness of the database"- },- "limits_memory_reservation": {- "type": "string",- "description": "Memory reservation of the database"- },- "limits_cpus": {- "type": "string",- "description": "CPU limit of the database"- },- "limits_cpuset": {- "type": "string",- "description": "CPU set of the database"- },- "limits_cpu_shares": {- "type": "integer",- "description": "CPU shares of the database"- },- "instant_deploy": {- "type": "boolean",- "description": "Instant deploy the database"- },- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the database."- }- },- "type": "object"+ "type": "object"+ }}}- }- },- "responses": {- "200": {- "description": "Database updated"},"401": {"$ref": "#\/components\/responses\/401"@@ -5704,8 +5497,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "422": {- "$ref": "#\/components\/responses\/422"+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -5713,119 +5506,35 @@"bearerAuth": []}]- }- },- "\/databases\/clickhouse": {- "post": {+ },+ "patch": {"tags": [- "Databases"+ "Cloud Tokens"+ ],+ "summary": "Update Cloud Provider Token",+ "description": "Update cloud provider token name.",+ "operationId": "update-cloud-token-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Token UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }],- "summary": "Create (Clickhouse)",- "description": "Create a new Clickhouse database.",- "operationId": "create-database-clickhouse","requestBody": {- "description": "Database data",+ "description": "Cloud provider token updated.","required": true,"content": {"application\/json": {"schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],"properties": {- "server_uuid": {- "type": "string",- "description": "UUID of the server"- },- "project_uuid": {- "type": "string",- "description": "UUID of the project"- },- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "environment_uuid": {- "type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "destination_uuid": {- "type": "string",- "description": "UUID of the destination if the server has multiple destinations"- },- "clickhouse_admin_user": {- "type": "string",- "description": "Clickhouse admin user"- },- "clickhouse_admin_password": {- "type": "string",- "description": "Clickhouse admin password"- },"name": {"type": "string",- "description": "Name of the database"- },- "description": {- "type": "string",- "description": "Description of the database"- },- "image": {- "type": "string",- "description": "Docker Image of the database"- },- "is_public": {- "type": "boolean",- "description": "Is the database public?"- },- "public_port": {- "type": "integer",- "description": "Public port of the database"- },- "public_port_timeout": {- "type": "integer",- "description": "Public port timeout in seconds (default: 3600)"- },- "limits_memory": {- "type": "string",- "description": "Memory limit of the database"- },- "limits_memory_swap": {- "type": "string",- "description": "Memory swap limit of the database"- },- "limits_memory_swappiness": {- "type": "integer",- "description": "Memory swappiness of the database"- },- "limits_memory_reservation": {- "type": "string",- "description": "Memory reservation of the database"- },- "limits_cpus": {- "type": "string",- "description": "CPU limit of the database"- },- "limits_cpuset": {- "type": "string",- "description": "CPU set of the database"- },- "limits_cpu_shares": {- "type": "integer",- "description": "CPU shares of the database"- },- "instant_deploy": {- "type": "boolean",- "description": "Instant deploy the database"- },- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the database."+ "description": "The friendly name for the token."}},"type": "object"@@ -5835,13 +5544,25 @@},"responses": {"200": {- "description": "Database updated"+ "description": "Cloud provider token updated.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"},"422": {"$ref": "#\/components\/responses\/422"@@ -5854,132 +5575,85 @@]}},- "\/databases\/dragonfly": {+ "\/cloud-tokens\/{uuid}\/validate": {"post": {"tags": [- "Databases"+ "Cloud Tokens"],- "summary": "Create (DragonFly)",- "description": "Create a new DragonFly database.",- "operationId": "create-database-dragonfly",- "requestBody": {- "description": "Database data",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],- "properties": {- "server_uuid": {- "type": "string",- "description": "UUID of the server"- },- "project_uuid": {- "type": "string",- "description": "UUID of the project"- },- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "environment_uuid": {- "type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "destination_uuid": {- "type": "string",- "description": "UUID of the destination if the server has multiple destinations"- },- "dragonfly_password": {- "type": "string",- "description": "DragonFly password"- },- "name": {- "type": "string",- "description": "Name of the database"- },- "description": {- "type": "string",- "description": "Description of the database"- },- "image": {- "type": "string",- "description": "Docker Image of the database"- },- "is_public": {- "type": "boolean",- "description": "Is the database public?"- },- "public_port": {- "type": "integer",- "description": "Public port of the database"- },- "public_port_timeout": {- "type": "integer",- "description": "Public port timeout in seconds (default: 3600)"- },- "limits_memory": {- "type": "string",- "description": "Memory limit of the database"- },- "limits_memory_swap": {- "type": "string",- "description": "Memory swap limit of the database"- },- "limits_memory_swappiness": {- "type": "integer",- "description": "Memory swappiness of the database"- },- "limits_memory_reservation": {- "type": "string",- "description": "Memory reservation of the database"- },- "limits_cpus": {- "type": "string",- "description": "CPU limit of the database"- },- "limits_cpuset": {- "type": "string",- "description": "CPU set of the database"- },- "limits_cpu_shares": {- "type": "integer",- "description": "CPU shares of the database"- },- "instant_deploy": {- "type": "boolean",- "description": "Instant deploy the database"- },- "tags": {- "type": "array",- "items": {- "type": "string"+ "summary": "Validate Cloud Provider Token",+ "description": "Validate a cloud provider token against the provider API.",+ "operationId": "validate-cloud-token-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Token UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Token validation result.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "valid": {+ "type": "boolean",+ "example": true},- "description": "Tags to assign to the database."- }- },- "type": "object"+ "message": {+ "type": "string",+ "example": "Token is valid."+ }+ },+ "type": "object"+ }}}+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"}},+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "List",+ "description": "List all databases.",+ "operationId": "list-databases","responses": {"200": {- "description": "Database updated"+ "description": "Get all databases",+ "content": {+ "application\/json": {+ "schema": {+ "type": "string"+ },+ "example": "Content is very complex. Will be implemented later."+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},"400": {"$ref": "#\/components\/responses\/400"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -5989,117 +5663,140 @@]}},- "\/databases\/redis": {+ "\/databases\/{uuid}\/backups": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "Get",+ "description": "Get backups details by database UUID.",+ "operationId": "get-database-backups-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Get all backups for a database",+ "content": {+ "application\/json": {+ "schema": {+ "type": "string"+ },+ "example": "Content is very complex. Will be implemented later."+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },"post": {"tags": ["Databases"],- "summary": "Create (Redis)",- "description": "Create a new Redis database.",- "operationId": "create-database-redis",+ "summary": "Create Backup",+ "description": "Create a new scheduled backup configuration for a database",+ "operationId": "create-database-backup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {- "description": "Database data",+ "description": "Backup configuration data","required": true,"content": {"application\/json": {"schema": {"required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"+ "frequency"],"properties": {- "server_uuid": {+ "frequency": {"type": "string",- "description": "UUID of the server"+ "description": "Backup frequency (cron expression or: every_minute, hourly, daily, weekly, monthly, yearly)"},- "project_uuid": {- "type": "string",- "description": "UUID of the project"+ "enabled": {+ "type": "boolean",+ "description": "Whether the backup is enabled",+ "default": true},- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ "save_s3": {+ "type": "boolean",+ "description": "Whether to save backups to S3",+ "default": false},- "environment_uuid": {+ "s3_storage_uuid": {"type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ "description": "S3 storage UUID (required if save_s3 is true)"},- "destination_uuid": {- "type": "string",- "description": "UUID of the destination if the server has multiple destinations"- },- "redis_password": {- "type": "string",- "description": "Redis password"- },- "redis_conf": {- "type": "string",- "description": "Redis conf"- },- "name": {- "type": "string",- "description": "Name of the database"- },- "description": {+ "databases_to_backup": {"type": "string",- "description": "Description of the database"+ "description": "Comma separated list of databases to backup"},- "image": {- "type": "string",- "description": "Docker Image of the database"+ "dump_all": {+ "type": "boolean",+ "description": "Whether to dump all databases",+ "default": false},- "is_public": {+ "backup_now": {"type": "boolean",- "description": "Is the database public?"+ "description": "Whether to trigger backup immediately after creation"},- "public_port": {+ "database_backup_retention_amount_locally": {"type": "integer",- "description": "Public port of the database"+ "description": "Number of backups to retain locally"},- "public_port_timeout": {+ "database_backup_retention_days_locally": {"type": "integer",- "description": "Public port timeout in seconds (default: 3600)"- },- "limits_memory": {- "type": "string",- "description": "Memory limit of the database"+ "description": "Number of days to retain backups locally"},- "limits_memory_swap": {- "type": "string",- "description": "Memory swap limit of the database"+ "database_backup_retention_max_storage_locally": {+ "type": "number",+ "description": "Max storage (GB) for local backups"},- "limits_memory_swappiness": {+ "database_backup_retention_amount_s3": {"type": "integer",- "description": "Memory swappiness of the database"- },- "limits_memory_reservation": {- "type": "string",- "description": "Memory reservation of the database"- },- "limits_cpus": {- "type": "string",- "description": "CPU limit of the database"- },- "limits_cpuset": {- "type": "string",- "description": "CPU set of the database"+ "description": "Number of backups to retain in S3"},- "limits_cpu_shares": {+ "database_backup_retention_days_s3": {"type": "integer",- "description": "CPU shares of the database"+ "description": "Number of days to retain backups in S3"},- "instant_deploy": {- "type": "boolean",- "description": "Instant deploy the database"+ "database_backup_retention_max_storage_s3": {+ "type": "number",+ "description": "Max storage (GB) for S3 backups"},- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the database."+ "timeout": {+ "type": "integer",+ "description": "Backup job timeout in seconds (min: 60, max: 36000)",+ "default": 3600}},"type": "object"@@ -6108,8 +5805,26 @@}},"responses": {- "200": {- "description": "Database updated"+ "201": {+ "description": "Backup configuration created successfully",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string",+ "format": "uuid",+ "example": "550e8400-e29b-41d4-a716-446655440000"+ },+ "message": {+ "type": "string",+ "example": "Backup configuration created successfully."+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"@@ -6117,6 +5832,9 @@"400": {"$ref": "#\/components\/responses\/400"},+ "404": {+ "$ref": "#\/components\/responses\/404"+ },"422": {"$ref": "#\/components\/responses\/422"}@@ -6128,127 +5846,36 @@]}},- "\/databases\/keydb": {- "post": {+ "\/databases\/{uuid}": {+ "get": {"tags": ["Databases"],- "summary": "Create (KeyDB)",- "description": "Create a new KeyDB database.",- "operationId": "create-database-keydb",- "requestBody": {- "description": "Database data",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],- "properties": {- "server_uuid": {- "type": "string",- "description": "UUID of the server"- },- "project_uuid": {- "type": "string",- "description": "UUID of the project"- },- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "environment_uuid": {- "type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "destination_uuid": {- "type": "string",- "description": "UUID of the destination if the server has multiple destinations"- },- "keydb_password": {- "type": "string",- "description": "KeyDB password"- },- "keydb_conf": {- "type": "string",- "description": "KeyDB conf"- },- "name": {- "type": "string",- "description": "Name of the database"- },- "description": {- "type": "string",- "description": "Description of the database"- },- "image": {- "type": "string",- "description": "Docker Image of the database"- },- "is_public": {- "type": "boolean",- "description": "Is the database public?"- },- "public_port": {- "type": "integer",- "description": "Public port of the database"- },- "public_port_timeout": {- "type": "integer",- "description": "Public port timeout in seconds (default: 3600)"- },- "limits_memory": {- "type": "string",- "description": "Memory limit of the database"- },- "limits_memory_swap": {- "type": "string",- "description": "Memory swap limit of the database"- },- "limits_memory_swappiness": {- "type": "integer",- "description": "Memory swappiness of the database"- },- "limits_memory_reservation": {- "type": "string",- "description": "Memory reservation of the database"- },- "limits_cpus": {- "type": "string",- "description": "CPU limit of the database"- },- "limits_cpuset": {- "type": "string",- "description": "CPU set of the database"- },- "limits_cpu_shares": {- "type": "integer",- "description": "CPU shares of the database"- },- "instant_deploy": {- "type": "boolean",- "description": "Instant deploy the database"- },- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the database."- }- },- "type": "object"- }+ "summary": "Get",+ "description": "Get database by UUID.",+ "operationId": "get-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"}}- },+ ],"responses": {"200": {- "description": "Database updated"+ "description": "Get all databases",+ "content": {+ "application\/json": {+ "schema": {+ "type": "string"+ },+ "example": "Content is very complex. Will be implemented later."+ }+ }},"401": {"$ref": "#\/components\/responses\/401"@@ -6256,8 +5883,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "422": {- "$ref": "#\/components\/responses\/422"+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -6265,69 +5892,123 @@"bearerAuth": []}]- }- },- "\/databases\/mariadb": {- "post": {+ },+ "delete": {"tags": ["Databases"],- "summary": "Create (MariaDB)",- "description": "Create a new MariaDB database.",- "operationId": "create-database-mariadb",+ "summary": "Delete",+ "description": "Delete database by UUID.",+ "operationId": "delete-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "delete_configurations",+ "in": "query",+ "description": "Delete configurations.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true+ }+ },+ {+ "name": "delete_volumes",+ "in": "query",+ "description": "Delete volumes.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true+ }+ },+ {+ "name": "docker_cleanup",+ "in": "query",+ "description": "Run docker cleanup.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true+ }+ },+ {+ "name": "delete_connected_networks",+ "in": "query",+ "description": "Delete connected networks.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Database deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Database deleted."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Databases"+ ],+ "summary": "Update",+ "description": "Update database by UUID.",+ "operationId": "update-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {"description": "Database data","required": true,"content": {"application\/json": {"schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],"properties": {- "server_uuid": {- "type": "string",- "description": "UUID of the server"- },- "project_uuid": {- "type": "string",- "description": "UUID of the project"- },- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "environment_uuid": {- "type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."- },- "destination_uuid": {- "type": "string",- "description": "UUID of the destination if the server has multiple destinations"- },- "mariadb_conf": {- "type": "string",- "description": "MariaDB conf"- },- "mariadb_root_password": {- "type": "string",- "description": "MariaDB root password"- },- "mariadb_user": {- "type": "string",- "description": "MariaDB user"- },- "mariadb_password": {- "type": "string",- "description": "MariaDB password"- },- "mariadb_database": {- "type": "string",- "description": "MariaDB database"- },"name": {"type": "string","description": "Name of the database"@@ -6380,167 +6061,142 @@"type": "integer","description": "CPU shares of the database"},- "instant_deploy": {- "type": "boolean",- "description": "Instant deploy the database"- },- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the database."- }- },- "type": "object"- }- }- }- },- "responses": {- "200": {- "description": "Database updated"- },- "401": {- "$ref": "#\/components\/responses\/401"- },- "400": {- "$ref": "#\/components\/responses\/400"- },- "422": {- "$ref": "#\/components\/responses\/422"- }- },- "security": [- {- "bearerAuth": []- }- ]- }- },- "\/databases\/mysql": {- "post": {- "tags": [- "Databases"- ],- "summary": "Create (MySQL)",- "description": "Create a new MySQL database.",- "operationId": "create-database-mysql",- "requestBody": {- "description": "Database data",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],- "properties": {- "server_uuid": {+ "postgres_user": {"type": "string",- "description": "UUID of the server"+ "description": "PostgreSQL user"},- "project_uuid": {+ "postgres_password": {"type": "string",- "description": "UUID of the project"+ "description": "PostgreSQL password"},- "environment_name": {+ "postgres_db": {"type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ "description": "PostgreSQL database"},- "environment_uuid": {+ "postgres_initdb_args": {"type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ "description": "PostgreSQL initdb args"},- "destination_uuid": {+ "postgres_host_auth_method": {"type": "string",- "description": "UUID of the destination if the server has multiple destinations"+ "description": "PostgreSQL host auth method"},- "mysql_root_password": {+ "postgres_conf": {"type": "string",- "description": "MySQL root password"+ "description": "PostgreSQL conf"},- "mysql_password": {+ "clickhouse_admin_user": {"type": "string",- "description": "MySQL password"+ "description": "Clickhouse admin user"},- "mysql_user": {+ "clickhouse_admin_password": {"type": "string",- "description": "MySQL user"+ "description": "Clickhouse admin password"},- "mysql_database": {+ "dragonfly_password": {"type": "string",- "description": "MySQL database"+ "description": "DragonFly password"},- "mysql_conf": {+ "redis_password": {"type": "string",- "description": "MySQL conf"+ "description": "Redis password"},- "name": {+ "redis_conf": {"type": "string",- "description": "Name of the database"+ "description": "Redis conf"},- "description": {+ "keydb_password": {"type": "string",- "description": "Description of the database"+ "description": "KeyDB password"},- "image": {+ "keydb_conf": {"type": "string",- "description": "Docker Image of the database"+ "description": "KeyDB conf"},- "is_public": {- "type": "boolean",- "description": "Is the database public?"+ "mariadb_conf": {+ "type": "string",+ "description": "MariaDB conf"},- "public_port": {- "type": "integer",- "description": "Public port of the database"+ "mariadb_root_password": {+ "type": "string",+ "description": "MariaDB root password"},- "public_port_timeout": {- "type": "integer",- "description": "Public port timeout in seconds (default: 3600)"+ "mariadb_user": {+ "type": "string",+ "description": "MariaDB user"},- "limits_memory": {+ "mariadb_password": {"type": "string",- "description": "Memory limit of the database"+ "description": "MariaDB password"},- "limits_memory_swap": {+ "mariadb_database": {"type": "string",- "description": "Memory swap limit of the database"+ "description": "MariaDB database"},- "limits_memory_swappiness": {- "type": "integer",- "description": "Memory swappiness of the database"+ "mongo_conf": {+ "type": "string",+ "description": "Mongo conf"},- "limits_memory_reservation": {+ "mongo_initdb_root_username": {"type": "string",- "description": "Memory reservation of the database"+ "description": "Mongo initdb root username"},- "limits_cpus": {+ "mongo_initdb_root_password": {"type": "string",- "description": "CPU limit of the database"+ "description": "Mongo initdb root password"},- "limits_cpuset": {+ "mongo_initdb_database": {"type": "string",- "description": "CPU set of the database"+ "description": "Mongo initdb init database"},- "limits_cpu_shares": {- "type": "integer",- "description": "CPU shares of the database"+ "mysql_root_password": {+ "type": "string",+ "description": "MySQL root password"},- "instant_deploy": {+ "mysql_password": {+ "type": "string",+ "description": "MySQL password"+ },+ "mysql_user": {+ "type": "string",+ "description": "MySQL user"+ },+ "mysql_database": {+ "type": "string",+ "description": "MySQL database"+ },+ "mysql_conf": {+ "type": "string",+ "description": "MySQL conf"+ },+ "health_check_enabled": {"type": "boolean",- "description": "Instant deploy the database"+ "description": "Enable the database healthcheck probe.",+ "default": true},- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the database."+ "health_check_interval": {+ "type": "integer",+ "description": "Healthcheck interval in seconds.",+ "minimum": 1,+ "default": 15+ },+ "health_check_timeout": {+ "type": "integer",+ "description": "Healthcheck timeout in seconds.",+ "minimum": 1,+ "default": 5+ },+ "health_check_retries": {+ "type": "integer",+ "description": "Healthcheck retries count.",+ "minimum": 1,+ "default": 5+ },+ "health_check_start_period": {+ "type": "integer",+ "description": "Healthcheck start period in seconds.",+ "minimum": 0,+ "default": 5}},"type": "object"@@ -6558,6 +6214,9 @@"400": {"$ref": "#\/components\/responses\/400"},+ "404": {+ "$ref": "#\/components\/responses\/404"+ },"422": {"$ref": "#\/components\/responses\/422"}@@ -6569,54 +6228,269 @@]}},- "\/databases\/mongodb": {- "post": {+ "\/databases\/{uuid}\/backups\/{scheduled_backup_uuid}": {+ "delete": {"tags": ["Databases"],- "summary": "Create (MongoDB)",- "description": "Create a new MongoDB database.",- "operationId": "create-database-mongodb",+ "summary": "Delete backup configuration",+ "description": "Deletes a backup configuration and all its executions.",+ "operationId": "delete-backup-configuration-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "scheduled_backup_uuid",+ "in": "path",+ "description": "UUID of the backup configuration to delete",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "delete_s3",+ "in": "query",+ "description": "Whether to delete all backup files from S3",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Backup configuration deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Backup configuration and all executions deleted."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "404": {+ "description": "Backup configuration not found.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Backup configuration not found."+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Databases"+ ],+ "summary": "Update",+ "description": "Update a specific backup configuration for a given database, identified by its UUID and the backup ID",+ "operationId": "update-database-backup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "scheduled_backup_uuid",+ "in": "path",+ "description": "UUID of the backup configuration.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {- "description": "Database data",+ "description": "Database backup configuration data","required": true,"content": {"application\/json": {"schema": {- "required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"- ],"properties": {- "server_uuid": {- "type": "string",- "description": "UUID of the server"+ "save_s3": {+ "type": "boolean",+ "description": "Whether data is saved in s3 or not"},- "project_uuid": {+ "s3_storage_uuid": {"type": "string",- "description": "UUID of the project"+ "description": "S3 storage UUID"},- "environment_name": {- "type": "string",- "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ "backup_now": {+ "type": "boolean",+ "description": "Whether to take a backup now or not"},- "environment_uuid": {- "type": "string",- "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ "enabled": {+ "type": "boolean",+ "description": "Whether the backup is enabled or not"},- "destination_uuid": {+ "databases_to_backup": {"type": "string",- "description": "UUID of the destination if the server has multiple destinations"+ "description": "Comma separated list of databases to backup"},- "mongo_conf": {- "type": "string",- "description": "MongoDB conf"+ "dump_all": {+ "type": "boolean",+ "description": "Whether all databases are dumped or not"},- "mongo_initdb_root_username": {+ "frequency": {"type": "string",- "description": "MongoDB initdb root username"+ "description": "Frequency of the backup"+ },+ "database_backup_retention_amount_locally": {+ "type": "integer",+ "description": "Retention amount of the backup locally"+ },+ "database_backup_retention_days_locally": {+ "type": "integer",+ "description": "Retention days of the backup locally"+ },+ "database_backup_retention_max_storage_locally": {+ "type": "number",+ "description": "Max storage of the backup locally"+ },+ "database_backup_retention_amount_s3": {+ "type": "integer",+ "description": "Retention amount of the backup in s3"+ },+ "database_backup_retention_days_s3": {+ "type": "integer",+ "description": "Retention days of the backup in s3"+ },+ "database_backup_retention_max_storage_s3": {+ "type": "number",+ "description": "Max storage of the backup in S3"+ },+ "timeout": {+ "type": "integer",+ "description": "Backup job timeout in seconds (min: 60, max: 36000)",+ "default": 3600+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database backup configuration updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/postgresql": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (PostgreSQL)",+ "description": "Create a new PostgreSQL database.",+ "operationId": "create-database-postgresql",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "postgres_user": {+ "type": "string",+ "description": "PostgreSQL user"+ },+ "postgres_password": {+ "type": "string",+ "description": "PostgreSQL password"+ },+ "postgres_db": {+ "type": "string",+ "description": "PostgreSQL database"+ },+ "postgres_initdb_args": {+ "type": "string",+ "description": "PostgreSQL initdb args"+ },+ "postgres_host_auth_method": {+ "type": "string",+ "description": "PostgreSQL host auth method"+ },+ "postgres_conf": {+ "type": "string",+ "description": "PostgreSQL conf"+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"},"name": {"type": "string",@@ -6694,11 +6568,4541 @@"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },- "422": {- "$ref": "#\/components\/responses\/422"+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/clickhouse": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (Clickhouse)",+ "description": "Create a new Clickhouse database.",+ "operationId": "create-database-clickhouse",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "clickhouse_admin_user": {+ "type": "string",+ "description": "Clickhouse admin user"+ },+ "clickhouse_admin_password": {+ "type": "string",+ "description": "Clickhouse admin password"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/dragonfly": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (DragonFly)",+ "description": "Create a new DragonFly database.",+ "operationId": "create-database-dragonfly",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "dragonfly_password": {+ "type": "string",+ "description": "DragonFly password"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/redis": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (Redis)",+ "description": "Create a new Redis database.",+ "operationId": "create-database-redis",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "redis_password": {+ "type": "string",+ "description": "Redis password"+ },+ "redis_conf": {+ "type": "string",+ "description": "Redis conf"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/keydb": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (KeyDB)",+ "description": "Create a new KeyDB database.",+ "operationId": "create-database-keydb",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "keydb_password": {+ "type": "string",+ "description": "KeyDB password"+ },+ "keydb_conf": {+ "type": "string",+ "description": "KeyDB conf"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/mariadb": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (MariaDB)",+ "description": "Create a new MariaDB database.",+ "operationId": "create-database-mariadb",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "mariadb_conf": {+ "type": "string",+ "description": "MariaDB conf"+ },+ "mariadb_root_password": {+ "type": "string",+ "description": "MariaDB root password"+ },+ "mariadb_user": {+ "type": "string",+ "description": "MariaDB user"+ },+ "mariadb_password": {+ "type": "string",+ "description": "MariaDB password"+ },+ "mariadb_database": {+ "type": "string",+ "description": "MariaDB database"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/mysql": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (MySQL)",+ "description": "Create a new MySQL database.",+ "operationId": "create-database-mysql",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "mysql_root_password": {+ "type": "string",+ "description": "MySQL root password"+ },+ "mysql_password": {+ "type": "string",+ "description": "MySQL password"+ },+ "mysql_user": {+ "type": "string",+ "description": "MySQL user"+ },+ "mysql_database": {+ "type": "string",+ "description": "MySQL database"+ },+ "mysql_conf": {+ "type": "string",+ "description": "MySQL conf"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/mongodb": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create (MongoDB)",+ "description": "Create a new MongoDB database.",+ "operationId": "create-database-mongodb",+ "requestBody": {+ "description": "Database data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],+ "properties": {+ "server_uuid": {+ "type": "string",+ "description": "UUID of the server"+ },+ "project_uuid": {+ "type": "string",+ "description": "UUID of the project"+ },+ "environment_name": {+ "type": "string",+ "description": "Name of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the environment. You need to provide at least one of environment_name or environment_uuid."+ },+ "destination_uuid": {+ "type": "string",+ "description": "UUID of the destination if the server has multiple destinations"+ },+ "mongo_conf": {+ "type": "string",+ "description": "MongoDB conf"+ },+ "mongo_initdb_root_username": {+ "type": "string",+ "description": "MongoDB initdb root username"+ },+ "name": {+ "type": "string",+ "description": "Name of the database"+ },+ "description": {+ "type": "string",+ "description": "Description of the database"+ },+ "image": {+ "type": "string",+ "description": "Docker Image of the database"+ },+ "is_public": {+ "type": "boolean",+ "description": "Is the database public?"+ },+ "public_port": {+ "type": "integer",+ "description": "Public port of the database"+ },+ "public_port_timeout": {+ "type": "integer",+ "description": "Public port timeout in seconds (default: 3600)"+ },+ "limits_memory": {+ "type": "string",+ "description": "Memory limit of the database"+ },+ "limits_memory_swap": {+ "type": "string",+ "description": "Memory swap limit of the database"+ },+ "limits_memory_swappiness": {+ "type": "integer",+ "description": "Memory swappiness of the database"+ },+ "limits_memory_reservation": {+ "type": "string",+ "description": "Memory reservation of the database"+ },+ "limits_cpus": {+ "type": "string",+ "description": "CPU limit of the database"+ },+ "limits_cpuset": {+ "type": "string",+ "description": "CPU set of the database"+ },+ "limits_cpu_shares": {+ "type": "integer",+ "description": "CPU shares of the database"+ },+ "instant_deploy": {+ "type": "boolean",+ "description": "Instant deploy the database"+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the database."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database updated"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/logs": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "Get database logs.",+ "description": "Get database logs by UUID.",+ "operationId": "get-database-logs-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string",+ "format": "uuid"+ }+ },+ {+ "name": "lines",+ "in": "query",+ "description": "Number of lines to show from the end of the logs.",+ "required": false,+ "schema": {+ "type": "integer",+ "format": "int32",+ "default": 100+ }+ },+ {+ "name": "show_timestamps",+ "in": "query",+ "description": "Show timestamps in the logs.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Get database logs by UUID.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "logs": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/backups\/{scheduled_backup_uuid}\/executions\/{execution_uuid}": {+ "delete": {+ "tags": [+ "Databases"+ ],+ "summary": "Delete backup execution",+ "description": "Deletes a specific backup execution.",+ "operationId": "delete-backup-execution-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "scheduled_backup_uuid",+ "in": "path",+ "description": "UUID of the backup configuration",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "execution_uuid",+ "in": "path",+ "description": "UUID of the backup execution to delete",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "delete_s3",+ "in": "query",+ "description": "Whether to delete the backup from S3",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Backup execution deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Backup execution deleted."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "404": {+ "description": "Backup execution not found.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Backup execution not found."+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/backups\/{scheduled_backup_uuid}\/executions": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "List backup executions",+ "description": "Get all executions for a specific backup configuration.",+ "operationId": "list-backup-executions",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "scheduled_backup_uuid",+ "in": "path",+ "description": "UUID of the backup configuration",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of backup executions",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "executions": {+ "type": "array",+ "items": {+ "properties": {+ "uuid": {+ "type": "string"+ },+ "filename": {+ "type": "string"+ },+ "size": {+ "type": "integer"+ },+ "created_at": {+ "type": "string"+ },+ "message": {+ "type": "string"+ },+ "status": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },+ "404": {+ "description": "Backup configuration not found."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/move": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Move",+ "description": "Move database to another project\/environment. This is a purely organizational change \u2014 running containers are not affected. Note: after moving, the database will pick up shared environment variables from the new environment on the next deployment.",+ "operationId": "move-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "description": "Target environment to move the database to.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "environment_uuid"+ ],+ "properties": {+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the target environment."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Database moved successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Database moved successfully."+ },+ "uuid": {+ "type": "string"+ },+ "project_uuid": {+ "type": "string"+ },+ "environment_uuid": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/start": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Start",+ "description": "Start database.",+ "operationId": "start-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Start database.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Database starting request queued."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/stop": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Stop",+ "description": "Stop database.",+ "operationId": "stop-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "docker_cleanup",+ "in": "query",+ "description": "Perform docker cleanup (prune networks, volumes, etc.).",+ "schema": {+ "type": "boolean",+ "default": true+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Stop database.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Database stopping request queued."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/restart": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Restart",+ "description": "Restart database.",+ "operationId": "restart-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Restart database.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Database restaring request queued."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/envs": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "List Envs",+ "description": "List all envs by database UUID.",+ "operationId": "list-envs-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Environment variables.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/EnvironmentVariable"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create Env",+ "description": "Create env by database UUID.",+ "operationId": "create-env-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "description": "Env created.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "key": {+ "type": "string",+ "description": "The key of the environment variable."+ },+ "value": {+ "type": "string",+ "description": "The value of the environment variable."+ },+ "is_literal": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is a literal, nothing espaced."+ },+ "is_multiline": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is multiline."+ },+ "is_shown_once": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable's value is shown on the UI."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Environment variable created.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string",+ "example": "nc0k04gk8g0cgsk440g0koko"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Databases"+ ],+ "summary": "Update Env",+ "description": "Update env by database UUID.",+ "operationId": "update-env-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "description": "Env updated.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "key",+ "value"+ ],+ "properties": {+ "key": {+ "type": "string",+ "description": "The key of the environment variable."+ },+ "value": {+ "type": "string",+ "description": "The value of the environment variable."+ },+ "is_literal": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is a literal, nothing espaced."+ },+ "is_multiline": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is multiline."+ },+ "is_shown_once": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable's value is shown on the UI."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Environment variable updated.",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/EnvironmentVariable"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/envs\/bulk": {+ "patch": {+ "tags": [+ "Databases"+ ],+ "summary": "Update Envs (Bulk)",+ "description": "Update multiple envs by database UUID.",+ "operationId": "update-envs-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "description": "Bulk envs updated.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "data"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "properties": {+ "key": {+ "type": "string",+ "description": "The key of the environment variable."+ },+ "value": {+ "type": "string",+ "description": "The value of the environment variable."+ },+ "is_literal": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is a literal, nothing espaced."+ },+ "is_multiline": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is multiline."+ },+ "is_shown_once": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable's value is shown on the UI."+ }+ },+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Environment variables updated.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/EnvironmentVariable"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/envs\/{env_uuid}": {+ "delete": {+ "tags": [+ "Databases"+ ],+ "summary": "Delete Env",+ "description": "Delete env by UUID.",+ "operationId": "delete-env-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "env_uuid",+ "in": "path",+ "description": "UUID of the environment variable.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Environment variable deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Environment variable deleted."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/storages": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "List Storages",+ "description": "List all persistent storages and file storages by database UUID.",+ "operationId": "list-storages-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "All storages by database UUID.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "persistent_storages": {+ "type": "array",+ "items": {+ "type": "object"+ }+ },+ "file_storages": {+ "type": "array",+ "items": {+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create Storage",+ "description": "Create a persistent storage or file storage for a database.",+ "operationId": "create-storage-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "type",+ "mount_path"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "persistent",+ "file"+ ],+ "description": "The type of storage."+ },+ "name": {+ "type": "string",+ "description": "Volume name (persistent only, required for persistent)."+ },+ "mount_path": {+ "type": "string",+ "description": "The container mount path."+ },+ "host_path": {+ "type": "string",+ "nullable": true,+ "description": "The host path (persistent only, optional)."+ },+ "content": {+ "type": "string",+ "nullable": true,+ "description": "File content (file only, optional)."+ },+ "is_directory": {+ "type": "boolean",+ "description": "Whether this is a directory mount (file only, default false)."+ },+ "fs_path": {+ "type": "string",+ "description": "Host directory path (required when is_directory is true)."+ }+ },+ "type": "object",+ "additionalProperties": false+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Storage created.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Databases"+ ],+ "summary": "Update Storage",+ "description": "Update a persistent storage or file storage by database UUID.",+ "operationId": "update-storage-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "description": "Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "type"+ ],+ "properties": {+ "uuid": {+ "type": "string",+ "description": "The UUID of the storage (preferred)."+ },+ "id": {+ "type": "integer",+ "description": "The ID of the storage (deprecated, use uuid instead)."+ },+ "type": {+ "type": "string",+ "enum": [+ "persistent",+ "file"+ ],+ "description": "The type of storage: persistent or file."+ },+ "is_preview_suffix_enabled": {+ "type": "boolean",+ "description": "Whether to add -pr-N suffix for preview deployments."+ },+ "name": {+ "type": "string",+ "description": "The volume name (persistent only, not allowed for read-only storages)."+ },+ "mount_path": {+ "type": "string",+ "description": "The container mount path (not allowed for read-only storages)."+ },+ "host_path": {+ "type": "string",+ "nullable": true,+ "description": "The host path (persistent only, not allowed for read-only storages)."+ },+ "content": {+ "type": "string",+ "nullable": true,+ "description": "The file content (file only, not allowed for read-only storages)."+ }+ },+ "type": "object",+ "additionalProperties": false+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Storage updated.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/storages\/{storage_uuid}": {+ "delete": {+ "tags": [+ "Databases"+ ],+ "summary": "Delete Storage",+ "description": "Delete a persistent storage or file storage by database UUID.",+ "operationId": "delete-storage-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "storage_uuid",+ "in": "path",+ "description": "UUID of the storage.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Storage deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/tags": {+ "get": {+ "tags": [+ "Databases"+ ],+ "summary": "List Tags",+ "description": "List tags for a database by UUID.",+ "operationId": "list-tags-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of tags.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Tag"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Create Tag",+ "description": "Add tag(s) to a database by UUID.",+ "operationId": "create-tag-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "tag_name": {+ "type": "string",+ "description": "The tag name (min 2 characters). Required if tag_names is not provided."+ },+ "tag_names": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Array of tag names (each min 2 characters). Required if tag_name is not provided."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Tags added successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Tag"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/tags\/{tag_uuid}": {+ "delete": {+ "tags": [+ "Databases"+ ],+ "summary": "Delete Tag",+ "description": "Remove a tag from a database by UUID.",+ "operationId": "delete-tag-by-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "tag_uuid",+ "in": "path",+ "description": "UUID of the tag.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Tag removed."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/clone": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Clone",+ "description": "Clone a database to a destination owned by the authenticated team.",+ "operationId": "clone-database-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the database.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "destination_uuid"+ ],+ "properties": {+ "destination_uuid": {+ "type": "string"+ },+ "name": {+ "type": [+ "string",+ "null"+ ]+ },+ "clone_volumes": {+ "type": "boolean",+ "default": false+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Database cloned."+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/deployments": {+ "get": {+ "tags": [+ "Deployments"+ ],+ "summary": "List",+ "description": "List currently running deployments",+ "operationId": "list-deployments",+ "responses": {+ "200": {+ "description": "Get all currently running deployments.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/ApplicationDeploymentQueue"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/deployments\/{uuid}": {+ "get": {+ "tags": [+ "Deployments"+ ],+ "summary": "Get",+ "description": "Get deployment by UUID.",+ "operationId": "get-deployment-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Deployment UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Get deployment by UUID.",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/ApplicationDeploymentQueue"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/deployments\/{uuid}\/cancel": {+ "post": {+ "tags": [+ "Deployments"+ ],+ "summary": "Cancel",+ "description": "Cancel a deployment by UUID.",+ "operationId": "cancel-deployment-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Deployment UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Deployment cancelled successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Deployment cancelled successfully."+ },+ "deployment_uuid": {+ "type": "string",+ "example": "cm37r6cqj000008jm0veg5tkm"+ },+ "status": {+ "type": "string",+ "example": "cancelled-by-user"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "400": {+ "description": "Deployment cannot be cancelled (already finished\/failed\/cancelled).",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Deployment cannot be cancelled. Current status: finished"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "403": {+ "description": "User doesn't have permission to cancel this deployment.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "You do not have permission to cancel this deployment."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/deploy": {+ "post": {+ "tags": [+ "Deployments"+ ],+ "summary": "Deploy",+ "description": "Deploy by tag or UUID using query parameters or a JSON body.",+ "operationId": "deploy-by-tag-or-uuid",+ "parameters": [+ {+ "name": "tag",+ "in": "query",+ "description": "Tag name(s). Comma separated list is also accepted.",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "uuid",+ "in": "query",+ "description": "Resource UUID(s). Comma separated list is also accepted.",+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "force",+ "in": "query",+ "description": "Force rebuild (without cache)",+ "schema": {+ "type": "boolean"+ }+ },+ {+ "name": "pr",+ "in": "query",+ "description": "Pull Request Id for deploying specific PR builds. Cannot be used with tag parameter.",+ "schema": {+ "type": "integer"+ }+ },+ {+ "name": "pull_request_id",+ "in": "query",+ "description": "Preview deployment identifier. Alias of pr.",+ "schema": {+ "type": "integer"+ }+ },+ {+ "name": "docker_tag",+ "in": "query",+ "description": "Docker image tag for Docker Image preview deployments. Requires pull_request_id.",+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Get deployment(s) UUID's",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "deployments": {+ "type": "array",+ "items": {+ "properties": {+ "message": {+ "type": "string"+ },+ "resource_uuid": {+ "type": "string"+ },+ "deployment_uuid": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/deployments\/applications\/{uuid}": {+ "get": {+ "tags": [+ "Deployments"+ ],+ "summary": "List application deployments",+ "description": "List application deployments by using the app uuid",+ "operationId": "list-deployments-by-app-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "skip",+ "in": "query",+ "description": "Number of records to skip.",+ "required": false,+ "schema": {+ "type": "integer",+ "default": 0,+ "minimum": 0+ }+ },+ {+ "name": "take",+ "in": "query",+ "description": "Number of records to take.",+ "required": false,+ "schema": {+ "type": "integer",+ "default": 10,+ "minimum": 1+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List application deployments by using the app uuid.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Application"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/destinations": {+ "get": {+ "tags": [+ "Destinations"+ ],+ "summary": "List destinations",+ "description": "List all Docker network destinations for the authenticated team.",+ "operationId": "list-destinations",+ "responses": {+ "200": {+ "description": "Destinations for the authenticated team.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Destination"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/servers\/{server_uuid}\/destinations": {+ "get": {+ "tags": [+ "Destinations"+ ],+ "summary": "List destinations by server",+ "description": "List Docker network destinations attached to a server owned by the authenticated team.",+ "operationId": "list-server-destinations",+ "parameters": [+ {+ "name": "server_uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Destinations attached to the server.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Destination"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "post": {+ "tags": [+ "Destinations"+ ],+ "summary": "Create destination",+ "description": "Create a Docker network destination on a server owned by the authenticated team.",+ "operationId": "create-server-destination",+ "parameters": [+ {+ "name": "server_uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "network"+ ],+ "properties": {+ "name": {+ "type": "string",+ "maxLength": 255+ },+ "network": {+ "type": "string",+ "maxLength": 255,+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"+ },+ "type": {+ "type": "string",+ "enum": [+ "standalone",+ "swarm"+ ]+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "Destination created.",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/Destination"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "409": {+ "description": "A destination with this network already exists."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/destinations\/{uuid}": {+ "get": {+ "tags": [+ "Destinations"+ ],+ "summary": "Get destination",+ "description": "Get a Docker network destination by UUID.",+ "operationId": "get-destination-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Destination UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Destination details.",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/Destination"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "delete": {+ "tags": [+ "Destinations"+ ],+ "summary": "Delete destination",+ "description": "Delete an unused Docker network destination.",+ "operationId": "delete-destination-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Destination UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Destination deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Deleted."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "409": {+ "description": "Destination has attached resources."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Destinations"+ ],+ "summary": "Update destination",+ "description": "Update a Docker network destination name. Network cannot be changed via the API.",+ "operationId": "update-destination-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Destination UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "maxLength": 255+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Destination updated.",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/Destination"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/digitalocean\/regions": {+ "get": {+ "tags": [+ "DigitalOcean"+ ],+ "summary": "Get DigitalOcean regions",+ "operationId": "get-digitalocean-regions",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of DigitalOcean regions."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "description": "Validation failed."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/digitalocean\/sizes": {+ "get": {+ "tags": [+ "DigitalOcean"+ ],+ "summary": "Get DigitalOcean sizes",+ "operationId": "get-digitalocean-sizes",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of DigitalOcean sizes."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "description": "Validation failed."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/digitalocean\/images": {+ "get": {+ "tags": [+ "DigitalOcean"+ ],+ "summary": "Get DigitalOcean images",+ "operationId": "get-digitalocean-images",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of DigitalOcean images."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "description": "Validation failed."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/digitalocean\/ssh-keys": {+ "get": {+ "tags": [+ "DigitalOcean"+ ],+ "summary": "Get DigitalOcean SSH keys",+ "operationId": "get-digitalocean-ssh-keys",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of DigitalOcean SSH keys."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "description": "Validation failed."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/servers\/digitalocean": {+ "post": {+ "tags": [+ "DigitalOcean"+ ],+ "summary": "Create a server on DigitalOcean",+ "operationId": "create-digitalocean-server",+ "responses": {+ "201": {+ "description": "DigitalOcean droplet created and linked to a Coolify server."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "description": "Validation failed."+ },+ "429": {+ "description": "DigitalOcean rate limit exceeded."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/github-apps": {+ "get": {+ "tags": [+ "GitHub Apps"+ ],+ "summary": "List",+ "description": "List all GitHub apps.",+ "operationId": "list-github-apps",+ "responses": {+ "200": {+ "description": "List of GitHub apps.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "organization": {+ "type": "string",+ "nullable": true+ },+ "api_url": {+ "type": "string"+ },+ "html_url": {+ "type": "string"+ },+ "custom_user": {+ "type": "string"+ },+ "custom_port": {+ "type": "integer"+ },+ "app_id": {+ "type": "integer"+ },+ "installation_id": {+ "type": "integer"+ },+ "client_id": {+ "type": "string"+ },+ "private_key_id": {+ "type": "integer"+ },+ "is_system_wide": {+ "type": "boolean"+ },+ "is_public": {+ "type": "boolean"+ },+ "team_id": {+ "type": "integer"+ },+ "type": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "post": {+ "tags": [+ "GitHub Apps"+ ],+ "summary": "Create GitHub App",+ "description": "Create a new GitHub app.",+ "operationId": "create-github-app",+ "requestBody": {+ "description": "GitHub app creation payload.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "name",+ "html_url",+ "app_id",+ "installation_id",+ "client_id",+ "client_secret",+ "private_key_uuid"+ ],+ "properties": {+ "name": {+ "type": "string",+ "description": "Name of the GitHub app."+ },+ "organization": {+ "type": "string",+ "nullable": true,+ "description": "Organization to associate the app with."+ },+ "api_url": {+ "type": "string",+ "description": "API URL for the GitHub app (e.g., https:\/\/api.github.com)."+ },+ "html_url": {+ "type": "string",+ "description": "HTML URL for the GitHub app (e.g., https:\/\/github.com)."+ },+ "custom_user": {+ "type": "string",+ "description": "Custom user for SSH access (default: git)."+ },+ "custom_port": {+ "type": "integer",+ "description": "Custom port for SSH access (default: 22)."+ },+ "app_id": {+ "type": "integer",+ "description": "GitHub App ID from GitHub."+ },+ "installation_id": {+ "type": "integer",+ "description": "GitHub Installation ID."+ },+ "client_id": {+ "type": "string",+ "description": "GitHub OAuth App Client ID."+ },+ "client_secret": {+ "type": "string",+ "description": "GitHub OAuth App Client Secret."+ },+ "webhook_secret": {+ "type": "string",+ "description": "Webhook secret for GitHub webhooks."+ },+ "private_key_uuid": {+ "type": "string",+ "description": "UUID of an existing private key for GitHub App authentication."+ },+ "is_system_wide": {+ "type": "boolean",+ "description": "Is this app system-wide (cloud only)."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "GitHub app created successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "organization": {+ "type": "string",+ "nullable": true+ },+ "api_url": {+ "type": "string"+ },+ "html_url": {+ "type": "string"+ },+ "custom_user": {+ "type": "string"+ },+ "custom_port": {+ "type": "integer"+ },+ "app_id": {+ "type": "integer"+ },+ "installation_id": {+ "type": "integer"+ },+ "client_id": {+ "type": "string"+ },+ "private_key_id": {+ "type": "integer"+ },+ "is_system_wide": {+ "type": "boolean"+ },+ "team_id": {+ "type": "integer"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/github-apps\/{github_app_id}\/repositories": {+ "get": {+ "tags": [+ "GitHub Apps"+ ],+ "summary": "Load Repositories for a GitHub App",+ "description": "Fetch repositories from GitHub for a given GitHub app.",+ "operationId": "load-repositories",+ "parameters": [+ {+ "name": "github_app_id",+ "in": "path",+ "description": "GitHub App ID",+ "required": true,+ "schema": {+ "type": "integer"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Repositories loaded successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "repositories": {+ "type": "array",+ "items": {+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/github-apps\/{github_app_id}\/repositories\/{owner}\/{repo}\/branches": {+ "get": {+ "tags": [+ "GitHub Apps"+ ],+ "summary": "Load Branches for a GitHub Repository",+ "description": "Fetch branches from GitHub for a given repository.",+ "operationId": "load-branches",+ "parameters": [+ {+ "name": "github_app_id",+ "in": "path",+ "description": "GitHub App ID",+ "required": true,+ "schema": {+ "type": "integer"+ }+ },+ {+ "name": "owner",+ "in": "path",+ "description": "Repository owner",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "repo",+ "in": "path",+ "description": "Repository name",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Branches loaded successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "branches": {+ "type": "array",+ "items": {+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/github-apps\/{github_app_id}": {+ "delete": {+ "tags": [+ "GitHub Apps"+ ],+ "summary": "Delete GitHub App",+ "description": "Delete a GitHub app if it's not being used by any applications.",+ "operationId": "deleteGithubApp",+ "parameters": [+ {+ "name": "github_app_id",+ "in": "path",+ "description": "GitHub App ID",+ "required": true,+ "schema": {+ "type": "integer"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "GitHub app deleted successfully",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "GitHub app deleted successfully"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "description": "Unauthorized"+ },+ "404": {+ "description": "GitHub app not found"+ },+ "409": {+ "description": "Conflict - GitHub app is in use",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "This GitHub app is being used by 5 application(s). Please delete all applications first."+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "GitHub Apps"+ ],+ "summary": "Update GitHub App",+ "description": "Update an existing GitHub app.",+ "operationId": "updateGithubApp",+ "parameters": [+ {+ "name": "github_app_id",+ "in": "path",+ "description": "GitHub App ID",+ "required": true,+ "schema": {+ "type": "integer"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "GitHub App name"+ },+ "organization": {+ "type": "string",+ "nullable": true,+ "description": "GitHub organization"+ },+ "api_url": {+ "type": "string",+ "description": "GitHub API URL"+ },+ "html_url": {+ "type": "string",+ "description": "GitHub HTML URL"+ },+ "custom_user": {+ "type": "string",+ "description": "Custom user for SSH"+ },+ "custom_port": {+ "type": "integer",+ "description": "Custom port for SSH"+ },+ "app_id": {+ "type": "integer",+ "description": "GitHub App ID"+ },+ "installation_id": {+ "type": "integer",+ "description": "GitHub Installation ID"+ },+ "client_id": {+ "type": "string",+ "description": "GitHub Client ID"+ },+ "client_secret": {+ "type": "string",+ "description": "GitHub Client Secret"+ },+ "webhook_secret": {+ "type": "string",+ "description": "GitHub Webhook Secret"+ },+ "private_key_uuid": {+ "type": "string",+ "description": "Private key UUID"+ },+ "is_system_wide": {+ "type": "boolean",+ "description": "Is system wide (non-cloud instances only)"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "GitHub app updated successfully",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "GitHub app updated successfully"+ },+ "data": {+ "type": "object",+ "description": "Updated GitHub app data"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "description": "Unauthorized"+ },+ "404": {+ "description": "GitHub app not found"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/gitlab-apps": {+ "get": {+ "tags": [+ "GitLab Apps"+ ],+ "summary": "List",+ "description": "List all GitLab apps for the current team (and system-wide sources).",+ "operationId": "list-gitlab-apps",+ "responses": {+ "200": {+ "description": "List of GitLab apps.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "api_url": {+ "type": "string"+ },+ "html_url": {+ "type": "string"+ },+ "custom_user": {+ "type": "string"+ },+ "custom_port": {+ "type": "integer"+ },+ "client_id": {+ "type": "string",+ "nullable": true+ },+ "group_name": {+ "type": "string",+ "nullable": true+ },+ "redirect_uri": {+ "type": "string",+ "nullable": true+ },+ "is_system_wide": {+ "type": "boolean"+ },+ "is_public": {+ "type": "boolean"+ },+ "team_id": {+ "type": "integer"+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "post": {+ "tags": [+ "GitLab Apps"+ ],+ "summary": "Create GitLab App",+ "description": "Create a new GitLab app (OAuth source). Credentials may be supplied later via the UI or update endpoint.",+ "operationId": "create-gitlab-app",+ "requestBody": {+ "description": "GitLab app creation payload.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "name",+ "html_url"+ ],+ "properties": {+ "name": {+ "type": "string",+ "description": "Name of the GitLab app."+ },+ "html_url": {+ "type": "string",+ "description": "GitLab instance URL (e.g., https:\/\/gitlab.com)."+ },+ "api_url": {+ "type": "string",+ "description": "GitLab API URL (defaults to {html_url}\/api\/v4)."+ },+ "custom_user": {+ "type": "string",+ "description": "Custom user for SSH access (default: git)."+ },+ "custom_port": {+ "type": "integer",+ "description": "Custom port for SSH access (default: 22)."+ },+ "group_name": {+ "type": "string",+ "nullable": true,+ "description": "Optional comma-separated group names to filter repositories."+ },+ "client_id": {+ "type": "string",+ "nullable": true,+ "description": "GitLab OAuth Application ID."+ },+ "client_secret": {+ "type": "string",+ "nullable": true,+ "description": "GitLab OAuth Application Secret."+ },+ "webhook_token": {+ "type": "string",+ "nullable": true,+ "description": "Webhook secret token (auto-generated when omitted)."+ },+ "redirect_uri": {+ "type": "string",+ "nullable": true,+ "description": "OAuth redirect URI registered in GitLab."+ },+ "is_system_wide": {+ "type": "boolean",+ "description": "Is this app system-wide (non-cloud instances only)."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "GitLab app created successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "api_url": {+ "type": "string"+ },+ "html_url": {+ "type": "string"+ },+ "custom_user": {+ "type": "string"+ },+ "custom_port": {+ "type": "integer"+ },+ "client_id": {+ "type": "string",+ "nullable": true+ },+ "group_name": {+ "type": "string",+ "nullable": true+ },+ "redirect_uri": {+ "type": "string",+ "nullable": true+ },+ "is_system_wide": {+ "type": "boolean"+ },+ "team_id": {+ "type": "integer"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/gitlab-apps\/{gitlab_app_id}": {+ "delete": {+ "tags": [+ "GitLab Apps"+ ],+ "summary": "Delete GitLab App",+ "description": "Delete a GitLab app if it is not being used by any applications.",+ "operationId": "deleteGitlabApp",+ "parameters": [+ {+ "name": "gitlab_app_id",+ "in": "path",+ "description": "GitLab App ID",+ "required": true,+ "schema": {+ "type": "integer"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "GitLab app deleted successfully",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "GitLab app deleted successfully"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "description": "Unauthorized"+ },+ "404": {+ "description": "GitLab app not found"+ },+ "409": {+ "description": "Conflict - GitLab app is in use",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "This GitLab app is being used by 5 application(s). Please delete all applications first."+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "GitLab Apps"+ ],+ "summary": "Update GitLab App",+ "description": "Update an existing GitLab app.",+ "operationId": "updateGitlabApp",+ "parameters": [+ {+ "name": "gitlab_app_id",+ "in": "path",+ "description": "GitLab App ID",+ "required": true,+ "schema": {+ "type": "integer"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "GitLab App name"+ },+ "html_url": {+ "type": "string",+ "description": "GitLab HTML URL"+ },+ "api_url": {+ "type": "string",+ "description": "GitLab API URL"+ },+ "custom_user": {+ "type": "string",+ "description": "Custom user for SSH"+ },+ "custom_port": {+ "type": "integer",+ "description": "Custom port for SSH"+ },+ "group_name": {+ "type": "string",+ "nullable": true,+ "description": "Optional group filter"+ },+ "client_id": {+ "type": "string",+ "nullable": true,+ "description": "OAuth Application ID"+ },+ "client_secret": {+ "type": "string",+ "nullable": true,+ "description": "OAuth Application Secret"+ },+ "webhook_token": {+ "type": "string",+ "nullable": true,+ "description": "Webhook secret token"+ },+ "redirect_uri": {+ "type": "string",+ "nullable": true,+ "description": "OAuth redirect URI"+ },+ "is_system_wide": {+ "type": "boolean",+ "description": "Is system wide (non-cloud instances only)"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "GitLab app updated successfully",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "GitLab app updated successfully"+ },+ "data": {+ "type": "object",+ "description": "Updated GitLab app data"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "description": "Unauthorized"+ },+ "404": {+ "description": "GitLab app not found"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/hetzner\/locations": {+ "get": {+ "tags": [+ "Hetzner"+ ],+ "summary": "Get Hetzner Locations",+ "description": "Get all available Hetzner datacenter locations.",+ "operationId": "get-hetzner-locations",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of Hetzner locations.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "country": {+ "type": "string"+ },+ "city": {+ "type": "string"+ },+ "latitude": {+ "type": "number"+ },+ "longitude": {+ "type": "number"+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/hetzner\/server-types": {+ "get": {+ "tags": [+ "Hetzner"+ ],+ "summary": "Get Hetzner Server Types",+ "description": "Get all available Hetzner server types (instance sizes).",+ "operationId": "get-hetzner-server-types",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of Hetzner server types.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "cores": {+ "type": "integer"+ },+ "memory": {+ "type": "number"+ },+ "disk": {+ "type": "integer"+ },+ "prices": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "location": {+ "type": "string",+ "description": "Datacenter location name"+ },+ "price_hourly": {+ "type": "object",+ "properties": {+ "net": {+ "type": "string"+ },+ "gross": {+ "type": "string"+ }+ }+ },+ "price_monthly": {+ "type": "object",+ "properties": {+ "net": {+ "type": "string"+ },+ "gross": {+ "type": "string"+ }+ }+ }+ }+ }+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/hetzner\/images": {+ "get": {+ "tags": [+ "Hetzner"+ ],+ "summary": "Get Hetzner Images",+ "description": "Get all available Hetzner system images (operating systems).",+ "operationId": "get-hetzner-images",+ "parameters": [+ {+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",+ "required": false,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "cloud_provider_token_id",+ "in": "query",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",+ "required": false,+ "deprecated": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "List of Hetzner images.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ },+ "description": {+ "type": "string"+ },+ "type": {+ "type": "string"+ },+ "os_flavor": {+ "type": "string"+ },+ "os_version": {+ "type": "string"+ },+ "architecture": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -6708,59 +11112,59 @@]}},- "\/databases\/{uuid}\/logs": {+ "\/hetzner\/ssh-keys": {"get": {"tags": [- "Databases"+ "Hetzner"],- "summary": "Get database logs.",- "description": "Get database logs by UUID.",- "operationId": "get-database-logs-by-uuid",+ "summary": "Get Hetzner SSH Keys",+ "description": "Get all SSH keys stored in the Hetzner account.",+ "operationId": "get-hetzner-ssh-keys","parameters": [{- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string",- "format": "uuid"- }- },- {- "name": "lines",+ "name": "cloud_provider_token_uuid","in": "query",- "description": "Number of lines to show from the end of the logs.",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.","required": false,"schema": {- "type": "integer",- "format": "int32",- "default": 100+ "type": "string"}},{- "name": "show_timestamps",+ "name": "cloud_provider_token_id","in": "query",- "description": "Show timestamps in the logs.",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.","required": false,+ "deprecated": true,"schema": {- "type": "boolean",- "default": false+ "type": "string"}}],"responses": {"200": {- "description": "Get database logs by UUID.",+ "description": "List of Hetzner SSH keys.","content": {"application\/json": {"schema": {- "properties": {- "logs": {- "type": "string"- }- },- "type": "object"+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ },+ "fingerprint": {+ "type": "string"+ },+ "public_key": {+ "type": "string"+ }+ },+ "type": "object"+ }}}}@@ -6768,9 +11172,6 @@"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"}@@ -6782,85 +11183,62 @@]}},- "\/databases\/{uuid}\/backups\/{scheduled_backup_uuid}\/executions\/{execution_uuid}": {- "delete": {+ "\/hetzner\/firewalls": {+ "get": {"tags": [- "Databases"+ "Hetzner"],- "summary": "Delete backup execution",- "description": "Deletes a specific backup execution.",- "operationId": "delete-backup-execution-by-uuid",+ "summary": "Get Hetzner Firewalls",+ "description": "Get all existing Hetzner firewalls for the current project.",+ "operationId": "get-hetzner-firewalls","parameters": [{- "name": "uuid",- "in": "path",- "description": "UUID of the database",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "scheduled_backup_uuid",- "in": "path",- "description": "UUID of the backup configuration",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "execution_uuid",- "in": "path",- "description": "UUID of the backup execution to delete",- "required": true,+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",+ "required": false,"schema": {"type": "string"}},{- "name": "delete_s3",+ "name": "cloud_provider_token_id","in": "query",- "description": "Whether to delete the backup from S3",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.","required": false,+ "deprecated": true,"schema": {- "type": "boolean",- "default": false+ "type": "string"}}],"responses": {"200": {- "description": "Backup execution deleted.",+ "description": "List of Hetzner firewalls.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string",- "example": "Backup execution deleted."- }- },- "type": "object"+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ }+ },+ "type": "object"+ }}}}},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {- "description": "Backup execution not found.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Backup execution not found."- }- },- "type": "object"- }- }- }+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -6870,29 +11248,30 @@]}},- "\/databases\/{uuid}\/backups\/{scheduled_backup_uuid}\/executions": {+ "\/hetzner\/networks": {"get": {"tags": [- "Databases"+ "Hetzner"],- "summary": "List backup executions",- "description": "Get all executions for a specific backup configuration.",- "operationId": "list-backup-executions",+ "summary": "Get Hetzner Networks",+ "description": "Get all existing Hetzner private networks for the current project.",+ "operationId": "get-hetzner-networks","parameters": [{- "name": "uuid",- "in": "path",- "description": "UUID of the database",- "required": true,+ "name": "cloud_provider_token_uuid",+ "in": "query",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",+ "required": false,"schema": {"type": "string"}},{- "name": "scheduled_backup_uuid",- "in": "path",- "description": "UUID of the backup configuration",- "required": true,+ "name": "cloud_provider_token_id",+ "in": "query",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",+ "required": false,+ "deprecated": true,"schema": {"type": "string"}@@ -6900,45 +11279,34 @@],"responses": {"200": {- "description": "List of backup executions",+ "description": "List of Hetzner networks.","content": {"application\/json": {"schema": {- "properties": {- "executions": {- "type": "array",- "items": {- "properties": {- "uuid": {- "type": "string"- },- "filename": {- "type": "string"- },- "size": {- "type": "integer"- },- "created_at": {- "type": "string"- },- "message": {- "type": "string"- },- "status": {- "type": "string"- }- },- "type": "object"+ "type": "array",+ "items": {+ "properties": {+ "id": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ },+ "ip_range": {+ "type": "string"}- }- },- "type": "object"+ },+ "type": "object"+ }}}}},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {- "description": "Backup configuration not found."+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -6948,38 +11316,107 @@]}},- "\/databases\/{uuid}\/move": {- "post": {- "tags": [- "Databases"- ],- "summary": "Move",- "description": "Move database to another project\/environment. This is a purely organizational change \u2014 running containers are not affected. Note: after moving, the database will pick up shared environment variables from the new environment on the next deployment.",- "operationId": "move-database-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }+ "\/servers\/hetzner": {+ "post": {+ "tags": [+ "Hetzner"],+ "summary": "Create Hetzner Server",+ "description": "Create a new server on Hetzner and register it in Coolify.",+ "operationId": "create-hetzner-server","requestBody": {- "description": "Target environment to move the database to.",+ "description": "Hetzner server creation parameters","required": true,"content": {"application\/json": {"schema": {"required": [- "environment_uuid"+ "location",+ "server_type",+ "image",+ "private_key_uuid"],"properties": {- "environment_uuid": {+ "cloud_provider_token_uuid": {"type": "string",- "description": "UUID of the target environment."+ "example": "abc123",+ "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided."+ },+ "cloud_provider_token_id": {+ "type": "string",+ "example": "abc123",+ "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",+ "deprecated": true+ },+ "location": {+ "type": "string",+ "example": "nbg1",+ "description": "Hetzner location name"+ },+ "server_type": {+ "type": "string",+ "example": "cx11",+ "description": "Hetzner server type name"+ },+ "image": {+ "type": "integer",+ "example": 15512617,+ "description": "Hetzner image ID"+ },+ "name": {+ "type": "string",+ "example": "my-server",+ "description": "Server name (auto-generated if not provided)"+ },+ "private_key_uuid": {+ "type": "string",+ "example": "xyz789",+ "description": "Private key UUID"+ },+ "enable_ipv4": {+ "type": "boolean",+ "example": true,+ "description": "Enable IPv4 (default: true)"+ },+ "enable_ipv6": {+ "type": "boolean",+ "example": true,+ "description": "Enable IPv6 (default: true)"+ },+ "enable_backups": {+ "type": "boolean",+ "example": false,+ "description": "Enable Hetzner server backups after creation (adds 20% to the monthly server fee)"+ },+ "hetzner_ssh_key_ids": {+ "type": "array",+ "items": {+ "type": "integer"+ },+ "description": "Additional Hetzner SSH key IDs"+ },+ "hetzner_firewall_ids": {+ "type": "array",+ "items": {+ "type": "integer"+ },+ "description": "Existing Hetzner firewall IDs to apply during server creation"+ },+ "hetzner_network_ids": {+ "type": "array",+ "items": {+ "type": "integer"+ },+ "description": "Existing Hetzner network IDs to attach during server creation"+ },+ "cloud_init_script": {+ "type": "string",+ "description": "Cloud-init YAML script (optional)"+ },+ "instant_validate": {+ "type": "boolean",+ "example": false,+ "description": "Validate server immediately after creation"}},"type": "object"@@ -6988,24 +11425,24 @@}},"responses": {- "200": {- "description": "Database moved successfully.",+ "201": {+ "description": "Hetzner server created.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string",- "example": "Database moved successfully."- },"uuid": {- "type": "string"+ "type": "string",+ "example": "og888os",+ "description": "The UUID of the server."},- "project_uuid": {- "type": "string"+ "hetzner_server_id": {+ "type": "integer",+ "description": "The Hetzner server ID."},- "environment_uuid": {- "type": "string"+ "ip": {+ "type": "string",+ "description": "The server IP address."}},"type": "object"@@ -7024,6 +11461,9 @@},"422": {"$ref": "#\/components\/responses\/422"+ },+ "429": {+ "$ref": "#\/components\/responses\/429"}},"security": [@@ -7033,50 +11473,23 @@]}},- "\/databases\/{uuid}\/start": {- "post": {+ "\/notifications\/email": {+ "get": {"tags": [- "Databases"- ],- "summary": "Start",- "description": "Start database.",- "operationId": "start-database-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }+ "Notifications"],+ "summary": "Get email notification settings",+ "description": "Get the current team email notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner.",+ "operationId": "get-current-team-email-notifications","responses": {"200": {- "description": "Start database.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Database starting request queued."- }- },- "type": "object"- }- }- }+ "description": "Email notification settings."},"401": {"$ref": "#\/components\/responses\/401"},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"}},"security": [@@ -7084,52 +11497,17 @@"bearerAuth": []}]- }- },- "\/databases\/{uuid}\/stop": {- "post": {+ },+ "patch": {"tags": [- "Databases"- ],- "summary": "Stop",- "description": "Stop database.",- "operationId": "stop-database-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "docker_cleanup",- "in": "query",- "description": "Perform docker cleanup (prune networks, volumes, etc.).",- "schema": {- "type": "boolean",- "default": true- }- }+ "Notifications"],+ "summary": "Update email notification settings",+ "description": "Update the current team email notification settings.",+ "operationId": "update-current-team-email-notifications","responses": {"200": {- "description": "Stop database.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Database stopping request queued."- }- },- "type": "object"- }- }- }+ "description": "Updated email notification settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -7137,8 +11515,11 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -7148,41 +11529,41 @@]}},- "\/databases\/{uuid}\/restart": {- "post": {+ "\/notifications\/discord": {+ "get": {"tags": [- "Databases"+ "Notifications"],- "summary": "Restart",- "description": "Restart database.",- "operationId": "restart-database-by-uuid",- "parameters": [+ "summary": "Get Discord notification settings",+ "description": "Get the current team Discord notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner.",+ "operationId": "get-current-team-discord-notifications",+ "responses": {+ "200": {+ "description": "Discord notification settings."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [{- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }+ "bearerAuth": []}+ ]+ },+ "patch": {+ "tags": [+ "Notifications"],+ "summary": "Update Discord notification settings",+ "description": "Update the current team Discord notification settings.",+ "operationId": "update-current-team-discord-notifications","responses": {"200": {- "description": "Restart database.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Database restaring request queued."- }- },- "type": "object"- }- }- }+ "description": "Updated Discord notification settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -7190,8 +11571,11 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -7201,47 +11585,23 @@]}},- "\/databases\/{uuid}\/envs": {+ "\/notifications\/slack": {"get": {"tags": [- "Databases"- ],- "summary": "List Envs",- "description": "List all envs by database UUID.",- "operationId": "list-envs-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }+ "Notifications"],+ "summary": "Get Slack notification settings",+ "description": "Get the current team Slack notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner.",+ "operationId": "get-current-team-slack-notifications","responses": {"200": {- "description": "Environment variables.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/EnvironmentVariable"- }- }- }- }+ "description": "Slack notification settings."},"401": {"$ref": "#\/components\/responses\/401"},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"}},"security": [@@ -7250,73 +11610,16 @@}]},- "post": {+ "patch": {"tags": [- "Databases"- ],- "summary": "Create Env",- "description": "Create env by database UUID.",- "operationId": "create-env-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }+ "Notifications"],- "requestBody": {- "description": "Env created.",- "required": true,- "content": {- "application\/json": {- "schema": {- "properties": {- "key": {- "type": "string",- "description": "The key of the environment variable."- },- "value": {- "type": "string",- "description": "The value of the environment variable."- },- "is_literal": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is a literal, nothing espaced."- },- "is_multiline": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is multiline."- },- "is_shown_once": {- "type": "boolean",- "description": "The flag to indicate if the environment variable's value is shown on the UI."- }- },- "type": "object"- }- }- }- },+ "summary": "Update Slack notification settings",+ "description": "Update the current team Slack notification settings.",+ "operationId": "update-current-team-slack-notifications","responses": {- "201": {- "description": "Environment variable created.",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string",- "example": "nc0k04gk8g0cgsk440g0koko"- }- },- "type": "object"- }- }- }+ "200": {+ "description": "Updated Slack notification settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -7324,8 +11627,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."},"422": {"$ref": "#\/components\/responses\/422"@@ -7336,72 +11639,43 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/notifications\/telegram": {+ "get": {"tags": [- "Databases"+ "Notifications"],- "summary": "Update Env",- "description": "Update env by database UUID.",- "operationId": "update-env-by-database-uuid",- "parameters": [+ "summary": "Get Telegram notification settings",+ "description": "Get the current team Telegram notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner.",+ "operationId": "get-current-team-telegram-notifications",+ "responses": {+ "200": {+ "description": "Telegram notification settings."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [{- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }+ "bearerAuth": []}+ ]+ },+ "patch": {+ "tags": [+ "Notifications"],- "requestBody": {- "description": "Env updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "key",- "value"- ],- "properties": {- "key": {- "type": "string",- "description": "The key of the environment variable."- },- "value": {- "type": "string",- "description": "The value of the environment variable."- },- "is_literal": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is a literal, nothing espaced."- },- "is_multiline": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is multiline."- },- "is_shown_once": {- "type": "boolean",- "description": "The flag to indicate if the environment variable's value is shown on the UI."- }- },- "type": "object"- }- }- }- },+ "summary": "Update Telegram notification settings",+ "description": "Update the current team Telegram notification settings.",+ "operationId": "update-current-team-telegram-notifications","responses": {- "201": {- "description": "Environment variable updated.",- "content": {- "application\/json": {- "schema": {- "$ref": "#\/components\/schemas\/EnvironmentVariable"- }- }- }+ "200": {+ "description": "Updated Telegram notification settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -7409,8 +11683,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."},"422": {"$ref": "#\/components\/responses\/422"@@ -7423,82 +11697,41 @@]}},- "\/databases\/{uuid}\/envs\/bulk": {- "patch": {+ "\/notifications\/pushover": {+ "get": {"tags": [- "Databases"+ "Notifications"],- "summary": "Update Envs (Bulk)",- "description": "Update multiple envs by database UUID.",- "operationId": "update-envs-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }+ "summary": "Get Pushover notification settings",+ "description": "Get the current team Pushover notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner.",+ "operationId": "get-current-team-pushover-notifications",+ "responses": {+ "200": {+ "description": "Pushover notification settings."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"}- ],- "requestBody": {- "description": "Bulk envs updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "data"- ],- "properties": {- "data": {- "type": "array",- "items": {- "properties": {- "key": {- "type": "string",- "description": "The key of the environment variable."- },- "value": {- "type": "string",- "description": "The value of the environment variable."- },- "is_literal": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is a literal, nothing espaced."- },- "is_multiline": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is multiline."- },- "is_shown_once": {- "type": "boolean",- "description": "The flag to indicate if the environment variable's value is shown on the UI."- }- },- "type": "object"- }- }- },- "type": "object"- }- }+ },+ "security": [+ {+ "bearerAuth": []}- },+ ]+ },+ "patch": {+ "tags": [+ "Notifications"+ ],+ "summary": "Update Pushover notification settings",+ "description": "Update the current team Pushover notification settings.",+ "operationId": "update-current-team-pushover-notifications","responses": {- "201": {- "description": "Environment variables updated.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/EnvironmentVariable"- }- }- }- }+ "200": {+ "description": "Updated Pushover notification settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -7506,8 +11739,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."},"422": {"$ref": "#\/components\/responses\/422"@@ -7520,50 +11753,41 @@]}},- "\/databases\/{uuid}\/envs\/{env_uuid}": {- "delete": {+ "\/notifications\/webhook": {+ "get": {"tags": [- "Databases"+ "Notifications"],- "summary": "Delete Env",- "description": "Delete env by UUID.",- "operationId": "delete-env-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }+ "summary": "Get webhook notification settings",+ "description": "Get the current team webhook notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner.",+ "operationId": "get-current-team-webhook-notifications",+ "responses": {+ "200": {+ "description": "Webhook notification settings."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ }+ },+ "security": [{- "name": "env_uuid",- "in": "path",- "description": "UUID of the environment variable.",- "required": true,- "schema": {- "type": "string"- }+ "bearerAuth": []}+ ]+ },+ "patch": {+ "tags": [+ "Notifications"],+ "summary": "Update webhook notification settings",+ "description": "Update the current team webhook notification settings.",+ "operationId": "update-current-team-webhook-notifications","responses": {"200": {- "description": "Environment variable deleted.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Environment variable deleted."- }- },- "type": "object"- }- }- }+ "description": "Updated webhook notification settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -7571,8 +11795,11 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "403": {+ "description": "Forbidden."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -7582,43 +11809,68 @@]}},- "\/databases\/{uuid}\/storages": {+ "\/version": {"get": {- "tags": [- "Databases"- ],- "summary": "List Storages",- "description": "List all persistent storages and file storages by database UUID.",- "operationId": "list-storages-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"+ "summary": "Version",+ "description": "Get Coolify version.",+ "operationId": "version",+ "responses": {+ "200": {+ "description": "Returns the version of the application",+ "content": {+ "text\/html": {+ "schema": {+ "type": "string"+ },+ "example": "v4.0.0"+ }}+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"}- ],+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/enable": {+ "post": {+ "summary": "Enable API",+ "description": "Enable API (only with root permissions).",+ "operationId": "enable-api","responses": {"200": {- "description": "All storages by database UUID.",+ "description": "Enable API.","content": {"application\/json": {"schema": {"properties": {- "persistent_storages": {- "type": "array",- "items": {- "type": "object"- }- },- "file_storages": {- "type": "array",- "items": {- "type": "object"- }+ "message": {+ "type": "string",+ "example": "API enabled."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "403": {+ "description": "You are not allowed to enable the API.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "You are not allowed to enable the API."}},"type": "object"@@ -7631,9 +11883,6 @@},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"}},"security": [@@ -7641,82 +11890,41 @@"bearerAuth": []}]- },+ }+ },+ "\/disable": {"post": {- "tags": [- "Databases"- ],- "summary": "Create Storage",- "description": "Create a persistent storage or file storage for a database.",- "operationId": "create-storage-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "requestBody": {- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "type",- "mount_path"- ],- "properties": {- "type": {- "type": "string",- "enum": [- "persistent",- "file"- ],- "description": "The type of storage."- },- "name": {- "type": "string",- "description": "Volume name (persistent only, required for persistent)."- },- "mount_path": {- "type": "string",- "description": "The container mount path."- },- "host_path": {- "type": "string",- "nullable": true,- "description": "The host path (persistent only, optional)."- },- "content": {- "type": "string",- "nullable": true,- "description": "File content (file only, optional)."- },- "is_directory": {- "type": "boolean",- "description": "Whether this is a directory mount (file only, default false)."- },- "fs_path": {- "type": "string",- "description": "Host directory path (required when is_directory is true)."- }- },- "type": "object",- "additionalProperties": false- }- }- }- },+ "summary": "Disable API",+ "description": "Disable API (only with root permissions).",+ "operationId": "disable-api","responses": {- "201": {- "description": "Storage created.",+ "200": {+ "description": "Disable API.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "API disabled."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "403": {+ "description": "You are not allowed to disable the API.","content": {"application\/json": {"schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "You are not allowed to disable the API."+ }+ },"type": "object"}}@@ -7727,12 +11935,6 @@},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -7740,86 +11942,41 @@"bearerAuth": []}]- },- "patch": {- "tags": [- "Databases"- ],- "summary": "Update Storage",- "description": "Update a persistent storage or file storage by database UUID.",- "operationId": "update-storage-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }- ],- "requestBody": {- "description": "Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "type"- ],- "properties": {- "uuid": {- "type": "string",- "description": "The UUID of the storage (preferred)."- },- "id": {- "type": "integer",- "description": "The ID of the storage (deprecated, use uuid instead)."- },- "type": {- "type": "string",- "enum": [- "persistent",- "file"- ],- "description": "The type of storage: persistent or file."- },- "is_preview_suffix_enabled": {- "type": "boolean",- "description": "Whether to add -pr-N suffix for preview deployments."- },- "name": {- "type": "string",- "description": "The volume name (persistent only, not allowed for read-only storages)."- },- "mount_path": {- "type": "string",- "description": "The container mount path (not allowed for read-only storages)."- },- "host_path": {- "type": "string",- "nullable": true,- "description": "The host path (persistent only, not allowed for read-only storages)."+ }+ },+ "\/mcp\/enable": {+ "post": {+ "summary": "Enable MCP Server",+ "description": "Enable the MCP server endpoint at \/mcp (only with root permissions).",+ "operationId": "enable-mcp",+ "responses": {+ "200": {+ "description": "MCP server enabled.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "MCP server enabled."+ }},- "content": {- "type": "string",- "nullable": true,- "description": "The file content (file only, not allowed for read-only storages)."- }- },- "type": "object",- "additionalProperties": false+ "type": "object"+ }}}- }- },- "responses": {- "200": {- "description": "Storage updated.",+ },+ "403": {+ "description": "You are not allowed to enable the MCP server.","content": {"application\/json": {"schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "You are not allowed to enable the MCP server."+ }+ },"type": "object"}}@@ -7830,12 +11987,6 @@},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -7845,43 +11996,37 @@]}},- "\/databases\/{uuid}\/storages\/{storage_uuid}": {- "delete": {- "tags": [- "Databases"- ],- "summary": "Delete Storage",- "description": "Delete a persistent storage or file storage by database UUID.",- "operationId": "delete-storage-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "storage_uuid",- "in": "path",- "description": "UUID of the storage.",- "required": true,- "schema": {- "type": "string"- }- }- ],+ "\/mcp\/disable": {+ "post": {+ "summary": "Disable MCP Server",+ "description": "Disable the MCP server endpoint at \/mcp (only with root permissions).",+ "operationId": "disable-mcp","responses": {"200": {- "description": "Storage deleted.",+ "description": "MCP server disabled.","content": {"application\/json": {"schema": {"properties": {"message": {- "type": "string"+ "type": "string",+ "example": "MCP server disabled."+ }+ },+ "type": "object"+ }+ }+ }+ },+ "403": {+ "description": "You are not allowed to disable the MCP server.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "You are not allowed to disable the MCP server."}},"type": "object"@@ -7894,12 +12039,6 @@},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -7909,34 +12048,49 @@]}},- "\/databases\/{uuid}\/tags": {+ "\/health": {"get": {- "tags": [- "Databases"- ],- "summary": "List Tags",- "description": "List tags for a database by UUID.",- "operationId": "list-tags-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"+ "summary": "Healthcheck",+ "description": "Healthcheck endpoint.",+ "operationId": "healthcheck",+ "responses": {+ "200": {+ "description": "Healthcheck endpoint.",+ "content": {+ "text\/html": {+ "schema": {+ "type": "string"+ },+ "example": "OK"+ }}+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"}+ }+ }+ },+ "\/projects": {+ "get": {+ "tags": [+ "Projects"],+ "summary": "List",+ "description": "List projects.",+ "operationId": "list-projects","responses": {"200": {- "description": "List of tags.",+ "description": "Get all projects.","content": {"application\/json": {"schema": {"type": "array","items": {- "$ref": "#\/components\/schemas\/Tag"+ "$ref": "#\/components\/schemas\/Project"}}}@@ -7947,9 +12101,6 @@},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"}},"security": [@@ -7960,38 +12111,25 @@},"post": {"tags": [- "Databases"- ],- "summary": "Create Tag",- "description": "Add tag(s) to a database by UUID.",- "operationId": "create-tag-by-database-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- }+ "Projects"],+ "summary": "Create",+ "description": "Create Project.",+ "operationId": "create-project","requestBody": {+ "description": "Project created.","required": true,"content": {"application\/json": {"schema": {"properties": {- "tag_name": {+ "name": {"type": "string",- "description": "The tag name (min 2 characters). Required if tag_names is not provided."+ "description": "The name of the project."},- "tag_names": {- "type": "array",- "items": {- "type": "string"- },- "description": "Array of tag names (each min 2 characters). Required if tag_name is not provided."+ "description": {+ "type": "string",+ "description": "The description of the project."}},"type": "object"@@ -8001,14 +12139,18 @@},"responses": {"201": {- "description": "Tags added successfully.",+ "description": "Project created.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Tag"- }+ "properties": {+ "uuid": {+ "type": "string",+ "example": "og888os",+ "description": "The UUID of the project."+ }+ },+ "type": "object"}}}@@ -8033,28 +12175,19 @@]}},- "\/databases\/{uuid}\/tags\/{tag_uuid}": {- "delete": {+ "\/projects\/{uuid}": {+ "get": {"tags": [- "Databases"+ "Projects"],- "summary": "Delete Tag",- "description": "Remove a tag from a database by UUID.",- "operationId": "delete-tag-by-database-uuid",+ "summary": "Get",+ "description": "Get project by UUID.",+ "operationId": "get-project-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the database.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "tag_uuid",- "in": "path",- "description": "UUID of the tag.",+ "description": "Project UUID","required": true,"schema": {"type": "string"@@ -8063,43 +12196,11 @@],"responses": {"200": {- "description": "Tag removed."- },- "401": {- "$ref": "#\/components\/responses\/401"- },- "400": {- "$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"- }- },- "security": [- {- "bearerAuth": []- }- ]- }- },- "\/deployments": {- "get": {- "tags": [- "Deployments"- ],- "summary": "List",- "description": "List currently running deployments",- "operationId": "list-deployments",- "responses": {- "200": {- "description": "Get all currently running deployments.",+ "description": "Project details","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/ApplicationDeploymentQueue"- }+ "$ref": "#\/components\/schemas\/Project"}}}@@ -8109,6 +12210,9 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "description": "Project not found."}},"security": [@@ -8116,21 +12220,19 @@"bearerAuth": []}]- }- },- "\/deployments\/{uuid}": {- "get": {+ },+ "delete": {"tags": [- "Deployments"+ "Projects"],- "summary": "Get",- "description": "Get deployment by UUID.",- "operationId": "get-deployment-by-uuid",+ "summary": "Delete",+ "description": "Delete project by UUID.",+ "operationId": "delete-project-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Deployment UUID",+ "description": "UUID of the application.","required": true,"schema": {"type": "string"@@ -8139,11 +12241,17 @@],"responses": {"200": {- "description": "Get deployment by UUID.",+ "description": "Project deleted.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/ApplicationDeploymentQueue"+ "properties": {+ "message": {+ "type": "string",+ "example": "Project deleted."+ }+ },+ "type": "object"}}}@@ -8156,6 +12264,9 @@},"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8163,61 +12274,64 @@"bearerAuth": []}]- }- },- "\/deployments\/{uuid}\/cancel": {- "post": {+ },+ "patch": {"tags": [- "Deployments"+ "Projects"],- "summary": "Cancel",- "description": "Cancel a deployment by UUID.",- "operationId": "cancel-deployment-by-uuid",+ "summary": "Update",+ "description": "Update Project.",+ "operationId": "update-project-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Deployment UUID",+ "description": "UUID of the project.","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "description": "Project updated.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "The name of the project."+ },+ "description": {+ "type": "string",+ "description": "The description of the project."+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {- "200": {- "description": "Deployment cancelled successfully.",+ "201": {+ "description": "Project updated.","content": {"application\/json": {"schema": {"properties": {- "message": {+ "uuid": {"type": "string",- "example": "Deployment cancelled successfully."+ "example": "og888os"},- "deployment_uuid": {+ "name": {"type": "string",- "example": "cm37r6cqj000008jm0veg5tkm"+ "example": "Project Name"},- "status": {- "type": "string",- "example": "cancelled-by-user"- }- },- "type": "object"- }- }- }- },- "400": {- "description": "Deployment cannot be cancelled (already finished\/failed\/cancelled).",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {+ "description": {"type": "string",- "example": "Deployment cannot be cancelled. Current status: finished"+ "example": "Project Description"}},"type": "object"@@ -8228,86 +12342,46 @@"401": {"$ref": "#\/components\/responses\/401"},- "403": {- "description": "User doesn't have permission to cancel this deployment.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "You do not have permission to cancel this deployment."- }- },- "type": "object"- }- }- }+ "400": {+ "$ref": "#\/components\/responses\/400"},"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [{- "bearerAuth": []- }- ]- }- },- "\/deploy": {- "post": {- "tags": [- "Deployments"- ],- "summary": "Deploy",- "description": "Deploy by tag or UUID using query parameters or a JSON body.",- "operationId": "deploy-by-tag-or-uuid",- "parameters": [- {- "name": "tag",- "in": "query",- "description": "Tag name(s). Comma separated list is also accepted.",- "schema": {- "type": "string"- }- },- {- "name": "uuid",- "in": "query",- "description": "Resource UUID(s). Comma separated list is also accepted.",- "schema": {- "type": "string"- }- },- {- "name": "force",- "in": "query",- "description": "Force rebuild (without cache)",- "schema": {- "type": "boolean"- }- },- {- "name": "pr",- "in": "query",- "description": "Pull Request Id for deploying specific PR builds. Cannot be used with tag parameter.",- "schema": {- "type": "integer"- }- },- {- "name": "pull_request_id",- "in": "query",- "description": "Preview deployment identifier. Alias of pr.",+ "bearerAuth": []+ }+ ]+ }+ },+ "\/projects\/{uuid}\/{environment_name_or_uuid}": {+ "get": {+ "tags": [+ "Projects"+ ],+ "summary": "Environment",+ "description": "Get environment by name or UUID.",+ "operationId": "get-environment-by-name-or-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Project UUID",+ "required": true,"schema": {- "type": "integer"+ "type": "string"}},{- "name": "docker_tag",- "in": "query",- "description": "Docker image tag for Docker Image preview deployments. Requires pull_request_id.",+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID",+ "required": true,"schema": {"type": "string"}@@ -8315,30 +12389,11 @@],"responses": {"200": {- "description": "Get deployment(s) UUID's",+ "description": "Environment details","content": {"application\/json": {"schema": {- "properties": {- "deployments": {- "type": "array",- "items": {- "properties": {- "message": {- "type": "string"- },- "resource_uuid": {- "type": "string"- },- "deployment_uuid": {- "type": "string"- }- },- "type": "object"- }- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/Environment"}}}@@ -8348,6 +12403,12 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8357,56 +12418,34 @@]}},- "\/deployments\/applications\/{uuid}": {+ "\/projects\/{uuid}\/environments": {"get": {"tags": [- "Deployments"+ "Projects"],- "summary": "List application deployments",- "description": "List application deployments by using the app uuid",- "operationId": "list-deployments-by-app-uuid",+ "summary": "List Environments",+ "description": "List all environments in a project.",+ "operationId": "get-environments","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the application.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}- },- {- "name": "skip",- "in": "query",- "description": "Number of records to skip.",- "required": false,- "schema": {- "type": "integer",- "default": 0,- "minimum": 0- }- },- {- "name": "take",- "in": "query",- "description": "Number of records to take.",- "required": false,- "schema": {- "type": "integer",- "default": 10,- "minimum": 1- }}],"responses": {"200": {- "description": "List application deployments by using the app uuid.",+ "description": "List of environments","content": {"application\/json": {"schema": {"type": "array","items": {- "$ref": "#\/components\/schemas\/Application"+ "$ref": "#\/components\/schemas\/Environment"}}}@@ -8417,6 +12456,12 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "description": "Project not found."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8424,32 +12469,74 @@"bearerAuth": []}]- }- },- "\/destinations": {- "get": {+ },+ "post": {"tags": [- "Destinations"+ "Projects"],- "summary": "List destinations",- "description": "List all Docker network destinations for the authenticated team.",- "operationId": "list-destinations",+ "summary": "Create Environment",+ "description": "Create environment in project.",+ "operationId": "create-environment",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Project UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "description": "Environment created.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "The name of the environment."+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {- "200": {- "description": "Destinations for the authenticated team.",+ "201": {+ "description": "Environment created.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Destination"- }+ "properties": {+ "uuid": {+ "type": "string",+ "example": "env123",+ "description": "The UUID of the environment."+ }+ },+ "type": "object"}}}},"401": {"$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "description": "Project not found."+ },+ "409": {+ "description": "Environment with this name already exists."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8459,19 +12546,28 @@]}},- "\/servers\/{server_uuid}\/destinations": {- "get": {+ "\/projects\/{uuid}\/environments\/{environment_name_or_uuid}": {+ "delete": {"tags": [- "Destinations"+ "Projects"],- "summary": "List destinations by server",- "description": "List Docker network destinations attached to a server owned by the authenticated team.",- "operationId": "list-server-destinations",+ "summary": "Delete Environment",+ "description": "Delete environment by name or UUID. Environment must be empty.",+ "operationId": "delete-environment","parameters": [{- "name": "server_uuid",+ "name": "uuid","in": "path",- "description": "Server UUID",+ "description": "Project UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID","required": true,"schema": {"type": "string"@@ -8480,14 +12576,17 @@],"responses": {"200": {- "description": "Destinations attached to the server.",+ "description": "Environment deleted.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Destination"- }+ "properties": {+ "message": {+ "type": "string",+ "example": "Environment deleted."+ }+ },+ "type": "object"}}}@@ -8495,8 +12594,14 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "description": "Environment has resources, so it cannot be deleted."+ },"404": {- "$ref": "#\/components\/responses\/404"+ "description": "Project or environment not found."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8505,18 +12610,27 @@}]},- "post": {+ "patch": {"tags": [- "Destinations"+ "Projects"],- "summary": "Create destination",- "description": "Create a Docker network destination on a server owned by the authenticated team.",- "operationId": "create-server-destination",+ "summary": "Update Environment",+ "description": "Update environment by name or UUID within a project.",+ "operationId": "update-environment","parameters": [{- "name": "server_uuid",+ "name": "uuid","in": "path",- "description": "Server UUID",+ "description": "Project UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID","required": true,"schema": {"type": "string"@@ -8524,29 +12638,19 @@}],"requestBody": {+ "description": "Environment fields to update.","required": true,"content": {"application\/json": {"schema": {- "required": [- "network"- ],"properties": {"name": {"type": "string",- "maxLength": 255- },- "network": {- "type": "string",- "maxLength": 255,- "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"+ "description": "The name of the environment."},- "type": {+ "description": {"type": "string",- "enum": [- "standalone",- "swarm"- ]+ "description": "The description of the environment."}},"type": "object"@@ -8555,12 +12659,26 @@}},"responses": {- "201": {- "description": "Destination created.",+ "200": {+ "description": "Environment updated.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Destination"+ "properties": {+ "uuid": {+ "type": "string",+ "example": "env123"+ },+ "name": {+ "type": "string",+ "example": "staging"+ },+ "description": {+ "type": "string",+ "example": "Staging environment"+ }+ },+ "type": "object"}}}@@ -8568,11 +12686,14 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {- "$ref": "#\/components\/responses\/404"+ "description": "Project or environment not found."},"409": {- "description": "A destination with this network already exists."+ "description": "Environment with this name already exists."},"422": {"$ref": "#\/components\/responses\/422"@@ -8585,41 +12706,31 @@]}},- "\/destinations\/{uuid}": {+ "\/resources": {"get": {"tags": [- "Destinations"- ],- "summary": "Get destination",- "description": "Get a Docker network destination by UUID.",- "operationId": "get-destination-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "Destination UUID",- "required": true,- "schema": {- "type": "string"- }- }+ "Resources"],+ "summary": "List",+ "description": "Get all resources.",+ "operationId": "list-resources","responses": {"200": {- "description": "Destination details.",+ "description": "Get all resources","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Destination"- }+ "type": "string"+ },+ "example": "Content is very complex. Will be implemented later."}}},"401": {"$ref": "#\/components\/responses\/401"},- "404": {- "$ref": "#\/components\/responses\/404"+ "400": {+ "$ref": "#\/components\/responses\/400"}},"security": [@@ -8627,38 +12738,59 @@"bearerAuth": []}]- },- "delete": {+ }+ },+ "\/s3-storages": {+ "get": {"tags": [- "Destinations"- ],- "summary": "Delete destination",- "description": "Delete an unused Docker network destination.",- "operationId": "delete-destination-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "Destination UUID",- "required": true,- "schema": {- "type": "string"- }- }+ "S3 Storages"],+ "summary": "List S3 Storages",+ "description": "List all S3 storages for the authenticated team.",+ "operationId": "list-s3-storages","responses": {"200": {- "description": "Destination deleted.",+ "description": "Get all S3 storages.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string",- "example": "Deleted."- }- },- "type": "object"+ "type": "array",+ "items": {+ "properties": {+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "nullable": true+ },+ "endpoint": {+ "type": "string"+ },+ "bucket": {+ "type": "string"+ },+ "region": {+ "type": "string"+ },+ "is_usable": {+ "type": "boolean"+ },+ "team_id": {+ "type": "integer"+ },+ "created_at": {+ "type": "string"+ },+ "updated_at": {+ "type": "string"+ }+ },+ "type": "object"+ }}}}@@ -8666,11 +12798,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "404": {- "$ref": "#\/components\/responses\/404"- },- "409": {- "description": "Destination has attached resources."+ "400": {+ "$ref": "#\/components\/responses\/400"}},"security": [@@ -8678,43 +12807,98 @@"bearerAuth": []}]- }- },- "\/digitalocean\/regions": {- "get": {+ },+ "post": {"tags": [- "DigitalOcean"+ "S3 Storages"],- "summary": "Get DigitalOcean regions",- "operationId": "get-digitalocean-regions",- "parameters": [- {- "name": "cloud_provider_token_uuid",- "in": "query",- "required": false,- "schema": {- "type": "string"- }- },- {- "name": "cloud_provider_token_id",- "in": "query",- "required": false,- "deprecated": true,- "schema": {- "type": "string"+ "summary": "Create S3 Storage",+ "description": "Create a new S3 storage configuration for the authenticated team.",+ "operationId": "create-s3-storage",+ "requestBody": {+ "description": "S3 storage details",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "name",+ "endpoint",+ "bucket",+ "region",+ "key",+ "secret"+ ],+ "properties": {+ "name": {+ "type": "string",+ "example": "My S3 Storage",+ "description": "A friendly name for the storage."+ },+ "description": {+ "type": "string",+ "nullable": true,+ "description": "Optional description."+ },+ "endpoint": {+ "type": "string",+ "example": "https:\/\/s3.us-east-1.amazonaws.com",+ "description": "S3-compatible endpoint URL."+ },+ "bucket": {+ "type": "string",+ "example": "my-bucket",+ "description": "S3 bucket name."+ },+ "region": {+ "type": "string",+ "example": "us-east-1",+ "description": "S3 region."+ },+ "key": {+ "type": "string",+ "description": "Access key."+ },+ "secret": {+ "type": "string",+ "description": "Secret key."+ },+ "is_usable": {+ "type": "boolean",+ "description": "Whether the storage is marked usable."+ }+ },+ "type": "object"+ }}}- ],+ },"responses": {- "200": {- "description": "List of DigitalOcean regions."+ "201": {+ "description": "S3 storage created.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string",+ "example": "og888os",+ "description": "The UUID of the S3 storage."+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"422": {- "description": "Validation failed."+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8724,27 +12908,20 @@]}},- "\/digitalocean\/sizes": {+ "\/s3-storages\/{uuid}": {"get": {"tags": [- "DigitalOcean"+ "S3 Storages"],- "summary": "Get DigitalOcean sizes",- "operationId": "get-digitalocean-sizes",+ "summary": "Get S3 Storage",+ "description": "Get S3 storage by UUID.",+ "operationId": "get-s3-storage-by-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "required": false,- "schema": {- "type": "string"- }- },- {- "name": "cloud_provider_token_id",- "in": "query",- "required": false,- "deprecated": true,+ "name": "uuid",+ "in": "path",+ "description": "S3 Storage UUID",+ "required": true,"schema": {"type": "string"}@@ -8752,13 +12929,53 @@],"responses": {"200": {- "description": "List of DigitalOcean sizes."+ "description": "Get S3 storage by UUID",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "description": {+ "type": "string",+ "nullable": true+ },+ "endpoint": {+ "type": "string"+ },+ "bucket": {+ "type": "string"+ },+ "region": {+ "type": "string"+ },+ "is_usable": {+ "type": "boolean"+ },+ "team_id": {+ "type": "integer"+ },+ "created_at": {+ "type": "string"+ },+ "updated_at": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},- "422": {- "description": "Validation failed."+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -8766,29 +12983,20 @@"bearerAuth": []}]- }- },- "\/digitalocean\/images": {- "get": {+ },+ "delete": {"tags": [- "DigitalOcean"+ "S3 Storages"],- "summary": "Get DigitalOcean images",- "operationId": "get-digitalocean-images",+ "summary": "Delete S3 Storage",+ "description": "Delete S3 storage by UUID.",+ "operationId": "delete-s3-storage-by-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "required": false,- "schema": {- "type": "string"- }- },- {- "name": "cloud_provider_token_id",- "in": "query",- "required": false,- "deprecated": true,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the S3 storage.",+ "required": true,"schema": {"type": "string"}@@ -8796,13 +13004,26 @@],"responses": {"200": {- "description": "List of DigitalOcean images."+ "description": "S3 storage deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "S3 storage deleted."+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},- "422": {- "description": "Validation failed."+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -8810,43 +13031,95 @@"bearerAuth": []}]- }- },- "\/digitalocean\/ssh-keys": {- "get": {+ },+ "patch": {"tags": [- "DigitalOcean"+ "S3 Storages"],- "summary": "Get DigitalOcean SSH keys",- "operationId": "get-digitalocean-ssh-keys",+ "summary": "Update S3 Storage",+ "description": "Update S3 storage by UUID.",+ "operationId": "update-s3-storage-by-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "required": false,- "schema": {- "type": "string"- }- },- {- "name": "cloud_provider_token_id",- "in": "query",- "required": false,- "deprecated": true,+ "name": "uuid",+ "in": "path",+ "description": "S3 Storage UUID",+ "required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "description": "S3 storage fields to update.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "A friendly name for the storage."+ },+ "description": {+ "type": "string",+ "nullable": true,+ "description": "Optional description."+ },+ "endpoint": {+ "type": "string",+ "description": "S3-compatible endpoint URL."+ },+ "bucket": {+ "type": "string",+ "description": "S3 bucket name."+ },+ "region": {+ "type": "string",+ "description": "S3 region."+ },+ "key": {+ "type": "string",+ "description": "Access key."+ },+ "secret": {+ "type": "string",+ "description": "Secret key."+ },+ "is_usable": {+ "type": "boolean",+ "description": "Whether the storage is marked usable."+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "List of DigitalOcean SSH keys."+ "description": "S3 storage updated.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},+ "404": {+ "$ref": "#\/components\/responses\/404"+ },"422": {- "description": "Validation failed."+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -8856,25 +13129,51 @@]}},- "\/servers\/digitalocean": {+ "\/s3-storages\/{uuid}\/validate": {"post": {"tags": [- "DigitalOcean"+ "S3 Storages"+ ],+ "summary": "Validate S3 Storage",+ "description": "Validate an S3 storage connection using ListObjectsV2.",+ "operationId": "validate-s3-storage-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "S3 Storage UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }],- "summary": "Create a server on DigitalOcean",- "operationId": "create-digitalocean-server","responses": {- "201": {- "description": "DigitalOcean droplet created and linked to a Coolify server."+ "200": {+ "description": "S3 storage validation result.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "valid": {+ "type": "boolean",+ "example": true+ },+ "message": {+ "type": "string",+ "example": "S3 storage connection is valid."+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},- "422": {- "description": "Validation failed."- },- "429": {- "description": "DigitalOcean rate limit exceeded."+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -8884,74 +13183,34 @@]}},- "\/github-apps": {+ "\/applications\/{uuid}\/scheduled-tasks": {"get": {"tags": [- "GitHub Apps"+ "Scheduled Tasks"+ ],+ "summary": "List Tasks",+ "description": "List all scheduled tasks for an application.",+ "operationId": "list-scheduled-tasks-by-application-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }],- "summary": "List",- "description": "List all GitHub apps.",- "operationId": "list-github-apps","responses": {"200": {- "description": "List of GitHub apps.",+ "description": "Get all scheduled tasks for an application.","content": {"application\/json": {"schema": {"type": "array","items": {- "properties": {- "id": {- "type": "integer"- },- "uuid": {- "type": "string"- },- "name": {- "type": "string"- },- "organization": {- "type": "string",- "nullable": true- },- "api_url": {- "type": "string"- },- "html_url": {- "type": "string"- },- "custom_user": {- "type": "string"- },- "custom_port": {- "type": "integer"- },- "app_id": {- "type": "integer"- },- "installation_id": {- "type": "integer"- },- "client_id": {- "type": "string"- },- "private_key_id": {- "type": "integer"- },- "is_system_wide": {- "type": "boolean"- },- "is_public": {- "type": "boolean"- },- "team_id": {- "type": "integer"- },- "type": {- "type": "string"- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/ScheduledTask"}}}@@ -8960,91 +13219,72 @@"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [{"bearerAuth": []}- ]- },- "post": {- "tags": [- "GitHub Apps"+ ]+ },+ "post": {+ "tags": [+ "Scheduled Tasks"+ ],+ "summary": "Create Task",+ "description": "Create a new scheduled task for an application.",+ "operationId": "create-scheduled-task-by-application-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }],- "summary": "Create GitHub App",- "description": "Create a new GitHub app.",- "operationId": "create-github-app","requestBody": {- "description": "GitHub app creation payload.",+ "description": "Scheduled task data","required": true,"content": {"application\/json": {"schema": {"required": ["name",- "html_url",- "app_id",- "installation_id",- "client_id",- "client_secret",- "private_key_uuid"+ "command",+ "frequency"],"properties": {"name": {"type": "string",- "description": "Name of the GitHub app."- },- "organization": {- "type": "string",- "nullable": true,- "description": "Organization to associate the app with."+ "description": "The name of the scheduled task."},- "api_url": {+ "command": {"type": "string",- "description": "API URL for the GitHub app (e.g., https:\/\/api.github.com)."+ "description": "The command to execute."},- "html_url": {+ "frequency": {"type": "string",- "description": "HTML URL for the GitHub app (e.g., https:\/\/github.com)."+ "description": "The frequency of the scheduled task."},- "custom_user": {+ "container": {"type": "string",- "description": "Custom user for SSH access (default: git)."- },- "custom_port": {- "type": "integer",- "description": "Custom port for SSH access (default: 22)."- },- "app_id": {- "type": "integer",- "description": "GitHub App ID from GitHub."+ "nullable": true,+ "description": "The container where the command should be executed."},- "installation_id": {+ "timeout": {"type": "integer",- "description": "GitHub Installation ID."- },- "client_id": {- "type": "string",- "description": "GitHub OAuth App Client ID."- },- "client_secret": {- "type": "string",- "description": "GitHub OAuth App Client Secret."- },- "webhook_secret": {- "type": "string",- "description": "Webhook secret for GitHub webhooks."- },- "private_key_uuid": {- "type": "string",- "description": "UUID of an existing private key for GitHub App authentication."+ "description": "The timeout of the scheduled task in seconds.",+ "default": 300},- "is_system_wide": {+ "enabled": {"type": "boolean",- "description": "Is this app system-wide (cloud only)."+ "description": "The flag to indicate if the scheduled task is enabled.",+ "default": true}},"type": "object"@@ -9054,53 +13294,70 @@},"responses": {"201": {- "description": "GitHub app created successfully.",+ "description": "Scheduled task created.",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/ScheduledTask"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/applications\/{uuid}\/scheduled-tasks\/{task_uuid}": {+ "delete": {+ "tags": [+ "Scheduled Tasks"+ ],+ "summary": "Delete Task",+ "description": "Delete a scheduled task for an application.",+ "operationId": "delete-scheduled-task-by-application-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Scheduled task deleted.","content": {"application\/json": {"schema": {"properties": {- "id": {- "type": "integer"- },- "uuid": {- "type": "string"- },- "name": {- "type": "string"- },- "organization": {+ "message": {"type": "string",- "nullable": true- },- "api_url": {- "type": "string"- },- "html_url": {- "type": "string"- },- "custom_user": {- "type": "string"- },- "custom_port": {- "type": "integer"- },- "app_id": {- "type": "integer"- },- "installation_id": {- "type": "integer"- },- "client_id": {- "type": "string"- },- "private_key_id": {- "type": "integer"- },- "is_system_wide": {- "type": "boolean"- },- "team_id": {- "type": "integer"+ "example": "Scheduled task deleted."}},"type": "object"@@ -9108,14 +13365,11 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},- "422": {- "$ref": "#\/components\/responses\/422"+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -9123,54 +13377,93 @@"bearerAuth": []}]- }- },- "\/github-apps\/{github_app_id}\/repositories": {- "get": {+ },+ "patch": {"tags": [- "GitHub Apps"+ "Scheduled Tasks"],- "summary": "Load Repositories for a GitHub App",- "description": "Fetch repositories from GitHub for a given GitHub app.",- "operationId": "load-repositories",+ "summary": "Update Task",+ "description": "Update a scheduled task for an application.",+ "operationId": "update-scheduled-task-by-application-uuid","parameters": [{- "name": "github_app_id",+ "name": "uuid","in": "path",- "description": "GitHub App ID",+ "description": "UUID of the application.","required": true,"schema": {- "type": "integer"+ "type": "string"+ }+ },+ {+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,+ "schema": {+ "type": "string"}}],+ "requestBody": {+ "description": "Scheduled task data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "The name of the scheduled task."+ },+ "command": {+ "type": "string",+ "description": "The command to execute."+ },+ "frequency": {+ "type": "string",+ "description": "The frequency of the scheduled task."+ },+ "container": {+ "type": "string",+ "nullable": true,+ "description": "The container where the command should be executed."+ },+ "timeout": {+ "type": "integer",+ "description": "The timeout of the scheduled task in seconds.",+ "default": 300+ },+ "enabled": {+ "type": "boolean",+ "description": "The flag to indicate if the scheduled task is enabled.",+ "default": true+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "Repositories loaded successfully.",+ "description": "Scheduled task updated.","content": {"application\/json": {"schema": {- "properties": {- "repositories": {- "type": "array",- "items": {- "type": "object"- }- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/ScheduledTask"}}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -9180,37 +13473,28 @@]}},- "\/github-apps\/{github_app_id}\/repositories\/{owner}\/{repo}\/branches": {+ "\/applications\/{uuid}\/scheduled-tasks\/{task_uuid}\/executions": {"get": {"tags": [- "GitHub Apps"+ "Scheduled Tasks"],- "summary": "Load Branches for a GitHub Repository",- "description": "Fetch branches from GitHub for a given repository.",- "operationId": "load-branches",+ "summary": "List Executions",+ "description": "List all executions for a scheduled task on an application.",+ "operationId": "list-scheduled-task-executions-by-application-uuid","parameters": [{- "name": "github_app_id",- "in": "path",- "description": "GitHub App ID",- "required": true,- "schema": {- "type": "integer"- }- },- {- "name": "owner",+ "name": "uuid","in": "path",- "description": "Repository owner",+ "description": "UUID of the application.","required": true,"schema": {"type": "string"}},{- "name": "repo",+ "name": "task_uuid","in": "path",- "description": "Repository name",+ "description": "UUID of the scheduled task.","required": true,"schema": {"type": "string"@@ -9219,26 +13503,18 @@],"responses": {"200": {- "description": "Branches loaded successfully.",+ "description": "Get all executions for a scheduled task.","content": {"application\/json": {"schema": {- "properties": {- "branches": {- "type": "array",- "items": {- "type": "object"- }- }- },- "type": "object"+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/ScheduledTaskExecution"+ }}}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},@@ -9253,63 +13529,44 @@]}},- "\/github-apps\/{github_app_id}": {- "delete": {+ "\/services\/{uuid}\/scheduled-tasks": {+ "get": {"tags": [- "GitHub Apps"+ "Scheduled Tasks"],- "summary": "Delete GitHub App",- "description": "Delete a GitHub app if it's not being used by any applications.",- "operationId": "deleteGithubApp",+ "summary": "List Tasks",+ "description": "List all scheduled tasks for a service.",+ "operationId": "list-scheduled-tasks-by-service-uuid","parameters": [{- "name": "github_app_id",+ "name": "uuid","in": "path",- "description": "GitHub App ID",+ "description": "UUID of the service.","required": true,"schema": {- "type": "integer"+ "type": "string"}}],"responses": {"200": {- "description": "GitHub app deleted successfully",+ "description": "Get all scheduled tasks for a service.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string",- "example": "GitHub app deleted successfully"- }- },- "type": "object"+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/ScheduledTask"+ }}}}},"401": {- "description": "Unauthorized"+ "$ref": "#\/components\/responses\/401"},"404": {- "description": "GitHub app not found"- },- "409": {- "description": "Conflict - GitHub app is in use",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "This GitHub app is being used by 5 application(s). Please delete all applications first."- }- },- "type": "object"- }- }- }+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -9318,189 +13575,76 @@}]},- "patch": {+ "post": {"tags": [- "GitHub Apps"+ "Scheduled Tasks"],- "summary": "Update GitHub App",- "description": "Update an existing GitHub app.",- "operationId": "updateGithubApp",+ "summary": "Create Task",+ "description": "Create a new scheduled task for a service.",+ "operationId": "create-scheduled-task-by-service-uuid","parameters": [{- "name": "github_app_id",+ "name": "uuid","in": "path",- "description": "GitHub App ID",+ "description": "UUID of the service.","required": true,"schema": {- "type": "integer"+ "type": "string"}}],"requestBody": {+ "description": "Scheduled task data","required": true,"content": {"application\/json": {"schema": {+ "required": [+ "name",+ "command",+ "frequency"+ ],"properties": {"name": {"type": "string",- "description": "GitHub App name"- },- "organization": {- "type": "string",- "nullable": true,- "description": "GitHub organization"- },- "api_url": {- "type": "string",- "description": "GitHub API URL"- },- "html_url": {- "type": "string",- "description": "GitHub HTML URL"- },- "custom_user": {- "type": "string",- "description": "Custom user for SSH"- },- "custom_port": {- "type": "integer",- "description": "Custom port for SSH"- },- "app_id": {- "type": "integer",- "description": "GitHub App ID"- },- "installation_id": {- "type": "integer",- "description": "GitHub Installation ID"- },- "client_id": {- "type": "string",- "description": "GitHub Client ID"- },- "client_secret": {- "type": "string",- "description": "GitHub Client Secret"+ "description": "The name of the scheduled task."},- "webhook_secret": {+ "command": {"type": "string",- "description": "GitHub Webhook Secret"+ "description": "The command to execute."},- "private_key_uuid": {+ "frequency": {"type": "string",- "description": "Private key UUID"- },- "is_system_wide": {- "type": "boolean",- "description": "Is system wide (non-cloud instances only)"- }- },- "type": "object"- }- }- }- },- "responses": {- "200": {- "description": "GitHub app updated successfully",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "GitHub app updated successfully"- },- "data": {- "type": "object",- "description": "Updated GitHub app data"- }- },- "type": "object"- }- }- }- },- "401": {- "description": "Unauthorized"- },- "404": {- "description": "GitHub app not found"- },- "422": {- "$ref": "#\/components\/responses\/422"- }- },- "security": [- {- "bearerAuth": []- }- ]- }- },- "\/hetzner\/locations": {- "get": {- "tags": [- "Hetzner"- ],- "summary": "Get Hetzner Locations",- "description": "Get all available Hetzner datacenter locations.",- "operationId": "get-hetzner-locations",- "parameters": [- {- "name": "cloud_provider_token_uuid",- "in": "query",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",- "required": false,- "schema": {- "type": "string"- }- },- {- "name": "cloud_provider_token_id",- "in": "query",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "required": false,- "deprecated": true,- "schema": {- "type": "string"+ "description": "The frequency of the scheduled task."+ },+ "container": {+ "type": "string",+ "nullable": true,+ "description": "The container where the command should be executed."+ },+ "timeout": {+ "type": "integer",+ "description": "The timeout of the scheduled task in seconds.",+ "default": 300+ },+ "enabled": {+ "type": "boolean",+ "description": "The flag to indicate if the scheduled task is enabled.",+ "default": true+ }+ },+ "type": "object"+ }}}- ],+ },"responses": {- "200": {- "description": "List of Hetzner locations.",+ "201": {+ "description": "Scheduled task created.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "properties": {- "id": {- "type": "integer"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "country": {- "type": "string"- },- "city": {- "type": "string"- },- "latitude": {- "type": "number"- },- "longitude": {- "type": "number"- }- },- "type": "object"- }+ "$ref": "#\/components\/schemas\/ScheduledTask"}}}@@ -9510,6 +13654,9 @@},"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -9519,30 +13666,29 @@]}},- "\/hetzner\/server-types": {- "get": {+ "\/services\/{uuid}\/scheduled-tasks\/{task_uuid}": {+ "delete": {"tags": [- "Hetzner"+ "Scheduled Tasks"],- "summary": "Get Hetzner Server Types",- "description": "Get all available Hetzner server types (instance sizes).",- "operationId": "get-hetzner-server-types",+ "summary": "Delete Task",+ "description": "Delete a scheduled task for a service.",+ "operationId": "delete-scheduled-task-by-service-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",- "required": false,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,"schema": {"type": "string"}},{- "name": "cloud_provider_token_id",- "in": "query",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "required": false,- "deprecated": true,+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,"schema": {"type": "string"}@@ -9550,68 +13696,17 @@],"responses": {"200": {- "description": "List of Hetzner server types.",+ "description": "Scheduled task deleted.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "properties": {- "id": {- "type": "integer"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "cores": {- "type": "integer"- },- "memory": {- "type": "number"- },- "disk": {- "type": "integer"- },- "prices": {- "type": "array",- "items": {- "type": "object",- "properties": {- "location": {- "type": "string",- "description": "Datacenter location name"- },- "price_hourly": {- "type": "object",- "properties": {- "net": {- "type": "string"- },- "gross": {- "type": "string"- }- }- },- "price_monthly": {- "type": "object",- "properties": {- "net": {- "type": "string"- },- "gross": {- "type": "string"- }- }- }- }- }- }- },- "type": "object"- }+ "properties": {+ "message": {+ "type": "string",+ "example": "Scheduled task deleted."+ }+ },+ "type": "object"}}}@@ -9628,70 +13723,81 @@"bearerAuth": []}]- }- },- "\/hetzner\/images": {- "get": {+ },+ "patch": {"tags": [- "Hetzner"+ "Scheduled Tasks"],- "summary": "Get Hetzner Images",- "description": "Get all available Hetzner system images (operating systems).",- "operationId": "get-hetzner-images",+ "summary": "Update Task",+ "description": "Update a scheduled task for a service.",+ "operationId": "update-scheduled-task-by-service-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",- "required": false,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,"schema": {"type": "string"}},{- "name": "cloud_provider_token_id",- "in": "query",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "required": false,- "deprecated": true,+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "description": "Scheduled task data",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "name": {+ "type": "string",+ "description": "The name of the scheduled task."+ },+ "command": {+ "type": "string",+ "description": "The command to execute."+ },+ "frequency": {+ "type": "string",+ "description": "The frequency of the scheduled task."+ },+ "container": {+ "type": "string",+ "nullable": true,+ "description": "The container where the command should be executed."+ },+ "timeout": {+ "type": "integer",+ "description": "The timeout of the scheduled task in seconds.",+ "default": 300+ },+ "enabled": {+ "type": "boolean",+ "description": "The flag to indicate if the scheduled task is enabled.",+ "default": true+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "List of Hetzner images.",+ "description": "Scheduled task updated.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "properties": {- "id": {- "type": "integer"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "type": {- "type": "string"- },- "os_flavor": {- "type": "string"- },- "os_version": {- "type": "string"- },- "architecture": {- "type": "string"- }- },- "type": "object"- }+ "$ref": "#\/components\/schemas\/ScheduledTask"}}}@@ -9701,6 +13807,9 @@},"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -9710,30 +13819,29 @@]}},- "\/hetzner\/ssh-keys": {+ "\/services\/{uuid}\/scheduled-tasks\/{task_uuid}\/executions": {"get": {"tags": [- "Hetzner"+ "Scheduled Tasks"],- "summary": "Get Hetzner SSH Keys",- "description": "Get all SSH keys stored in the Hetzner account.",- "operationId": "get-hetzner-ssh-keys",+ "summary": "List Executions",+ "description": "List all executions for a scheduled task on a service.",+ "operationId": "list-scheduled-task-executions-by-service-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",- "required": false,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,"schema": {"type": "string"}},{- "name": "cloud_provider_token_id",- "in": "query",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "required": false,- "deprecated": true,+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,"schema": {"type": "string"}@@ -9741,27 +13849,13 @@],"responses": {"200": {- "description": "List of Hetzner SSH keys.",+ "description": "Get all executions for a scheduled task.","content": {"application\/json": {"schema": {"type": "array","items": {- "properties": {- "id": {- "type": "integer"- },- "name": {- "type": "string"- },- "fingerprint": {- "type": "string"- },- "public_key": {- "type": "string"- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/ScheduledTaskExecution"}}}@@ -9781,30 +13875,29 @@]}},- "\/hetzner\/firewalls": {- "get": {+ "\/applications\/{uuid}\/scheduled-tasks\/{task_uuid}\/execute": {+ "post": {"tags": [- "Hetzner"+ "Scheduled Tasks"],- "summary": "Get Hetzner Firewalls",- "description": "Get all existing Hetzner firewalls for the current project.",- "operationId": "get-hetzner-firewalls",+ "summary": "Execute Task",+ "description": "Queue immediate execution of a scheduled task for an application.",+ "operationId": "execute-scheduled-task-by-application-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",- "required": false,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the application.",+ "required": true,"schema": {"type": "string"}},{- "name": "cloud_provider_token_id",- "in": "query",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "required": false,- "deprecated": true,+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,"schema": {"type": "string"}@@ -9812,25 +13905,7 @@],"responses": {"200": {- "description": "List of Hetzner firewalls.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "properties": {- "id": {- "type": "integer"- },- "name": {- "type": "string"- }- },- "type": "object"- }- }- }- }+ "description": "Scheduled task execution queued."},"401": {"$ref": "#\/components\/responses\/401"@@ -9846,30 +13921,29 @@]}},- "\/hetzner\/networks": {- "get": {+ "\/services\/{uuid}\/scheduled-tasks\/{task_uuid}\/execute": {+ "post": {"tags": [- "Hetzner"+ "Scheduled Tasks"],- "summary": "Get Hetzner Networks",- "description": "Get all existing Hetzner private networks for the current project.",- "operationId": "get-hetzner-networks",+ "summary": "Execute Task",+ "description": "Queue immediate execution of a scheduled task for a service.",+ "operationId": "execute-scheduled-task-by-service-uuid","parameters": [{- "name": "cloud_provider_token_uuid",- "in": "query",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided.",- "required": false,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,"schema": {"type": "string"}},{- "name": "cloud_provider_token_id",- "in": "query",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "required": false,- "deprecated": true,+ "name": "task_uuid",+ "in": "path",+ "description": "UUID of the scheduled task.",+ "required": true,"schema": {"type": "string"}@@ -9877,24 +13951,39 @@],"responses": {"200": {- "description": "List of Hetzner networks.",+ "description": "Scheduled task execution queued."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/security\/keys": {+ "get": {+ "tags": [+ "Private Keys"+ ],+ "summary": "List",+ "description": "List all private keys.",+ "operationId": "list-private-keys",+ "responses": {+ "200": {+ "description": "Get all private keys.","content": {"application\/json": {"schema": {"type": "array","items": {- "properties": {- "id": {- "type": "integer"- },- "name": {- "type": "string"- },- "ip_range": {- "type": "string"- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/PrivateKey"}}}@@ -9903,8 +13992,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "404": {- "$ref": "#\/components\/responses\/404"+ "400": {+ "$ref": "#\/components\/responses\/400"}},"security": [@@ -9912,135 +14001,112 @@"bearerAuth": []}]- }- },- "\/servers\/hetzner": {+ },"post": {"tags": [- "Hetzner"+ "Private Keys"],- "summary": "Create Hetzner Server",- "description": "Create a new server on Hetzner and register it in Coolify.",- "operationId": "create-hetzner-server",+ "summary": "Create",+ "description": "Create a new private key.",+ "operationId": "create-private-key","requestBody": {- "description": "Hetzner server creation parameters","required": true,"content": {"application\/json": {"schema": {"required": [- "location",- "server_type",- "image",- "private_key_uuid"+ "private_key"],"properties": {- "cloud_provider_token_uuid": {- "type": "string",- "example": "abc123",- "description": "Cloud provider token UUID. Required if cloud_provider_token_id is not provided."- },- "cloud_provider_token_id": {- "type": "string",- "example": "abc123",- "description": "Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.",- "deprecated": true- },- "location": {- "type": "string",- "example": "nbg1",- "description": "Hetzner location name"- },- "server_type": {- "type": "string",- "example": "cx11",- "description": "Hetzner server type name"- },- "image": {- "type": "integer",- "example": 15512617,- "description": "Hetzner image ID"- },"name": {- "type": "string",- "example": "my-server",- "description": "Server name (auto-generated if not provided)"- },- "private_key_uuid": {- "type": "string",- "example": "xyz789",- "description": "Private key UUID"- },- "enable_ipv4": {- "type": "boolean",- "example": true,- "description": "Enable IPv4 (default: true)"- },- "enable_ipv6": {- "type": "boolean",- "example": true,- "description": "Enable IPv6 (default: true)"- },- "enable_backups": {- "type": "boolean",- "example": false,- "description": "Enable Hetzner server backups after creation (adds 20% to the monthly server fee)"+ "type": "string"},- "hetzner_ssh_key_ids": {- "type": "array",- "items": {- "type": "integer"- },- "description": "Additional Hetzner SSH key IDs"+ "description": {+ "type": "string"},- "hetzner_firewall_ids": {- "type": "array",- "items": {- "type": "integer"- },- "description": "Existing Hetzner firewall IDs to apply during server creation"+ "private_key": {+ "type": "string"+ }+ },+ "type": "object",+ "additionalProperties": false+ }+ }+ }+ },+ "responses": {+ "201": {+ "description": "The created private key's UUID.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "uuid": {+ "type": "string"+ }},- "hetzner_network_ids": {- "type": "array",- "items": {- "type": "integer"- },- "description": "Existing Hetzner network IDs to attach during server creation"+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Private Keys"+ ],+ "summary": "Update",+ "description": "Update a private key.",+ "operationId": "update-private-key",+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "private_key"+ ],+ "properties": {+ "name": {+ "type": "string"},- "cloud_init_script": {- "type": "string",- "description": "Cloud-init YAML script (optional)"+ "description": {+ "type": "string"},- "instant_validate": {- "type": "boolean",- "example": false,- "description": "Validate server immediately after creation"+ "private_key": {+ "type": "string"}},- "type": "object"+ "type": "object",+ "additionalProperties": false}}}},"responses": {"201": {- "description": "Hetzner server created.",+ "description": "The updated private key's UUID.","content": {"application\/json": {"schema": {"properties": {"uuid": {- "type": "string",- "example": "og888os",- "description": "The UUID of the server."- },- "hetzner_server_id": {- "type": "integer",- "description": "The Hetzner server ID."- },- "ip": {- "type": "string",- "description": "The server IP address."+ "type": "string"}},"type": "object"@@ -10054,14 +14120,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"- },"422": {"$ref": "#\/components\/responses\/422"- },- "429": {- "$ref": "#\/components\/responses\/429"}},"security": [@@ -10071,20 +14131,33 @@]}},- "\/version": {+ "\/security\/keys\/{uuid}": {"get": {- "summary": "Version",- "description": "Get Coolify version.",- "operationId": "version",+ "tags": [+ "Private Keys"+ ],+ "summary": "Get",+ "description": "Get key by UUID.",+ "operationId": "get-private-key-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Private Key UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {"200": {- "description": "Returns the version of the application",+ "description": "Get all private keys.","content": {- "text\/html": {+ "application\/json": {"schema": {- "type": "string"- },- "example": "v4.0.0"+ "$ref": "#\/components\/schemas\/PrivateKey"+ }}}},@@ -10093,6 +14166,9 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "description": "Private Key not found."}},"security": [@@ -10100,23 +14176,35 @@"bearerAuth": []}]- }- },- "\/enable": {- "post": {- "summary": "Enable API",- "description": "Enable API (only with root permissions).",- "operationId": "enable-api",+ },+ "delete": {+ "tags": [+ "Private Keys"+ ],+ "summary": "Delete",+ "description": "Delete a private key.",+ "operationId": "delete-private-key-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Private Key UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {"200": {- "description": "Enable API.",+ "description": "Private Key deleted.","content": {"application\/json": {"schema": {"properties": {"message": {"type": "string",- "example": "API enabled."+ "example": "Private Key deleted."}},"type": "object"@@ -10124,15 +14212,76 @@}}},- "403": {- "description": "You are not allowed to enable the API.",+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "description": "Private Key not found."+ },+ "422": {+ "description": "Private Key is in use and cannot be deleted.","content": {"application\/json": {"schema": {"properties": {"message": {"type": "string",- "example": "You are not allowed to enable the API."+ "example": "Private Key is in use and cannot be deleted."+ }+ },+ "type": "object"+ }+ }+ }+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/servers\/{uuid}\/cloudflare-tunnel": {+ "get": {+ "tags": [+ "Servers"+ ],+ "summary": "Get Cloudflare Tunnel settings",+ "description": "Get Cloudflare Tunnel settings for a server owned by the authenticated team.",+ "operationId": "get-server-cloudflare-tunnel",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Cloudflare Tunnel settings.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "is_cloudflare_tunnel": {+ "type": "boolean"+ },+ "ip": {+ "type": "string"+ },+ "ip_previous": {+ "type": [+ "string",+ "null"+ ]}},"type": "object"@@ -10145,6 +14294,65 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Servers"+ ],+ "summary": "Update Cloudflare Tunnel settings",+ "description": "Update stored Cloudflare Tunnel settings for a server. Does not run remote cloudflared configuration; use enable\/disable for the manual UI actions.",+ "operationId": "update-server-cloudflare-tunnel",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "is_cloudflare_tunnel": {+ "type": "boolean"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "responses": {+ "200": {+ "description": "Updated Cloudflare Tunnel settings."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -10154,49 +14362,40 @@]}},- "\/disable": {+ "\/servers\/{uuid}\/cloudflare-tunnel\/enable": {"post": {- "summary": "Disable API",- "description": "Disable API (only with root permissions).",- "operationId": "disable-api",+ "tags": [+ "Servers"+ ],+ "summary": "Enable Cloudflare Tunnel (manual)",+ "description": "Manually mark Cloudflare Tunnel as enabled for a server (matches UI manual enable). Does not deploy cloudflared remotely.",+ "operationId": "enable-server-cloudflare-tunnel",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {"200": {- "description": "Disable API.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "API disabled."- }- },- "type": "object"- }- }- }- },- "403": {- "description": "You are not allowed to disable the API.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "You are not allowed to disable the API."- }- },- "type": "object"- }- }- }+ "description": "Cloudflare Tunnel enabled."},"401": {"$ref": "#\/components\/responses\/401"},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -10206,49 +14405,40 @@]}},- "\/mcp\/enable": {+ "\/servers\/{uuid}\/cloudflare-tunnel\/disable": {"post": {- "summary": "Enable MCP Server",- "description": "Enable the MCP server endpoint at \/mcp (only with root permissions).",- "operationId": "enable-mcp",+ "tags": [+ "Servers"+ ],+ "summary": "Disable Cloudflare Tunnel",+ "description": "Mark Cloudflare Tunnel as disabled and restore ip_previous when available. Does not remove the remote cloudflared container.",+ "operationId": "disable-server-cloudflare-tunnel",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {"200": {- "description": "MCP server enabled.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "MCP server enabled."- }- },- "type": "object"- }- }- }- },- "403": {- "description": "You are not allowed to enable the MCP server.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "You are not allowed to enable the MCP server."- }- },- "type": "object"- }- }- }+ "description": "Cloudflare Tunnel disabled."},"401": {"$ref": "#\/components\/responses\/401"},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -10258,37 +14448,49 @@]}},- "\/mcp\/disable": {- "post": {- "summary": "Disable MCP Server",- "description": "Disable the MCP server endpoint at \/mcp (only with root permissions).",- "operationId": "disable-mcp",+ "\/servers\/{uuid}\/docker-cleanup": {+ "get": {+ "tags": [+ "Servers"+ ],+ "summary": "Get Docker cleanup settings",+ "description": "Get Docker cleanup settings for a server owned by the authenticated team.",+ "operationId": "get-server-docker-cleanup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {"200": {- "description": "MCP server disabled.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "MCP server disabled."- }- },- "type": "object"- }- }- }- },- "403": {- "description": "You are not allowed to disable the MCP server.",+ "description": "Docker cleanup settings.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string",- "example": "You are not allowed to disable the MCP server."+ "docker_cleanup_frequency": {+ "type": "string"+ },+ "docker_cleanup_threshold": {+ "type": "integer"+ },+ "force_docker_cleanup": {+ "type": "boolean"+ },+ "delete_unused_volumes": {+ "type": "boolean"+ },+ "delete_unused_networks": {+ "type": "boolean"+ },+ "disable_application_image_retention": {+ "type": "boolean"}},"type": "object"@@ -10301,6 +14503,9 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -10308,52 +14513,85 @@"bearerAuth": []}]- }- },- "\/health": {- "get": {- "summary": "Healthcheck",- "description": "Healthcheck endpoint.",- "operationId": "healthcheck",- "responses": {- "200": {- "description": "Healthcheck endpoint.",- "content": {- "text\/html": {- "schema": {- "type": "string"+ },+ "patch": {+ "tags": [+ "Servers"+ ],+ "summary": "Update Docker cleanup settings",+ "description": "Update Docker cleanup settings for a server owned by the authenticated team.",+ "operationId": "update-server-docker-cleanup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "docker_cleanup_frequency": {+ "description": "Cron \/ human frequency expression.",+ "type": "string"+ },+ "docker_cleanup_threshold": {+ "type": "integer",+ "maximum": 99,+ "minimum": 1+ },+ "force_docker_cleanup": {+ "type": "boolean"+ },+ "delete_unused_volumes": {+ "type": "boolean"+ },+ "delete_unused_networks": {+ "type": "boolean"+ },+ "disable_application_image_retention": {+ "type": "boolean"+ }},- "example": "OK"+ "type": "object"}}- },- "401": {- "$ref": "#\/components\/responses\/401"- },- "400": {- "$ref": "#\/components\/responses\/400"}- }- }- },- "\/projects": {- "get": {- "tags": [- "Projects"- ],- "summary": "List",- "description": "List projects.",- "operationId": "list-projects",+ },"responses": {"200": {- "description": "Get all projects.",+ "description": "Updated Docker cleanup settings.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Project"- }+ "properties": {+ "docker_cleanup_frequency": {+ "type": "string"+ },+ "docker_cleanup_threshold": {+ "type": "integer"+ },+ "force_docker_cleanup": {+ "type": "boolean"+ },+ "delete_unused_volumes": {+ "type": "boolean"+ },+ "delete_unused_networks": {+ "type": "boolean"+ },+ "disable_application_image_retention": {+ "type": "boolean"+ }+ },+ "type": "object"}}}@@ -10363,6 +14601,12 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -10370,28 +14614,38 @@"bearerAuth": []}]- },+ }+ },+ "\/servers\/{uuid}\/docker-cleanup\/run": {"post": {"tags": [- "Projects"+ "Servers"+ ],+ "summary": "Run Docker cleanup",+ "description": "Dispatch a manual Docker cleanup job for a server owned by the authenticated team.",+ "operationId": "run-server-docker-cleanup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }],- "summary": "Create",- "description": "Create Project.",- "operationId": "create-project","requestBody": {- "description": "Project created.",- "required": true,+ "required": false,"content": {"application\/json": {"schema": {"properties": {- "name": {- "type": "string",- "description": "The name of the project."+ "delete_unused_volumes": {+ "type": "boolean"},- "description": {- "type": "string",- "description": "The description of the project."+ "delete_unused_networks": {+ "type": "boolean"}},"type": "object"@@ -10400,16 +14654,15 @@}},"responses": {- "201": {- "description": "Project created.",+ "200": {+ "description": "Docker cleanup job dispatched.","content": {"application\/json": {"schema": {"properties": {- "uuid": {+ "message": {"type": "string",- "example": "og888os",- "description": "The UUID of the project."+ "example": "Manual cleanup job started."}},"type": "object"@@ -10437,19 +14690,19 @@]}},- "\/projects\/{uuid}": {+ "\/servers\/{uuid}\/docker-cleanup\/executions": {"get": {"tags": [- "Projects"+ "Servers"],- "summary": "Get",- "description": "Get project by UUID.",- "operationId": "get-project-by-uuid",+ "summary": "List Docker cleanup executions",+ "description": "List recent Docker cleanup execution logs for a server owned by the authenticated team.",+ "operationId": "list-server-docker-cleanup-executions","parameters": [{"name": "uuid","in": "path",- "description": "Project UUID",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -10458,11 +14711,40 @@],"responses": {"200": {- "description": "Project details",+ "description": "Recent Docker cleanup executions.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Project"+ "type": "array",+ "items": {+ "properties": {+ "uuid": {+ "type": "string"+ },+ "status": {+ "type": "string"+ },+ "message": {+ "type": [+ "string",+ "null"+ ]+ },+ "finished_at": {+ "type": [+ "string",+ "null"+ ]+ },+ "created_at": {+ "type": "string"+ },+ "updated_at": {+ "type": "string"+ }+ },+ "type": "object"+ }}}}@@ -10474,7 +14756,7 @@"$ref": "#\/components\/responses\/400"},"404": {- "description": "Project not found."+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -10482,19 +14764,21 @@"bearerAuth": []}]- },- "delete": {+ }+ },+ "\/servers\/{uuid}\/log-drains": {+ "get": {"tags": [- "Projects"+ "Servers"],- "summary": "Delete",- "description": "Delete project by UUID.",- "operationId": "delete-project-by-uuid",+ "summary": "Get log drain settings",+ "description": "Get log drain settings for a server owned by the authenticated team. Sensitive fields require the read:sensitive or root token ability.",+ "operationId": "get-server-log-drains","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the application.",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -10503,14 +14787,47 @@],"responses": {"200": {- "description": "Project deleted.",+ "description": "Log drain settings.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string",- "example": "Project deleted."+ "is_logdrain_newrelic_enabled": {+ "type": "boolean"+ },+ "logdrain_newrelic_license_key": {+ "description": "Only present with read:sensitive.",+ "type": "string"+ },+ "logdrain_newrelic_base_uri": {+ "type": [+ "string",+ "null"+ ]+ },+ "is_logdrain_axiom_enabled": {+ "type": "boolean"+ },+ "logdrain_axiom_dataset_name": {+ "type": [+ "string",+ "null"+ ]+ },+ "logdrain_axiom_api_key": {+ "description": "Only present with read:sensitive.",+ "type": "string"+ },+ "is_logdrain_custom_enabled": {+ "type": "boolean"+ },+ "logdrain_custom_config": {+ "description": "Only present with read:sensitive.",+ "type": "string"+ },+ "logdrain_custom_config_parser": {+ "description": "Only present with read:sensitive.",+ "type": "string"}},"type": "object"@@ -10526,9 +14843,6 @@},"404": {"$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -10539,16 +14853,16 @@},"patch": {"tags": [- "Projects"+ "Servers"],- "summary": "Update",- "description": "Update Project.",- "operationId": "update-project-by-uuid",+ "summary": "Update log drain settings",+ "description": "Update New Relic, Axiom, or custom log drain settings for a server owned by the authenticated team.",+ "operationId": "update-server-log-drains","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the project.",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -10556,19 +14870,37 @@}],"requestBody": {- "description": "Project updated.","required": true,"content": {"application\/json": {"schema": {"properties": {- "name": {- "type": "string",- "description": "The name of the project."+ "is_logdrain_newrelic_enabled": {+ "type": "boolean"},- "description": {- "type": "string",- "description": "The description of the project."+ "logdrain_newrelic_license_key": {+ "type": "string"+ },+ "logdrain_newrelic_base_uri": {+ "type": "string"+ },+ "is_logdrain_axiom_enabled": {+ "type": "boolean"+ },+ "logdrain_axiom_dataset_name": {+ "type": "string"+ },+ "logdrain_axiom_api_key": {+ "type": "string"+ },+ "is_logdrain_custom_enabled": {+ "type": "boolean"+ },+ "logdrain_custom_config": {+ "type": "string"+ },+ "logdrain_custom_config_parser": {+ "type": "string"}},"type": "object"@@ -10577,29 +14909,8 @@}},"responses": {- "201": {- "description": "Project updated.",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string",- "example": "og888os"- },- "name": {- "type": "string",- "example": "Project Name"- },- "description": {- "type": "string",- "example": "Project Description"- }- },- "type": "object"- }- }- }+ "200": {+ "description": "Updated log drain settings."},"401": {"$ref": "#\/components\/responses\/401"@@ -10621,41 +14932,182 @@]}},- "\/projects\/{uuid}\/{environment_name_or_uuid}": {+ "\/servers\/{uuid}\/proxy": {"get": {"tags": [- "Projects"+ "Servers"],- "summary": "Environment",- "description": "Get environment by name or UUID.",- "operationId": "get-environment-by-name-or-uuid",+ "summary": "Get server proxy",+ "description": "Get proxy settings for a server owned by the authenticated team. The raw proxy configuration is only returned when the token has `read:sensitive` (or `root`) and the user is a team admin\/owner, and only when already stored in the database (no remote fetch).",+ "operationId": "get-server-proxy","parameters": [{"name": "uuid","in": "path",- "description": "Project UUID",+ "description": "Server UUID","required": true,"schema": {"type": "string"}+ }+ ],+ "responses": {+ "200": {+ "description": "Server proxy settings.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "proxy_type": {+ "type": [+ "string",+ "null"+ ],+ "example": "TRAEFIK"+ },+ "status": {+ "type": [+ "string",+ "null"+ ],+ "example": "running"+ },+ "redirect_enabled": {+ "type": "boolean",+ "example": true+ },+ "redirect_url": {+ "type": [+ "string",+ "null"+ ],+ "example": "https:\/\/example.com"+ },+ "generate_exact_labels": {+ "type": "boolean",+ "example": false+ },+ "configuration": {+ "description": "Docker Compose proxy configuration when stored in the database. Only present with read:sensitive.",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [{- "name": "environment_name_or_uuid",+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Servers"+ ],+ "summary": "Update server proxy",+ "description": "Update proxy redirect settings, exact labels generation, and optionally the proxy type for a team-owned server.",+ "operationId": "update-server-proxy",+ "parameters": [+ {+ "name": "uuid","in": "path",- "description": "Environment name or UUID",+ "description": "Server UUID","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "redirect_enabled": {+ "type": "boolean"+ },+ "redirect_url": {+ "description": "Public http(s) redirect URL, or null to clear.",+ "type": [+ "string",+ "null"+ ]+ },+ "generate_exact_labels": {+ "type": "boolean"+ },+ "proxy_type": {+ "description": "Proxy type (case-insensitive).",+ "type": "string",+ "enum": [+ "traefik",+ "caddy",+ "nginx",+ "none"+ ]+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "Environment details",+ "description": "Proxy settings updated.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Environment"+ "properties": {+ "proxy_type": {+ "type": [+ "string",+ "null"+ ]+ },+ "status": {+ "type": [+ "string",+ "null"+ ]+ },+ "redirect_enabled": {+ "type": "boolean"+ },+ "redirect_url": {+ "type": [+ "string",+ "null"+ ]+ },+ "generate_exact_labels": {+ "type": "boolean"+ },+ "configuration": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"}}}@@ -10680,35 +15132,87 @@]}},- "\/projects\/{uuid}\/environments": {- "get": {+ "\/servers\/{uuid}\/proxy\/configuration": {+ "put": {"tags": [- "Projects"+ "Servers"],- "summary": "List Environments",- "description": "List all environments in a project.",- "operationId": "get-environments",+ "summary": "Save server proxy configuration",+ "description": "Save the raw proxy Docker Compose configuration for a team-owned server. Multi-line configuration must be base64 encoded (same pattern as other compose payloads).",+ "operationId": "save-server-proxy-configuration","parameters": [{"name": "uuid","in": "path",- "description": "Project UUID",+ "description": "Server UUID","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "configuration"+ ],+ "properties": {+ "configuration": {+ "description": "Proxy docker-compose YAML. Prefer base64 encoding for multi-line content.",+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "List of environments",+ "description": "Proxy configuration saved.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Environment"- }+ "properties": {+ "message": {+ "type": "string",+ "example": "Proxy configuration saved."+ },+ "proxy_type": {+ "type": [+ "string",+ "null"+ ]+ },+ "status": {+ "type": [+ "string",+ "null"+ ]+ },+ "redirect_enabled": {+ "type": "boolean"+ },+ "redirect_url": {+ "type": [+ "string",+ "null"+ ]+ },+ "generate_exact_labels": {+ "type": "boolean"+ },+ "configuration": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"}}}@@ -10720,7 +15224,7 @@"$ref": "#\/components\/responses\/400"},"404": {- "description": "Project not found."+ "$ref": "#\/components\/responses\/404"},"422": {"$ref": "#\/components\/responses\/422"@@ -10731,53 +15235,37 @@"bearerAuth": []}]- },+ }+ },+ "\/servers\/{uuid}\/proxy\/restart": {"post": {"tags": [- "Projects"+ "Servers"],- "summary": "Create Environment",- "description": "Create environment in project.",- "operationId": "create-environment",+ "summary": "Restart server proxy",+ "description": "Queue a proxy restart for a team-owned server.",+ "operationId": "restart-server-proxy","parameters": [{"name": "uuid","in": "path",- "description": "Project UUID",+ "description": "Server UUID","required": true,"schema": {"type": "string"}}],- "requestBody": {- "description": "Environment created.",- "required": true,- "content": {- "application\/json": {- "schema": {- "properties": {- "name": {- "type": "string",- "description": "The name of the environment."- }- },- "type": "object"- }- }- }- },"responses": {- "201": {- "description": "Environment created.",+ "200": {+ "description": "Proxy restart queued.","content": {"application\/json": {"schema": {"properties": {- "uuid": {+ "message": {"type": "string",- "example": "env123",- "description": "The UUID of the environment."+ "example": "Proxy restart queued."}},"type": "object"@@ -10792,13 +15280,7 @@"$ref": "#\/components\/responses\/400"},"404": {- "description": "Project not found."- },- "409": {- "description": "Environment with this name already exists."- },- "422": {- "$ref": "#\/components\/responses\/422"+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -10808,28 +15290,19 @@]}},- "\/projects\/{uuid}\/environments\/{environment_name_or_uuid}": {- "delete": {+ "\/servers\/{uuid}\/sentinel": {+ "get": {"tags": [- "Projects"+ "Servers"],- "summary": "Delete Environment",- "description": "Delete environment by name or UUID. Environment must be empty.",- "operationId": "delete-environment",+ "summary": "Get Sentinel settings",+ "description": "Get Sentinel settings for a server owned by the authenticated team. sentinel_token and sentinel_custom_url require the read:sensitive or root token ability.",+ "operationId": "get-server-sentinel","parameters": [{"name": "uuid","in": "path",- "description": "Project UUID",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "environment_name_or_uuid",- "in": "path",- "description": "Environment name or UUID",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -10838,14 +15311,42 @@],"responses": {"200": {- "description": "Environment deleted.",+ "description": "Sentinel settings.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string",- "example": "Environment deleted."+ "is_sentinel_enabled": {+ "type": "boolean"+ },+ "is_metrics_enabled": {+ "type": "boolean"+ },+ "is_sentinel_debug_enabled": {+ "type": "boolean"+ },+ "sentinel_token": {+ "description": "Only present with read:sensitive.",+ "type": "string"+ },+ "sentinel_metrics_refresh_rate_seconds": {+ "type": "integer"+ },+ "sentinel_metrics_history_days": {+ "type": "integer"+ },+ "sentinel_push_interval_seconds": {+ "type": "integer"+ },+ "sentinel_custom_url": {+ "description": "Only present with read:sensitive.",+ "type": "string"+ },+ "sentinel_updated_at": {+ "type": [+ "string",+ "null"+ ]}},"type": "object"@@ -10857,13 +15358,10 @@"$ref": "#\/components\/responses\/401"},"400": {- "description": "Environment has resources, so it cannot be deleted."+ "$ref": "#\/components\/responses\/400"},"404": {- "description": "Project or environment not found."- },- "422": {- "$ref": "#\/components\/responses\/422"+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -10871,33 +15369,82 @@"bearerAuth": []}]- }- },- "\/resources": {- "get": {+ },+ "patch": {"tags": [- "Resources"+ "Servers"],- "summary": "List",- "description": "Get all resources.",- "operationId": "list-resources",- "responses": {- "200": {- "description": "Get all resources",- "content": {- "application\/json": {- "schema": {- "type": "string"+ "summary": "Update Sentinel settings",+ "description": "Update Sentinel settings for a server owned by the authenticated team. Changing token\/metrics timing fields may restart Sentinel.",+ "operationId": "update-server-sentinel",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Server UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "is_sentinel_enabled": {+ "type": "boolean"+ },+ "is_metrics_enabled": {+ "type": "boolean"+ },+ "is_sentinel_debug_enabled": {+ "type": "boolean"+ },+ "sentinel_token": {+ "type": "string"+ },+ "sentinel_metrics_refresh_rate_seconds": {+ "type": "integer",+ "minimum": 1+ },+ "sentinel_metrics_history_days": {+ "type": "integer",+ "minimum": 1+ },+ "sentinel_push_interval_seconds": {+ "type": "integer",+ "minimum": 10+ },+ "sentinel_custom_url": {+ "type": [+ "string",+ "null"+ ]+ }},- "example": "Content is very complex. Will be implemented later."+ "type": "object"}}+ }+ },+ "responses": {+ "200": {+ "description": "Updated Sentinel settings."},"401": {"$ref": "#\/components\/responses\/401"},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -10907,34 +15454,23 @@]}},- "\/applications\/{uuid}\/scheduled-tasks": {+ "\/servers": {"get": {"tags": [- "Scheduled Tasks"- ],- "summary": "List Tasks",- "description": "List all scheduled tasks for an application.",- "operationId": "list-scheduled-tasks-by-application-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the application.",- "required": true,- "schema": {- "type": "string"- }- }+ "Servers"],+ "summary": "List",+ "description": "List all servers.",+ "operationId": "list-servers","responses": {"200": {- "description": "Get all scheduled tasks for an application.",+ "description": "Get all servers.","content": {"application\/json": {"schema": {"type": "array","items": {- "$ref": "#\/components\/schemas\/ScheduledTask"+ "$ref": "#\/components\/schemas\/Server"}}}@@ -10943,8 +15479,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "404": {- "$ref": "#\/components\/responses\/404"+ "400": {+ "$ref": "#\/components\/responses\/400"}},"security": [@@ -10955,60 +15491,67 @@},"post": {"tags": [- "Scheduled Tasks"- ],- "summary": "Create Task",- "description": "Create a new scheduled task for an application.",- "operationId": "create-scheduled-task-by-application-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the application.",- "required": true,- "schema": {- "type": "string"- }- }+ "Servers"],+ "summary": "Create",+ "description": "Create Server.",+ "operationId": "create-server","requestBody": {- "description": "Scheduled task data",+ "description": "Server created.","required": true,"content": {"application\/json": {"schema": {- "required": [- "name",- "command",- "frequency"- ],"properties": {"name": {"type": "string",- "description": "The name of the scheduled task."+ "example": "My Server",+ "description": "The name of the server."},- "command": {+ "description": {"type": "string",- "description": "The command to execute."+ "example": "My Server Description",+ "description": "The description of the server."},- "frequency": {+ "ip": {"type": "string",- "description": "The frequency of the scheduled task."+ "example": "127.0.0.1",+ "description": "The IP of the server."},- "container": {+ "port": {+ "type": "integer",+ "example": 22,+ "description": "The port of the server."+ },+ "user": {"type": "string",- "nullable": true,- "description": "The container where the command should be executed."+ "example": "root",+ "description": "The user of the server."},- "timeout": {- "type": "integer",- "description": "The timeout of the scheduled task in seconds.",- "default": 300+ "private_key_uuid": {+ "type": "string",+ "example": "og888os",+ "description": "The UUID of the private key."},- "enabled": {+ "is_build_server": {"type": "boolean",- "description": "The flag to indicate if the scheduled task is enabled.",- "default": true+ "example": false,+ "description": "Is build server."+ },+ "instant_validate": {+ "type": "boolean",+ "example": false,+ "description": "Instant validate."+ },+ "proxy_type": {+ "type": "string",+ "enum": [+ "traefik",+ "caddy",+ "none"+ ],+ "example": "traefik",+ "description": "The proxy type."}},"type": "object"@@ -11018,11 +15561,18 @@},"responses": {"201": {- "description": "Scheduled task created.",+ "description": "Server created.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/ScheduledTask"+ "properties": {+ "uuid": {+ "type": "string",+ "example": "og888os",+ "description": "The UUID of the server."+ }+ },+ "type": "object"}}}@@ -11030,6 +15580,9 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},@@ -11044,28 +15597,64 @@]}},- "\/applications\/{uuid}\/scheduled-tasks\/{task_uuid}": {- "delete": {+ "\/servers\/{uuid}": {+ "get": {"tags": [- "Scheduled Tasks"+ "Servers"],- "summary": "Delete Task",- "description": "Delete a scheduled task for an application.",- "operationId": "delete-scheduled-task-by-application-uuid",+ "summary": "Get",+ "description": "Get server by UUID.",+ "operationId": "get-server-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the application.",+ "description": "Server's UUID","required": true,"schema": {"type": "string"}+ }+ ],+ "responses": {+ "200": {+ "description": "Get server by UUID",+ "content": {+ "application\/json": {+ "schema": {+ "$ref": "#\/components\/schemas\/Server"+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [{- "name": "task_uuid",+ "bearerAuth": []+ }+ ]+ },+ "delete": {+ "tags": [+ "Servers"+ ],+ "summary": "Delete",+ "description": "Delete server by UUID.",+ "operationId": "delete-server-by-uuid",+ "parameters": [+ {+ "name": "uuid","in": "path",- "description": "UUID of the scheduled task.",+ "description": "UUID of the server.","required": true,"schema": {"type": "string"@@ -11074,14 +15663,14 @@],"responses": {"200": {- "description": "Scheduled task deleted.",+ "description": "Server deleted.","content": {"application\/json": {"schema": {"properties": {"message": {"type": "string",- "example": "Scheduled task deleted."+ "example": "Server deleted."}},"type": "object"@@ -11092,8 +15681,14 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -11104,25 +15699,16 @@},"patch": {"tags": [- "Scheduled Tasks"+ "Servers"],- "summary": "Update Task",- "description": "Update a scheduled task for an application.",- "operationId": "update-scheduled-task-by-application-uuid",+ "summary": "Update",+ "description": "Update Server.",+ "operationId": "update-server-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the application.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "task_uuid",- "in": "path",- "description": "UUID of the scheduled task.",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -11130,7 +15716,7 @@}],"requestBody": {- "description": "Scheduled task data",+ "description": "Server updated.","required": true,"content": {"application\/json": {@@ -11138,30 +15724,68 @@"properties": {"name": {"type": "string",- "description": "The name of the scheduled task."+ "description": "The name of the server."},- "command": {+ "description": {"type": "string",- "description": "The command to execute."+ "description": "The description of the server."},- "frequency": {+ "ip": {"type": "string",- "description": "The frequency of the scheduled task."+ "description": "The IP of the server."},- "container": {+ "port": {+ "type": "integer",+ "description": "The port of the server."+ },+ "user": {"type": "string",- "nullable": true,- "description": "The container where the command should be executed."+ "description": "The user of the server."},- "timeout": {- "type": "integer",- "description": "The timeout of the scheduled task in seconds.",- "default": 300+ "private_key_uuid": {+ "type": "string",+ "description": "The UUID of the private key."},- "enabled": {+ "is_build_server": {"type": "boolean",- "description": "The flag to indicate if the scheduled task is enabled.",- "default": true+ "description": "Is build server."+ },+ "instant_validate": {+ "type": "boolean",+ "description": "Instant validate."+ },+ "proxy_type": {+ "type": "string",+ "enum": [+ "traefik",+ "caddy",+ "none"+ ],+ "description": "The proxy type."+ },+ "concurrent_builds": {+ "type": "integer",+ "description": "Number of concurrent builds."+ },+ "dynamic_timeout": {+ "type": "integer",+ "description": "Deployment timeout in seconds."+ },+ "deployment_queue_limit": {+ "type": "integer",+ "description": "Maximum number of queued deployments."+ },+ "server_disk_usage_notification_threshold": {+ "type": "integer",+ "description": "Server disk usage notification threshold (%)."+ },+ "server_disk_usage_check_frequency": {+ "type": "string",+ "description": "Cron expression for disk usage check frequency."+ },+ "connection_timeout": {+ "type": "integer",+ "description": "SSH connection timeout in seconds (1-300). Default: 10."}},"type": "object"@@ -11170,12 +15794,12 @@}},"responses": {- "200": {- "description": "Scheduled task updated.",+ "201": {+ "description": "Server updated.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/ScheduledTask"+ "$ref": "#\/components\/schemas\/Server"}}}@@ -11183,6 +15807,9 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},@@ -11197,28 +15824,19 @@]}},- "\/applications\/{uuid}\/scheduled-tasks\/{task_uuid}\/executions": {+ "\/servers\/{uuid}\/resources": {"get": {"tags": [- "Scheduled Tasks"+ "Servers"],- "summary": "List Executions",- "description": "List all executions for a scheduled task on an application.",- "operationId": "list-scheduled-task-executions-by-application-uuid",+ "summary": "Resources",+ "description": "Get resources by server.",+ "operationId": "get-resources-by-server-uuid","parameters": [{- "name": "uuid",- "in": "path",- "description": "UUID of the application.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "task_uuid",+ "name": "uuid","in": "path",- "description": "UUID of the scheduled task.",+ "description": "Server's UUID","required": true,"schema": {"type": "string"@@ -11227,13 +15845,36 @@],"responses": {"200": {- "description": "Get all executions for a scheduled task.",+ "description": "Get resources by server","content": {"application\/json": {"schema": {"type": "array","items": {- "$ref": "#\/components\/schemas\/ScheduledTaskExecution"+ "properties": {+ "id": {+ "type": "integer"+ },+ "uuid": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "type": {+ "type": "string"+ },+ "created_at": {+ "type": "string"+ },+ "updated_at": {+ "type": "string"+ },+ "status": {+ "type": "string"+ }+ },+ "type": "object"}}}@@ -11242,8 +15883,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "404": {- "$ref": "#\/components\/responses\/404"+ "400": {+ "$ref": "#\/components\/responses\/400"}},"security": [@@ -11253,19 +15894,19 @@]}},- "\/services\/{uuid}\/scheduled-tasks": {+ "\/servers\/{uuid}\/domains": {"get": {"tags": [- "Scheduled Tasks"+ "Servers"],- "summary": "List Tasks",- "description": "List all scheduled tasks for a service.",- "operationId": "list-scheduled-tasks-by-service-uuid",+ "summary": "Domains",+ "description": "Get domains by server.",+ "operationId": "get-domains-by-server-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Server's UUID","required": true,"schema": {"type": "string"@@ -11274,13 +15915,24 @@],"responses": {"200": {- "description": "Get all scheduled tasks for a service.",+ "description": "Get domains by server","content": {"application\/json": {"schema": {"type": "array","items": {- "$ref": "#\/components\/schemas\/ScheduledTask"+ "properties": {+ "ip": {+ "type": "string"+ },+ "domains": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+ },+ "type": "object"}}}@@ -11289,8 +15941,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "404": {- "$ref": "#\/components\/responses\/404"+ "400": {+ "$ref": "#\/components\/responses\/400"}},"security": [@@ -11298,19 +15950,21 @@"bearerAuth": []}]- },+ }+ },+ "\/servers\/{uuid}\/validate": {"post": {"tags": [- "Scheduled Tasks"+ "Servers"],- "summary": "Create Task",- "description": "Create a new scheduled task for a service.",- "operationId": "create-scheduled-task-by-service-uuid",+ "summary": "Validate",+ "description": "Validate server by UUID.",+ "operationId": "validate-server-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -11318,43 +15972,15 @@}],"requestBody": {- "description": "Scheduled task data",- "required": true,+ "required": false,"content": {"application\/json": {"schema": {- "required": [- "name",- "command",- "frequency"- ],"properties": {- "name": {- "type": "string",- "description": "The name of the scheduled task."- },- "command": {- "type": "string",- "description": "The command to execute."- },- "frequency": {- "type": "string",- "description": "The frequency of the scheduled task."- },- "container": {- "type": "string",- "nullable": true,- "description": "The container where the command should be executed."- },- "timeout": {- "type": "integer",- "description": "The timeout of the scheduled task in seconds.",- "default": 300- },- "enabled": {+ "install": {+ "description": "Install missing prerequisites and Docker. This can restart the Docker daemon.","type": "boolean",- "description": "The flag to indicate if the scheduled task is enabled.",- "default": true+ "default": false}},"type": "object"@@ -11364,11 +15990,17 @@},"responses": {"201": {- "description": "Scheduled task created.",+ "description": "Server validation started.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/ScheduledTask"+ "properties": {+ "message": {+ "type": "string",+ "example": "Validation started."+ }+ },+ "type": "object"}}}@@ -11376,6 +16008,9 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},@@ -11390,28 +16025,75 @@]}},- "\/services\/{uuid}\/scheduled-tasks\/{task_uuid}": {- "delete": {+ "\/services\/{uuid}\/applications": {+ "get": {"tags": [- "Scheduled Tasks"+ "Service applications"],- "summary": "Delete Task",- "description": "Delete a scheduled task for a service.",- "operationId": "delete-scheduled-task-by-service-uuid",+ "summary": "List service applications",+ "description": "List compose service applications (containers) for a single service.",+ "operationId": "list-service-applications-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Service UUID.","required": true,"schema": {"type": "string"}+ }+ ],+ "responses": {+ "200": {+ "description": "Service applications for this service.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "type": "object"+ }+ }+ }+ }+ },+ "401": {+ "$ref": "#\/components\/responses\/401"},+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [{- "name": "task_uuid",+ "bearerAuth": []+ }+ ]+ }+ },+ "\/services\/{uuid}\/applications\/{app_uuid}": {+ "get": {+ "tags": [+ "Service applications"+ ],+ "summary": "Get service application",+ "description": "Get a single compose service application by service UUID and application UUID.",+ "operationId": "get-service-application-by-service-and-app-uuid",+ "parameters": [+ {+ "name": "uuid","in": "path",- "description": "UUID of the scheduled task.",+ "description": "Service UUID.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "app_uuid",+ "in": "path",+ "description": "Service application UUID.","required": true,"schema": {"type": "string"@@ -11420,16 +16102,10 @@],"responses": {"200": {- "description": "Scheduled task deleted.",+ "description": "Service application.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string",- "example": "Scheduled task deleted."- }- },"type": "object"}}@@ -11450,64 +16126,94 @@},"patch": {"tags": [- "Scheduled Tasks"+ "Service applications"],- "summary": "Update Task",- "description": "Update a scheduled task for a service.",- "operationId": "update-scheduled-task-by-service-uuid",+ "summary": "Update service application",+ "description": "Update fields for a compose service application. Use `url` for comma-separated public URLs (same rules as `urls[].url` on PATCH \/services\/{uuid}).",+ "operationId": "patch-service-application-by-service-and-app-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Service UUID.","required": true,"schema": {"type": "string"}},{- "name": "task_uuid",+ "name": "app_uuid","in": "path",- "description": "UUID of the scheduled task.",+ "description": "Service application UUID.","required": true,"schema": {"type": "string"}+ },+ {+ "name": "force_domain_override",+ "in": "query",+ "description": "When true, allow duplicate URLs in the request and proceed despite domain conflicts (same as service PATCH).",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false+ }}],"requestBody": {- "description": "Scheduled task data",- "required": true,"content": {"application\/json": {"schema": {"properties": {- "name": {- "type": "string",- "description": "The name of the scheduled task."+ "url": {+ "description": "Comma-separated list of URLs (e.g. \"http:\/\/app.example.com:8080,https:\/\/app2.example.com\"). Stored as fqdn.",+ "type": [+ "string",+ "null"+ ]},- "command": {- "type": "string",- "description": "The command to execute."+ "human_name": {+ "type": [+ "string",+ "null"+ ]+ },+ "description": {+ "type": [+ "string",+ "null"+ ]+ },+ "image": {+ "type": [+ "string",+ "null"+ ]},- "frequency": {- "type": "string",- "description": "The frequency of the scheduled task."+ "exclude_from_status": {+ "type": [+ "boolean",+ "null"+ ]},- "container": {- "type": "string",- "nullable": true,- "description": "The container where the command should be executed."+ "is_log_drain_enabled": {+ "type": [+ "boolean",+ "null"+ ]},- "timeout": {- "type": "integer",- "description": "The timeout of the scheduled task in seconds.",- "default": 300+ "is_gzip_enabled": {+ "type": [+ "boolean",+ "null"+ ]},- "enabled": {- "type": "boolean",- "description": "The flag to indicate if the scheduled task is enabled.",- "default": true+ "is_stripprefix_enabled": {+ "type": [+ "boolean",+ "null"+ ]}},"type": "object"@@ -11517,11 +16223,11 @@},"responses": {"200": {- "description": "Scheduled task updated.",+ "description": "Updated service application.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/ScheduledTask"+ "type": "object"}}}@@ -11532,6 +16238,9 @@"404": {"$ref": "#\/components\/responses\/404"},+ "409": {+ "description": "Domain conflicts (unless force_domain_override)."+ },"422": {"$ref": "#\/components\/responses\/422"}@@ -11543,53 +16252,72 @@]}},- "\/services\/{uuid}\/scheduled-tasks\/{task_uuid}\/executions": {+ "\/services\/{uuid}\/applications\/{app_uuid}\/logs": {"get": {"tags": [- "Scheduled Tasks"+ "Service applications"],- "summary": "List Executions",- "description": "List all executions for a scheduled task on a service.",- "operationId": "list-scheduled-task-executions-by-service-uuid",+ "summary": "Get service application logs",+ "description": "Get Docker logs for a single compose service container.",+ "operationId": "get-service-application-logs-by-service-and-app-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Service UUID.","required": true,"schema": {"type": "string"}},{- "name": "task_uuid",+ "name": "app_uuid","in": "path",- "description": "UUID of the scheduled task.",+ "description": "Service application UUID.","required": true,"schema": {"type": "string"}+ },+ {+ "name": "lines",+ "in": "query",+ "description": "Number of lines to show from the end of the logs.",+ "required": false,+ "schema": {+ "type": "integer",+ "format": "int32",+ "default": 100+ }}],"responses": {"200": {- "description": "Get all executions for a scheduled task.",+ "description": "Logs.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/ScheduledTaskExecution"- }+ "properties": {+ "logs": {+ "type": "string"+ }+ },+ "type": "object"}}}},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"401": {"$ref": "#\/components\/responses\/401"},"404": {"$ref": "#\/components\/responses\/404"+ },+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -11597,83 +16325,50 @@"bearerAuth": []}]- }- },- "\/security\/keys": {- "get": {+ },+ "post": {"tags": [- "Private Keys"+ "Service applications"],- "summary": "List",- "description": "List all private keys.",- "operationId": "list-private-keys",- "responses": {- "200": {- "description": "Get all private keys.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/PrivateKey"- }- }- }+ "summary": "Get service application logs",+ "description": "Get Docker logs for a single compose service container.",+ "operationId": "post-service-application-logs-by-service-and-app-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"}},- "401": {- "$ref": "#\/components\/responses\/401"+ {+ "name": "app_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }},- "400": {- "$ref": "#\/components\/responses\/400"- }- },- "security": [{- "bearerAuth": []- }- ]- },- "post": {- "tags": [- "Private Keys"- ],- "summary": "Create",- "description": "Create a new private key.",- "operationId": "create-private-key",- "requestBody": {- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "private_key"- ],- "properties": {- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "private_key": {- "type": "string"- }- },- "type": "object",- "additionalProperties": false- }+ "name": "lines",+ "in": "query",+ "required": false,+ "schema": {+ "type": "integer",+ "format": "int32",+ "default": 100}}- },+ ],"responses": {- "201": {- "description": "The created private key's UUID.",+ "200": {+ "description": "Logs.","content": {"application\/json": {"schema": {"properties": {- "uuid": {+ "logs": {"type": "string"}},@@ -11682,14 +16377,17 @@}}},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"},- "422": {- "$ref": "#\/components\/responses\/422"+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -11697,47 +16395,60 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/services\/{uuid}\/applications\/{app_uuid}\/start": {+ "post": {"tags": [- "Private Keys"+ "Service applications"],- "summary": "Update",- "description": "Update a private key.",- "operationId": "update-private-key",- "requestBody": {- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "private_key"- ],- "properties": {- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "private_key": {- "type": "string"- }- },- "type": "object",- "additionalProperties": false- }+ "summary": "Start or redeploy service application container",+ "description": "Runs docker compose up for a single compose service (no-deps), optionally pulling the image and rebuilding.",+ "operationId": "post-start-service-application-by-service-and-app-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "app_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "force",+ "in": "query",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false+ }+ },+ {+ "name": "latest",+ "in": "query",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false}}- },+ ],"responses": {- "201": {- "description": "The updated private key's UUID.",+ "200": {+ "description": "Deploy request queued.","content": {"application\/json": {"schema": {"properties": {- "uuid": {+ "message": {"type": "string"}},@@ -11746,14 +16457,17 @@}}},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"},- "422": {- "$ref": "#\/components\/responses\/422"+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -11763,19 +16477,26 @@]}},- "\/security\/keys\/{uuid}": {- "get": {+ "\/services\/{uuid}\/applications\/{app_uuid}\/restart": {+ "post": {"tags": [- "Private Keys"+ "Service applications"],- "summary": "Get",- "description": "Get key by UUID.",- "operationId": "get-private-key-by-uuid",+ "summary": "Restart service application container",+ "description": "Restarts a single compose service container.",+ "operationId": "post-restart-service-application-by-service-and-app-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Private Key UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "app_uuid",+ "in": "path","required": true,"schema": {"type": "string"@@ -11784,23 +16505,31 @@],"responses": {"200": {- "description": "Get all private keys.",+ "description": "Restart queued.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/PrivateKey"+ "properties": {+ "message": {+ "type": "string"+ }+ },+ "type": "object"}}}},- "401": {- "$ref": "#\/components\/responses\/401"- },"400": {"$ref": "#\/components\/responses\/400"},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {- "description": "Private Key not found."+ "$ref": "#\/components\/responses\/404"+ },+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -11808,19 +16537,28 @@"bearerAuth": []}]- },- "delete": {+ }+ },+ "\/services\/{uuid}\/applications\/{app_uuid}\/stop": {+ "post": {"tags": [- "Private Keys"+ "Service applications"],- "summary": "Delete",- "description": "Delete a private key.",- "operationId": "delete-private-key-by-uuid",+ "summary": "Stop service application container",+ "description": "Stops a single compose service container.",+ "operationId": "post-stop-service-application-by-service-and-app-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Private Key UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "app_uuid",+ "in": "path","required": true,"schema": {"type": "string"@@ -11829,14 +16567,13 @@],"responses": {"200": {- "description": "Private Key deleted.",+ "description": "Stop queued.","content": {"application\/json": {"schema": {"properties": {"message": {- "type": "string",- "example": "Private Key deleted."+ "type": "string"}},"type": "object"@@ -11844,30 +16581,17 @@}}},- "401": {- "$ref": "#\/components\/responses\/401"- },"400": {"$ref": "#\/components\/responses\/400"},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {- "description": "Private Key not found."+ "$ref": "#\/components\/responses\/404"},- "422": {- "description": "Private Key is in use and cannot be deleted.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Private Key is in use and cannot be deleted."- }- },- "type": "object"- }- }- }+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -11877,23 +16601,34 @@]}},- "\/servers": {+ "\/services\/{uuid}\/databases": {"get": {"tags": [- "Servers"+ "Service databases"+ ],+ "summary": "List service databases",+ "description": "List compose databases for a single service.",+ "operationId": "list-service-databases-by-service-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Service UUID.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }],- "summary": "List",- "description": "List all servers.",- "operationId": "list-servers","responses": {"200": {- "description": "Get all servers.",+ "description": "Service databases.","content": {"application\/json": {"schema": {"type": "array","items": {- "$ref": "#\/components\/schemas\/Server"+ "type": "object"}}}@@ -11902,8 +16637,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"}},"security": [@@ -11911,90 +16646,42 @@"bearerAuth": []}]- },- "post": {+ }+ },+ "\/services\/{uuid}\/databases\/{database_uuid}": {+ "get": {"tags": [- "Servers"+ "Service databases"],- "summary": "Create",- "description": "Create Server.",- "operationId": "create-server",- "requestBody": {- "description": "Server created.",- "required": true,- "content": {- "application\/json": {- "schema": {- "properties": {- "name": {- "type": "string",- "example": "My Server",- "description": "The name of the server."- },- "description": {- "type": "string",- "example": "My Server Description",- "description": "The description of the server."- },- "ip": {- "type": "string",- "example": "127.0.0.1",- "description": "The IP of the server."- },- "port": {- "type": "integer",- "example": 22,- "description": "The port of the server."- },- "user": {- "type": "string",- "example": "root",- "description": "The user of the server."- },- "private_key_uuid": {- "type": "string",- "example": "og888os",- "description": "The UUID of the private key."- },- "is_build_server": {- "type": "boolean",- "example": false,- "description": "Is build server."- },- "instant_validate": {- "type": "boolean",- "example": false,- "description": "Instant validate."- },- "proxy_type": {- "type": "string",- "enum": [- "traefik",- "caddy",- "none"- ],- "example": "traefik",- "description": "The proxy type."- }- },- "type": "object"- }+ "summary": "Get service database",+ "description": "Get a compose database by service UUID and database UUID.",+ "operationId": "get-service-database-by-service-and-database-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Service UUID.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "database_uuid",+ "in": "path",+ "description": "Service database UUID.",+ "required": true,+ "schema": {+ "type": "string"}}- },+ ],"responses": {- "201": {- "description": "Server created.",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string",- "example": "og888os",- "description": "The UUID of the server."- }- },+ "200": {+ "description": "Service database.",+ "content": {+ "application\/json": {+ "schema": {"type": "object"}}@@ -12003,14 +16690,8 @@"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -12018,46 +16699,107 @@"bearerAuth": []}]- }- },- "\/servers\/{uuid}": {- "get": {+ },+ "patch": {"tags": [- "Servers"+ "Service databases"],- "summary": "Get",- "description": "Get server by UUID.",- "operationId": "get-server-by-uuid",+ "summary": "Update service database",+ "description": "Update mutable fields for a compose service database.",+ "operationId": "patch-service-database-by-service-and-database-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Server's UUID",+ "description": "Service UUID.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "database_uuid",+ "in": "path",+ "description": "Service database UUID.","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "human_name": {+ "type": [+ "string",+ "null"+ ]+ },+ "description": {+ "type": [+ "string",+ "null"+ ]+ },+ "image": {+ "type": "string"+ },+ "exclude_from_status": {+ "type": "boolean"+ },+ "is_log_drain_enabled": {+ "type": "boolean"+ },+ "is_public": {+ "type": "boolean"+ },+ "public_port": {+ "type": [+ "integer",+ "null"+ ],+ "maximum": 65535,+ "minimum": 1+ },+ "public_port_timeout": {+ "type": [+ "integer",+ "null"+ ],+ "minimum": 1+ }+ },+ "type": "object",+ "additionalProperties": false+ }+ }+ }+ },"responses": {"200": {- "description": "Get server by UUID",+ "description": "Updated service database.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Server"+ "type": "object"}}}},- "401": {- "$ref": "#\/components\/responses\/401"- },"400": {"$ref": "#\/components\/responses\/400"},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -12065,35 +16807,53 @@"bearerAuth": []}]- },- "delete": {+ }+ },+ "\/services\/{uuid}\/databases\/{database_uuid}\/logs": {+ "get": {"tags": [- "Servers"+ "Service databases"],- "summary": "Delete",- "description": "Delete server by UUID.",- "operationId": "delete-server-by-uuid",+ "summary": "Get service database logs",+ "description": "Get Docker logs for a compose database container.",+ "operationId": "get-service-database-logs-by-service-and-database-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the server.","required": true,"schema": {"type": "string"}+ },+ {+ "name": "database_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "lines",+ "in": "query",+ "required": false,+ "schema": {+ "type": "integer",+ "format": "int32",+ "default": 100+ }}],"responses": {"200": {- "description": "Server deleted.",+ "description": "Logs.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string",- "example": "Server deleted."+ "logs": {+ "type": "string"}},"type": "object"@@ -12101,17 +16861,17 @@}}},- "401": {- "$ref": "#\/components\/responses\/401"- },"400": {"$ref": "#\/components\/responses\/400"},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {"$ref": "#\/components\/responses\/404"},- "422": {- "$ref": "#\/components\/responses\/422"+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -12119,125 +16879,79 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/services\/{uuid}\/databases\/{database_uuid}\/start": {+ "post": {"tags": [- "Servers"+ "Service databases"],- "summary": "Update",- "description": "Update Server.",- "operationId": "update-server-by-uuid",+ "summary": "Start or redeploy service database container",+ "description": "Run docker compose up for a single compose database.",+ "operationId": "start-service-database-by-service-and-database-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Server UUID","required": true,"schema": {"type": "string"}- }- ],- "requestBody": {- "description": "Server updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "properties": {- "name": {- "type": "string",- "description": "The name of the server."- },- "description": {- "type": "string",- "description": "The description of the server."- },- "ip": {- "type": "string",- "description": "The IP of the server."- },- "port": {- "type": "integer",- "description": "The port of the server."- },- "user": {- "type": "string",- "description": "The user of the server."- },- "private_key_uuid": {- "type": "string",- "description": "The UUID of the private key."- },- "is_build_server": {- "type": "boolean",- "description": "Is build server."- },- "instant_validate": {- "type": "boolean",- "description": "Instant validate."- },- "proxy_type": {- "type": "string",- "enum": [- "traefik",- "caddy",- "none"- ],- "description": "The proxy type."- },- "concurrent_builds": {- "type": "integer",- "description": "Number of concurrent builds."- },- "dynamic_timeout": {- "type": "integer",- "description": "Deployment timeout in seconds."- },- "deployment_queue_limit": {- "type": "integer",- "description": "Maximum number of queued deployments."- },- "server_disk_usage_notification_threshold": {- "type": "integer",- "description": "Server disk usage notification threshold (%)."- },- "server_disk_usage_check_frequency": {- "type": "string",- "description": "Cron expression for disk usage check frequency."- },- "connection_timeout": {- "type": "integer",- "description": "SSH connection timeout in seconds (1-300). Default: 10."- }- },- "type": "object"- }+ },+ {+ "name": "database_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "force",+ "in": "query",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false+ }+ },+ {+ "name": "latest",+ "in": "query",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": false}}- },+ ],"responses": {- "201": {- "description": "Server updated.",+ "200": {+ "description": "Deploy request queued.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Server"+ "properties": {+ "message": {+ "type": "string"+ }+ },+ "type": "object"}}}},- "401": {- "$ref": "#\/components\/responses\/401"- },"400": {"$ref": "#\/components\/responses\/400"},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {"$ref": "#\/components\/responses\/404"},- "422": {- "$ref": "#\/components\/responses\/422"+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -12247,19 +16961,26 @@]}},- "\/servers\/{uuid}\/resources": {- "get": {+ "\/services\/{uuid}\/databases\/{database_uuid}\/restart": {+ "post": {"tags": [- "Servers"+ "Service databases"],- "summary": "Resources",- "description": "Get resources by server.",- "operationId": "get-resources-by-server-uuid",+ "summary": "Restart service database container",+ "description": "Restart a compose database container.",+ "operationId": "restart-service-database-by-service-and-database-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Server's UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "database_uuid",+ "in": "path","required": true,"schema": {"type": "string"@@ -12268,46 +16989,31 @@],"responses": {"200": {- "description": "Get resources by server",+ "description": "Restart queued.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "properties": {- "id": {- "type": "integer"- },- "uuid": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"- },- "created_at": {- "type": "string"- },- "updated_at": {- "type": "string"- },- "status": {- "type": "string"- }- },- "type": "object"- }+ "properties": {+ "message": {+ "type": "string"+ }+ },+ "type": "object"}}}},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "501": {+ "description": "Swarm not supported."}},"security": [@@ -12317,19 +17023,26 @@]}},- "\/servers\/{uuid}\/domains": {- "get": {+ "\/services\/{uuid}\/databases\/{database_uuid}\/stop": {+ "post": {"tags": [- "Servers"+ "Service databases"],- "summary": "Domains",- "description": "Get domains by server.",- "operationId": "get-domains-by-server-uuid",+ "summary": "Stop service database container",+ "description": "Stop a compose database container.",+ "operationId": "stop-service-database-by-service-and-database-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Server's UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "database_uuid",+ "in": "path","required": true,"schema": {"type": "string"@@ -12338,24 +17051,57 @@],"responses": {"200": {- "description": "Get domains by server",+ "description": "Stop queued.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string"+ }+ },+ "type": "object"+ }+ }+ }+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "501": {+ "description": "Swarm not supported."+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/services": {+ "get": {+ "tags": [+ "Services"+ ],+ "summary": "List",+ "description": "List all services.",+ "operationId": "list-services",+ "responses": {+ "200": {+ "description": "Get all services","content": {"application\/json": {"schema": {"type": "array","items": {- "properties": {- "ip": {- "type": "string"- },- "domains": {- "type": "array",- "items": {- "type": "string"- }- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/Service"}}}@@ -12373,37 +17119,102 @@"bearerAuth": []}]- }- },- "\/servers\/{uuid}\/validate": {+ },"post": {"tags": [- "Servers"- ],- "summary": "Validate",- "description": "Validate server by UUID.",- "operationId": "validate-server-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "Server UUID",- "required": true,- "schema": {- "type": "string"- }- }+ "Services"],+ "summary": "Create service",+ "description": "Create a one-click \/ custom service",+ "operationId": "create-service","requestBody": {- "required": false,+ "required": true,"content": {"application\/json": {"schema": {+ "required": [+ "server_uuid",+ "project_uuid",+ "environment_name",+ "environment_uuid"+ ],"properties": {- "install": {- "description": "Install missing prerequisites and Docker. This can restart the Docker daemon.",+ "type": {+ "description": "The one-click service type (e.g. \"actualbudget\", \"calibre-web\", \"gitea-with-mysql\" ...)",+ "type": "string"+ },+ "name": {+ "type": "string",+ "maxLength": 255,+ "description": "Name of the service."+ },+ "description": {+ "type": "string",+ "nullable": true,+ "description": "Description of the service."+ },+ "project_uuid": {+ "type": "string",+ "description": "Project UUID."+ },+ "environment_name": {+ "type": "string",+ "description": "Environment name. You need to provide at least one of environment_name or environment_uuid."+ },+ "environment_uuid": {+ "type": "string",+ "description": "Environment UUID. You need to provide at least one of environment_name or environment_uuid."+ },+ "server_uuid": {+ "type": "string",+ "description": "Server UUID."+ },+ "destination_uuid": {+ "type": "string",+ "description": "Destination UUID. Required if server has multiple destinations."+ },+ "instant_deploy": {+ "type": "boolean",+ "default": false,+ "description": "Start the service immediately after creation."+ },+ "docker_compose_raw": {+ "type": "string",+ "description": "The base64 encoded Docker Compose content."+ },+ "urls": {+ "type": "array",+ "description": "Array of URLs to be applied to containers of a service.",+ "items": {+ "properties": {+ "name": {+ "type": "string",+ "description": "The service name as defined in docker-compose."+ },+ "url": {+ "type": "string",+ "description": "Comma-separated list of URLs (e.g. \"https:\/\/app.coolify.io,https:\/\/app2.coolify.io\")."+ }+ },+ "type": "object"+ }+ },+ "force_domain_override": {"type": "boolean",- "default": false+ "default": false,+ "description": "Force domain override even if conflicts are detected."+ },+ "is_container_label_escape_enabled": {+ "type": "boolean",+ "default": true,+ "description": "Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off."+ },+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Tags to assign to the service."}},"type": "object"@@ -12413,14 +17224,21 @@},"responses": {"201": {- "description": "Server validation started.",+ "description": "Service created successfully.","content": {"application\/json": {"schema": {"properties": {- "message": {+ "uuid": {"type": "string",- "example": "Validation started."+ "description": "Service UUID."+ },+ "domains": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Service domains."}},"type": "object"@@ -12434,8 +17252,59 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "409": {+ "description": "Domain conflicts detected.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Domain conflicts detected. Use force_domain_override=true to proceed."+ },+ "warning": {+ "type": "string",+ "example": "Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior."+ },+ "conflicts": {+ "type": "array",+ "items": {+ "properties": {+ "domain": {+ "type": "string",+ "example": "example.com"+ },+ "resource_name": {+ "type": "string",+ "example": "My Application"+ },+ "resource_uuid": {+ "type": "string",+ "nullable": true,+ "example": "abc123-def456"+ },+ "resource_type": {+ "type": "string",+ "enum": [+ "application",+ "service",+ "instance"+ ],+ "example": "application"+ },+ "message": {+ "type": "string",+ "example": "Domain example.com is already in use by application 'My Application'"+ }+ },+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }},"422": {"$ref": "#\/components\/responses\/422"@@ -12448,19 +17317,19 @@]}},- "\/services\/{uuid}\/applications": {+ "\/services\/{uuid}": {"get": {"tags": [- "Service applications"+ "Services"],- "summary": "List service applications",- "description": "List compose service applications (containers) for a single service.",- "operationId": "list-service-applications-by-service-uuid",+ "summary": "Get",+ "description": "Get service by UUID.",+ "operationId": "get-service-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",+ "description": "Service UUID","required": true,"schema": {"type": "string"@@ -12469,14 +17338,11 @@],"responses": {"200": {- "description": "Service applications for this service.",+ "description": "Get a service by UUID.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "type": "object"- }+ "$ref": "#\/components\/schemas\/Service"}}}@@ -12484,6 +17350,9 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"}@@ -12493,42 +17362,77 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/applications\/{app_uuid}": {- "get": {+ },+ "delete": {"tags": [- "Service applications"+ "Services"],- "summary": "Get service application",- "description": "Get a single compose service application by service UUID and application UUID.",- "operationId": "get-service-application-by-service-and-app-uuid",+ "summary": "Delete",+ "description": "Delete service by UUID.",+ "operationId": "delete-service-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",+ "description": "Service UUID","required": true,"schema": {"type": "string"}},{- "name": "app_uuid",- "in": "path",- "description": "Service application UUID.",- "required": true,+ "name": "delete_configurations",+ "in": "query",+ "description": "Delete configurations.",+ "required": false,"schema": {- "type": "string"+ "type": "boolean",+ "default": true+ }+ },+ {+ "name": "delete_volumes",+ "in": "query",+ "description": "Delete volumes.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true+ }+ },+ {+ "name": "docker_cleanup",+ "in": "query",+ "description": "Run docker cleanup.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true+ }+ },+ {+ "name": "delete_connected_networks",+ "in": "query",+ "description": "Delete connected networks.",+ "required": false,+ "schema": {+ "type": "boolean",+ "default": true}}],"responses": {"200": {- "description": "Service application.",+ "description": "Delete a service by UUID","content": {"application\/json": {"schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Service deletion request queued."+ }+ },"type": "object"}}@@ -12537,6 +17441,9 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"}@@ -12549,94 +17456,76 @@},"patch": {"tags": [- "Service applications"+ "Services"],- "summary": "Update service application",- "description": "Update fields for a compose service application. Use `url` for comma-separated public URLs (same rules as `urls[].url` on PATCH \/services\/{uuid}).",- "operationId": "patch-service-application-by-service-and-app-uuid",+ "summary": "Update",+ "description": "Update service by UUID.",+ "operationId": "update-service-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "app_uuid",- "in": "path",- "description": "Service application UUID.",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}- },- {- "name": "force_domain_override",- "in": "query",- "description": "When true, allow duplicate URLs in the request and proceed despite domain conflicts (same as service PATCH).",- "required": false,- "schema": {- "type": "boolean",- "default": false- }}],"requestBody": {+ "description": "Service updated.",+ "required": true,"content": {"application\/json": {"schema": {"properties": {- "url": {- "description": "Comma-separated list of URLs (e.g. \"http:\/\/app.example.com:8080,https:\/\/app2.example.com\"). Stored as fqdn.",- "type": [- "string",- "null"- ]- },- "human_name": {- "type": [- "string",- "null"- ]+ "name": {+ "type": "string",+ "description": "The service name."},"description": {- "type": [- "string",- "null"- ]+ "type": "string",+ "description": "The service description."},- "image": {- "type": [- "string",- "null"- ]+ "instant_deploy": {+ "type": "boolean",+ "description": "The flag to indicate if the service should be deployed instantly."},- "exclude_from_status": {- "type": [- "boolean",- "null"- ]+ "connect_to_docker_network": {+ "type": "boolean",+ "default": false,+ "description": "Connect the service to the predefined docker network."},- "is_log_drain_enabled": {- "type": [- "boolean",- "null"- ]+ "docker_compose_raw": {+ "type": "string",+ "description": "The base64 encoded Docker Compose content."},- "is_gzip_enabled": {- "type": [- "boolean",- "null"- ]+ "urls": {+ "type": "array",+ "description": "Array of URLs to be applied to containers of a service.",+ "items": {+ "properties": {+ "name": {+ "type": "string",+ "description": "The service name as defined in docker-compose."+ },+ "url": {+ "type": "string",+ "description": "Comma-separated list of URLs (e.g. \"https:\/\/app.coolify.io,https:\/\/app2.coolify.io\")."+ }+ },+ "type": "object"+ }},- "is_stripprefix_enabled": {- "type": [- "boolean",- "null"- ]+ "force_domain_override": {+ "type": "boolean",+ "default": false,+ "description": "Force domain override even if conflicts are detected."+ },+ "is_container_label_escape_enabled": {+ "type": "boolean",+ "default": true,+ "description": "Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off."}},"type": "object"@@ -12646,10 +17535,23 @@},"responses": {"200": {- "description": "Updated service application.",+ "description": "Service updated.","content": {"application\/json": {"schema": {+ "properties": {+ "uuid": {+ "type": "string",+ "description": "Service UUID."+ },+ "domains": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Service domains."+ }+ },"type": "object"}}@@ -12658,11 +17560,65 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},"409": {- "description": "Domain conflicts (unless force_domain_override)."+ "description": "Domain conflicts detected.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Domain conflicts detected. Use force_domain_override=true to proceed."+ },+ "warning": {+ "type": "string",+ "example": "Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior."+ },+ "conflicts": {+ "type": "array",+ "items": {+ "properties": {+ "domain": {+ "type": "string",+ "example": "example.com"+ },+ "resource_name": {+ "type": "string",+ "example": "My Application"+ },+ "resource_uuid": {+ "type": "string",+ "nullable": true,+ "example": "abc123-def456"+ },+ "resource_type": {+ "type": "string",+ "enum": [+ "application",+ "service",+ "instance"+ ],+ "example": "application"+ },+ "message": {+ "type": "string",+ "example": "Domain example.com is already in use by application 'My Application'"+ }+ },+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }},"422": {"$ref": "#\/components\/responses\/422"@@ -12675,31 +17631,33 @@]}},- "\/services\/{uuid}\/applications\/{app_uuid}\/logs": {+ "\/services\/{uuid}\/logs": {"get": {"tags": [- "Service applications"+ "Services"],- "summary": "Get service application logs",- "description": "Get Docker logs for a single compose service container.",- "operationId": "get-service-application-logs-by-service-and-app-uuid",+ "summary": "Get service logs.",+ "description": "Get logs for a specific service sub-resource by service UUID. The `sub_service_name` query parameter must match the `name` field of one of the service applications or databases returned by `GET \/services\/{uuid}`.",+ "operationId": "get-service-logs-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",+ "description": "UUID of the service.","required": true,"schema": {- "type": "string"+ "type": "string",+ "format": "uuid"}},{- "name": "app_uuid",- "in": "path",- "description": "Service application UUID.",+ "name": "sub_service_name",+ "in": "query",+ "description": "Sub-service name from `GET \/services\/{uuid}` under `applications[].name` or `databases[].name`. Do not use `human_name` or the Docker container name with the service UUID suffix.","required": true,"schema": {- "type": "string"+ "type": "string",+ "example": "appwrite-console"}},{@@ -12712,81 +17670,21 @@"format": "int32","default": 100}- }- ],- "responses": {- "200": {- "description": "Logs.",- "content": {- "application\/json": {- "schema": {- "properties": {- "logs": {- "type": "string"- }- },- "type": "object"- }- }- }- },- "400": {- "$ref": "#\/components\/responses\/400"- },- "401": {- "$ref": "#\/components\/responses\/401"- },- "404": {- "$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."- }- },- "security": [- {- "bearerAuth": []- }- ]- },- "post": {- "tags": [- "Service applications"- ],- "summary": "Get service application logs",- "description": "Get Docker logs for a single compose service container.",- "operationId": "post-service-application-logs-by-service-and-app-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "required": true,- "schema": {- "type": "string"- }},{- "name": "app_uuid",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "lines",+ "name": "show_timestamps","in": "query",+ "description": "Show timestamps in the logs.","required": false,"schema": {- "type": "integer",- "format": "int32",- "default": 100+ "type": "boolean",+ "default": false}}],"responses": {"200": {- "description": "Logs.",+ "description": "Get service logs by UUID.","content": {"application\/json": {"schema": {@@ -12800,17 +17698,14 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."}},"security": [@@ -12820,77 +17715,47 @@]}},- "\/services\/{uuid}\/applications\/{app_uuid}\/start": {- "post": {+ "\/services\/{uuid}\/envs": {+ "get": {"tags": [- "Service applications"+ "Services"],- "summary": "Start or redeploy service application container",- "description": "Runs docker compose up for a single compose service (no-deps), optionally pulling the image and rebuilding.",- "operationId": "post-start-service-application-by-service-and-app-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "app_uuid",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "force",- "in": "query",- "required": false,- "schema": {- "type": "boolean",- "default": false- }- },+ "summary": "List Envs",+ "description": "List all envs by service UUID.",+ "operationId": "list-envs-by-service-uuid",+ "parameters": [{- "name": "latest",- "in": "query",- "required": false,+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,"schema": {- "type": "boolean",- "default": false+ "type": "string"}}],"responses": {"200": {- "description": "Deploy request queued.",+ "description": "All environment variables by service UUID.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string"- }- },- "type": "object"+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/EnvironmentVariable"+ }}}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."}},"security": [@@ -12898,43 +17763,72 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/applications\/{app_uuid}\/restart": {+ },"post": {"tags": [- "Service applications"+ "Services"],- "summary": "Restart service application container",- "description": "Restarts a single compose service container.",- "operationId": "post-restart-service-application-by-service-and-app-uuid",+ "summary": "Create Env",+ "description": "Create env by service UUID.",+ "operationId": "create-env-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "app_uuid",- "in": "path",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "description": "Env created.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "key": {+ "type": "string",+ "description": "The key of the environment variable."+ },+ "value": {+ "type": "string",+ "description": "The value of the environment variable."+ },+ "is_preview": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is used in preview deployments."+ },+ "is_literal": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is a literal, nothing espaced."+ },+ "is_multiline": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is multiline."+ },+ "is_shown_once": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable's value is shown on the UI."+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {- "200": {- "description": "Restart queued.",+ "201": {+ "description": "Environment variable created.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string"+ "uuid": {+ "type": "string",+ "example": "nc0k04gk8g0cgsk440g0koko"}},"type": "object"@@ -12942,17 +17836,17 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},- "501": {- "description": "Swarm not supported."+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -12960,61 +17854,88 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/applications\/{app_uuid}\/stop": {- "post": {+ },+ "patch": {"tags": [- "Service applications"+ "Services"],- "summary": "Stop service application container",- "description": "Stops a single compose service container.",- "operationId": "post-stop-service-application-by-service-and-app-uuid",+ "summary": "Update Env",+ "description": "Update env by service UUID.",+ "operationId": "update-env-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "app_uuid",- "in": "path",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}}],+ "requestBody": {+ "description": "Env updated.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "key",+ "value"+ ],+ "properties": {+ "key": {+ "type": "string",+ "description": "The key of the environment variable."+ },+ "value": {+ "type": "string",+ "description": "The value of the environment variable."+ },+ "is_preview": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is used in preview deployments."+ },+ "is_literal": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is a literal, nothing espaced."+ },+ "is_multiline": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is multiline."+ },+ "is_shown_once": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable's value is shown on the UI."+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {- "200": {- "description": "Stop queued.",+ "201": {+ "description": "Environment variable updated.","content": {"application\/json": {"schema": {- "properties": {- "message": {- "type": "string"- }- },- "type": "object"+ "$ref": "#\/components\/schemas\/EnvironmentVariable"}}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},- "501": {- "description": "Swarm not supported."+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -13024,34 +17945,82 @@]}},- "\/services\/{uuid}\/databases": {- "get": {+ "\/services\/{uuid}\/envs\/bulk": {+ "patch": {"tags": [- "Service databases"+ "Services"],- "summary": "List service databases",- "description": "List compose databases for a single service.",- "operationId": "list-service-databases-by-service-uuid",+ "summary": "Update Envs (Bulk)",+ "description": "Update multiple envs by service UUID.",+ "operationId": "update-envs-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}}- ],+ ],+ "requestBody": {+ "description": "Bulk envs updated.",+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "data"+ ],+ "properties": {+ "data": {+ "type": "array",+ "items": {+ "properties": {+ "key": {+ "type": "string",+ "description": "The key of the environment variable."+ },+ "value": {+ "type": "string",+ "description": "The value of the environment variable."+ },+ "is_preview": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is used in preview deployments."+ },+ "is_literal": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is a literal, nothing espaced."+ },+ "is_multiline": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable is multiline."+ },+ "is_shown_once": {+ "type": "boolean",+ "description": "The flag to indicate if the environment variable's value is shown on the UI."+ }+ },+ "type": "object"+ }+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {- "200": {- "description": "Service databases.",+ "201": {+ "description": "Environment variables updated.","content": {"application\/json": {"schema": {"type": "array","items": {- "type": "object"+ "$ref": "#\/components\/schemas\/EnvironmentVariable"}}}@@ -13060,8 +18029,14 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -13071,28 +18046,28 @@]}},- "\/services\/{uuid}\/databases\/{database_uuid}": {- "get": {+ "\/services\/{uuid}\/envs\/{env_uuid}": {+ "delete": {"tags": [- "Service databases"+ "Services"],- "summary": "Get service database",- "description": "Get a compose database by service UUID and database UUID.",- "operationId": "get-service-database-by-service-and-database-uuid",+ "summary": "Delete Env",+ "description": "Delete env by UUID.",+ "operationId": "delete-env-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}},{- "name": "database_uuid",+ "name": "env_uuid","in": "path",- "description": "Service database UUID.",+ "description": "UUID of the environment variable.","required": true,"schema": {"type": "string"@@ -13101,10 +18076,16 @@],"responses": {"200": {- "description": "Service database.",+ "description": "Environment variable deleted.","content": {"application\/json": {"schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Environment variable deleted."+ }+ },"type": "object"}}@@ -13113,6 +18094,9 @@"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"}@@ -13122,28 +18106,21 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/services\/{uuid}\/move": {+ "post": {"tags": [- "Service databases"+ "Services"],- "summary": "Update service database",- "description": "Update mutable fields for a compose service database.",- "operationId": "patch-service-database-by-service-and-database-uuid",+ "summary": "Move",+ "description": "Move service to another project\/environment. This is a purely organizational change \u2014 running containers are not affected. Note: after moving, the service will pick up shared environment variables from the new environment on the next deployment.",+ "operationId": "move-service-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "database_uuid",- "in": "path",- "description": "Service database UUID.",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"@@ -13151,73 +18128,57 @@}],"requestBody": {+ "description": "Target environment to move the service to.",+ "required": true,"content": {"application\/json": {"schema": {+ "required": [+ "environment_uuid"+ ],"properties": {- "human_name": {- "type": [- "string",- "null"- ]- },- "description": {- "type": [- "string",- "null"- ]- },- "image": {- "type": "string"- },- "exclude_from_status": {- "type": "boolean"- },- "is_log_drain_enabled": {- "type": "boolean"- },- "is_public": {- "type": "boolean"- },- "public_port": {- "type": [- "integer",- "null"- ],- "maximum": 65535,- "minimum": 1- },- "public_port_timeout": {- "type": [- "integer",- "null"- ],- "minimum": 1+ "environment_uuid": {+ "type": "string",+ "description": "UUID of the target environment."}},- "type": "object",- "additionalProperties": false+ "type": "object"}}}},"responses": {"200": {- "description": "Updated service database.",+ "description": "Service moved successfully.","content": {"application\/json": {"schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Service moved successfully."+ },+ "uuid": {+ "type": "string"+ },+ "project_uuid": {+ "type": "string"+ },+ "environment_uuid": {+ "type": "string"+ }+ },"type": "object"}}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"},@@ -13232,51 +18193,35 @@]}},- "\/services\/{uuid}\/databases\/{database_uuid}\/logs": {- "get": {+ "\/services\/{uuid}\/start": {+ "post": {"tags": [- "Service databases"+ "Services"],- "summary": "Get service database logs",- "description": "Get Docker logs for a compose database container.",- "operationId": "get-service-database-logs-by-service-and-database-uuid",+ "summary": "Start",+ "description": "Start service.",+ "operationId": "start-service-by-uuid","parameters": [{"name": "uuid","in": "path",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}- },- {- "name": "database_uuid",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "lines",- "in": "query",- "required": false,- "schema": {- "type": "integer",- "format": "int32",- "default": 100- }}],"responses": {"200": {- "description": "Logs.",+ "description": "Start service.","content": {"application\/json": {"schema": {"properties": {- "logs": {- "type": "string"+ "message": {+ "type": "string",+ "example": "Service starting request queued."}},"type": "object"@@ -13284,17 +18229,14 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."}},"security": [@@ -13304,59 +18246,44 @@]}},- "\/services\/{uuid}\/databases\/{database_uuid}\/start": {+ "\/services\/{uuid}\/stop": {"post": {"tags": [- "Service databases"+ "Services"],- "summary": "Start or redeploy service database container",- "description": "Run docker compose up for a single compose database.",- "operationId": "start-service-database-by-service-and-database-uuid",+ "summary": "Stop",+ "description": "Stop service.",+ "operationId": "stop-service-by-uuid","parameters": [{"name": "uuid","in": "path",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}},{- "name": "database_uuid",- "in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "force",- "in": "query",- "required": false,- "schema": {- "type": "boolean",- "default": false- }- },- {- "name": "latest",+ "name": "docker_cleanup","in": "query",- "required": false,+ "description": "Perform docker cleanup (prune networks, volumes, etc.).","schema": {"type": "boolean",- "default": false+ "default": true}}],"responses": {"200": {- "description": "Deploy request queued.",+ "description": "Stop service.","content": {"application\/json": {"schema": {"properties": {"message": {- "type": "string"+ "type": "string",+ "example": "Service stopping request queued."}},"type": "object"@@ -13364,17 +18291,14 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."}},"security": [@@ -13384,41 +18308,44 @@]}},- "\/services\/{uuid}\/databases\/{database_uuid}\/restart": {+ "\/services\/{uuid}\/restart": {"post": {"tags": [- "Service databases"+ "Services"],- "summary": "Restart service database container",- "description": "Restart a compose database container.",- "operationId": "restart-service-database-by-service-and-database-uuid",+ "summary": "Restart",+ "description": "Restart service.",+ "operationId": "restart-service-by-uuid","parameters": [{"name": "uuid","in": "path",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}},{- "name": "database_uuid",- "in": "path",- "required": true,+ "name": "latest",+ "in": "query",+ "description": "Pull latest images.","schema": {- "type": "string"+ "type": "boolean",+ "default": false}}],"responses": {"200": {- "description": "Restart queued.",+ "description": "Restart service.","content": {"application\/json": {"schema": {"properties": {"message": {- "type": "string"+ "type": "string",+ "example": "Service restaring request queued."}},"type": "object"@@ -13426,17 +18353,14 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."}},"security": [@@ -13446,26 +18370,19 @@]}},- "\/services\/{uuid}\/databases\/{database_uuid}\/stop": {- "post": {+ "\/services\/{uuid}\/storages": {+ "get": {"tags": [- "Service databases"+ "Services"],- "summary": "Stop service database container",- "description": "Stop a compose database container.",- "operationId": "stop-service-database-by-service-and-database-uuid",+ "summary": "List Storages",+ "description": "List all persistent storages and file storages by service UUID.",+ "operationId": "list-storages-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "database_uuid",- "in": "path",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"@@ -13474,13 +18391,22 @@],"responses": {"200": {- "description": "Stop queued.",+ "description": "All storages by service UUID.","content": {"application\/json": {"schema": {"properties": {- "message": {- "type": "string"+ "persistent_storages": {+ "type": "array",+ "items": {+ "type": "object"+ }+ },+ "file_storages": {+ "type": "array",+ "items": {+ "type": "object"+ }}},"type": "object"@@ -13488,17 +18414,14 @@}}},- "400": {- "$ref": "#\/components\/responses\/400"- },"401": {"$ref": "#\/components\/responses\/401"},+ "400": {+ "$ref": "#\/components\/responses\/400"+ },"404": {"$ref": "#\/components\/responses\/404"- },- "501": {- "description": "Swarm not supported."}},"security": [@@ -13506,26 +18429,88 @@"bearerAuth": []}]- }- },- "\/services": {- "get": {+ },+ "post": {"tags": ["Services"],- "summary": "List",- "description": "List all services.",- "operationId": "list-services",+ "summary": "Create Storage",+ "description": "Create a persistent storage or file storage for a service sub-resource.",+ "operationId": "create-storage-by-service-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "type",+ "mount_path",+ "resource_uuid"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "persistent",+ "file"+ ],+ "description": "The type of storage."+ },+ "resource_uuid": {+ "type": "string",+ "description": "UUID of the service application or database sub-resource."+ },+ "name": {+ "type": "string",+ "description": "Volume name (persistent only, required for persistent)."+ },+ "mount_path": {+ "type": "string",+ "description": "The container mount path."+ },+ "host_path": {+ "type": "string",+ "nullable": true,+ "description": "The host path (persistent only, optional)."+ },+ "content": {+ "type": "string",+ "nullable": true,+ "description": "File content (file only, optional)."+ },+ "is_directory": {+ "type": "boolean",+ "description": "Whether this is a directory mount (file only, default false)."+ },+ "fs_path": {+ "type": "string",+ "description": "Host directory path (required when is_directory is true)."+ }+ },+ "type": "object",+ "additionalProperties": false+ }+ }+ }+ },"responses": {- "200": {- "description": "Get all services",+ "201": {+ "description": "Storage created.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Service"- }+ "type": "object"}}}@@ -13535,6 +18520,12 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -13543,127 +18534,85 @@}]},- "post": {+ "patch": {"tags": ["Services"],- "summary": "Create service",- "description": "Create a one-click \/ custom service",- "operationId": "create-service",+ "summary": "Update Storage",+ "description": "Update a persistent storage or file storage by service UUID.",+ "operationId": "update-storage-by-service-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {+ "description": "Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.","required": true,"content": {"application\/json": {"schema": {"required": [- "server_uuid",- "project_uuid",- "environment_name",- "environment_uuid"+ "type"],"properties": {- "type": {- "description": "The one-click service type (e.g. \"actualbudget\", \"calibre-web\", \"gitea-with-mysql\" ...)",- "type": "string"- },- "name": {- "type": "string",- "maxLength": 255,- "description": "Name of the service."- },- "description": {- "type": "string",- "nullable": true,- "description": "Description of the service."- },- "project_uuid": {- "type": "string",- "description": "Project UUID."- },- "environment_name": {- "type": "string",- "description": "Environment name. You need to provide at least one of environment_name or environment_uuid."- },- "environment_uuid": {+ "uuid": {"type": "string",- "description": "Environment UUID. You need to provide at least one of environment_name or environment_uuid."+ "description": "The UUID of the storage (preferred)."},- "server_uuid": {- "type": "string",- "description": "Server UUID."+ "id": {+ "type": "integer",+ "description": "The ID of the storage (deprecated, use uuid instead)."},- "destination_uuid": {+ "type": {"type": "string",- "description": "Destination UUID. Required if server has multiple destinations."+ "enum": [+ "persistent",+ "file"+ ],+ "description": "The type of storage: persistent or file."},- "instant_deploy": {+ "is_preview_suffix_enabled": {"type": "boolean",- "default": false,- "description": "Start the service immediately after creation."+ "description": "Whether to add -pr-N suffix for preview deployments."},- "docker_compose_raw": {+ "name": {"type": "string",- "description": "The base64 encoded Docker Compose content."- },- "urls": {- "type": "array",- "description": "Array of URLs to be applied to containers of a service.",- "items": {- "properties": {- "name": {- "type": "string",- "description": "The service name as defined in docker-compose."- },- "url": {- "type": "string",- "description": "Comma-separated list of URLs (e.g. \"https:\/\/app.coolify.io,https:\/\/app2.coolify.io\")."- }- },- "type": "object"- }+ "description": "The volume name (persistent only, not allowed for read-only storages)."},- "force_domain_override": {- "type": "boolean",- "default": false,- "description": "Force domain override even if conflicts are detected."+ "mount_path": {+ "type": "string",+ "description": "The container mount path (not allowed for read-only storages)."},- "is_container_label_escape_enabled": {- "type": "boolean",- "default": true,- "description": "Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off."+ "host_path": {+ "type": "string",+ "nullable": true,+ "description": "The host path (persistent only, not allowed for read-only storages)."},- "tags": {- "type": "array",- "items": {- "type": "string"- },- "description": "Tags to assign to the service."+ "content": {+ "type": "string",+ "nullable": true,+ "description": "The file content (file only, not allowed for read-only storages)."}},- "type": "object"+ "type": "object",+ "additionalProperties": false}}}},"responses": {- "201": {- "description": "Service created successfully.",+ "200": {+ "description": "Storage updated.","content": {"application\/json": {"schema": {- "properties": {- "uuid": {- "type": "string",- "description": "Service UUID."- },- "domains": {- "type": "array",- "items": {- "type": "string"- },- "description": "Service domains."- }- },"type": "object"}}@@ -13675,53 +18624,57 @@"400": {"$ref": "#\/components\/responses\/400"},- "409": {- "description": "Domain conflicts detected.",+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/services\/{uuid}\/storages\/{storage_uuid}": {+ "delete": {+ "tags": [+ "Services"+ ],+ "summary": "Delete Storage",+ "description": "Delete a persistent storage or file storage by service UUID.",+ "operationId": "delete-storage-by-service-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "storage_uuid",+ "in": "path",+ "description": "UUID of the storage.",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Storage deleted.","content": {"application\/json": {"schema": {"properties": {"message": {- "type": "string",- "example": "Domain conflicts detected. Use force_domain_override=true to proceed."- },- "warning": {- "type": "string",- "example": "Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior."- },- "conflicts": {- "type": "array",- "items": {- "properties": {- "domain": {- "type": "string",- "example": "example.com"- },- "resource_name": {- "type": "string",- "example": "My Application"- },- "resource_uuid": {- "type": "string",- "nullable": true,- "example": "abc123-def456"- },- "resource_type": {- "type": "string",- "enum": [- "application",- "service",- "instance"- ],- "example": "application"- },- "message": {- "type": "string",- "example": "Domain example.com is already in use by application 'My Application'"- }- },- "type": "object"- }+ "type": "string"}},"type": "object"@@ -13729,6 +18682,15 @@}}},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },"422": {"$ref": "#\/components\/responses\/422"}@@ -13740,19 +18702,19 @@]}},- "\/services\/{uuid}": {+ "\/services\/{uuid}\/tags": {"get": {"tags": ["Services"],- "summary": "Get",- "description": "Get service by UUID.",- "operationId": "get-service-by-uuid",+ "summary": "List Tags",+ "description": "List tags for a service by UUID.",+ "operationId": "list-tags-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"@@ -13761,11 +18723,14 @@],"responses": {"200": {- "description": "Get a service by UUID.",+ "description": "List of tags.","content": {"application\/json": {"schema": {- "$ref": "#\/components\/schemas\/Service"+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Tag"+ }}}}@@ -13786,80 +18751,112 @@}]},- "delete": {+ "post": {"tags": ["Services"],- "summary": "Delete",- "description": "Delete service by UUID.",- "operationId": "delete-service-by-uuid",+ "summary": "Create Tag",+ "description": "Add tag(s) to a service by UUID.",+ "operationId": "create-tag-by-service-uuid","parameters": [{"name": "uuid","in": "path",- "description": "Service UUID",+ "description": "UUID of the service.","required": true,"schema": {"type": "string"}- },- {- "name": "delete_configurations",- "in": "query",- "description": "Delete configurations.",- "required": false,- "schema": {- "type": "boolean",- "default": true+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "tag_name": {+ "type": "string",+ "description": "The tag name (min 2 characters). Required if tag_names is not provided."+ },+ "tag_names": {+ "type": "array",+ "items": {+ "type": "string"+ },+ "description": "Array of tag names (each min 2 characters). Required if tag_name is not provided."+ }+ },+ "type": "object"+ }}- },- {- "name": "delete_volumes",- "in": "query",- "description": "Delete volumes.",- "required": false,- "schema": {- "type": "boolean",- "default": true+ }+ },+ "responses": {+ "201": {+ "description": "Tags added successfully.",+ "content": {+ "application\/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#\/components\/schemas\/Tag"+ }+ }+ }}},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "400": {+ "$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"+ }+ },+ "security": [{- "name": "docker_cleanup",- "in": "query",- "description": "Run docker cleanup.",- "required": false,+ "bearerAuth": []+ }+ ]+ }+ },+ "\/services\/{uuid}\/tags\/{tag_uuid}": {+ "delete": {+ "tags": [+ "Services"+ ],+ "summary": "Delete Tag",+ "description": "Remove a tag from a service by UUID.",+ "operationId": "delete-tag-by-service-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "UUID of the service.",+ "required": true,"schema": {- "type": "boolean",- "default": true+ "type": "string"}},{- "name": "delete_connected_networks",- "in": "query",- "description": "Delete connected networks.",- "required": false,+ "name": "tag_uuid",+ "in": "path",+ "description": "UUID of the tag.",+ "required": true,"schema": {- "type": "boolean",- "default": true+ "type": "string"}}],"responses": {"200": {- "description": "Delete a service by UUID",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Service deletion request queued."- }- },- "type": "object"- }- }- }+ "description": "Tag removed."},"401": {"$ref": "#\/components\/responses\/401"@@ -13876,14 +18873,16 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/services\/{uuid}\/clone": {+ "post": {"tags": ["Services"],- "summary": "Update",- "description": "Update service by UUID.",- "operationId": "update-service-by-uuid",+ "summary": "Clone",+ "description": "Clone a service to a destination owned by the authenticated team.",+ "operationId": "clone-service-by-uuid","parameters": [{"name": "uuid",@@ -13896,59 +18895,26 @@}],"requestBody": {- "description": "Service updated.","required": true,"content": {"application\/json": {"schema": {+ "required": [+ "destination_uuid"+ ],"properties": {- "name": {- "type": "string",- "description": "The service name."- },- "description": {- "type": "string",- "description": "The service description."- },- "instant_deploy": {- "type": "boolean",- "description": "The flag to indicate if the service should be deployed instantly."- },- "connect_to_docker_network": {- "type": "boolean",- "default": false,- "description": "Connect the service to the predefined docker network."- },- "docker_compose_raw": {- "type": "string",- "description": "The base64 encoded Docker Compose content."- },- "urls": {- "type": "array",- "description": "Array of URLs to be applied to containers of a service.",- "items": {- "properties": {- "name": {- "type": "string",- "description": "The service name as defined in docker-compose."- },- "url": {- "type": "string",- "description": "Comma-separated list of URLs (e.g. \"https:\/\/app.coolify.io,https:\/\/app2.coolify.io\")."- }- },- "type": "object"- }+ "destination_uuid": {+ "type": "string"},- "force_domain_override": {- "type": "boolean",- "default": false,- "description": "Force domain override even if conflicts are detected."+ "name": {+ "type": [+ "string",+ "null"+ ]},- "is_container_label_escape_enabled": {+ "clone_volumes": {"type": "boolean",- "default": true,- "description": "Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off."+ "default": false}},"type": "object"@@ -13957,92 +18923,18 @@}},"responses": {- "200": {- "description": "Service updated.",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string",- "description": "Service UUID."- },- "domains": {- "type": "array",- "items": {- "type": "string"- },- "description": "Service domains."- }- },- "type": "object"- }- }- }- },- "401": {- "$ref": "#\/components\/responses\/401"+ "201": {+ "description": "Service cloned."},"400": {"$ref": "#\/components\/responses\/400"},+ "401": {+ "$ref": "#\/components\/responses\/401"+ },"404": {"$ref": "#\/components\/responses\/404"},- "409": {- "description": "Domain conflicts detected.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Domain conflicts detected. Use force_domain_override=true to proceed."- },- "warning": {- "type": "string",- "example": "Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior."- },- "conflicts": {- "type": "array",- "items": {- "properties": {- "domain": {- "type": "string",- "example": "example.com"- },- "resource_name": {- "type": "string",- "example": "My Application"- },- "resource_uuid": {- "type": "string",- "nullable": true,- "example": "abc123-def456"- },- "resource_type": {- "type": "string",- "enum": [- "application",- "service",- "instance"- ],- "example": "application"- },- "message": {- "type": "string",- "example": "Domain example.com is already in use by application 'My Application'"- }- },- "type": "object"- }- }- },- "type": "object"- }- }- }- },"422": {"$ref": "#\/components\/responses\/422"}@@ -14054,81 +18946,86 @@]}},- "\/services\/{uuid}\/logs": {+ "\/team\/envs": {"get": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Get service logs.",- "description": "Get logs for a specific service sub-resource by service UUID. The `sub_service_name` query parameter must match the `name` field of one of the service applications or databases returned by `GET \/services\/{uuid}`.",- "operationId": "get-service-logs-by-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the service.",- "required": true,- "schema": {- "type": "string",- "format": "uuid"- }- },- {- "name": "sub_service_name",- "in": "query",- "description": "Sub-service name from `GET \/services\/{uuid}` under `applications[].name` or `databases[].name`. Do not use `human_name` or the Docker container name with the service UUID suffix.",- "required": true,- "schema": {- "type": "string",- "example": "appwrite-console"- }- },- {- "name": "lines",- "in": "query",- "description": "Number of lines to show from the end of the logs.",- "required": false,- "schema": {- "type": "integer",- "format": "int32",- "default": 100- }+ "summary": "List Team Shared Envs",+ "description": "List shared environment variables for the current team (type=team).",+ "operationId": "list-team-shared-envs",+ "responses": {+ "200": {+ "description": "Team shared environment variables."},+ "401": {+ "$ref": "#\/components\/responses\/401"+ }+ },+ "security": [{- "name": "show_timestamps",- "in": "query",- "description": "Show timestamps in the logs.",- "required": false,- "schema": {- "type": "boolean",- "default": false- }+ "bearerAuth": []}+ ]+ },+ "post": {+ "tags": [+ "Shared Environment Variables"],- "responses": {- "200": {- "description": "Get service logs by UUID.",- "content": {- "application\/json": {- "schema": {- "properties": {- "logs": {- "type": "string"- }+ "summary": "Create Team Shared Env",+ "description": "Create a shared environment variable for the current team (type=team).",+ "operationId": "create-team-shared-env",+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "key"+ ],+ "properties": {+ "key": {+ "type": "string"+ },+ "value": {+ "type": [+ "string",+ "null"+ ]+ },+ "is_literal": {+ "type": "boolean"+ },+ "is_multiline": {+ "type": "boolean"+ },+ "is_shown_once": {+ "type": "boolean"},- "type": "object"- }+ "comment": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "type": "object"}}+ }+ },+ "responses": {+ "201": {+ "description": "Environment variable created."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"+ "409": {+ "description": "Environment variable already exists."},- "404": {- "$ref": "#\/components\/responses\/404"+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -14138,45 +19035,32 @@]}},- "\/services\/{uuid}\/envs": {- "get": {+ "\/team\/envs\/{env_id}": {+ "delete": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "List Envs",- "description": "List all envs by service UUID.",- "operationId": "list-envs-by-service-uuid",+ "summary": "Delete Team Shared Env",+ "description": "Delete a team shared environment variable by id.",+ "operationId": "delete-team-shared-env","parameters": [{- "name": "uuid",+ "name": "env_id","in": "path",- "description": "UUID of the service.",+ "description": "Shared env id (integer).","required": true,"schema": {- "type": "string"+ "type": "integer"}}],"responses": {"200": {- "description": "All environment variables by service UUID.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/EnvironmentVariable"- }- }- }- }+ "description": "Environment variable deleted."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"}@@ -14187,84 +19071,31 @@}]},- "post": {+ "patch": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Create Env",- "description": "Create env by service UUID.",- "operationId": "create-env-by-service-uuid",+ "summary": "Update Team Shared Env",+ "description": "Update a team shared environment variable by id.",+ "operationId": "update-team-shared-env","parameters": [{- "name": "uuid",+ "name": "env_id","in": "path",- "description": "UUID of the service.",+ "description": "Shared env id (integer).","required": true,"schema": {- "type": "string"+ "type": "integer"}}],- "requestBody": {- "description": "Env created.",- "required": true,- "content": {- "application\/json": {- "schema": {- "properties": {- "key": {- "type": "string",- "description": "The key of the environment variable."- },- "value": {- "type": "string",- "description": "The value of the environment variable."- },- "is_preview": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is used in preview deployments."- },- "is_literal": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is a literal, nothing espaced."- },- "is_multiline": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is multiline."- },- "is_shown_once": {- "type": "boolean",- "description": "The flag to indicate if the environment variable's value is shown on the UI."- }- },- "type": "object"- }- }- }- },"responses": {- "201": {- "description": "Environment variable created.",- "content": {- "application\/json": {- "schema": {- "properties": {- "uuid": {- "type": "string",- "example": "nc0k04gk8g0cgsk440g0koko"- }- },- "type": "object"- }- }- }+ "200": {+ "description": "Environment variable updated."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"},@@ -14277,88 +19108,36 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/projects\/{uuid}\/envs": {+ "get": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Update Env",- "description": "Update env by service UUID.",- "operationId": "update-env-by-service-uuid",+ "summary": "List Project Shared Envs",+ "description": "List shared environment variables for a project (type=project).",+ "operationId": "list-project-shared-envs","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}}],- "requestBody": {- "description": "Env updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "key",- "value"- ],- "properties": {- "key": {- "type": "string",- "description": "The key of the environment variable."- },- "value": {- "type": "string",- "description": "The value of the environment variable."- },- "is_preview": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is used in preview deployments."- },- "is_literal": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is a literal, nothing espaced."- },- "is_multiline": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is multiline."- },- "is_shown_once": {- "type": "boolean",- "description": "The flag to indicate if the environment variable's value is shown on the UI."- }- },- "type": "object"- }- }- }- },"responses": {- "201": {- "description": "Environment variable updated.",- "content": {- "application\/json": {- "schema": {- "$ref": "#\/components\/schemas\/EnvironmentVariable"- }- }- }+ "200": {+ "description": "Project shared environment variables."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -14366,98 +19145,38 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/envs\/bulk": {- "patch": {+ },+ "post": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Update Envs (Bulk)",- "description": "Update multiple envs by service UUID.",- "operationId": "update-envs-by-service-uuid",+ "summary": "Create Project Shared Env",+ "description": "Create a shared environment variable for a project (type=project).",+ "operationId": "create-project-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}}],- "requestBody": {- "description": "Bulk envs updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "data"- ],- "properties": {- "data": {- "type": "array",- "items": {- "properties": {- "key": {- "type": "string",- "description": "The key of the environment variable."- },- "value": {- "type": "string",- "description": "The value of the environment variable."- },- "is_preview": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is used in preview deployments."- },- "is_literal": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is a literal, nothing espaced."- },- "is_multiline": {- "type": "boolean",- "description": "The flag to indicate if the environment variable is multiline."- },- "is_shown_once": {- "type": "boolean",- "description": "The flag to indicate if the environment variable's value is shown on the UI."- }- },- "type": "object"- }- }- },- "type": "object"- }- }- }- },"responses": {"201": {- "description": "Environment variables updated.",- "content": {- "application\/json": {- "schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/EnvironmentVariable"- }- }- }- }+ "description": "Environment variable created."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"},+ "409": {+ "description": "Environment variable already exists."+ },"422": {"$ref": "#\/components\/responses\/422"}@@ -14469,57 +19188,41 @@]}},- "\/services\/{uuid}\/envs\/{env_uuid}": {+ "\/projects\/{uuid}\/envs\/{env_id}": {"delete": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Delete Env",- "description": "Delete env by UUID.",- "operationId": "delete-env-by-service-uuid",+ "summary": "Delete Project Shared Env",+ "description": "Delete a project shared environment variable by id.",+ "operationId": "delete-project-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}},{- "name": "env_uuid",+ "name": "env_id","in": "path",- "description": "UUID of the environment variable.",+ "description": "Shared env id (integer).","required": true,"schema": {- "type": "string"+ "type": "integer"}}],"responses": {"200": {- "description": "Environment variable deleted.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Environment variable deleted."- }- },- "type": "object"- }- }- }+ "description": "Environment variable deleted."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"}@@ -14529,79 +19232,41 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/move": {- "post": {+ },+ "patch": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Move",- "description": "Move service to another project\/environment. This is a purely organizational change \u2014 running containers are not affected. Note: after moving, the service will pick up shared environment variables from the new environment on the next deployment.",- "operationId": "move-service-by-uuid",+ "summary": "Update Project Shared Env",+ "description": "Update a project shared environment variable by id.",+ "operationId": "update-project-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}- }- ],- "requestBody": {- "description": "Target environment to move the service to.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "environment_uuid"- ],- "properties": {- "environment_uuid": {- "type": "string",- "description": "UUID of the target environment."- }- },- "type": "object"- }+ },+ {+ "name": "env_id",+ "in": "path",+ "description": "Shared env id (integer).",+ "required": true,+ "schema": {+ "type": "integer"}}- },+ ],"responses": {"200": {- "description": "Service moved successfully.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Service moved successfully."- },- "uuid": {- "type": "string"- },- "project_uuid": {- "type": "string"- },- "environment_uuid": {- "type": "string"- }- },- "type": "object"- }- }- }+ "description": "Environment variable updated."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"},@@ -14616,19 +19281,28 @@]}},- "\/services\/{uuid}\/start": {- "post": {+ "\/projects\/{uuid}\/environments\/{environment_name_or_uuid}\/envs": {+ "get": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Start",- "description": "Start service.",- "operationId": "start-service-by-uuid",+ "summary": "List Environment Shared Envs",+ "description": "List shared environment variables for a project environment (type=environment).",+ "operationId": "list-environment-shared-envs","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID","required": true,"schema": {"type": "string"@@ -14637,27 +19311,11 @@],"responses": {"200": {- "description": "Start service.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Service starting request queued."- }- },- "type": "object"- }- }- }+ "description": "Environment shared environment variables."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"}@@ -14667,61 +19325,49 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/stop": {+ },"post": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Stop",- "description": "Stop service.",- "operationId": "stop-service-by-uuid",+ "summary": "Create Environment Shared Env",+ "description": "Create a shared environment variable for a project environment (type=environment).",+ "operationId": "create-environment-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}},{- "name": "docker_cleanup",- "in": "query",- "description": "Perform docker cleanup (prune networks, volumes, etc.).",+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID",+ "required": true,"schema": {- "type": "boolean",- "default": true+ "type": "string"}}],"responses": {- "200": {- "description": "Stop service.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Service stopping request queued."- }- },- "type": "object"- }- }- }+ "201": {+ "description": "Environment variable created."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"+ },+ "409": {+ "description": "Environment variable already exists."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -14731,59 +19377,108 @@]}},- "\/services\/{uuid}\/restart": {- "post": {+ "\/projects\/{uuid}\/environments\/{environment_name_or_uuid}\/envs\/{env_id}": {+ "delete": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Restart",- "description": "Restart service.",- "operationId": "restart-service-by-uuid",+ "summary": "Delete Environment Shared Env",+ "description": "Delete an environment shared environment variable by id.",+ "operationId": "delete-environment-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Project UUID","required": true,"schema": {"type": "string"}},{- "name": "latest",- "in": "query",- "description": "Pull latest images.",+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID",+ "required": true,"schema": {- "type": "boolean",- "default": false+ "type": "string"+ }+ },+ {+ "name": "env_id",+ "in": "path",+ "description": "Shared env id (integer).",+ "required": true,+ "schema": {+ "type": "integer"}}],"responses": {"200": {- "description": "Restart service.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string",- "example": "Service restaring request queued."- }- },- "type": "object"- }- }+ "description": "Environment variable deleted."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ },+ "patch": {+ "tags": [+ "Shared Environment Variables"+ ],+ "summary": "Update Environment Shared Env",+ "description": "Update an environment shared environment variable by id.",+ "operationId": "update-environment-shared-env",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Project UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "environment_name_or_uuid",+ "in": "path",+ "description": "Environment name or UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "env_id",+ "in": "path",+ "description": "Shared env id (integer).",+ "required": true,+ "schema": {+ "type": "integer"}+ }+ ],+ "responses": {+ "200": {+ "description": "Environment variable updated."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -14793,19 +19488,19 @@]}},- "\/services\/{uuid}\/storages": {+ "\/servers\/{uuid}\/envs": {"get": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "List Storages",- "description": "List all persistent storages and file storages by service UUID.",- "operationId": "list-storages-by-service-uuid",+ "summary": "List Server Shared Envs",+ "description": "List shared environment variables for a server (type=server).",+ "operationId": "list-server-shared-envs","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Server UUID","required": true,"schema": {"type": "string"@@ -14814,35 +19509,11 @@],"responses": {"200": {- "description": "All storages by service UUID.",- "content": {- "application\/json": {- "schema": {- "properties": {- "persistent_storages": {- "type": "array",- "items": {- "type": "object"- }- },- "file_storages": {- "type": "array",- "items": {- "type": "object"- }- }- },- "type": "object"- }- }- }+ "description": "Server shared environment variables."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"}@@ -14855,98 +19526,35 @@},"post": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Create Storage",- "description": "Create a persistent storage or file storage for a service sub-resource.",- "operationId": "create-storage-by-service-uuid",+ "summary": "Create Server Shared Env",+ "description": "Create a shared environment variable for a server (type=server).",+ "operationId": "create-server-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Server UUID","required": true,"schema": {"type": "string"}}],- "requestBody": {- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "type",- "mount_path",- "resource_uuid"- ],- "properties": {- "type": {- "type": "string",- "enum": [- "persistent",- "file"- ],- "description": "The type of storage."- },- "resource_uuid": {- "type": "string",- "description": "UUID of the service application or database sub-resource."- },- "name": {- "type": "string",- "description": "Volume name (persistent only, required for persistent)."- },- "mount_path": {- "type": "string",- "description": "The container mount path."- },- "host_path": {- "type": "string",- "nullable": true,- "description": "The host path (persistent only, optional)."- },- "content": {- "type": "string",- "nullable": true,- "description": "File content (file only, optional)."- },- "is_directory": {- "type": "boolean",- "description": "Whether this is a directory mount (file only, default false)."- },- "fs_path": {- "type": "string",- "description": "Host directory path (required when is_directory is true)."- }- },- "type": "object",- "additionalProperties": false- }- }- }- },"responses": {"201": {- "description": "Storage created.",- "content": {- "application\/json": {- "schema": {- "type": "object"- }- }- }+ "description": "Environment variable created."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"},+ "409": {+ "description": "Environment variable already exists."+ },"422": {"$ref": "#\/components\/responses\/422"}@@ -14956,102 +19564,45 @@"bearerAuth": []}]- },- "patch": {+ }+ },+ "\/servers\/{uuid}\/envs\/{env_id}": {+ "delete": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Update Storage",- "description": "Update a persistent storage or file storage by service UUID.",- "operationId": "update-storage-by-service-uuid",+ "summary": "Delete Server Shared Env",+ "description": "Delete a server shared environment variable by id.",+ "operationId": "delete-server-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Server UUID","required": true,"schema": {"type": "string"}- }- ],- "requestBody": {- "description": "Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.",- "required": true,- "content": {- "application\/json": {- "schema": {- "required": [- "type"- ],- "properties": {- "uuid": {- "type": "string",- "description": "The UUID of the storage (preferred)."- },- "id": {- "type": "integer",- "description": "The ID of the storage (deprecated, use uuid instead)."- },- "type": {- "type": "string",- "enum": [- "persistent",- "file"- ],- "description": "The type of storage: persistent or file."- },- "is_preview_suffix_enabled": {- "type": "boolean",- "description": "Whether to add -pr-N suffix for preview deployments."- },- "name": {- "type": "string",- "description": "The volume name (persistent only, not allowed for read-only storages)."- },- "mount_path": {- "type": "string",- "description": "The container mount path (not allowed for read-only storages)."- },- "host_path": {- "type": "string",- "nullable": true,- "description": "The host path (persistent only, not allowed for read-only storages)."- },- "content": {- "type": "string",- "nullable": true,- "description": "The file content (file only, not allowed for read-only storages)."- }- },- "type": "object",- "additionalProperties": false- }+ },+ {+ "name": "env_id",+ "in": "path",+ "description": "Shared env id (integer).",+ "required": true,+ "schema": {+ "type": "integer"}}- },+ ],"responses": {"200": {- "description": "Storage updated.",- "content": {- "application\/json": {- "schema": {- "type": "object"- }- }- }+ "description": "Environment variable deleted."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"- },- "422": {- "$ref": "#\/components\/responses\/422"}},"security": [@@ -15059,58 +19610,41 @@"bearerAuth": []}]- }- },- "\/services\/{uuid}\/storages\/{storage_uuid}": {- "delete": {+ },+ "patch": {"tags": [- "Services"+ "Shared Environment Variables"],- "summary": "Delete Storage",- "description": "Delete a persistent storage or file storage by service UUID.",- "operationId": "delete-storage-by-service-uuid",+ "summary": "Update Server Shared Env",+ "description": "Update a server shared environment variable by id.",+ "operationId": "update-server-shared-env","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",+ "description": "Server UUID","required": true,"schema": {"type": "string"}},{- "name": "storage_uuid",+ "name": "env_id","in": "path",- "description": "UUID of the storage.",+ "description": "Shared env id (integer).","required": true,"schema": {- "type": "string"+ "type": "integer"}}],"responses": {"200": {- "description": "Storage deleted.",- "content": {- "application\/json": {- "schema": {- "properties": {- "message": {- "type": "string"- }- },- "type": "object"- }- }- }+ "description": "Environment variable updated."},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"},@@ -15125,28 +19659,17 @@]}},- "\/services\/{uuid}\/tags": {+ "\/tags": {"get": {"tags": [- "Services"- ],- "summary": "List Tags",- "description": "List tags for a service by UUID.",- "operationId": "list-tags-by-service-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the service.",- "required": true,- "schema": {- "type": "string"- }- }+ "Tags"],+ "summary": "List",+ "description": "List all tags for the current team.",+ "operationId": "list-tags","responses": {"200": {- "description": "List of tags.",+ "description": "All tags for the current team.","content": {"application\/json": {"schema": {@@ -15163,9 +19686,6 @@},"400": {"$ref": "#\/components\/responses\/400"- },- "404": {- "$ref": "#\/components\/responses\/404"}},"security": [@@ -15176,38 +19696,24 @@},"post": {"tags": [- "Services"- ],- "summary": "Create Tag",- "description": "Add tag(s) to a service by UUID.",- "operationId": "create-tag-by-service-uuid",- "parameters": [- {- "name": "uuid",- "in": "path",- "description": "UUID of the service.",- "required": true,- "schema": {- "type": "string"- }- }+ "Tags"],+ "summary": "Create",+ "description": "Create a tag for the current team.",+ "operationId": "create-tag","requestBody": {"required": true,"content": {"application\/json": {"schema": {+ "required": [+ "name"+ ],"properties": {- "tag_name": {+ "name": {"type": "string",- "description": "The tag name (min 2 characters). Required if tag_names is not provided."- },- "tag_names": {- "type": "array",- "items": {- "type": "string"- },- "description": "Array of tag names (each min 2 characters). Required if tag_name is not provided."+ "maxLength": 255,+ "minLength": 2}},"type": "object"@@ -15217,14 +19723,11 @@},"responses": {"201": {- "description": "Tags added successfully.",+ "description": "Tag created.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Tag"- }+ "$ref": "#\/components\/schemas\/Tag"}}}@@ -15235,8 +19738,8 @@"400": {"$ref": "#\/components\/responses\/400"},- "404": {- "$ref": "#\/components\/responses\/404"+ "409": {+ "description": "Tag with this name already exists."},"422": {"$ref": "#\/components\/responses\/422"@@ -15249,28 +19752,19 @@]}},- "\/services\/{uuid}\/tags\/{tag_uuid}": {+ "\/tags\/{uuid}": {"delete": {"tags": [- "Services"+ "Tags"],- "summary": "Delete Tag",- "description": "Remove a tag from a service by UUID.",- "operationId": "delete-tag-by-service-uuid",+ "summary": "Delete",+ "description": "Delete a tag for the current team. Detaches the tag from all resources via cascade.",+ "operationId": "delete-tag-by-uuid","parameters": [{"name": "uuid","in": "path",- "description": "UUID of the service.",- "required": true,- "schema": {- "type": "string"- }- },- {- "name": "tag_uuid",- "in": "path",- "description": "UUID of the tag.",+ "description": "Tag UUID","required": true,"schema": {"type": "string"@@ -15279,14 +19773,24 @@],"responses": {"200": {- "description": "Tag removed."+ "description": "Tag deleted.",+ "content": {+ "application\/json": {+ "schema": {+ "properties": {+ "message": {+ "type": "string",+ "example": "Tag deleted."+ }+ },+ "type": "object"+ }+ }+ }},"401": {"$ref": "#\/components\/responses\/401"},- "400": {- "$ref": "#\/components\/responses\/400"- },"404": {"$ref": "#\/components\/responses\/404"}@@ -15296,26 +19800,52 @@"bearerAuth": []}]- }- },- "\/tags": {- "get": {+ },+ "patch": {"tags": ["Tags"],- "summary": "List",- "description": "List all tags for the current team.",- "operationId": "list-tags",+ "summary": "Update",+ "description": "Update a tag name for the current team.",+ "operationId": "update-tag-by-uuid",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "description": "Tag UUID",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "requestBody": {+ "required": true,+ "content": {+ "application\/json": {+ "schema": {+ "required": [+ "name"+ ],+ "properties": {+ "name": {+ "type": "string",+ "maxLength": 255,+ "minLength": 2+ }+ },+ "type": "object"+ }+ }+ }+ },"responses": {"200": {- "description": "All tags for the current team.",+ "description": "Tag updated.","content": {"application\/json": {"schema": {- "type": "array",- "items": {- "$ref": "#\/components\/schemas\/Tag"- }+ "$ref": "#\/components\/schemas\/Tag"}}}@@ -15325,6 +19855,15 @@},"400": {"$ref": "#\/components\/responses\/400"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ },+ "409": {+ "description": "Tag with this name already exists."+ },+ "422": {+ "$ref": "#\/components\/responses\/422"}},"security": [@@ -15467,17 +20006,17 @@]}},- "\/teams\/current": {+ "\/team": {"get": {"tags": ["Teams"],"summary": "Authenticated Team",- "description": "Get currently authenticated team.",- "operationId": "get-current-team",+ "description": "Get the team bound to the API token.",+ "operationId": "get-token-team","responses": {"200": {- "description": "Current Team.",+ "description": "Team bound to the API token.","content": {"application\/json": {"schema": {@@ -15500,17 +20039,17 @@]}},- "\/teams\/current\/members": {+ "\/team\/members": {"get": {"tags": ["Teams"],"summary": "Authenticated Team Members",- "description": "Get currently authenticated team members.",- "operationId": "get-current-team-members",+ "description": "Get members of the team bound to the API token.",+ "operationId": "get-token-team-members","responses": {"200": {- "description": "Currently authenticated team members.",+ "description": "Members of the team bound to the API token.","content": {"application\/json": {"schema": {@@ -15926,6 +20465,138 @@]}},+ "\/applications\/{uuid}\/storages\/{storage_uuid}\/backups\/run": {+ "post": {+ "tags": [+ "Applications"+ ],+ "summary": "Run application storage backup",+ "description": "Queue an immediate volume backup for an application storage that has a schedule.",+ "operationId": "run-application-storage-backup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "storage_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Storage backup queued."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/databases\/{uuid}\/storages\/{storage_uuid}\/backups\/run": {+ "post": {+ "tags": [+ "Databases"+ ],+ "summary": "Run database storage backup",+ "description": "Queue an immediate volume backup for a database storage that has a schedule.",+ "operationId": "run-database-storage-backup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "storage_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Storage backup queued."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },+ "\/services\/{uuid}\/storages\/{storage_uuid}\/backups\/run": {+ "post": {+ "tags": [+ "Services"+ ],+ "summary": "Run service storage backup",+ "description": "Queue an immediate volume backup for a service storage that has a schedule.",+ "operationId": "run-service-storage-backup",+ "parameters": [+ {+ "name": "uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ },+ {+ "name": "storage_uuid",+ "in": "path",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Storage backup queued."+ },+ "401": {+ "$ref": "#\/components\/responses\/401"+ },+ "404": {+ "$ref": "#\/components\/responses\/404"+ }+ },+ "security": [+ {+ "bearerAuth": []+ }+ ]+ }+ },"\/vultr\/regions": {"get": {"tags": [@@ -16436,6 +21107,10 @@"type": "string","description": "Preview URL template."},+ "max_restart_count": {+ "type": "integer",+ "description": "Maximum container restart count before stopping."+ },"destination_type": {"type": "string","description": "Destination type."@@ -17621,6 +22296,10 @@"name": "Applications","description": "Applications"},+ {+ "name": "Cloud-init Scripts",+ "description": "Cloud-init Scripts"+ },{"name": "Cloud Tokens","description": "Cloud Tokens"@@ -17645,10 +22324,18 @@"name": "GitHub Apps","description": "GitHub Apps"},+ {+ "name": "GitLab Apps",+ "description": "GitLab Apps"+ },{"name": "Hetzner","description": "Hetzner"},+ {+ "name": "Notifications",+ "description": "Notifications"+ },{"name": "Projects","description": "Projects"@@ -17657,6 +22344,10 @@"name": "Resources","description": "Resources"},+ {+ "name": "S3 Storages",+ "description": "S3 Storages"+ },{"name": "Scheduled Tasks","description": "Scheduled Tasks"@@ -17681,6 +22372,10 @@"name": "Services","description": "Services"},+ {+ "name": "Shared Environment Variables",+ "description": "Shared Environment Variables"+ },{"name": "Tags","description": "Tags"diff --git a/openapi.yaml b/openapi.yamlindex fe3b85ad4a..dd98f718dc 100644--- a/openapi.yaml+++ b/openapi.yaml@@ -316,6 +316,42 @@ paths:is_raw_compose_deployment_enabled:type: booleandescription: 'Deploy the raw Docker Compose definition.'+ is_log_drain_enabled:+ type: boolean+ description: 'Enable log drain for the application.'+ is_gpu_enabled:+ type: boolean+ description: 'Enable GPU support.'+ gpu_driver:+ type: string+ nullable: true+ description: 'GPU driver name.'+ gpu_count:+ type: string+ nullable: true+ description: 'Number of GPUs to allocate.'+ gpu_device_ids:+ type: string+ nullable: true+ description: 'Comma-separated GPU device IDs.'+ gpu_options:+ type: string+ nullable: true+ description: 'Additional GPU options.'+ is_consistent_container_name_enabled:+ type: boolean+ description: 'Use a consistent container name across deployments.'+ custom_internal_name:+ type: string+ nullable: true+ description: 'Custom internal container name.'+ preview_url_template:+ type: string+ description: 'Preview URL template.'+ max_restart_count:+ type: integer+ minimum: 0+ description: 'Maximum container restart count before stopping.'is_http_basic_auth_enabled:type: booleandescription: 'HTTP Basic Authentication enabled.'@@ -658,6 +694,42 @@ paths:is_raw_compose_deployment_enabled:type: booleandescription: 'Deploy the raw Docker Compose definition.'+ is_log_drain_enabled:+ type: boolean+ description: 'Enable log drain for the application.'+ is_gpu_enabled:+ type: boolean+ description: 'Enable GPU support.'+ gpu_driver:+ type: string+ nullable: true+ description: 'GPU driver name.'+ gpu_count:+ type: string+ nullable: true+ description: 'Number of GPUs to allocate.'+ gpu_device_ids:+ type: string+ nullable: true+ description: 'Comma-separated GPU device IDs.'+ gpu_options:+ type: string+ nullable: true+ description: 'Additional GPU options.'+ is_consistent_container_name_enabled:+ type: boolean+ description: 'Use a consistent container name across deployments.'+ custom_internal_name:+ type: string+ nullable: true+ description: 'Custom internal container name.'+ preview_url_template:+ type: string+ description: 'Preview URL template.'+ max_restart_count:+ type: integer+ minimum: 0+ description: 'Maximum container restart count before stopping.'is_http_basic_auth_enabled:type: booleandescription: 'HTTP Basic Authentication enabled.'@@ -1000,6 +1072,42 @@ paths:is_raw_compose_deployment_enabled:type: booleandescription: 'Deploy the raw Docker Compose definition.'+ is_log_drain_enabled:+ type: boolean+ description: 'Enable log drain for the application.'+ is_gpu_enabled:+ type: boolean+ description: 'Enable GPU support.'+ gpu_driver:+ type: string+ nullable: true+ description: 'GPU driver name.'+ gpu_count:+ type: string+ nullable: true+ description: 'Number of GPUs to allocate.'+ gpu_device_ids:+ type: string+ nullable: true+ description: 'Comma-separated GPU device IDs.'+ gpu_options:+ type: string+ nullable: true+ description: 'Additional GPU options.'+ is_consistent_container_name_enabled:+ type: boolean+ description: 'Use a consistent container name across deployments.'+ custom_internal_name:+ type: string+ nullable: true+ description: 'Custom internal container name.'+ preview_url_template:+ type: string+ description: 'Preview URL template.'+ max_restart_count:+ type: integer+ minimum: 0+ description: 'Maximum container restart count before stopping.'is_http_basic_auth_enabled:type: booleandescription: 'HTTP Basic Authentication enabled.'@@ -1283,6 +1391,42 @@ paths:is_raw_compose_deployment_enabled:type: booleandescription: 'Deploy the raw Docker Compose definition.'+ is_log_drain_enabled:+ type: boolean+ description: 'Enable log drain for the application.'+ is_gpu_enabled:+ type: boolean+ description: 'Enable GPU support.'+ gpu_driver:+ type: string+ nullable: true+ description: 'GPU driver name.'+ gpu_count:+ type: string+ nullable: true+ description: 'Number of GPUs to allocate.'+ gpu_device_ids:+ type: string+ nullable: true+ description: 'Comma-separated GPU device IDs.'+ gpu_options:+ type: string+ nullable: true+ description: 'Additional GPU options.'+ is_consistent_container_name_enabled:+ type: boolean+ description: 'Use a consistent container name across deployments.'+ custom_internal_name:+ type: string+ nullable: true+ description: 'Custom internal container name.'+ preview_url_template:+ type: string+ description: 'Preview URL template.'+ max_restart_count:+ type: integer+ minimum: 0+ description: 'Maximum container restart count before stopping.'is_http_basic_auth_enabled:type: booleandescription: 'HTTP Basic Authentication enabled.'@@ -1552,6 +1696,42 @@ paths:is_raw_compose_deployment_enabled:type: booleandescription: 'Deploy the raw Docker Compose definition.'+ is_log_drain_enabled:+ type: boolean+ description: 'Enable log drain for the application.'+ is_gpu_enabled:+ type: boolean+ description: 'Enable GPU support.'+ gpu_driver:+ type: string+ nullable: true+ description: 'GPU driver name.'+ gpu_count:+ type: string+ nullable: true+ description: 'Number of GPUs to allocate.'+ gpu_device_ids:+ type: string+ nullable: true+ description: 'Comma-separated GPU device IDs.'+ gpu_options:+ type: string+ nullable: true+ description: 'Additional GPU options.'+ is_consistent_container_name_enabled:+ type: boolean+ description: 'Use a consistent container name across deployments.'+ custom_internal_name:+ type: string+ nullable: true+ description: 'Custom internal container name.'+ preview_url_template:+ type: string+ description: 'Preview URL template.'+ max_restart_count:+ type: integer+ minimum: 0+ description: 'Maximum container restart count before stopping.'is_http_basic_auth_enabled:type: booleandescription: 'HTTP Basic Authentication enabled.'@@ -1975,6 +2155,42 @@ paths:is_raw_compose_deployment_enabled:type: booleandescription: 'Deploy the raw Docker Compose definition.'+ is_log_drain_enabled:+ type: boolean+ description: 'Enable log drain for the application.'+ is_gpu_enabled:+ type: boolean+ description: 'Enable GPU support.'+ gpu_driver:+ type: string+ nullable: true+ description: 'GPU driver name.'+ gpu_count:+ type: string+ nullable: true+ description: 'Number of GPUs to allocate.'+ gpu_device_ids:+ type: string+ nullable: true+ description: 'Comma-separated GPU device IDs.'+ gpu_options:+ type: string+ nullable: true+ description: 'Additional GPU options.'+ is_consistent_container_name_enabled:+ type: boolean+ description: 'Use a consistent container name across deployments.'+ custom_internal_name:+ type: string+ nullable: true+ description: 'Custom internal container name.'+ preview_url_template:+ type: string+ description: 'Preview URL template.'+ max_restart_count:+ type: integer+ minimum: 0+ description: 'Maximum container restart count before stopping.'connect_to_docker_network:type: booleandescription: 'The flag to connect the service to the predefined Docker network.'@@ -2846,182 +3062,132 @@ paths:security:-bearerAuth: []- /cloud-tokens:- get:- tags:- - 'Cloud Tokens'- summary: 'List Cloud Provider Tokens'- description: 'List all cloud provider tokens for the authenticated team.'- operationId: list-cloud-tokens- responses:- '200':- description: 'Get all cloud provider tokens.'- content:- application/json:- schema:- type: array- items:- properties: { uuid: { type: string }, name: { type: string }, provider: { type: string, enum: [hetzner, digitalocean, vultr] }, team_id: { type: integer }, servers_count: { type: integer }, created_at: { type: string }, updated_at: { type: string } }- type: object- '401':- $ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- security:- -- bearerAuth: []+ '/applications/{uuid}/clone':post:tags:- - 'Cloud Tokens'- summary: 'Create Cloud Provider Token'- description: 'Create a new cloud provider token. The token will be validated before being stored.'- operationId: create-cloud-token+ - Applications+ summary: Clone+ description: 'Clone an application to a destination owned by the authenticated team.'+ operationId: clone-application-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: true+ schema:+ type: stringrequestBody:- description: 'Cloud provider token details'required: truecontent:application/json:schema:required:- - provider- - token- - name+ - destination_uuidproperties:- provider:- type: string- enum: [hetzner, digitalocean, vultr]- example: hetzner- description: 'The cloud provider.'- token:+ destination_uuid:+ description: 'UUID of the destination to clone into.'type: string- example: your-api-token-here- description: 'The API token for the cloud provider.'name:- type: string- example: 'My Hetzner Token'- description: 'A friendly name for the token.'+ description: 'Optional name for the cloned application.'+ type: [string, 'null']+ clone_volumes:+ description: 'Whether to clone volume data.'+ type: boolean+ default: falsetype: objectresponses:'201':- description: 'Cloud provider token created.'+ description: 'Application cloned.'content:application/json:schema:properties:- uuid: { type: string, example: og888os, description: 'The UUID of the token.' }+ uuid: { type: string }+ message: { type: string, example: 'Application cloned.' }type: object- '401':- $ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '422':- $ref: '#/components/responses/422'- security:- -- bearerAuth: []- '/cloud-tokens/{uuid}':- get:- tags:- - 'Cloud Tokens'- summary: 'Get Cloud Provider Token'- description: 'Get cloud provider token by UUID.'- operationId: get-cloud-token-by-uuid- parameters:- -- name: uuid- in: path- description: 'Token UUID'- required: true- schema:- type: string- responses:- '200':- description: 'Get cloud provider token by UUID'- content:- application/json:- schema:- properties:- uuid: { type: string }- name: { type: string }- provider: { type: string }- team_id: { type: integer }- servers_count: { type: integer }- created_at: { type: string }- updated_at: { type: string }- type: object'401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- delete:+ '/applications/{uuid}/rollback-images':+ get:tags:- - 'Cloud Tokens'- summary: 'Delete Cloud Provider Token'- description: 'Delete cloud provider token by UUID. Cannot delete if token is used by any servers.'- operationId: delete-cloud-token-by-uuid+ - Applications+ summary: 'List Rollback Images'+ description: 'List available Docker images for rolling back an application. Returns an empty list when the server is unavailable or remote inspection is not possible.'+ operationId: list-application-rollback-imagesparameters:-name: uuidin: path- description: 'UUID of the cloud provider token.'+ description: 'UUID of the application.'required: trueschema:type: stringresponses:'200':- description: 'Cloud provider token deleted.'+ description: 'Rollback images.'content:application/json:schema:properties:- message: { type: string, example: 'Cloud provider token deleted.' }+ current: { type: [string, 'null'] }+ images: { type: array, items: { properties: { tag: { type: string }, created_at: { type: string }, is_current: { type: boolean } }, type: object } }type: object'401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- patch:+ '/applications/{uuid}/rollback':+ post:tags:- - 'Cloud Tokens'- summary: 'Update Cloud Provider Token'- description: 'Update cloud provider token name.'- operationId: update-cloud-token-by-uuid+ - Applications+ summary: Rollback+ description: 'Queue a rollback deployment for an application to a previous image commit/tag.'+ operationId: rollback-application-by-uuidparameters:-name: uuidin: path- description: 'Token UUID'+ description: 'UUID of the application.'required: trueschema:type: stringrequestBody:- description: 'Cloud provider token updated.'required: truecontent:application/json:schema:+ required:+ - commitproperties:- name:+ commit:+ description: 'Image tag / commit to roll back to.'type: string- description: 'The friendly name for the token.'type: objectresponses:'200':- description: 'Cloud provider token updated.'+ description: 'Rollback deployment queued.'content:application/json:schema:properties:- uuid: { type: string }+ message: { type: string }+ deployment_uuid: { type: string }type: object+ '400':+ $ref: '#/components/responses/400''401':$ref: '#/components/responses/401''404':@@ -3031,31 +3197,24 @@ paths:security:-bearerAuth: []- '/cloud-tokens/{uuid}/validate':- post:+ '/applications/{uuid}/destinations':+ get:tags:- - 'Cloud Tokens'- summary: 'Validate Cloud Provider Token'- description: 'Validate a cloud provider token against the provider API.'- operationId: validate-cloud-token-by-uuid+ - Applications+ summary: 'List Destinations'+ description: 'List primary and additional destinations for a standalone application.'+ operationId: list-application-destinationsparameters:-name: uuidin: path- description: 'Token UUID'+ description: 'UUID of the application.'required: trueschema:type: stringresponses:'200':- description: 'Token validation result.'- content:- application/json:- schema:- properties:- valid: { type: boolean, example: true }- message: { type: string, example: 'Token is valid.' }- type: object+ description: 'Application destinations.''401':$ref: '#/components/responses/401''404':@@ -3063,178 +3222,150 @@ paths:security:-bearerAuth: []- /databases:- get:+ post:tags:- - Databases- summary: List- description: 'List all databases.'- operationId: list-databases+ - Applications+ summary: 'Add Destination'+ description: 'Attach an additional standalone Docker destination to an application.'+ operationId: add-application-destination+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - destination_uuid+ properties:+ destination_uuid:+ type: string+ type: objectresponses:- '200':- description: 'Get all databases'- content:- application/json:- schema:- type: string- example: 'Content is very complex. Will be implemented later.'- '401':- $ref: '#/components/responses/401'+ '201':+ description: 'Destination attached.''400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/backups':- get:+ '/applications/{uuid}/destinations/{destination_uuid}':+ delete:tags:- - Databases- summary: Get- description: 'Get backups details by database UUID.'- operationId: get-database-backups-by-uuid+ - Applications+ summary: 'Remove Destination'+ description: 'Detach an additional destination from an application.'+ operationId: remove-application-destinationparameters:-name: uuidin: path- description: 'UUID of the database.'+ description: 'UUID of the application.'+ required: true+ schema:+ type: string+ -+ name: destination_uuid+ in: path+ description: 'UUID of the destination.'required: trueschema:type: stringresponses:'200':- description: 'Get all backups for a database'- content:- application/json:- schema:- type: string- example: 'Content is very complex. Will be implemented later.'+ description: 'Destination detached.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- post:+ /cloud-init-scripts:+ get:tags:- - Databases- summary: 'Create Backup'- description: 'Create a new scheduled backup configuration for a database'- operationId: create-database-backup- parameters:+ - 'Cloud-init Scripts'+ summary: 'List Cloud-init Scripts'+ description: 'List all cloud-init scripts for the authenticated team.'+ operationId: list-cloud-init-scripts+ responses:+ '200':+ description: 'Cloud-init scripts for the team.'+ '401':+ $ref: '#/components/responses/401'+ '403':+ description: Forbidden.+ security:-- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ bearerAuth: []+ post:+ tags:+ - 'Cloud-init Scripts'+ summary: 'Create Cloud-init Script'+ description: 'Create a new cloud-init script for the authenticated team.'+ operationId: create-cloud-init-scriptrequestBody:- description: 'Backup configuration data'required: truecontent:application/json:schema:required:- - frequency+ - name+ - scriptproperties:- frequency:- type: string- description: 'Backup frequency (cron expression or: every_minute, hourly, daily, weekly, monthly, yearly)'- enabled:- type: boolean- description: 'Whether the backup is enabled'- default: true- save_s3:- type: boolean- description: 'Whether to save backups to S3'- default: false- s3_storage_uuid:+ name:type: string- description: 'S3 storage UUID (required if save_s3 is true)'- databases_to_backup:+ script:+ description: 'Bash script (#!) or cloud-config YAML.'type: string- description: 'Comma separated list of databases to backup'- dump_all:- type: boolean- description: 'Whether to dump all databases'- default: false- backup_now:- type: boolean- description: 'Whether to trigger backup immediately after creation'- database_backup_retention_amount_locally:- type: integer- description: 'Number of backups to retain locally'- database_backup_retention_days_locally:- type: integer- description: 'Number of days to retain backups locally'- database_backup_retention_max_storage_locally:- type: number- description: 'Max storage (GB) for local backups'- database_backup_retention_amount_s3:- type: integer- description: 'Number of backups to retain in S3'- database_backup_retention_days_s3:- type: integer- description: 'Number of days to retain backups in S3'- database_backup_retention_max_storage_s3:- type: number- description: 'Max storage (GB) for S3 backups'- timeout:- type: integer- description: 'Backup job timeout in seconds (min: 60, max: 36000)'- default: 3600type: objectresponses:'201':- description: 'Backup configuration created successfully'- content:- application/json:- schema:- properties:- uuid: { type: string, format: uuid, example: 550e8400-e29b-41d4-a716-446655440000 }- message: { type: string, example: 'Backup configuration created successfully.' }- type: object+ description: 'Cloud-init script created.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'+ '403':+ description: Forbidden.'422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}':+ '/cloud-init-scripts/{uuid}':get:tags:- - Databases- summary: Get- description: 'Get database by UUID.'- operationId: get-database-by-uuid+ - 'Cloud-init Scripts'+ summary: 'Get Cloud-init Script'+ description: 'Get a cloud-init script by UUID.'+ operationId: get-cloud-init-script-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'required: trueschema:type: stringresponses:'200':- description: 'Get all databases'- content:- application/json:- schema:- type: string- example: 'Content is very complex. Will be implemented later.'+ description: 'Cloud-init script.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'+ '403':+ description: Forbidden.'404':$ref: '#/components/responses/404'security:@@ -3242,63 +3373,24 @@ paths:bearerAuth: []delete:tags:- - Databases- summary: Delete- description: 'Delete database by UUID.'- operationId: delete-database-by-uuid+ - 'Cloud-init Scripts'+ summary: 'Delete Cloud-init Script'+ description: 'Delete a cloud-init script by UUID.'+ operationId: delete-cloud-init-script-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'required: trueschema:type: string- -- name: delete_configurations- in: query- description: 'Delete configurations.'- required: false- schema:- type: boolean- default: true- -- name: delete_volumes- in: query- description: 'Delete volumes.'- required: false- schema:- type: boolean- default: true- -- name: docker_cleanup- in: query- description: 'Run docker cleanup.'- required: false- schema:- type: boolean- default: true- -- name: delete_connected_networks- in: query- description: 'Delete connected networks.'- required: false- schema:- type: boolean- default: trueresponses:'200':- description: 'Database deleted.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Database deleted.' }- type: object+ description: 'Cloud-init script deleted.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'+ '403':+ description: Forbidden.'404':$ref: '#/components/responses/404'security:@@ -3306,20 +3398,18 @@ paths:bearerAuth: []patch:tags:- - Databases- summary: Update- description: 'Update database by UUID.'- operationId: update-database-by-uuid+ - 'Cloud-init Scripts'+ summary: 'Update Cloud-init Script'+ description: 'Update a cloud-init script by UUID.'+ operationId: update-cloud-init-script-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'required: trueschema:type: stringrequestBody:- description: 'Database data'required: truecontent:application/json:@@ -3327,288 +3417,374 @@ paths:properties:name:type: string- description: 'Name of the database'- description:- type: string- description: 'Description of the database'- image:- type: string- description: 'Docker Image of the database'- is_public:- type: boolean- description: 'Is the database public?'- public_port:- type: integer- description: 'Public port of the database'- public_port_timeout:- type: integer- description: 'Public port timeout in seconds (default: 3600)'- limits_memory:- type: string- description: 'Memory limit of the database'- limits_memory_swap:- type: string- description: 'Memory swap limit of the database'- limits_memory_swappiness:- type: integer- description: 'Memory swappiness of the database'- limits_memory_reservation:- type: string- description: 'Memory reservation of the database'- limits_cpus:- type: string- description: 'CPU limit of the database'- limits_cpuset:- type: string- description: 'CPU set of the database'- limits_cpu_shares:- type: integer- description: 'CPU shares of the database'- postgres_user:- type: string- description: 'PostgreSQL user'- postgres_password:+ script:type: string- description: 'PostgreSQL password'- postgres_db:- type: string- description: 'PostgreSQL database'- postgres_initdb_args:- type: string- description: 'PostgreSQL initdb args'- postgres_host_auth_method:- type: string- description: 'PostgreSQL host auth method'- postgres_conf:- type: string- description: 'PostgreSQL conf'- clickhouse_admin_user:- type: string- description: 'Clickhouse admin user'- clickhouse_admin_password:- type: string- description: 'Clickhouse admin password'- dragonfly_password:- type: string- description: 'DragonFly password'- redis_password:- type: string- description: 'Redis password'- redis_conf:- type: string- description: 'Redis conf'- keydb_password:- type: string- description: 'KeyDB password'- keydb_conf:- type: string- description: 'KeyDB conf'- mariadb_conf:- type: string- description: 'MariaDB conf'- mariadb_root_password:- type: string- description: 'MariaDB root password'- mariadb_user:- type: string- description: 'MariaDB user'- mariadb_password:- type: string- description: 'MariaDB password'- mariadb_database:- type: string- description: 'MariaDB database'- mongo_conf:- type: string- description: 'Mongo conf'- mongo_initdb_root_username:- type: string- description: 'Mongo initdb root username'- mongo_initdb_root_password:- type: string- description: 'Mongo initdb root password'- mongo_initdb_database:- type: string- description: 'Mongo initdb init database'- mysql_root_password:- type: string- description: 'MySQL root password'- mysql_password:- type: string- description: 'MySQL password'- mysql_user:+ type: object+ responses:+ '200':+ description: 'Cloud-init script updated.'+ '401':+ $ref: '#/components/responses/401'+ '403':+ description: Forbidden.+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /cloud-tokens:+ get:+ tags:+ - 'Cloud Tokens'+ summary: 'List Cloud Provider Tokens'+ description: 'List all cloud provider tokens for the authenticated team.'+ operationId: list-cloud-tokens+ responses:+ '200':+ description: 'Get all cloud provider tokens.'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { uuid: { type: string }, name: { type: string }, provider: { type: string, enum: [hetzner, digitalocean, vultr] }, team_id: { type: integer }, servers_count: { type: integer }, created_at: { type: string }, updated_at: { type: string } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - 'Cloud Tokens'+ summary: 'Create Cloud Provider Token'+ description: 'Create a new cloud provider token. The token will be validated before being stored.'+ operationId: create-cloud-token+ requestBody:+ description: 'Cloud provider token details'+ required: true+ content:+ application/json:+ schema:+ required:+ - provider+ - token+ - name+ properties:+ provider:type: string- description: 'MySQL user'- mysql_database:+ enum: [hetzner, digitalocean, vultr]+ example: hetzner+ description: 'The cloud provider.'+ token:type: string- description: 'MySQL database'- mysql_conf:+ example: your-api-token-here+ description: 'The API token for the cloud provider.'+ name:type: string- description: 'MySQL conf'- health_check_enabled:- type: boolean- description: 'Enable the database healthcheck probe.'- default: true- health_check_interval:- type: integer- description: 'Healthcheck interval in seconds.'- minimum: 1- default: 15- health_check_timeout:- type: integer- description: 'Healthcheck timeout in seconds.'- minimum: 1- default: 5- health_check_retries:- type: integer- description: 'Healthcheck retries count.'- minimum: 1- default: 5- health_check_start_period:- type: integer- description: 'Healthcheck start period in seconds.'- minimum: 0- default: 5+ example: 'My Hetzner Token'+ description: 'A friendly name for the token.'type: objectresponses:- '200':- description: 'Database updated'+ '201':+ description: 'Cloud provider token created.'+ content:+ application/json:+ schema:+ properties:+ uuid: { type: string, example: og888os, description: 'The UUID of the token.' }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/backups/{scheduled_backup_uuid}':- delete:+ '/cloud-tokens/{uuid}':+ get:tags:- - Databases- summary: 'Delete backup configuration'- description: 'Deletes a backup configuration and all its executions.'- operationId: delete-backup-configuration-by-uuid+ - 'Cloud Tokens'+ summary: 'Get Cloud Provider Token'+ description: 'Get cloud provider token by UUID.'+ operationId: get-cloud-token-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database'- required: true- schema:- type: string- -- name: scheduled_backup_uuid- in: path- description: 'UUID of the backup configuration to delete'+ description: 'Token UUID'required: trueschema:type: string- -- name: delete_s3- in: query- description: 'Whether to delete all backup files from S3'- required: false- schema:- type: boolean- default: falseresponses:'200':- description: 'Backup configuration deleted.'+ description: 'Get cloud provider token by UUID'content:application/json:schema:properties:- message: { type: string, example: 'Backup configuration and all executions deleted.' }+ uuid: { type: string }+ name: { type: string }+ provider: { type: string }+ team_id: { type: integer }+ servers_count: { type: integer }+ created_at: { type: string }+ updated_at: { type: string }type: object+ '401':+ $ref: '#/components/responses/401''404':- description: 'Backup configuration not found.'+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ delete:+ tags:+ - 'Cloud Tokens'+ summary: 'Delete Cloud Provider Token'+ description: 'Delete cloud provider token by UUID. Cannot delete if token is used by any servers.'+ operationId: delete-cloud-token-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the cloud provider token.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Cloud provider token deleted.'content:application/json:schema:properties:- message: { type: string, example: 'Backup configuration not found.' }+ message: { type: string, example: 'Cloud provider token deleted.' }type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []patch:tags:- - Databases- summary: Update- description: 'Update a specific backup configuration for a given database, identified by its UUID and the backup ID'- operationId: update-database-backup+ - 'Cloud Tokens'+ summary: 'Update Cloud Provider Token'+ description: 'Update cloud provider token name.'+ operationId: update-cloud-token-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'+ description: 'Token UUID'required: trueschema:type: string- -- name: scheduled_backup_uuid+ requestBody:+ description: 'Cloud provider token updated.'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'The friendly name for the token.'+ type: object+ responses:+ '200':+ description: 'Cloud provider token updated.'+ content:+ application/json:+ schema:+ properties:+ uuid: { type: string }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/cloud-tokens/{uuid}/validate':+ post:+ tags:+ - 'Cloud Tokens'+ summary: 'Validate Cloud Provider Token'+ description: 'Validate a cloud provider token against the provider API.'+ operationId: validate-cloud-token-by-uuid+ parameters:+ -+ name: uuidin: path- description: 'UUID of the backup configuration.'+ description: 'Token UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Token validation result.'+ content:+ application/json:+ schema:+ properties:+ valid: { type: boolean, example: true }+ message: { type: string, example: 'Token is valid.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ /databases:+ get:+ tags:+ - Databases+ summary: List+ description: 'List all databases.'+ operationId: list-databases+ responses:+ '200':+ description: 'Get all databases'+ content:+ application/json:+ schema:+ type: string+ example: 'Content is very complex. Will be implemented later.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/backups':+ get:+ tags:+ - Databases+ summary: Get+ description: 'Get backups details by database UUID.'+ operationId: get-database-backups-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Get all backups for a database'+ content:+ application/json:+ schema:+ type: string+ example: 'Content is very complex. Will be implemented later.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - Databases+ summary: 'Create Backup'+ description: 'Create a new scheduled backup configuration for a database'+ operationId: create-database-backup+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'required: trueschema:type: stringrequestBody:- description: 'Database backup configuration data'+ description: 'Backup configuration data'required: truecontent:application/json:schema:+ required:+ - frequencyproperties:+ frequency:+ type: string+ description: 'Backup frequency (cron expression or: every_minute, hourly, daily, weekly, monthly, yearly)'+ enabled:+ type: boolean+ description: 'Whether the backup is enabled'+ default: truesave_s3:type: boolean- description: 'Whether data is saved in s3 or not'+ description: 'Whether to save backups to S3'+ default: falses3_storage_uuid:type: string- description: 'S3 storage UUID'- backup_now:- type: boolean- description: 'Whether to take a backup now or not'- enabled:- type: boolean- description: 'Whether the backup is enabled or not'+ description: 'S3 storage UUID (required if save_s3 is true)'databases_to_backup:type: stringdescription: 'Comma separated list of databases to backup'dump_all:type: boolean- description: 'Whether all databases are dumped or not'- frequency:- type: string- description: 'Frequency of the backup'+ description: 'Whether to dump all databases'+ default: false+ backup_now:+ type: boolean+ description: 'Whether to trigger backup immediately after creation'database_backup_retention_amount_locally:type: integer- description: 'Retention amount of the backup locally'+ description: 'Number of backups to retain locally'database_backup_retention_days_locally:type: integer- description: 'Retention days of the backup locally'+ description: 'Number of days to retain backups locally'database_backup_retention_max_storage_locally:type: number- description: 'Max storage of the backup locally'+ description: 'Max storage (GB) for local backups'database_backup_retention_amount_s3:type: integer- description: 'Retention amount of the backup in s3'+ description: 'Number of backups to retain in S3'database_backup_retention_days_s3:type: integer- description: 'Retention days of the backup in s3'+ description: 'Number of days to retain backups in S3'database_backup_retention_max_storage_s3:type: number- description: 'Max storage of the backup in S3'+ description: 'Max storage (GB) for S3 backups'timeout:type: integerdescription: 'Backup job timeout in seconds (min: 60, max: 36000)'default: 3600type: objectresponses:- '200':- description: 'Database backup configuration updated'+ '201':+ description: 'Backup configuration created successfully'+ content:+ application/json:+ schema:+ properties:+ uuid: { type: string, format: uuid, example: 550e8400-e29b-41d4-a716-446655440000 }+ message: { type: string, example: 'Backup configuration created successfully.' }+ type: object'401':$ref: '#/components/responses/401''400':@@ -3620,157 +3796,123 @@ paths:security:-bearerAuth: []- /databases/postgresql:- post:+ '/databases/{uuid}':+ get:tags:- Databases- summary: 'Create (PostgreSQL)'- description: 'Create a new PostgreSQL database.'- operationId: create-database-postgresql- requestBody:- description: 'Database data'- required: true- content:- application/json:- schema:- required:- - server_uuid- - project_uuid- - environment_name- - environment_uuid- properties:- server_uuid:- type: string- description: 'UUID of the server'- project_uuid:- type: string- description: 'UUID of the project'- environment_name:- type: string- description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'- environment_uuid:- type: string- description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'- postgres_user:- type: string- description: 'PostgreSQL user'- postgres_password:- type: string- description: 'PostgreSQL password'- postgres_db:- type: string- description: 'PostgreSQL database'- postgres_initdb_args:- type: string- description: 'PostgreSQL initdb args'- postgres_host_auth_method:- type: string- description: 'PostgreSQL host auth method'- postgres_conf:- type: string- description: 'PostgreSQL conf'- destination_uuid:- type: string- description: 'UUID of the destination if the server has multiple destinations'- name:- type: string- description: 'Name of the database'- description:- type: string- description: 'Description of the database'- image:- type: string- description: 'Docker Image of the database'- is_public:- type: boolean- description: 'Is the database public?'- public_port:- type: integer- description: 'Public port of the database'- public_port_timeout:- type: integer- description: 'Public port timeout in seconds (default: 3600)'- limits_memory:- type: string- description: 'Memory limit of the database'- limits_memory_swap:- type: string- description: 'Memory swap limit of the database'- limits_memory_swappiness:- type: integer- description: 'Memory swappiness of the database'- limits_memory_reservation:- type: string- description: 'Memory reservation of the database'- limits_cpus:- type: string- description: 'CPU limit of the database'- limits_cpuset:- type: string- description: 'CPU set of the database'- limits_cpu_shares:- type: integer- description: 'CPU shares of the database'- instant_deploy:- type: boolean- description: 'Instant deploy the database'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the database.'- type: object+ summary: Get+ description: 'Get database by UUID.'+ operationId: get-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: stringresponses:'200':- description: 'Database updated'+ description: 'Get all databases'+ content:+ application/json:+ schema:+ type: string+ example: 'Content is very complex. Will be implemented later.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '422':- $ref: '#/components/responses/422'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []- /databases/clickhouse:- post:+ delete:tags:- Databases- summary: 'Create (Clickhouse)'- description: 'Create a new Clickhouse database.'- operationId: create-database-clickhouse+ summary: Delete+ description: 'Delete database by UUID.'+ operationId: delete-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ -+ name: delete_configurations+ in: query+ description: 'Delete configurations.'+ required: false+ schema:+ type: boolean+ default: true+ -+ name: delete_volumes+ in: query+ description: 'Delete volumes.'+ required: false+ schema:+ type: boolean+ default: true+ -+ name: docker_cleanup+ in: query+ description: 'Run docker cleanup.'+ required: false+ schema:+ type: boolean+ default: true+ -+ name: delete_connected_networks+ in: query+ description: 'Delete connected networks.'+ required: false+ schema:+ type: boolean+ default: true+ responses:+ '200':+ description: 'Database deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Database deleted.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Databases+ summary: Update+ description: 'Update database by UUID.'+ operationId: update-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: stringrequestBody:description: 'Database data'required: truecontent:application/json:schema:- required:- - server_uuid- - project_uuid- - environment_name- - environment_uuidproperties:- server_uuid:- type: string- description: 'UUID of the server'- project_uuid:- type: string- description: 'UUID of the project'- environment_name:- type: string- description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'- environment_uuid:- type: string- description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'- destination_uuid:- type: string- description: 'UUID of the destination if the server has multiple destinations'- clickhouse_admin_user:- type: string- description: 'Clickhouse admin user'- clickhouse_admin_password:- type: string- description: 'Clickhouse admin password'name:type: stringdescription: 'Name of the database'@@ -3810,109 +3952,111 @@ paths:limits_cpu_shares:type: integerdescription: 'CPU shares of the database'- instant_deploy:- type: boolean- description: 'Instant deploy the database'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the database.'- type: object- responses:- '200':- description: 'Database updated'- '401':- $ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- '422':- $ref: '#/components/responses/422'- security:- -- bearerAuth: []- /databases/dragonfly:- post:- tags:- - Databases- summary: 'Create (DragonFly)'- description: 'Create a new DragonFly database.'- operationId: create-database-dragonfly- requestBody:- description: 'Database data'- required: true- content:- application/json:- schema:- required:- - server_uuid- - project_uuid- - environment_name- - environment_uuid- properties:- server_uuid:+ postgres_user:type: string- description: 'UUID of the server'- project_uuid:+ description: 'PostgreSQL user'+ postgres_password:type: string- description: 'UUID of the project'- environment_name:+ description: 'PostgreSQL password'+ postgres_db:type: string- description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'- environment_uuid:+ description: 'PostgreSQL database'+ postgres_initdb_args:type: string- description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'- destination_uuid:+ description: 'PostgreSQL initdb args'+ postgres_host_auth_method:type: string- description: 'UUID of the destination if the server has multiple destinations'+ description: 'PostgreSQL host auth method'+ postgres_conf:+ type: string+ description: 'PostgreSQL conf'+ clickhouse_admin_user:+ type: string+ description: 'Clickhouse admin user'+ clickhouse_admin_password:+ type: string+ description: 'Clickhouse admin password'dragonfly_password:type: stringdescription: 'DragonFly password'- name:+ redis_password:type: string- description: 'Name of the database'- description:+ description: 'Redis password'+ redis_conf:type: string- description: 'Description of the database'- image:+ description: 'Redis conf'+ keydb_password:type: string- description: 'Docker Image of the database'- is_public:- type: boolean- description: 'Is the database public?'- public_port:- type: integer- description: 'Public port of the database'- public_port_timeout:- type: integer- description: 'Public port timeout in seconds (default: 3600)'- limits_memory:+ description: 'KeyDB password'+ keydb_conf:type: string- description: 'Memory limit of the database'- limits_memory_swap:+ description: 'KeyDB conf'+ mariadb_conf:type: string- description: 'Memory swap limit of the database'- limits_memory_swappiness:- type: integer- description: 'Memory swappiness of the database'- limits_memory_reservation:+ description: 'MariaDB conf'+ mariadb_root_password:type: string- description: 'Memory reservation of the database'- limits_cpus:+ description: 'MariaDB root password'+ mariadb_user:type: string- description: 'CPU limit of the database'- limits_cpuset:+ description: 'MariaDB user'+ mariadb_password:type: string- description: 'CPU set of the database'- limits_cpu_shares:- type: integer- description: 'CPU shares of the database'- instant_deploy:+ description: 'MariaDB password'+ mariadb_database:+ type: string+ description: 'MariaDB database'+ mongo_conf:+ type: string+ description: 'Mongo conf'+ mongo_initdb_root_username:+ type: string+ description: 'Mongo initdb root username'+ mongo_initdb_root_password:+ type: string+ description: 'Mongo initdb root password'+ mongo_initdb_database:+ type: string+ description: 'Mongo initdb init database'+ mysql_root_password:+ type: string+ description: 'MySQL root password'+ mysql_password:+ type: string+ description: 'MySQL password'+ mysql_user:+ type: string+ description: 'MySQL user'+ mysql_database:+ type: string+ description: 'MySQL database'+ mysql_conf:+ type: string+ description: 'MySQL conf'+ health_check_enabled:type: boolean- description: 'Instant deploy the database'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the database.'+ description: 'Enable the database healthcheck probe.'+ default: true+ health_check_interval:+ type: integer+ description: 'Healthcheck interval in seconds.'+ minimum: 1+ default: 15+ health_check_timeout:+ type: integer+ description: 'Healthcheck timeout in seconds.'+ minimum: 1+ default: 5+ health_check_retries:+ type: integer+ description: 'Healthcheck retries count.'+ minimum: 1+ default: 5+ health_check_start_period:+ type: integer+ description: 'Healthcheck start period in seconds.'+ minimum: 0+ default: 5type: objectresponses:'200':@@ -3921,18 +4065,156 @@ paths:$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404''422':$ref: '#/components/responses/422'security:-bearerAuth: []- /databases/redis:+ '/databases/{uuid}/backups/{scheduled_backup_uuid}':+ delete:+ tags:+ - Databases+ summary: 'Delete backup configuration'+ description: 'Deletes a backup configuration and all its executions.'+ operationId: delete-backup-configuration-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database'+ required: true+ schema:+ type: string+ -+ name: scheduled_backup_uuid+ in: path+ description: 'UUID of the backup configuration to delete'+ required: true+ schema:+ type: string+ -+ name: delete_s3+ in: query+ description: 'Whether to delete all backup files from S3'+ required: false+ schema:+ type: boolean+ default: false+ responses:+ '200':+ description: 'Backup configuration deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Backup configuration and all executions deleted.' }+ type: object+ '404':+ description: 'Backup configuration not found.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Backup configuration not found.' }+ type: object+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Databases+ summary: Update+ description: 'Update a specific backup configuration for a given database, identified by its UUID and the backup ID'+ operationId: update-database-backup+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ -+ name: scheduled_backup_uuid+ in: path+ description: 'UUID of the backup configuration.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Database backup configuration data'+ required: true+ content:+ application/json:+ schema:+ properties:+ save_s3:+ type: boolean+ description: 'Whether data is saved in s3 or not'+ s3_storage_uuid:+ type: string+ description: 'S3 storage UUID'+ backup_now:+ type: boolean+ description: 'Whether to take a backup now or not'+ enabled:+ type: boolean+ description: 'Whether the backup is enabled or not'+ databases_to_backup:+ type: string+ description: 'Comma separated list of databases to backup'+ dump_all:+ type: boolean+ description: 'Whether all databases are dumped or not'+ frequency:+ type: string+ description: 'Frequency of the backup'+ database_backup_retention_amount_locally:+ type: integer+ description: 'Retention amount of the backup locally'+ database_backup_retention_days_locally:+ type: integer+ description: 'Retention days of the backup locally'+ database_backup_retention_max_storage_locally:+ type: number+ description: 'Max storage of the backup locally'+ database_backup_retention_amount_s3:+ type: integer+ description: 'Retention amount of the backup in s3'+ database_backup_retention_days_s3:+ type: integer+ description: 'Retention days of the backup in s3'+ database_backup_retention_max_storage_s3:+ type: number+ description: 'Max storage of the backup in S3'+ timeout:+ type: integer+ description: 'Backup job timeout in seconds (min: 60, max: 36000)'+ default: 3600+ type: object+ responses:+ '200':+ description: 'Database backup configuration updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /databases/postgresql:post:tags:- Databases- summary: 'Create (Redis)'- description: 'Create a new Redis database.'- operationId: create-database-redis+ summary: 'Create (PostgreSQL)'+ description: 'Create a new PostgreSQL database.'+ operationId: create-database-postgresqlrequestBody:description: 'Database data'required: true@@ -3957,15 +4239,27 @@ paths:environment_uuid:type: stringdescription: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'- destination_uuid:+ postgres_user:type: string- description: 'UUID of the destination if the server has multiple destinations'- redis_password:+ description: 'PostgreSQL user'+ postgres_password:type: string- description: 'Redis password'- redis_conf:+ description: 'PostgreSQL password'+ postgres_db:type: string- description: 'Redis conf'+ description: 'PostgreSQL database'+ postgres_initdb_args:+ type: string+ description: 'PostgreSQL initdb args'+ postgres_host_auth_method:+ type: string+ description: 'PostgreSQL host auth method'+ postgres_conf:+ type: string+ description: 'PostgreSQL conf'+ destination_uuid:+ type: string+ description: 'UUID of the destination if the server has multiple destinations'name:type: stringdescription: 'Name of the database'@@ -4025,13 +4319,13 @@ paths:security:-bearerAuth: []- /databases/keydb:+ /databases/clickhouse:post:tags:- Databases- summary: 'Create (KeyDB)'- description: 'Create a new KeyDB database.'- operationId: create-database-keydb+ summary: 'Create (Clickhouse)'+ description: 'Create a new Clickhouse database.'+ operationId: create-database-clickhouserequestBody:description: 'Database data'required: true@@ -4059,12 +4353,12 @@ paths:destination_uuid:type: stringdescription: 'UUID of the destination if the server has multiple destinations'- keydb_password:+ clickhouse_admin_user:type: string- description: 'KeyDB password'- keydb_conf:+ description: 'Clickhouse admin user'+ clickhouse_admin_password:type: string- description: 'KeyDB conf'+ description: 'Clickhouse admin password'name:type: stringdescription: 'Name of the database'@@ -4124,13 +4418,13 @@ paths:security:-bearerAuth: []- /databases/mariadb:+ /databases/dragonfly:post:tags:- Databases- summary: 'Create (MariaDB)'- description: 'Create a new MariaDB database.'- operationId: create-database-mariadb+ summary: 'Create (DragonFly)'+ description: 'Create a new DragonFly database.'+ operationId: create-database-dragonflyrequestBody:description: 'Database data'required: true@@ -4158,21 +4452,207 @@ paths:destination_uuid:type: stringdescription: 'UUID of the destination if the server has multiple destinations'- mariadb_conf:+ dragonfly_password:type: string- description: 'MariaDB conf'- mariadb_root_password:+ description: 'DragonFly password'+ name:type: string- description: 'MariaDB root password'- mariadb_user:+ description: 'Name of the database'+ description:type: string- description: 'MariaDB user'- mariadb_password:+ description: 'Description of the database'+ image:type: string- description: 'MariaDB password'- mariadb_database:+ description: 'Docker Image of the database'+ is_public:+ type: boolean+ description: 'Is the database public?'+ public_port:+ type: integer+ description: 'Public port of the database'+ public_port_timeout:+ type: integer+ description: 'Public port timeout in seconds (default: 3600)'+ limits_memory:type: string- description: 'MariaDB database'+ description: 'Memory limit of the database'+ limits_memory_swap:+ type: string+ description: 'Memory swap limit of the database'+ limits_memory_swappiness:+ type: integer+ description: 'Memory swappiness of the database'+ limits_memory_reservation:+ type: string+ description: 'Memory reservation of the database'+ limits_cpus:+ type: string+ description: 'CPU limit of the database'+ limits_cpuset:+ type: string+ description: 'CPU set of the database'+ limits_cpu_shares:+ type: integer+ description: 'CPU shares of the database'+ instant_deploy:+ type: boolean+ description: 'Instant deploy the database'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the database.'+ type: object+ responses:+ '200':+ description: 'Database updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /databases/redis:+ post:+ tags:+ - Databases+ summary: 'Create (Redis)'+ description: 'Create a new Redis database.'+ operationId: create-database-redis+ requestBody:+ description: 'Database data'+ required: true+ content:+ application/json:+ schema:+ required:+ - server_uuid+ - project_uuid+ - environment_name+ - environment_uuid+ properties:+ server_uuid:+ type: string+ description: 'UUID of the server'+ project_uuid:+ type: string+ description: 'UUID of the project'+ environment_name:+ type: string+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'+ environment_uuid:+ type: string+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'+ destination_uuid:+ type: string+ description: 'UUID of the destination if the server has multiple destinations'+ redis_password:+ type: string+ description: 'Redis password'+ redis_conf:+ type: string+ description: 'Redis conf'+ name:+ type: string+ description: 'Name of the database'+ description:+ type: string+ description: 'Description of the database'+ image:+ type: string+ description: 'Docker Image of the database'+ is_public:+ type: boolean+ description: 'Is the database public?'+ public_port:+ type: integer+ description: 'Public port of the database'+ public_port_timeout:+ type: integer+ description: 'Public port timeout in seconds (default: 3600)'+ limits_memory:+ type: string+ description: 'Memory limit of the database'+ limits_memory_swap:+ type: string+ description: 'Memory swap limit of the database'+ limits_memory_swappiness:+ type: integer+ description: 'Memory swappiness of the database'+ limits_memory_reservation:+ type: string+ description: 'Memory reservation of the database'+ limits_cpus:+ type: string+ description: 'CPU limit of the database'+ limits_cpuset:+ type: string+ description: 'CPU set of the database'+ limits_cpu_shares:+ type: integer+ description: 'CPU shares of the database'+ instant_deploy:+ type: boolean+ description: 'Instant deploy the database'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the database.'+ type: object+ responses:+ '200':+ description: 'Database updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /databases/keydb:+ post:+ tags:+ - Databases+ summary: 'Create (KeyDB)'+ description: 'Create a new KeyDB database.'+ operationId: create-database-keydb+ requestBody:+ description: 'Database data'+ required: true+ content:+ application/json:+ schema:+ required:+ - server_uuid+ - project_uuid+ - environment_name+ - environment_uuid+ properties:+ server_uuid:+ type: string+ description: 'UUID of the server'+ project_uuid:+ type: string+ description: 'UUID of the project'+ environment_name:+ type: string+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'+ environment_uuid:+ type: string+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'+ destination_uuid:+ type: string+ description: 'UUID of the destination if the server has multiple destinations'+ keydb_password:+ type: string+ description: 'KeyDB password'+ keydb_conf:+ type: string+ description: 'KeyDB conf'name:type: stringdescription: 'Name of the database'@@ -4187,441 +4667,2701 @@ paths:description: 'Is the database public?'public_port:type: integer- description: 'Public port of the database'- public_port_timeout:+ description: 'Public port of the database'+ public_port_timeout:+ type: integer+ description: 'Public port timeout in seconds (default: 3600)'+ limits_memory:+ type: string+ description: 'Memory limit of the database'+ limits_memory_swap:+ type: string+ description: 'Memory swap limit of the database'+ limits_memory_swappiness:+ type: integer+ description: 'Memory swappiness of the database'+ limits_memory_reservation:+ type: string+ description: 'Memory reservation of the database'+ limits_cpus:+ type: string+ description: 'CPU limit of the database'+ limits_cpuset:+ type: string+ description: 'CPU set of the database'+ limits_cpu_shares:+ type: integer+ description: 'CPU shares of the database'+ instant_deploy:+ type: boolean+ description: 'Instant deploy the database'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the database.'+ type: object+ responses:+ '200':+ description: 'Database updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /databases/mariadb:+ post:+ tags:+ - Databases+ summary: 'Create (MariaDB)'+ description: 'Create a new MariaDB database.'+ operationId: create-database-mariadb+ requestBody:+ description: 'Database data'+ required: true+ content:+ application/json:+ schema:+ required:+ - server_uuid+ - project_uuid+ - environment_name+ - environment_uuid+ properties:+ server_uuid:+ type: string+ description: 'UUID of the server'+ project_uuid:+ type: string+ description: 'UUID of the project'+ environment_name:+ type: string+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'+ environment_uuid:+ type: string+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'+ destination_uuid:+ type: string+ description: 'UUID of the destination if the server has multiple destinations'+ mariadb_conf:+ type: string+ description: 'MariaDB conf'+ mariadb_root_password:+ type: string+ description: 'MariaDB root password'+ mariadb_user:+ type: string+ description: 'MariaDB user'+ mariadb_password:+ type: string+ description: 'MariaDB password'+ mariadb_database:+ type: string+ description: 'MariaDB database'+ name:+ type: string+ description: 'Name of the database'+ description:+ type: string+ description: 'Description of the database'+ image:+ type: string+ description: 'Docker Image of the database'+ is_public:+ type: boolean+ description: 'Is the database public?'+ public_port:+ type: integer+ description: 'Public port of the database'+ public_port_timeout:+ type: integer+ description: 'Public port timeout in seconds (default: 3600)'+ limits_memory:+ type: string+ description: 'Memory limit of the database'+ limits_memory_swap:+ type: string+ description: 'Memory swap limit of the database'+ limits_memory_swappiness:+ type: integer+ description: 'Memory swappiness of the database'+ limits_memory_reservation:+ type: string+ description: 'Memory reservation of the database'+ limits_cpus:+ type: string+ description: 'CPU limit of the database'+ limits_cpuset:+ type: string+ description: 'CPU set of the database'+ limits_cpu_shares:+ type: integer+ description: 'CPU shares of the database'+ instant_deploy:+ type: boolean+ description: 'Instant deploy the database'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the database.'+ type: object+ responses:+ '200':+ description: 'Database updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /databases/mysql:+ post:+ tags:+ - Databases+ summary: 'Create (MySQL)'+ description: 'Create a new MySQL database.'+ operationId: create-database-mysql+ requestBody:+ description: 'Database data'+ required: true+ content:+ application/json:+ schema:+ required:+ - server_uuid+ - project_uuid+ - environment_name+ - environment_uuid+ properties:+ server_uuid:+ type: string+ description: 'UUID of the server'+ project_uuid:+ type: string+ description: 'UUID of the project'+ environment_name:+ type: string+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'+ environment_uuid:+ type: string+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'+ destination_uuid:+ type: string+ description: 'UUID of the destination if the server has multiple destinations'+ mysql_root_password:+ type: string+ description: 'MySQL root password'+ mysql_password:+ type: string+ description: 'MySQL password'+ mysql_user:+ type: string+ description: 'MySQL user'+ mysql_database:+ type: string+ description: 'MySQL database'+ mysql_conf:+ type: string+ description: 'MySQL conf'+ name:+ type: string+ description: 'Name of the database'+ description:+ type: string+ description: 'Description of the database'+ image:+ type: string+ description: 'Docker Image of the database'+ is_public:+ type: boolean+ description: 'Is the database public?'+ public_port:+ type: integer+ description: 'Public port of the database'+ public_port_timeout:+ type: integer+ description: 'Public port timeout in seconds (default: 3600)'+ limits_memory:+ type: string+ description: 'Memory limit of the database'+ limits_memory_swap:+ type: string+ description: 'Memory swap limit of the database'+ limits_memory_swappiness:+ type: integer+ description: 'Memory swappiness of the database'+ limits_memory_reservation:+ type: string+ description: 'Memory reservation of the database'+ limits_cpus:+ type: string+ description: 'CPU limit of the database'+ limits_cpuset:+ type: string+ description: 'CPU set of the database'+ limits_cpu_shares:+ type: integer+ description: 'CPU shares of the database'+ instant_deploy:+ type: boolean+ description: 'Instant deploy the database'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the database.'+ type: object+ responses:+ '200':+ description: 'Database updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /databases/mongodb:+ post:+ tags:+ - Databases+ summary: 'Create (MongoDB)'+ description: 'Create a new MongoDB database.'+ operationId: create-database-mongodb+ requestBody:+ description: 'Database data'+ required: true+ content:+ application/json:+ schema:+ required:+ - server_uuid+ - project_uuid+ - environment_name+ - environment_uuid+ properties:+ server_uuid:+ type: string+ description: 'UUID of the server'+ project_uuid:+ type: string+ description: 'UUID of the project'+ environment_name:+ type: string+ description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'+ environment_uuid:+ type: string+ description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'+ destination_uuid:+ type: string+ description: 'UUID of the destination if the server has multiple destinations'+ mongo_conf:+ type: string+ description: 'MongoDB conf'+ mongo_initdb_root_username:+ type: string+ description: 'MongoDB initdb root username'+ name:+ type: string+ description: 'Name of the database'+ description:+ type: string+ description: 'Description of the database'+ image:+ type: string+ description: 'Docker Image of the database'+ is_public:+ type: boolean+ description: 'Is the database public?'+ public_port:+ type: integer+ description: 'Public port of the database'+ public_port_timeout:+ type: integer+ description: 'Public port timeout in seconds (default: 3600)'+ limits_memory:+ type: string+ description: 'Memory limit of the database'+ limits_memory_swap:+ type: string+ description: 'Memory swap limit of the database'+ limits_memory_swappiness:+ type: integer+ description: 'Memory swappiness of the database'+ limits_memory_reservation:+ type: string+ description: 'Memory reservation of the database'+ limits_cpus:+ type: string+ description: 'CPU limit of the database'+ limits_cpuset:+ type: string+ description: 'CPU set of the database'+ limits_cpu_shares:+ type: integer+ description: 'CPU shares of the database'+ instant_deploy:+ type: boolean+ description: 'Instant deploy the database'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the database.'+ type: object+ responses:+ '200':+ description: 'Database updated'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/logs':+ get:+ tags:+ - Databases+ summary: 'Get database logs.'+ description: 'Get database logs by UUID.'+ operationId: get-database-logs-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ format: uuid+ -+ name: lines+ in: query+ description: 'Number of lines to show from the end of the logs.'+ required: false+ schema:+ type: integer+ format: int32+ default: 100+ -+ name: show_timestamps+ in: query+ description: 'Show timestamps in the logs.'+ required: false+ schema:+ type: boolean+ default: false+ responses:+ '200':+ description: 'Get database logs by UUID.'+ content:+ application/json:+ schema:+ properties:+ logs: { type: string }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/backups/{scheduled_backup_uuid}/executions/{execution_uuid}':+ delete:+ tags:+ - Databases+ summary: 'Delete backup execution'+ description: 'Deletes a specific backup execution.'+ operationId: delete-backup-execution-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database'+ required: true+ schema:+ type: string+ -+ name: scheduled_backup_uuid+ in: path+ description: 'UUID of the backup configuration'+ required: true+ schema:+ type: string+ -+ name: execution_uuid+ in: path+ description: 'UUID of the backup execution to delete'+ required: true+ schema:+ type: string+ -+ name: delete_s3+ in: query+ description: 'Whether to delete the backup from S3'+ required: false+ schema:+ type: boolean+ default: false+ responses:+ '200':+ description: 'Backup execution deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Backup execution deleted.' }+ type: object+ '404':+ description: 'Backup execution not found.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Backup execution not found.' }+ type: object+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/backups/{scheduled_backup_uuid}/executions':+ get:+ tags:+ - Databases+ summary: 'List backup executions'+ description: 'Get all executions for a specific backup configuration.'+ operationId: list-backup-executions+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database'+ required: true+ schema:+ type: string+ -+ name: scheduled_backup_uuid+ in: path+ description: 'UUID of the backup configuration'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of backup executions'+ content:+ application/json:+ schema:+ properties:+ executions: { type: array, items: { properties: { uuid: { type: string }, filename: { type: string }, size: { type: integer }, created_at: { type: string }, message: { type: string }, status: { type: string } }, type: object } }+ type: object+ '404':+ description: 'Backup configuration not found.'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/move':+ post:+ tags:+ - Databases+ summary: Move+ description: 'Move database to another project/environment. This is a purely organizational change — running containers are not affected. Note: after moving, the database will pick up shared environment variables from the new environment on the next deployment.'+ operationId: move-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Target environment to move the database to.'+ required: true+ content:+ application/json:+ schema:+ required:+ - environment_uuid+ properties:+ environment_uuid:+ type: string+ description: 'UUID of the target environment.'+ type: object+ responses:+ '200':+ description: 'Database moved successfully.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Database moved successfully.' }+ uuid: { type: string }+ project_uuid: { type: string }+ environment_uuid: { type: string }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/start':+ post:+ tags:+ - Databases+ summary: Start+ description: 'Start database.'+ operationId: start-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Start database.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Database starting request queued.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/stop':+ post:+ tags:+ - Databases+ summary: Stop+ description: 'Stop database.'+ operationId: stop-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ -+ name: docker_cleanup+ in: query+ description: 'Perform docker cleanup (prune networks, volumes, etc.).'+ schema:+ type: boolean+ default: true+ responses:+ '200':+ description: 'Stop database.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Database stopping request queued.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/restart':+ post:+ tags:+ - Databases+ summary: Restart+ description: 'Restart database.'+ operationId: restart-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Restart database.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Database restaring request queued.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/envs':+ get:+ tags:+ - Databases+ summary: 'List Envs'+ description: 'List all envs by database UUID.'+ operationId: list-envs-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Environment variables.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/EnvironmentVariable'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - Databases+ summary: 'Create Env'+ description: 'Create env by database UUID.'+ operationId: create-env-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Env created.'+ required: true+ content:+ application/json:+ schema:+ properties:+ key:+ type: string+ description: 'The key of the environment variable.'+ value:+ type: string+ description: 'The value of the environment variable.'+ is_literal:+ type: boolean+ description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'+ is_multiline:+ type: boolean+ description: 'The flag to indicate if the environment variable is multiline.'+ is_shown_once:+ type: boolean+ description: "The flag to indicate if the environment variable's value is shown on the UI."+ type: object+ responses:+ '201':+ description: 'Environment variable created.'+ content:+ application/json:+ schema:+ properties:+ uuid: { type: string, example: nc0k04gk8g0cgsk440g0koko }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Databases+ summary: 'Update Env'+ description: 'Update env by database UUID.'+ operationId: update-env-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Env updated.'+ required: true+ content:+ application/json:+ schema:+ required:+ - key+ - value+ properties:+ key:+ type: string+ description: 'The key of the environment variable.'+ value:+ type: string+ description: 'The value of the environment variable.'+ is_literal:+ type: boolean+ description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'+ is_multiline:+ type: boolean+ description: 'The flag to indicate if the environment variable is multiline.'+ is_shown_once:+ type: boolean+ description: "The flag to indicate if the environment variable's value is shown on the UI."+ type: object+ responses:+ '201':+ description: 'Environment variable updated.'+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/EnvironmentVariable'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/envs/bulk':+ patch:+ tags:+ - Databases+ summary: 'Update Envs (Bulk)'+ description: 'Update multiple envs by database UUID.'+ operationId: update-envs-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Bulk envs updated.'+ required: true+ content:+ application/json:+ schema:+ required:+ - data+ properties:+ data:+ type: array+ items: { properties: { key: { type: string, description: 'The key of the environment variable.' }, value: { type: string, description: 'The value of the environment variable.' }, is_literal: { type: boolean, description: 'The flag to indicate if the environment variable is a literal, nothing espaced.' }, is_multiline: { type: boolean, description: 'The flag to indicate if the environment variable is multiline.' }, is_shown_once: { type: boolean, description: "The flag to indicate if the environment variable's value is shown on the UI." } }, type: object }+ type: object+ responses:+ '201':+ description: 'Environment variables updated.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/EnvironmentVariable'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/envs/{env_uuid}':+ delete:+ tags:+ - Databases+ summary: 'Delete Env'+ description: 'Delete env by UUID.'+ operationId: delete-env-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ -+ name: env_uuid+ in: path+ description: 'UUID of the environment variable.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Environment variable deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Environment variable deleted.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/storages':+ get:+ tags:+ - Databases+ summary: 'List Storages'+ description: 'List all persistent storages and file storages by database UUID.'+ operationId: list-storages-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'All storages by database UUID.'+ content:+ application/json:+ schema:+ properties:+ persistent_storages: { type: array, items: { type: object } }+ file_storages: { type: array, items: { type: object } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - Databases+ summary: 'Create Storage'+ description: 'Create a persistent storage or file storage for a database.'+ operationId: create-storage-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - type+ - mount_path+ properties:+ type:+ type: string+ enum: [persistent, file]+ description: 'The type of storage.'+ name:+ type: string+ description: 'Volume name (persistent only, required for persistent).'+ mount_path:+ type: string+ description: 'The container mount path.'+ host_path:+ type: string+ nullable: true+ description: 'The host path (persistent only, optional).'+ content:+ type: string+ nullable: true+ description: 'File content (file only, optional).'+ is_directory:+ type: boolean+ description: 'Whether this is a directory mount (file only, default false).'+ fs_path:+ type: string+ description: 'Host directory path (required when is_directory is true).'+ type: object+ additionalProperties: false+ responses:+ '201':+ description: 'Storage created.'+ content:+ application/json:+ schema:+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Databases+ summary: 'Update Storage'+ description: 'Update a persistent storage or file storage by database UUID.'+ operationId: update-storage-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.'+ required: true+ content:+ application/json:+ schema:+ required:+ - type+ properties:+ uuid:+ type: string+ description: 'The UUID of the storage (preferred).'+ id:+ type: integer+ description: 'The ID of the storage (deprecated, use uuid instead).'+ type:+ type: string+ enum: [persistent, file]+ description: 'The type of storage: persistent or file.'+ is_preview_suffix_enabled:+ type: boolean+ description: 'Whether to add -pr-N suffix for preview deployments.'+ name:+ type: string+ description: 'The volume name (persistent only, not allowed for read-only storages).'+ mount_path:+ type: string+ description: 'The container mount path (not allowed for read-only storages).'+ host_path:+ type: string+ nullable: true+ description: 'The host path (persistent only, not allowed for read-only storages).'+ content:+ type: string+ nullable: true+ description: 'The file content (file only, not allowed for read-only storages).'+ type: object+ additionalProperties: false+ responses:+ '200':+ description: 'Storage updated.'+ content:+ application/json:+ schema:+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/storages/{storage_uuid}':+ delete:+ tags:+ - Databases+ summary: 'Delete Storage'+ description: 'Delete a persistent storage or file storage by database UUID.'+ operationId: delete-storage-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ -+ name: storage_uuid+ in: path+ description: 'UUID of the storage.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Storage deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/tags':+ get:+ tags:+ - Databases+ summary: 'List Tags'+ description: 'List tags for a database by UUID.'+ operationId: list-tags-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of tags.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Tag'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - Databases+ summary: 'Create Tag'+ description: 'Add tag(s) to a database by UUID.'+ operationId: create-tag-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ tag_name:+ type: string+ description: 'The tag name (min 2 characters). Required if tag_names is not provided.'+ tag_names:+ type: array+ items: { type: string }+ description: 'Array of tag names (each min 2 characters). Required if tag_name is not provided.'+ type: object+ responses:+ '201':+ description: 'Tags added successfully.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Tag'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/tags/{tag_uuid}':+ delete:+ tags:+ - Databases+ summary: 'Delete Tag'+ description: 'Remove a tag from a database by UUID.'+ operationId: delete-tag-by-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ -+ name: tag_uuid+ in: path+ description: 'UUID of the tag.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Tag removed.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/clone':+ post:+ tags:+ - Databases+ summary: Clone+ description: 'Clone a database to a destination owned by the authenticated team.'+ operationId: clone-database-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the database.'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - destination_uuid+ properties:+ destination_uuid:+ type: string+ name:+ type: [string, 'null']+ clone_volumes:+ type: boolean+ default: false+ type: object+ responses:+ '201':+ description: 'Database cloned.'+ '400':+ $ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /deployments:+ get:+ tags:+ - Deployments+ summary: List+ description: 'List currently running deployments'+ operationId: list-deployments+ responses:+ '200':+ description: 'Get all currently running deployments.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/ApplicationDeploymentQueue'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ '/deployments/{uuid}':+ get:+ tags:+ - Deployments+ summary: Get+ description: 'Get deployment by UUID.'+ operationId: get-deployment-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Deployment UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Get deployment by UUID.'+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ApplicationDeploymentQueue'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/deployments/{uuid}/cancel':+ post:+ tags:+ - Deployments+ summary: Cancel+ description: 'Cancel a deployment by UUID.'+ operationId: cancel-deployment-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Deployment UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Deployment cancelled successfully.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Deployment cancelled successfully.' }+ deployment_uuid: { type: string, example: cm37r6cqj000008jm0veg5tkm }+ status: { type: string, example: cancelled-by-user }+ type: object+ '400':+ description: 'Deployment cannot be cancelled (already finished/failed/cancelled).'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Deployment cannot be cancelled. Current status: finished' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '403':+ description: "User doesn't have permission to cancel this deployment."+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'You do not have permission to cancel this deployment.' }+ type: object+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ /deploy:+ post:+ tags:+ - Deployments+ summary: Deploy+ description: 'Deploy by tag or UUID using query parameters or a JSON body.'+ operationId: deploy-by-tag-or-uuid+ parameters:+ -+ name: tag+ in: query+ description: 'Tag name(s). Comma separated list is also accepted.'+ schema:+ type: string+ -+ name: uuid+ in: query+ description: 'Resource UUID(s). Comma separated list is also accepted.'+ schema:+ type: string+ -+ name: force+ in: query+ description: 'Force rebuild (without cache)'+ schema:+ type: boolean+ -+ name: pr+ in: query+ description: 'Pull Request Id for deploying specific PR builds. Cannot be used with tag parameter.'+ schema:+ type: integer+ -+ name: pull_request_id+ in: query+ description: 'Preview deployment identifier. Alias of pr.'+ schema:+ type: integer+ -+ name: docker_tag+ in: query+ description: 'Docker image tag for Docker Image preview deployments. Requires pull_request_id.'+ schema:+ type: string+ responses:+ '200':+ description: "Get deployment(s) UUID's"+ content:+ application/json:+ schema:+ properties:+ deployments: { type: array, items: { properties: { message: { type: string }, resource_uuid: { type: string }, deployment_uuid: { type: string } }, type: object } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ '/deployments/applications/{uuid}':+ get:+ tags:+ - Deployments+ summary: 'List application deployments'+ description: 'List application deployments by using the app uuid'+ operationId: list-deployments-by-app-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: true+ schema:+ type: string+ -+ name: skip+ in: query+ description: 'Number of records to skip.'+ required: false+ schema:+ type: integer+ default: 0+ minimum: 0+ -+ name: take+ in: query+ description: 'Number of records to take.'+ required: false+ schema:+ type: integer+ default: 10+ minimum: 1+ responses:+ '200':+ description: 'List application deployments by using the app uuid.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Application'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ /destinations:+ get:+ tags:+ - Destinations+ summary: 'List destinations'+ description: 'List all Docker network destinations for the authenticated team.'+ operationId: list-destinations+ responses:+ '200':+ description: 'Destinations for the authenticated team.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Destination'+ '401':+ $ref: '#/components/responses/401'+ security:+ -+ bearerAuth: []+ '/servers/{server_uuid}/destinations':+ get:+ tags:+ - Destinations+ summary: 'List destinations by server'+ description: 'List Docker network destinations attached to a server owned by the authenticated team.'+ operationId: list-server-destinations+ parameters:+ -+ name: server_uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Destinations attached to the server.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Destination'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - Destinations+ summary: 'Create destination'+ description: 'Create a Docker network destination on a server owned by the authenticated team.'+ operationId: create-server-destination+ parameters:+ -+ name: server_uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - network+ properties:+ name:+ type: string+ maxLength: 255+ network:+ type: string+ maxLength: 255+ pattern: '^[a-zA-Z0-9][a-zA-Z0-9._-]*$'+ type:+ type: string+ enum: [standalone, swarm]+ type: object+ responses:+ '201':+ description: 'Destination created.'+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Destination'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '409':+ description: 'A destination with this network already exists.'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/destinations/{uuid}':+ get:+ tags:+ - Destinations+ summary: 'Get destination'+ description: 'Get a Docker network destination by UUID.'+ operationId: get-destination-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Destination UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Destination details.'+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Destination'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ delete:+ tags:+ - Destinations+ summary: 'Delete destination'+ description: 'Delete an unused Docker network destination.'+ operationId: delete-destination-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Destination UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Destination deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: Deleted. }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '409':+ description: 'Destination has attached resources.'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Destinations+ summary: 'Update destination'+ description: 'Update a Docker network destination name. Network cannot be changed via the API.'+ operationId: update-destination-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Destination UUID'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ maxLength: 255+ type: object+ responses:+ '200':+ description: 'Destination updated.'+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Destination'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /digitalocean/regions:+ get:+ tags:+ - DigitalOcean+ summary: 'Get DigitalOcean regions'+ operationId: get-digitalocean-regions+ parameters:+ -+ name: cloud_provider_token_uuid+ in: query+ required: false+ schema:+ type: string+ -+ name: cloud_provider_token_id+ in: query+ required: false+ deprecated: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of DigitalOcean regions.'+ '401':+ $ref: '#/components/responses/401'+ '422':+ description: 'Validation failed.'+ security:+ -+ bearerAuth: []+ /digitalocean/sizes:+ get:+ tags:+ - DigitalOcean+ summary: 'Get DigitalOcean sizes'+ operationId: get-digitalocean-sizes+ parameters:+ -+ name: cloud_provider_token_uuid+ in: query+ required: false+ schema:+ type: string+ -+ name: cloud_provider_token_id+ in: query+ required: false+ deprecated: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of DigitalOcean sizes.'+ '401':+ $ref: '#/components/responses/401'+ '422':+ description: 'Validation failed.'+ security:+ -+ bearerAuth: []+ /digitalocean/images:+ get:+ tags:+ - DigitalOcean+ summary: 'Get DigitalOcean images'+ operationId: get-digitalocean-images+ parameters:+ -+ name: cloud_provider_token_uuid+ in: query+ required: false+ schema:+ type: string+ -+ name: cloud_provider_token_id+ in: query+ required: false+ deprecated: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of DigitalOcean images.'+ '401':+ $ref: '#/components/responses/401'+ '422':+ description: 'Validation failed.'+ security:+ -+ bearerAuth: []+ /digitalocean/ssh-keys:+ get:+ tags:+ - DigitalOcean+ summary: 'Get DigitalOcean SSH keys'+ operationId: get-digitalocean-ssh-keys+ parameters:+ -+ name: cloud_provider_token_uuid+ in: query+ required: false+ schema:+ type: string+ -+ name: cloud_provider_token_id+ in: query+ required: false+ deprecated: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of DigitalOcean SSH keys.'+ '401':+ $ref: '#/components/responses/401'+ '422':+ description: 'Validation failed.'+ security:+ -+ bearerAuth: []+ /servers/digitalocean:+ post:+ tags:+ - DigitalOcean+ summary: 'Create a server on DigitalOcean'+ operationId: create-digitalocean-server+ responses:+ '201':+ description: 'DigitalOcean droplet created and linked to a Coolify server.'+ '401':+ $ref: '#/components/responses/401'+ '422':+ description: 'Validation failed.'+ '429':+ description: 'DigitalOcean rate limit exceeded.'+ security:+ -+ bearerAuth: []+ /github-apps:+ get:+ tags:+ - 'GitHub Apps'+ summary: List+ description: 'List all GitHub apps.'+ operationId: list-github-apps+ responses:+ '200':+ description: 'List of GitHub apps.'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { id: { type: integer }, uuid: { type: string }, name: { type: string }, organization: { type: string, nullable: true }, api_url: { type: string }, html_url: { type: string }, custom_user: { type: string }, custom_port: { type: integer }, app_id: { type: integer }, installation_id: { type: integer }, client_id: { type: string }, private_key_id: { type: integer }, is_system_wide: { type: boolean }, is_public: { type: boolean }, team_id: { type: integer }, type: { type: string } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - 'GitHub Apps'+ summary: 'Create GitHub App'+ description: 'Create a new GitHub app.'+ operationId: create-github-app+ requestBody:+ description: 'GitHub app creation payload.'+ required: true+ content:+ application/json:+ schema:+ required:+ - name+ - html_url+ - app_id+ - installation_id+ - client_id+ - client_secret+ - private_key_uuid+ properties:+ name:+ type: string+ description: 'Name of the GitHub app.'+ organization:+ type: string+ nullable: true+ description: 'Organization to associate the app with.'+ api_url:+ type: string+ description: 'API URL for the GitHub app (e.g., https://api.github.com).'+ html_url:+ type: string+ description: 'HTML URL for the GitHub app (e.g., https://github.com).'+ custom_user:+ type: string+ description: 'Custom user for SSH access (default: git).'+ custom_port:+ type: integer+ description: 'Custom port for SSH access (default: 22).'+ app_id:+ type: integer+ description: 'GitHub App ID from GitHub.'+ installation_id:+ type: integer+ description: 'GitHub Installation ID.'+ client_id:+ type: string+ description: 'GitHub OAuth App Client ID.'+ client_secret:+ type: string+ description: 'GitHub OAuth App Client Secret.'+ webhook_secret:+ type: string+ description: 'Webhook secret for GitHub webhooks.'+ private_key_uuid:+ type: string+ description: 'UUID of an existing private key for GitHub App authentication.'+ is_system_wide:+ type: boolean+ description: 'Is this app system-wide (cloud only).'+ type: object+ responses:+ '201':+ description: 'GitHub app created successfully.'+ content:+ application/json:+ schema:+ properties:+ id: { type: integer }+ uuid: { type: string }+ name: { type: string }+ organization: { type: string, nullable: true }+ api_url: { type: string }+ html_url: { type: string }+ custom_user: { type: string }+ custom_port: { type: integer }+ app_id: { type: integer }+ installation_id: { type: integer }+ client_id: { type: string }+ private_key_id: { type: integer }+ is_system_wide: { type: boolean }+ team_id: { type: integer }+ type: object+ '400':+ $ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/github-apps/{github_app_id}/repositories':+ get:+ tags:+ - 'GitHub Apps'+ summary: 'Load Repositories for a GitHub App'+ description: 'Fetch repositories from GitHub for a given GitHub app.'+ operationId: load-repositories+ parameters:+ -+ name: github_app_id+ in: path+ description: 'GitHub App ID'+ required: true+ schema:+ type: integer+ responses:+ '200':+ description: 'Repositories loaded successfully.'+ content:+ application/json:+ schema:+ properties:+ repositories: { type: array, items: { type: object } }+ type: object+ '400':+ $ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/github-apps/{github_app_id}/repositories/{owner}/{repo}/branches':+ get:+ tags:+ - 'GitHub Apps'+ summary: 'Load Branches for a GitHub Repository'+ description: 'Fetch branches from GitHub for a given repository.'+ operationId: load-branches+ parameters:+ -+ name: github_app_id+ in: path+ description: 'GitHub App ID'+ required: true+ schema:+ type: integer+ -+ name: owner+ in: path+ description: 'Repository owner'+ required: true+ schema:+ type: string+ -+ name: repo+ in: path+ description: 'Repository name'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Branches loaded successfully.'+ content:+ application/json:+ schema:+ properties:+ branches: { type: array, items: { type: object } }+ type: object+ '400':+ $ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/github-apps/{github_app_id}':+ delete:+ tags:+ - 'GitHub Apps'+ summary: 'Delete GitHub App'+ description: "Delete a GitHub app if it's not being used by any applications."+ operationId: deleteGithubApp+ parameters:+ -+ name: github_app_id+ in: path+ description: 'GitHub App ID'+ required: true+ schema:+ type: integer+ responses:+ '200':+ description: 'GitHub app deleted successfully'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'GitHub app deleted successfully' }+ type: object+ '401':+ description: Unauthorized+ '404':+ description: 'GitHub app not found'+ '409':+ description: 'Conflict - GitHub app is in use'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'This GitHub app is being used by 5 application(s). Please delete all applications first.' }+ type: object+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - 'GitHub Apps'+ summary: 'Update GitHub App'+ description: 'Update an existing GitHub app.'+ operationId: updateGithubApp+ parameters:+ -+ name: github_app_id+ in: path+ description: 'GitHub App ID'+ required: true+ schema:+ type: integer+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'GitHub App name'+ organization:+ type: string+ nullable: true+ description: 'GitHub organization'+ api_url:+ type: string+ description: 'GitHub API URL'+ html_url:+ type: string+ description: 'GitHub HTML URL'+ custom_user:+ type: string+ description: 'Custom user for SSH'+ custom_port:+ type: integer+ description: 'Custom port for SSH'+ app_id:+ type: integer+ description: 'GitHub App ID'+ installation_id:type: integer- description: 'Public port timeout in seconds (default: 3600)'- limits_memory:- type: string- description: 'Memory limit of the database'- limits_memory_swap:+ description: 'GitHub Installation ID'+ client_id:type: string- description: 'Memory swap limit of the database'- limits_memory_swappiness:- type: integer- description: 'Memory swappiness of the database'- limits_memory_reservation:+ description: 'GitHub Client ID'+ client_secret:type: string- description: 'Memory reservation of the database'- limits_cpus:+ description: 'GitHub Client Secret'+ webhook_secret:type: string- description: 'CPU limit of the database'- limits_cpuset:+ description: 'GitHub Webhook Secret'+ private_key_uuid:type: string- description: 'CPU set of the database'- limits_cpu_shares:- type: integer- description: 'CPU shares of the database'- instant_deploy:+ description: 'Private key UUID'+ is_system_wide:type: boolean- description: 'Instant deploy the database'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the database.'+ description: 'Is system wide (non-cloud instances only)'type: objectresponses:'200':- description: 'Database updated'+ description: 'GitHub app updated successfully'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'GitHub app updated successfully' }+ data: { type: object, description: 'Updated GitHub app data' }+ type: object+ '401':+ description: Unauthorized+ '404':+ description: 'GitHub app not found'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /gitlab-apps:+ get:+ tags:+ - 'GitLab Apps'+ summary: List+ description: 'List all GitLab apps for the current team (and system-wide sources).'+ operationId: list-gitlab-apps+ responses:+ '200':+ description: 'List of GitLab apps.'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { id: { type: integer }, uuid: { type: string }, name: { type: string }, api_url: { type: string }, html_url: { type: string }, custom_user: { type: string }, custom_port: { type: integer }, client_id: { type: string, nullable: true }, group_name: { type: string, nullable: true }, redirect_uri: { type: string, nullable: true }, is_system_wide: { type: boolean }, is_public: { type: boolean }, team_id: { type: integer } }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- /databases/mysql:post:tags:- - Databases- summary: 'Create (MySQL)'- description: 'Create a new MySQL database.'- operationId: create-database-mysql+ - 'GitLab Apps'+ summary: 'Create GitLab App'+ description: 'Create a new GitLab app (OAuth source). Credentials may be supplied later via the UI or update endpoint.'+ operationId: create-gitlab-apprequestBody:- description: 'Database data'+ description: 'GitLab app creation payload.'required: truecontent:application/json:schema:required:- - server_uuid- - project_uuid- - environment_name- - environment_uuid+ - name+ - html_urlproperties:- server_uuid:- type: string- description: 'UUID of the server'- project_uuid:- type: string- description: 'UUID of the project'- environment_name:- type: string- description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'- environment_uuid:- type: string- description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'- destination_uuid:- type: string- description: 'UUID of the destination if the server has multiple destinations'- mysql_root_password:- type: string- description: 'MySQL root password'- mysql_password:- type: string- description: 'MySQL password'- mysql_user:- type: string- description: 'MySQL user'- mysql_database:- type: string- description: 'MySQL database'- mysql_conf:- type: string- description: 'MySQL conf'name:type: string- description: 'Name of the database'- description:+ description: 'Name of the GitLab app.'+ html_url:type: string- description: 'Description of the database'- image:+ description: 'GitLab instance URL (e.g., https://gitlab.com).'+ api_url:type: string- description: 'Docker Image of the database'- is_public:- type: boolean- description: 'Is the database public?'- public_port:- type: integer- description: 'Public port of the database'- public_port_timeout:+ description: 'GitLab API URL (defaults to {html_url}/api/v4).'+ custom_user:+ type: string+ description: 'Custom user for SSH access (default: git).'+ custom_port:type: integer- description: 'Public port timeout in seconds (default: 3600)'- limits_memory:+ description: 'Custom port for SSH access (default: 22).'+ group_name:type: string- description: 'Memory limit of the database'- limits_memory_swap:+ nullable: true+ description: 'Optional comma-separated group names to filter repositories.'+ client_id:type: string- description: 'Memory swap limit of the database'- limits_memory_swappiness:- type: integer- description: 'Memory swappiness of the database'- limits_memory_reservation:+ nullable: true+ description: 'GitLab OAuth Application ID.'+ client_secret:type: string- description: 'Memory reservation of the database'- limits_cpus:+ nullable: true+ description: 'GitLab OAuth Application Secret.'+ webhook_token:type: string- description: 'CPU limit of the database'- limits_cpuset:+ nullable: true+ description: 'Webhook secret token (auto-generated when omitted).'+ redirect_uri:type: string- description: 'CPU set of the database'- limits_cpu_shares:- type: integer- description: 'CPU shares of the database'- instant_deploy:+ nullable: true+ description: 'OAuth redirect URI registered in GitLab.'+ is_system_wide:type: boolean- description: 'Instant deploy the database'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the database.'+ description: 'Is this app system-wide (non-cloud instances only).'type: objectresponses:- '200':- description: 'Database updated'- '401':- $ref: '#/components/responses/401'+ '201':+ description: 'GitLab app created successfully.'+ content:+ application/json:+ schema:+ properties:+ id: { type: integer }+ uuid: { type: string }+ name: { type: string }+ api_url: { type: string }+ html_url: { type: string }+ custom_user: { type: string }+ custom_port: { type: integer }+ client_id: { type: string, nullable: true }+ group_name: { type: string, nullable: true }+ redirect_uri: { type: string, nullable: true }+ is_system_wide: { type: boolean }+ team_id: { type: integer }+ type: object'400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''422':$ref: '#/components/responses/422'security:-bearerAuth: []- /databases/mongodb:- post:+ '/gitlab-apps/{gitlab_app_id}':+ delete:tags:- - Databases- summary: 'Create (MongoDB)'- description: 'Create a new MongoDB database.'- operationId: create-database-mongodb+ - 'GitLab Apps'+ summary: 'Delete GitLab App'+ description: 'Delete a GitLab app if it is not being used by any applications.'+ operationId: deleteGitlabApp+ parameters:+ -+ name: gitlab_app_id+ in: path+ description: 'GitLab App ID'+ required: true+ schema:+ type: integer+ responses:+ '200':+ description: 'GitLab app deleted successfully'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'GitLab app deleted successfully' }+ type: object+ '401':+ description: Unauthorized+ '404':+ description: 'GitLab app not found'+ '409':+ description: 'Conflict - GitLab app is in use'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'This GitLab app is being used by 5 application(s). Please delete all applications first.' }+ type: object+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - 'GitLab Apps'+ summary: 'Update GitLab App'+ description: 'Update an existing GitLab app.'+ operationId: updateGitlabApp+ parameters:+ -+ name: gitlab_app_id+ in: path+ description: 'GitLab App ID'+ required: true+ schema:+ type: integerrequestBody:- description: 'Database data'required: true- content:- application/json:- schema:- required:- - server_uuid- - project_uuid- - environment_name- - environment_uuid- properties:- server_uuid:- type: string- description: 'UUID of the server'- project_uuid:- type: string- description: 'UUID of the project'- environment_name:- type: string- description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'- environment_uuid:- type: string- description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'- destination_uuid:- type: string- description: 'UUID of the destination if the server has multiple destinations'- mongo_conf:- type: string- description: 'MongoDB conf'- mongo_initdb_root_username:- type: string- description: 'MongoDB initdb root username'+ content:+ application/json:+ schema:+ properties:name:type: string- description: 'Name of the database'- description:+ description: 'GitLab App name'+ html_url:type: string- description: 'Description of the database'- image:+ description: 'GitLab HTML URL'+ api_url:type: string- description: 'Docker Image of the database'- is_public:- type: boolean- description: 'Is the database public?'- public_port:- type: integer- description: 'Public port of the database'- public_port_timeout:+ description: 'GitLab API URL'+ custom_user:+ type: string+ description: 'Custom user for SSH'+ custom_port:type: integer- description: 'Public port timeout in seconds (default: 3600)'- limits_memory:+ description: 'Custom port for SSH'+ group_name:type: string- description: 'Memory limit of the database'- limits_memory_swap:+ nullable: true+ description: 'Optional group filter'+ client_id:type: string- description: 'Memory swap limit of the database'- limits_memory_swappiness:- type: integer- description: 'Memory swappiness of the database'- limits_memory_reservation:+ nullable: true+ description: 'OAuth Application ID'+ client_secret:type: string- description: 'Memory reservation of the database'- limits_cpus:+ nullable: true+ description: 'OAuth Application Secret'+ webhook_token:type: string- description: 'CPU limit of the database'- limits_cpuset:+ nullable: true+ description: 'Webhook secret token'+ redirect_uri:type: string- description: 'CPU set of the database'- limits_cpu_shares:- type: integer- description: 'CPU shares of the database'- instant_deploy:+ nullable: true+ description: 'OAuth redirect URI'+ is_system_wide:type: boolean- description: 'Instant deploy the database'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the database.'+ description: 'Is system wide (non-cloud instances only)'type: objectresponses:'200':- description: 'Database updated'+ description: 'GitLab app updated successfully'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'GitLab app updated successfully' }+ data: { type: object, description: 'Updated GitLab app data' }+ type: object'401':- $ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'+ description: Unauthorized+ '404':+ description: 'GitLab app not found''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/logs':+ /hetzner/locations:get:tags:- - Databases- summary: 'Get database logs.'- description: 'Get database logs by UUID.'- operationId: get-database-logs-by-uuid+ - Hetzner+ summary: 'Get Hetzner Locations'+ description: 'Get all available Hetzner datacenter locations.'+ operationId: get-hetzner-locationsparameters:-- name: uuid- in: path- description: 'UUID of the database.'- required: true+ name: cloud_provider_token_uuid+ in: query+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'+ required: falseschema:type: string- format: uuid-- name: lines+ name: cloud_provider_token_idin: query- description: 'Number of lines to show from the end of the logs.'+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'required: false+ deprecated: trueschema:- type: integer- format: int32- default: 100+ type: string+ responses:+ '200':+ description: 'List of Hetzner locations.'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { id: { type: integer }, name: { type: string }, description: { type: string }, country: { type: string }, city: { type: string }, latitude: { type: number }, longitude: { type: number } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:-- name: show_timestamps+ bearerAuth: []+ /hetzner/server-types:+ get:+ tags:+ - Hetzner+ summary: 'Get Hetzner Server Types'+ description: 'Get all available Hetzner server types (instance sizes).'+ operationId: get-hetzner-server-types+ parameters:+ -+ name: cloud_provider_token_uuidin: query- description: 'Show timestamps in the logs.'+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'required: falseschema:- type: boolean- default: false+ type: string+ -+ name: cloud_provider_token_id+ in: query+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'+ required: false+ deprecated: true+ schema:+ type: stringresponses:'200':- description: 'Get database logs by UUID.'+ description: 'List of Hetzner server types.'content:application/json:schema:- properties:- logs: { type: string }- type: object+ type: array+ items:+ properties: { id: { type: integer }, name: { type: string }, description: { type: string }, cores: { type: integer }, memory: { type: number }, disk: { type: integer }, prices: { type: array, items: { type: object, properties: { location: { type: string, description: 'Datacenter location name' }, price_hourly: { type: object, properties: { net: { type: string }, gross: { type: string } } }, price_monthly: { type: object, properties: { net: { type: string }, gross: { type: string } } } } } } }+ type: object'401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- '/databases/{uuid}/backups/{scheduled_backup_uuid}/executions/{execution_uuid}':- delete:+ /hetzner/images:+ get:tags:- - Databases- summary: 'Delete backup execution'- description: 'Deletes a specific backup execution.'- operationId: delete-backup-execution-by-uuid+ - Hetzner+ summary: 'Get Hetzner Images'+ description: 'Get all available Hetzner system images (operating systems).'+ operationId: get-hetzner-imagesparameters:-- name: uuid- in: path- description: 'UUID of the database'- required: true+ name: cloud_provider_token_uuid+ in: query+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'+ required: falseschema:type: string-- name: scheduled_backup_uuid- in: path- description: 'UUID of the backup configuration'- required: true+ name: cloud_provider_token_id+ in: query+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'+ required: false+ deprecated: trueschema:type: string+ responses:+ '200':+ description: 'List of Hetzner images.'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { id: { type: integer }, name: { type: string }, description: { type: string }, type: { type: string }, os_flavor: { type: string }, os_version: { type: string }, architecture: { type: string } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:-- name: execution_uuid- in: path- description: 'UUID of the backup execution to delete'- required: true+ bearerAuth: []+ /hetzner/ssh-keys:+ get:+ tags:+ - Hetzner+ summary: 'Get Hetzner SSH Keys'+ description: 'Get all SSH keys stored in the Hetzner account.'+ operationId: get-hetzner-ssh-keys+ parameters:+ -+ name: cloud_provider_token_uuid+ in: query+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'+ required: falseschema:type: string-- name: delete_s3+ name: cloud_provider_token_idin: query- description: 'Whether to delete the backup from S3'+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'required: false+ deprecated: trueschema:- type: boolean- default: false+ type: stringresponses:'200':- description: 'Backup execution deleted.'+ description: 'List of Hetzner SSH keys.'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { id: { type: integer }, name: { type: string }, fingerprint: { type: string }, public_key: { type: string } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ /hetzner/firewalls:+ get:+ tags:+ - Hetzner+ summary: 'Get Hetzner Firewalls'+ description: 'Get all existing Hetzner firewalls for the current project.'+ operationId: get-hetzner-firewalls+ parameters:+ -+ name: cloud_provider_token_uuid+ in: query+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'+ required: false+ schema:+ type: string+ -+ name: cloud_provider_token_id+ in: query+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'+ required: false+ deprecated: true+ schema:+ type: string+ responses:+ '200':+ description: 'List of Hetzner firewalls.'content:application/json:schema:- properties:- message: { type: string, example: 'Backup execution deleted.' }- type: object+ type: array+ items:+ properties: { id: { type: integer }, name: { type: string } }+ type: object+ '401':+ $ref: '#/components/responses/401''404':- description: 'Backup execution not found.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Backup execution not found.' }- type: object+ $ref: '#/components/responses/404'security:-bearerAuth: []- '/databases/{uuid}/backups/{scheduled_backup_uuid}/executions':+ /hetzner/networks:get:tags:- - Databases- summary: 'List backup executions'- description: 'Get all executions for a specific backup configuration.'- operationId: list-backup-executions+ - Hetzner+ summary: 'Get Hetzner Networks'+ description: 'Get all existing Hetzner private networks for the current project.'+ operationId: get-hetzner-networksparameters:-- name: uuid- in: path- description: 'UUID of the database'- required: true+ name: cloud_provider_token_uuid+ in: query+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'+ required: falseschema:type: string-- name: scheduled_backup_uuid- in: path- description: 'UUID of the backup configuration'- required: true+ name: cloud_provider_token_id+ in: query+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'+ required: false+ deprecated: trueschema:type: stringresponses:'200':- description: 'List of backup executions'+ description: 'List of Hetzner networks.'content:application/json:schema:- properties:- executions: { type: array, items: { properties: { uuid: { type: string }, filename: { type: string }, size: { type: integer }, created_at: { type: string }, message: { type: string }, status: { type: string } }, type: object } }- type: object+ type: array+ items:+ properties: { id: { type: integer }, name: { type: string }, ip_range: { type: string } }+ type: object+ '401':+ $ref: '#/components/responses/401''404':- description: 'Backup configuration not found.'+ $ref: '#/components/responses/404'security:-bearerAuth: []- '/databases/{uuid}/move':+ /servers/hetzner:post:tags:- - Databases- summary: Move- description: 'Move database to another project/environment. This is a purely organizational change — running containers are not affected. Note: after moving, the database will pick up shared environment variables from the new environment on the next deployment.'- operationId: move-database-by-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ - Hetzner+ summary: 'Create Hetzner Server'+ description: 'Create a new server on Hetzner and register it in Coolify.'+ operationId: create-hetzner-serverrequestBody:- description: 'Target environment to move the database to.'+ description: 'Hetzner server creation parameters'required: truecontent:application/json:schema:required:- - environment_uuid+ - location+ - server_type+ - image+ - private_key_uuidproperties:- environment_uuid:+ cloud_provider_token_uuid:type: string- description: 'UUID of the target environment.'+ example: abc123+ description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'+ cloud_provider_token_id:+ type: string+ example: abc123+ description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'+ deprecated: true+ location:+ type: string+ example: nbg1+ description: 'Hetzner location name'+ server_type:+ type: string+ example: cx11+ description: 'Hetzner server type name'+ image:+ type: integer+ example: 15512617+ description: 'Hetzner image ID'+ name:+ type: string+ example: my-server+ description: 'Server name (auto-generated if not provided)'+ private_key_uuid:+ type: string+ example: xyz789+ description: 'Private key UUID'+ enable_ipv4:+ type: boolean+ example: true+ description: 'Enable IPv4 (default: true)'+ enable_ipv6:+ type: boolean+ example: true+ description: 'Enable IPv6 (default: true)'+ enable_backups:+ type: boolean+ example: false+ description: 'Enable Hetzner server backups after creation (adds 20% to the monthly server fee)'+ hetzner_ssh_key_ids:+ type: array+ items: { type: integer }+ description: 'Additional Hetzner SSH key IDs'+ hetzner_firewall_ids:+ type: array+ items: { type: integer }+ description: 'Existing Hetzner firewall IDs to apply during server creation'+ hetzner_network_ids:+ type: array+ items: { type: integer }+ description: 'Existing Hetzner network IDs to attach during server creation'+ cloud_init_script:+ type: string+ description: 'Cloud-init YAML script (optional)'+ instant_validate:+ type: boolean+ example: false+ description: 'Validate server immediately after creation'type: objectresponses:- '200':- description: 'Database moved successfully.'+ '201':+ description: 'Hetzner server created.'content:application/json:schema:properties:- message: { type: string, example: 'Database moved successfully.' }- uuid: { type: string }- project_uuid: { type: string }- environment_uuid: { type: string }+ uuid: { type: string, example: og888os, description: 'The UUID of the server.' }+ hetzner_server_id: { type: integer, description: 'The Hetzner server ID.' }+ ip: { type: string, description: 'The server IP address.' }type: object'401':$ref: '#/components/responses/401'@@ -4631,510 +7371,437 @@ paths:$ref: '#/components/responses/404''422':$ref: '#/components/responses/422'+ '429':+ $ref: '#/components/responses/429'security:-bearerAuth: []- '/databases/{uuid}/start':- post:+ /notifications/email:+ get:tags:- - Databases- summary: Start- description: 'Start database.'- operationId: start-database-by-uuid- parameters:+ - Notifications+ summary: 'Get email notification settings'+ description: 'Get the current team email notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.'+ operationId: get-current-team-email-notifications+ responses:+ '200':+ description: 'Email notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:-- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ bearerAuth: []+ patch:+ tags:+ - Notifications+ summary: 'Update email notification settings'+ description: 'Update the current team email notification settings.'+ operationId: update-current-team-email-notifications+ responses:+ '200':+ description: 'Updated email notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '403':+ description: Forbidden.+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /notifications/discord:+ get:+ tags:+ - Notifications+ summary: 'Get Discord notification settings'+ description: 'Get the current team Discord notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.'+ operationId: get-current-team-discord-notifications+ responses:+ '200':+ description: 'Discord notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Notifications+ summary: 'Update Discord notification settings'+ description: 'Update the current team Discord notification settings.'+ operationId: update-current-team-discord-notifications+ responses:+ '200':+ description: 'Updated Discord notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '403':+ description: Forbidden.+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /notifications/slack:+ get:+ tags:+ - Notifications+ summary: 'Get Slack notification settings'+ description: 'Get the current team Slack notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.'+ operationId: get-current-team-slack-notifications+ responses:+ '200':+ description: 'Slack notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Notifications+ summary: 'Update Slack notification settings'+ description: 'Update the current team Slack notification settings.'+ operationId: update-current-team-slack-notifications+ responses:+ '200':+ description: 'Updated Slack notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '403':+ description: Forbidden.+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /notifications/telegram:+ get:+ tags:+ - Notifications+ summary: 'Get Telegram notification settings'+ description: 'Get the current team Telegram notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.'+ operationId: get-current-team-telegram-notifications+ responses:+ '200':+ description: 'Telegram notification settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - Notifications+ summary: 'Update Telegram notification settings'+ description: 'Update the current team Telegram notification settings.'+ operationId: update-current-team-telegram-notificationsresponses:'200':- description: 'Start database.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Database starting request queued.' }- type: object+ description: 'Updated Telegram notification settings.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'+ '403':+ description: Forbidden.+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/stop':- post:+ /notifications/pushover:+ get:tags:- - Databases- summary: Stop- description: 'Stop database.'- operationId: stop-database-by-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string- -- name: docker_cleanup- in: query- description: 'Perform docker cleanup (prune networks, volumes, etc.).'- schema:- type: boolean- default: true+ - Notifications+ summary: 'Get Pushover notification settings'+ description: 'Get the current team Pushover notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.'+ operationId: get-current-team-pushover-notificationsresponses:'200':- description: 'Stop database.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Database stopping request queued.' }- type: object+ description: 'Pushover notification settings.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'security:-bearerAuth: []- '/databases/{uuid}/restart':- post:+ patch:tags:- - Databases- summary: Restart- description: 'Restart database.'- operationId: restart-database-by-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ - Notifications+ summary: 'Update Pushover notification settings'+ description: 'Update the current team Pushover notification settings.'+ operationId: update-current-team-pushover-notificationsresponses:'200':- description: 'Restart database.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Database restaring request queued.' }- type: object+ description: 'Updated Pushover notification settings.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'+ '403':+ description: Forbidden.+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/envs':+ /notifications/webhook:get:tags:- - Databases- summary: 'List Envs'- description: 'List all envs by database UUID.'- operationId: list-envs-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ - Notifications+ summary: 'Get webhook notification settings'+ description: 'Get the current team webhook notification settings. Encrypted secrets are only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner.'+ operationId: get-current-team-webhook-notificationsresponses:'200':- description: 'Environment variables.'- content:- application/json:- schema:- type: array- items:- $ref: '#/components/schemas/EnvironmentVariable'+ description: 'Webhook notification settings.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'security:-bearerAuth: []- post:+ patch:tags:- - Databases- summary: 'Create Env'- description: 'Create env by database UUID.'- operationId: create-env-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string- requestBody:- description: 'Env created.'- required: true- content:- application/json:- schema:- properties:- key:- type: string- description: 'The key of the environment variable.'- value:- type: string- description: 'The value of the environment variable.'- is_literal:- type: boolean- description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'- is_multiline:- type: boolean- description: 'The flag to indicate if the environment variable is multiline.'- is_shown_once:- type: boolean- description: "The flag to indicate if the environment variable's value is shown on the UI."- type: object+ - Notifications+ summary: 'Update webhook notification settings'+ description: 'Update the current team webhook notification settings.'+ operationId: update-current-team-webhook-notificationsresponses:- '201':- description: 'Environment variable created.'- content:- application/json:- schema:- properties:- uuid: { type: string, example: nc0k04gk8g0cgsk440g0koko }- type: object+ '200':+ description: 'Updated webhook notification settings.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'+ '403':+ description: Forbidden.'422':$ref: '#/components/responses/422'security:-bearerAuth: []- patch:- tags:- - Databases- summary: 'Update Env'- description: 'Update env by database UUID.'- operationId: update-env-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string- requestBody:- description: 'Env updated.'- required: true- content:- application/json:- schema:- required:- - key- - value- properties:- key:- type: string- description: 'The key of the environment variable.'- value:- type: string- description: 'The value of the environment variable.'- is_literal:- type: boolean- description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'- is_multiline:- type: boolean- description: 'The flag to indicate if the environment variable is multiline.'- is_shown_once:- type: boolean- description: "The flag to indicate if the environment variable's value is shown on the UI."- type: object+ /version:+ get:+ summary: Version+ description: 'Get Coolify version.'+ operationId: versionresponses:- '201':- description: 'Environment variable updated.'+ '200':+ description: 'Returns the version of the application'content:- application/json:+ text/html:schema:- $ref: '#/components/schemas/EnvironmentVariable'+ type: string+ example: v4.0.0'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/envs/bulk':- patch:- tags:- - Databases- summary: 'Update Envs (Bulk)'- description: 'Update multiple envs by database UUID.'- operationId: update-envs-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string- requestBody:- description: 'Bulk envs updated.'- required: true- content:- application/json:- schema:- required:- - data- properties:- data:- type: array- items: { properties: { key: { type: string, description: 'The key of the environment variable.' }, value: { type: string, description: 'The value of the environment variable.' }, is_literal: { type: boolean, description: 'The flag to indicate if the environment variable is a literal, nothing espaced.' }, is_multiline: { type: boolean, description: 'The flag to indicate if the environment variable is multiline.' }, is_shown_once: { type: boolean, description: "The flag to indicate if the environment variable's value is shown on the UI." } }, type: object }- type: object+ /enable:+ post:+ summary: 'Enable API'+ description: 'Enable API (only with root permissions).'+ operationId: enable-api+ responses:+ '200':+ description: 'Enable API.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'API enabled.' }+ type: object+ '403':+ description: 'You are not allowed to enable the API.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'You are not allowed to enable the API.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:+ -+ bearerAuth: []+ /disable:+ post:+ summary: 'Disable API'+ description: 'Disable API (only with root permissions).'+ operationId: disable-apiresponses:- '201':- description: 'Environment variables updated.'+ '200':+ description: 'Disable API.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/EnvironmentVariable'+ properties:+ message: { type: string, example: 'API disabled.' }+ type: object+ '403':+ description: 'You are not allowed to disable the API.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'You are not allowed to disable the API.' }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- '/databases/{uuid}/envs/{env_uuid}':- delete:- tags:- - Databases- summary: 'Delete Env'- description: 'Delete env by UUID.'- operationId: delete-env-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string- -- name: env_uuid- in: path- description: 'UUID of the environment variable.'- required: true- schema:- type: string+ /mcp/enable:+ post:+ summary: 'Enable MCP Server'+ description: 'Enable the MCP server endpoint at /mcp (only with root permissions).'+ operationId: enable-mcpresponses:'200':- description: 'Environment variable deleted.'+ description: 'MCP server enabled.'content:application/json:schema:properties:- message: { type: string, example: 'Environment variable deleted.' }+ message: { type: string, example: 'MCP server enabled.' }+ type: object+ '403':+ description: 'You are not allowed to enable the MCP server.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'You are not allowed to enable the MCP server.' }type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'security:-bearerAuth: []- '/databases/{uuid}/storages':- get:- tags:- - Databases- summary: 'List Storages'- description: 'List all persistent storages and file storages by database UUID.'- operationId: list-storages-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ /mcp/disable:+ post:+ summary: 'Disable MCP Server'+ description: 'Disable the MCP server endpoint at /mcp (only with root permissions).'+ operationId: disable-mcpresponses:'200':- description: 'All storages by database UUID.'+ description: 'MCP server disabled.'content:application/json:schema:properties:- persistent_storages: { type: array, items: { type: object } }- file_storages: { type: array, items: { type: object } }+ message: { type: string, example: 'MCP server disabled.' }+ type: object+ '403':+ description: 'You are not allowed to disable the MCP server.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'You are not allowed to disable the MCP server.' }type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'security:-bearerAuth: []- post:+ /health:+ get:+ summary: Healthcheck+ description: 'Healthcheck endpoint.'+ operationId: healthcheck+ responses:+ '200':+ description: 'Healthcheck endpoint.'+ content:+ text/html:+ schema:+ type: string+ example: OK+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ /projects:+ get:tags:- - Databases- summary: 'Create Storage'- description: 'Create a persistent storage or file storage for a database.'- operationId: create-storage-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string- requestBody:- required: true- content:- application/json:- schema:- required:- - type- - mount_path- properties:- type:- type: string- enum: [persistent, file]- description: 'The type of storage.'- name:- type: string- description: 'Volume name (persistent only, required for persistent).'- mount_path:- type: string- description: 'The container mount path.'- host_path:- type: string- nullable: true- description: 'The host path (persistent only, optional).'- content:- type: string- nullable: true- description: 'File content (file only, optional).'- is_directory:- type: boolean- description: 'Whether this is a directory mount (file only, default false).'- fs_path:- type: string- description: 'Host directory path (required when is_directory is true).'- type: object- additionalProperties: false+ - Projects+ summary: List+ description: 'List projects.'+ operationId: list-projectsresponses:- '201':- description: 'Storage created.'+ '200':+ description: 'Get all projects.'content:application/json:schema:- type: object+ type: array+ items:+ $ref: '#/components/schemas/Project''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- patch:+ post:tags:- - Databases- summary: 'Update Storage'- description: 'Update a persistent storage or file storage by database UUID.'- operationId: update-storage-by-database-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the database.'- required: true- schema:- type: string+ - Projects+ summary: Create+ description: 'Create Project.'+ operationId: create-projectrequestBody:- description: 'Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.'+ description: 'Project created.'required: truecontent:application/json:schema:- required:- - typeproperties:- uuid:- type: string- description: 'The UUID of the storage (preferred).'- id:- type: integer- description: 'The ID of the storage (deprecated, use uuid instead).'- type:- type: string- enum: [persistent, file]- description: 'The type of storage: persistent or file.'- is_preview_suffix_enabled:- type: boolean- description: 'Whether to add -pr-N suffix for preview deployments.'name:type: string- description: 'The volume name (persistent only, not allowed for read-only storages).'- mount_path:- type: string- description: 'The container mount path (not allowed for read-only storages).'- host_path:- type: string- nullable: true- description: 'The host path (persistent only, not allowed for read-only storages).'- content:+ description: 'The name of the project.'+ description:type: string- nullable: true- description: 'The file content (file only, not allowed for read-only storages).'+ description: 'The description of the project.'type: object- additionalProperties: falseresponses:- '200':- description: 'Storage updated.'+ '201':+ description: 'Project created.'content:application/json:schema:+ properties:+ uuid: { type: string, example: og888os, description: 'The UUID of the project.' }type: object'401':$ref: '#/components/responses/401'@@ -5147,118 +7814,110 @@ paths:security:-bearerAuth: []- '/databases/{uuid}/storages/{storage_uuid}':- delete:- tags:- - Databases- summary: 'Delete Storage'- description: 'Delete a persistent storage or file storage by database UUID.'- operationId: delete-storage-by-database-uuid+ '/projects/{uuid}':+ get:+ tags:+ - Projects+ summary: Get+ description: 'Get project by UUID.'+ operationId: get-project-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'- required: true- schema:- type: string- -- name: storage_uuid- in: path- description: 'UUID of the storage.'+ description: 'Project UUID'required: trueschema:type: stringresponses:'200':- description: 'Storage deleted.'+ description: 'Project details'content:application/json:schema:- properties:- message: { type: string }- type: object+ $ref: '#/components/schemas/Project''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':- $ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'+ description: 'Project not found.'security:-bearerAuth: []- '/databases/{uuid}/tags':- get:+ delete:tags:- - Databases- summary: 'List Tags'- description: 'List tags for a database by UUID.'- operationId: list-tags-by-database-uuid+ - Projects+ summary: Delete+ description: 'Delete project by UUID.'+ operationId: delete-project-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'+ description: 'UUID of the application.'required: trueschema:type: stringresponses:'200':- description: 'List of tags.'+ description: 'Project deleted.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Tag'+ properties:+ message: { type: string, example: 'Project deleted.' }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- post:+ patch:tags:- - Databases- summary: 'Create Tag'- description: 'Add tag(s) to a database by UUID.'- operationId: create-tag-by-database-uuid+ - Projects+ summary: Update+ description: 'Update Project.'+ operationId: update-project-by-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'+ description: 'UUID of the project.'required: trueschema:type: stringrequestBody:+ description: 'Project updated.'required: truecontent:application/json:schema:properties:- tag_name:+ name:type: string- description: 'The tag name (min 2 characters). Required if tag_names is not provided.'- tag_names:- type: array- items: { type: string }- description: 'Array of tag names (each min 2 characters). Required if tag_name is not provided.'+ description: 'The name of the project.'+ description:+ type: string+ description: 'The description of the project.'type: objectresponses:'201':- description: 'Tags added successfully.'+ description: 'Project updated.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Tag'+ properties:+ uuid: { type: string, example: og888os }+ name: { type: string, example: 'Project Name' }+ description: { type: string, example: 'Project Description' }+ type: object'401':$ref: '#/components/responses/401''400':@@ -5270,377 +7929,376 @@ paths:security:-bearerAuth: []- '/databases/{uuid}/tags/{tag_uuid}':- delete:+ '/projects/{uuid}/{environment_name_or_uuid}':+ get:tags:- - Databases- summary: 'Delete Tag'- description: 'Remove a tag from a database by UUID.'- operationId: delete-tag-by-database-uuid+ - Projects+ summary: Environment+ description: 'Get environment by name or UUID.'+ operationId: get-environment-by-name-or-uuidparameters:-name: uuidin: path- description: 'UUID of the database.'+ description: 'Project UUID'required: trueschema:type: string-- name: tag_uuid+ name: environment_name_or_uuidin: path- description: 'UUID of the tag.'+ description: 'Environment name or UUID'required: trueschema:type: stringresponses:'200':- description: 'Tag removed.'- '401':- $ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'- security:- -- bearerAuth: []- /deployments:- get:- tags:- - Deployments- summary: List- description: 'List currently running deployments'- operationId: list-deployments- responses:- '200':- description: 'Get all currently running deployments.'+ description: 'Environment details'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/ApplicationDeploymentQueue'+ $ref: '#/components/schemas/Environment''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/deployments/{uuid}':+ '/projects/{uuid}/environments':get:tags:- - Deployments- summary: Get- description: 'Get deployment by UUID.'- operationId: get-deployment-by-uuid+ - Projects+ summary: 'List Environments'+ description: 'List all environments in a project.'+ operationId: get-environmentsparameters:-name: uuidin: path- description: 'Deployment UUID'+ description: 'Project UUID'required: trueschema:type: stringresponses:'200':- description: 'Get deployment by UUID.'+ description: 'List of environments'content:application/json:schema:- $ref: '#/components/schemas/ApplicationDeploymentQueue'+ type: array+ items:+ $ref: '#/components/schemas/Environment''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':- $ref: '#/components/responses/404'+ description: 'Project not found.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/deployments/{uuid}/cancel':post:tags:- - Deployments- summary: Cancel- description: 'Cancel a deployment by UUID.'- operationId: cancel-deployment-by-uuid+ - Projects+ summary: 'Create Environment'+ description: 'Create environment in project.'+ operationId: create-environmentparameters:-name: uuidin: path- description: 'Deployment UUID'+ description: 'Project UUID'required: trueschema:type: string+ requestBody:+ description: 'Environment created.'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'The name of the environment.'+ type: objectresponses:- '200':- description: 'Deployment cancelled successfully.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Deployment cancelled successfully.' }- deployment_uuid: { type: string, example: cm37r6cqj000008jm0veg5tkm }- status: { type: string, example: cancelled-by-user }- type: object- '400':- description: 'Deployment cannot be cancelled (already finished/failed/cancelled).'+ '201':+ description: 'Environment created.'content:application/json:schema:properties:- message: { type: string, example: 'Deployment cannot be cancelled. Current status: finished' }+ uuid: { type: string, example: env123, description: 'The UUID of the environment.' }type: object'401':$ref: '#/components/responses/401'- '403':- description: "User doesn't have permission to cancel this deployment."- content:- application/json:- schema:- properties:- message: { type: string, example: 'You do not have permission to cancel this deployment.' }- type: object+ '400':+ $ref: '#/components/responses/400''404':- $ref: '#/components/responses/404'+ description: 'Project not found.'+ '409':+ description: 'Environment with this name already exists.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- /deploy:- post:+ '/projects/{uuid}/environments/{environment_name_or_uuid}':+ delete:tags:- - Deployments- summary: Deploy- description: 'Deploy by tag or UUID using query parameters or a JSON body.'- operationId: deploy-by-tag-or-uuid+ - Projects+ summary: 'Delete Environment'+ description: 'Delete environment by name or UUID. Environment must be empty.'+ operationId: delete-environmentparameters:- -- name: tag- in: query- description: 'Tag name(s). Comma separated list is also accepted.'- schema:- type: string-name: uuid- in: query- description: 'Resource UUID(s). Comma separated list is also accepted.'+ in: path+ description: 'Project UUID'+ required: trueschema:type: string-- name: force- in: query- description: 'Force rebuild (without cache)'- schema:- type: boolean- -- name: pr- in: query- description: 'Pull Request Id for deploying specific PR builds. Cannot be used with tag parameter.'- schema:- type: integer- -- name: pull_request_id- in: query- description: 'Preview deployment identifier. Alias of pr.'- schema:- type: integer- -- name: docker_tag- in: query- description: 'Docker image tag for Docker Image preview deployments. Requires pull_request_id.'+ name: environment_name_or_uuid+ in: path+ description: 'Environment name or UUID'+ required: trueschema:type: stringresponses:'200':- description: "Get deployment(s) UUID's"+ description: 'Environment deleted.'content:application/json:schema:properties:- deployments: { type: array, items: { properties: { message: { type: string }, resource_uuid: { type: string }, deployment_uuid: { type: string } }, type: object } }+ message: { type: string, example: 'Environment deleted.' }type: object'401':$ref: '#/components/responses/401''400':- $ref: '#/components/responses/400'+ description: 'Environment has resources, so it cannot be deleted.'+ '404':+ description: 'Project or environment not found.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/deployments/applications/{uuid}':- get:+ patch:tags:- - Deployments- summary: 'List application deployments'- description: 'List application deployments by using the app uuid'- operationId: list-deployments-by-app-uuid+ - Projects+ summary: 'Update Environment'+ description: 'Update environment by name or UUID within a project.'+ operationId: update-environmentparameters:-name: uuidin: path- description: 'UUID of the application.'+ description: 'Project UUID'required: trueschema:type: string-- name: skip- in: query- description: 'Number of records to skip.'- required: false- schema:- type: integer- default: 0- minimum: 0- -- name: take- in: query- description: 'Number of records to take.'- required: false+ name: environment_name_or_uuid+ in: path+ description: 'Environment name or UUID'+ required: trueschema:- type: integer- default: 10- minimum: 1+ type: string+ requestBody:+ description: 'Environment fields to update.'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'The name of the environment.'+ description:+ type: string+ description: 'The description of the environment.'+ type: objectresponses:'200':- description: 'List application deployments by using the app uuid.'+ description: 'Environment updated.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Application'+ properties:+ uuid: { type: string, example: env123 }+ name: { type: string, example: staging }+ description: { type: string, example: 'Staging environment' }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ description: 'Project or environment not found.'+ '409':+ description: 'Environment with this name already exists.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- /destinations:+ /resources:get:tags:- - Destinations- summary: 'List destinations'- description: 'List all Docker network destinations for the authenticated team.'- operationId: list-destinations+ - Resources+ summary: List+ description: 'Get all resources.'+ operationId: list-resourcesresponses:'200':- description: 'Destinations for the authenticated team.'+ description: 'Get all resources'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Destination'+ type: string+ example: 'Content is very complex. Will be implemented later.''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'security:-bearerAuth: []- '/servers/{server_uuid}/destinations':+ /s3-storages:get:tags:- - Destinations- summary: 'List destinations by server'- description: 'List Docker network destinations attached to a server owned by the authenticated team.'- operationId: list-server-destinations- parameters:- -- name: server_uuid- in: path- description: 'Server UUID'- required: true- schema:- type: string+ - 'S3 Storages'+ summary: 'List S3 Storages'+ description: 'List all S3 storages for the authenticated team.'+ operationId: list-s3-storagesresponses:'200':- description: 'Destinations attached to the server.'+ description: 'Get all S3 storages.'content:application/json:schema:type: arrayitems:- $ref: '#/components/schemas/Destination'+ properties: { uuid: { type: string }, name: { type: string }, description: { type: string, nullable: true }, endpoint: { type: string }, bucket: { type: string }, region: { type: string }, is_usable: { type: boolean }, team_id: { type: integer }, created_at: { type: string }, updated_at: { type: string } }+ type: object'401':$ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'+ '400':+ $ref: '#/components/responses/400'security:-bearerAuth: []post:tags:- - Destinations- summary: 'Create destination'- description: 'Create a Docker network destination on a server owned by the authenticated team.'- operationId: create-server-destination- parameters:- -- name: server_uuid- in: path- description: 'Server UUID'- required: true- schema:- type: string+ - 'S3 Storages'+ summary: 'Create S3 Storage'+ description: 'Create a new S3 storage configuration for the authenticated team.'+ operationId: create-s3-storagerequestBody:+ description: 'S3 storage details'required: truecontent:application/json:schema:required:- - network+ - name+ - endpoint+ - bucket+ - region+ - key+ - secretproperties:name:type: string- maxLength: 255- network:+ example: 'My S3 Storage'+ description: 'A friendly name for the storage.'+ description:type: string- maxLength: 255- pattern: '^[a-zA-Z0-9][a-zA-Z0-9._-]*$'- type:+ nullable: true+ description: 'Optional description.'+ endpoint:type: string- enum: [standalone, swarm]+ example: 'https://s3.us-east-1.amazonaws.com'+ description: 'S3-compatible endpoint URL.'+ bucket:+ type: string+ example: my-bucket+ description: 'S3 bucket name.'+ region:+ type: string+ example: us-east-1+ description: 'S3 region.'+ key:+ type: string+ description: 'Access key.'+ secret:+ type: string+ description: 'Secret key.'+ is_usable:+ type: boolean+ description: 'Whether the storage is marked usable.'type: objectresponses:'201':- description: 'Destination created.'+ description: 'S3 storage created.'content:application/json:schema:- $ref: '#/components/schemas/Destination'+ properties:+ uuid: { type: string, example: og888os, description: 'The UUID of the S3 storage.' }+ type: object'401':$ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'- '409':- description: 'A destination with this network already exists.'+ '400':+ $ref: '#/components/responses/400''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/destinations/{uuid}':+ '/s3-storages/{uuid}':get:tags:- - Destinations- summary: 'Get destination'- description: 'Get a Docker network destination by UUID.'- operationId: get-destination-by-uuid+ - 'S3 Storages'+ summary: 'Get S3 Storage'+ description: 'Get S3 storage by UUID.'+ operationId: get-s3-storage-by-uuidparameters:-name: uuidin: path- description: 'Destination UUID'+ description: 'S3 Storage UUID'required: trueschema:type: stringresponses:'200':- description: 'Destination details.'+ description: 'Get S3 storage by UUID'content:application/json:schema:- $ref: '#/components/schemas/Destination'+ properties:+ uuid: { type: string }+ name: { type: string }+ description: { type: string, nullable: true }+ endpoint: { type: string }+ bucket: { type: string }+ region: { type: string }+ is_usable: { type: boolean }+ team_id: { type: integer }+ created_at: { type: string }+ updated_at: { type: string }+ type: object'401':$ref: '#/components/responses/401''404':@@ -5650,364 +8308,360 @@ paths:bearerAuth: []delete:tags:- - Destinations- summary: 'Delete destination'- description: 'Delete an unused Docker network destination.'- operationId: delete-destination-by-uuid+ - 'S3 Storages'+ summary: 'Delete S3 Storage'+ description: 'Delete S3 storage by UUID.'+ operationId: delete-s3-storage-by-uuidparameters:-name: uuidin: path- description: 'Destination UUID'+ description: 'UUID of the S3 storage.'required: trueschema:type: stringresponses:'200':- description: 'Destination deleted.'+ description: 'S3 storage deleted.'content:application/json:schema:properties:- message: { type: string, example: Deleted. }+ message: { type: string, example: 'S3 storage deleted.' }type: object'401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'- '409':- description: 'Destination has attached resources.'- security:- -- bearerAuth: []- /digitalocean/regions:- get:- tags:- - DigitalOcean- summary: 'Get DigitalOcean regions'- operationId: get-digitalocean-regions- parameters:- -- name: cloud_provider_token_uuid- in: query- required: false- schema:- type: string- -- name: cloud_provider_token_id- in: query- required: false- deprecated: true- schema:- type: string- responses:- '200':- description: 'List of DigitalOcean regions.'- '401':- $ref: '#/components/responses/401'- '422':- description: 'Validation failed.'- security:- -- bearerAuth: []- /digitalocean/sizes:- get:- tags:- - DigitalOcean- summary: 'Get DigitalOcean sizes'- operationId: get-digitalocean-sizes- parameters:- -- name: cloud_provider_token_uuid- in: query- required: false- schema:- type: string- -- name: cloud_provider_token_id- in: query- required: false- deprecated: true- schema:- type: string- responses:- '200':- description: 'List of DigitalOcean sizes.'- '401':- $ref: '#/components/responses/401'- '422':- description: 'Validation failed.'security:-bearerAuth: []- /digitalocean/images:- get:+ patch:tags:- - DigitalOcean- summary: 'Get DigitalOcean images'- operationId: get-digitalocean-images+ - 'S3 Storages'+ summary: 'Update S3 Storage'+ description: 'Update S3 storage by UUID.'+ operationId: update-s3-storage-by-uuidparameters:-- name: cloud_provider_token_uuid- in: query- required: false- schema:- type: string- -- name: cloud_provider_token_id- in: query- required: false- deprecated: true+ name: uuid+ in: path+ description: 'S3 Storage UUID'+ required: trueschema:type: string+ requestBody:+ description: 'S3 storage fields to update.'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'A friendly name for the storage.'+ description:+ type: string+ nullable: true+ description: 'Optional description.'+ endpoint:+ type: string+ description: 'S3-compatible endpoint URL.'+ bucket:+ type: string+ description: 'S3 bucket name.'+ region:+ type: string+ description: 'S3 region.'+ key:+ type: string+ description: 'Access key.'+ secret:+ type: string+ description: 'Secret key.'+ is_usable:+ type: boolean+ description: 'Whether the storage is marked usable.'+ type: objectresponses:'200':- description: 'List of DigitalOcean images.'+ description: 'S3 storage updated.'+ content:+ application/json:+ schema:+ properties:+ uuid: { type: string }+ type: object'401':$ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404''422':- description: 'Validation failed.'+ $ref: '#/components/responses/422'security:-bearerAuth: []- /digitalocean/ssh-keys:- get:+ '/s3-storages/{uuid}/validate':+ post:tags:- - DigitalOcean- summary: 'Get DigitalOcean SSH keys'- operationId: get-digitalocean-ssh-keys+ - 'S3 Storages'+ summary: 'Validate S3 Storage'+ description: 'Validate an S3 storage connection using ListObjectsV2.'+ operationId: validate-s3-storage-by-uuidparameters:-- name: cloud_provider_token_uuid- in: query- required: false- schema:- type: string- -- name: cloud_provider_token_id- in: query- required: false- deprecated: true+ name: uuid+ in: path+ description: 'S3 Storage UUID'+ required: trueschema:type: stringresponses:'200':- description: 'List of DigitalOcean SSH keys.'- '401':- $ref: '#/components/responses/401'- '422':- description: 'Validation failed.'- security:- -- bearerAuth: []- /servers/digitalocean:- post:- tags:- - DigitalOcean- summary: 'Create a server on DigitalOcean'- operationId: create-digitalocean-server- responses:- '201':- description: 'DigitalOcean droplet created and linked to a Coolify server.'+ description: 'S3 storage validation result.'+ content:+ application/json:+ schema:+ properties:+ valid: { type: boolean, example: true }+ message: { type: string, example: 'S3 storage connection is valid.' }+ type: object'401':$ref: '#/components/responses/401'- '422':- description: 'Validation failed.'- '429':- description: 'DigitalOcean rate limit exceeded.'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []- /github-apps:+ '/applications/{uuid}/scheduled-tasks':get:tags:- - 'GitHub Apps'- summary: List- description: 'List all GitHub apps.'- operationId: list-github-apps+ - 'Scheduled Tasks'+ summary: 'List Tasks'+ description: 'List all scheduled tasks for an application.'+ operationId: list-scheduled-tasks-by-application-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: true+ schema:+ type: stringresponses:'200':- description: 'List of GitHub apps.'+ description: 'Get all scheduled tasks for an application.'content:application/json:schema:type: arrayitems:- properties: { id: { type: integer }, uuid: { type: string }, name: { type: string }, organization: { type: string, nullable: true }, api_url: { type: string }, html_url: { type: string }, custom_user: { type: string }, custom_port: { type: integer }, app_id: { type: integer }, installation_id: { type: integer }, client_id: { type: string }, private_key_id: { type: integer }, is_system_wide: { type: boolean }, is_public: { type: boolean }, team_id: { type: integer }, type: { type: string } }- type: object+ $ref: '#/components/schemas/ScheduledTask''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []post:tags:- - 'GitHub Apps'- summary: 'Create GitHub App'- description: 'Create a new GitHub app.'- operationId: create-github-app+ - 'Scheduled Tasks'+ summary: 'Create Task'+ description: 'Create a new scheduled task for an application.'+ operationId: create-scheduled-task-by-application-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: true+ schema:+ type: stringrequestBody:- description: 'GitHub app creation payload.'+ description: 'Scheduled task data'required: truecontent:application/json:schema:required:- name- - html_url- - app_id- - installation_id- - client_id- - client_secret- - private_key_uuid+ - command+ - frequencyproperties:name:type: string- description: 'Name of the GitHub app.'- organization:- type: string- nullable: true- description: 'Organization to associate the app with.'- api_url:+ description: 'The name of the scheduled task.'+ command:type: string- description: 'API URL for the GitHub app (e.g., https://api.github.com).'- html_url:+ description: 'The command to execute.'+ frequency:type: string- description: 'HTML URL for the GitHub app (e.g., https://github.com).'- custom_user:+ description: 'The frequency of the scheduled task.'+ container:type: string- description: 'Custom user for SSH access (default: git).'- custom_port:- type: integer- description: 'Custom port for SSH access (default: 22).'- app_id:- type: integer- description: 'GitHub App ID from GitHub.'- installation_id:+ nullable: true+ description: 'The container where the command should be executed.'+ timeout:type: integer- description: 'GitHub Installation ID.'- client_id:- type: string- description: 'GitHub OAuth App Client ID.'- client_secret:- type: string- description: 'GitHub OAuth App Client Secret.'- webhook_secret:- type: string- description: 'Webhook secret for GitHub webhooks.'- private_key_uuid:- type: string- description: 'UUID of an existing private key for GitHub App authentication.'- is_system_wide:+ description: 'The timeout of the scheduled task in seconds.'+ default: 300+ enabled:type: boolean- description: 'Is this app system-wide (cloud only).'+ description: 'The flag to indicate if the scheduled task is enabled.'+ default: truetype: objectresponses:'201':- description: 'GitHub app created successfully.'+ description: 'Scheduled task created.'content:application/json:schema:- properties:- id: { type: integer }- uuid: { type: string }- name: { type: string }- organization: { type: string, nullable: true }- api_url: { type: string }- html_url: { type: string }- custom_user: { type: string }- custom_port: { type: integer }- app_id: { type: integer }- installation_id: { type: integer }- client_id: { type: string }- private_key_id: { type: integer }- is_system_wide: { type: boolean }- team_id: { type: integer }- type: object- '400':- $ref: '#/components/responses/400'+ $ref: '#/components/schemas/ScheduledTask''401':$ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/github-apps/{github_app_id}/repositories':- get:+ '/applications/{uuid}/scheduled-tasks/{task_uuid}':+ delete:tags:- - 'GitHub Apps'- summary: 'Load Repositories for a GitHub App'- description: 'Fetch repositories from GitHub for a given GitHub app.'- operationId: load-repositories+ - 'Scheduled Tasks'+ summary: 'Delete Task'+ description: 'Delete a scheduled task for an application.'+ operationId: delete-scheduled-task-by-application-uuidparameters:-- name: github_app_id+ name: uuidin: path- description: 'GitHub App ID'+ description: 'UUID of the application.'required: trueschema:- type: integer+ type: string+ -+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Scheduled task deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Scheduled task deleted.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - 'Scheduled Tasks'+ summary: 'Update Task'+ description: 'Update a scheduled task for an application.'+ operationId: update-scheduled-task-by-application-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: true+ schema:+ type: string+ -+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: true+ schema:+ type: string+ requestBody:+ description: 'Scheduled task data'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'The name of the scheduled task.'+ command:+ type: string+ description: 'The command to execute.'+ frequency:+ type: string+ description: 'The frequency of the scheduled task.'+ container:+ type: string+ nullable: true+ description: 'The container where the command should be executed.'+ timeout:+ type: integer+ description: 'The timeout of the scheduled task in seconds.'+ default: 300+ enabled:+ type: boolean+ description: 'The flag to indicate if the scheduled task is enabled.'+ default: true+ type: objectresponses:'200':- description: 'Repositories loaded successfully.'+ description: 'Scheduled task updated.'content:application/json:schema:- properties:- repositories: { type: array, items: { type: object } }- type: object- '400':- $ref: '#/components/responses/400'+ $ref: '#/components/schemas/ScheduledTask''401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/github-apps/{github_app_id}/repositories/{owner}/{repo}/branches':+ '/applications/{uuid}/scheduled-tasks/{task_uuid}/executions':get:tags:- - 'GitHub Apps'- summary: 'Load Branches for a GitHub Repository'- description: 'Fetch branches from GitHub for a given repository.'- operationId: load-branches+ - 'Scheduled Tasks'+ summary: 'List Executions'+ description: 'List all executions for a scheduled task on an application.'+ operationId: list-scheduled-task-executions-by-application-uuidparameters:-- name: github_app_id- in: path- description: 'GitHub App ID'- required: true- schema:- type: integer- -- name: owner+ name: uuidin: path- description: 'Repository owner'+ description: 'UUID of the application.'required: trueschema:type: string-- name: repo+ name: task_uuidin: path- description: 'Repository name'+ description: 'UUID of the scheduled task.'required: trueschema:type: stringresponses:'200':- description: 'Branches loaded successfully.'+ description: 'Get all executions for a scheduled task.'content:application/json:schema:- properties:- branches: { type: array, items: { type: object } }- type: object- '400':- $ref: '#/components/responses/400'+ type: array+ items:+ $ref: '#/components/schemas/ScheduledTaskExecution''401':$ref: '#/components/responses/401''404':@@ -6015,198 +8669,131 @@ paths:security:-bearerAuth: []- '/github-apps/{github_app_id}':- delete:+ '/services/{uuid}/scheduled-tasks':+ get:tags:- - 'GitHub Apps'- summary: 'Delete GitHub App'- description: "Delete a GitHub app if it's not being used by any applications."- operationId: deleteGithubApp+ - 'Scheduled Tasks'+ summary: 'List Tasks'+ description: 'List all scheduled tasks for a service.'+ operationId: list-scheduled-tasks-by-service-uuidparameters:-- name: github_app_id+ name: uuidin: path- description: 'GitHub App ID'+ description: 'UUID of the service.'required: trueschema:- type: integer+ type: stringresponses:'200':- description: 'GitHub app deleted successfully'+ description: 'Get all scheduled tasks for a service.'content:application/json:schema:- properties:- message: { type: string, example: 'GitHub app deleted successfully' }- type: object+ type: array+ items:+ $ref: '#/components/schemas/ScheduledTask''401':- description: Unauthorized+ $ref: '#/components/responses/401''404':- description: 'GitHub app not found'- '409':- description: 'Conflict - GitHub app is in use'- content:- application/json:- schema:- properties:- message: { type: string, example: 'This GitHub app is being used by 5 application(s). Please delete all applications first.' }- type: object+ $ref: '#/components/responses/404'security:-bearerAuth: []- patch:+ post:tags:- - 'GitHub Apps'- summary: 'Update GitHub App'- description: 'Update an existing GitHub app.'- operationId: updateGithubApp+ - 'Scheduled Tasks'+ summary: 'Create Task'+ description: 'Create a new scheduled task for a service.'+ operationId: create-scheduled-task-by-service-uuidparameters:-- name: github_app_id+ name: uuidin: path- description: 'GitHub App ID'+ description: 'UUID of the service.'required: trueschema:- type: integer+ type: stringrequestBody:+ description: 'Scheduled task data'required: truecontent:application/json:schema:+ required:+ - name+ - command+ - frequencyproperties:name:type: string- description: 'GitHub App name'- organization:- type: string- nullable: true- description: 'GitHub organization'- api_url:+ description: 'The name of the scheduled task.'+ command:type: string- description: 'GitHub API URL'- html_url:+ description: 'The command to execute.'+ frequency:type: string- description: 'GitHub HTML URL'- custom_user:+ description: 'The frequency of the scheduled task.'+ container:type: string- description: 'Custom user for SSH'- custom_port:- type: integer- description: 'Custom port for SSH'- app_id:- type: integer- description: 'GitHub App ID'- installation_id:+ nullable: true+ description: 'The container where the command should be executed.'+ timeout:type: integer- description: 'GitHub Installation ID'- client_id:- type: string- description: 'GitHub Client ID'- client_secret:- type: string- description: 'GitHub Client Secret'- webhook_secret:- type: string- description: 'GitHub Webhook Secret'- private_key_uuid:- type: string- description: 'Private key UUID'- is_system_wide:+ description: 'The timeout of the scheduled task in seconds.'+ default: 300+ enabled:type: boolean- description: 'Is system wide (non-cloud instances only)'+ description: 'The flag to indicate if the scheduled task is enabled.'+ default: truetype: objectresponses:- '200':- description: 'GitHub app updated successfully'- content:- application/json:- schema:- properties:- message: { type: string, example: 'GitHub app updated successfully' }- data: { type: object, description: 'Updated GitHub app data' }- type: object- '401':- description: Unauthorized- '404':- description: 'GitHub app not found'- '422':- $ref: '#/components/responses/422'- security:- -- bearerAuth: []- /hetzner/locations:- get:- tags:- - Hetzner- summary: 'Get Hetzner Locations'- description: 'Get all available Hetzner datacenter locations.'- operationId: get-hetzner-locations- parameters:- -- name: cloud_provider_token_uuid- in: query- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- required: false- schema:- type: string- -- name: cloud_provider_token_id- in: query- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- required: false- deprecated: true- schema:- type: string- responses:- '200':- description: 'List of Hetzner locations.'+ '201':+ description: 'Scheduled task created.'content:application/json:schema:- type: array- items:- properties: { id: { type: integer }, name: { type: string }, description: { type: string }, country: { type: string }, city: { type: string }, latitude: { type: number }, longitude: { type: number } }- type: object+ $ref: '#/components/schemas/ScheduledTask''401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- /hetzner/server-types:- get:+ '/services/{uuid}/scheduled-tasks/{task_uuid}':+ delete:tags:- - Hetzner- summary: 'Get Hetzner Server Types'- description: 'Get all available Hetzner server types (instance sizes).'- operationId: get-hetzner-server-types+ - 'Scheduled Tasks'+ summary: 'Delete Task'+ description: 'Delete a scheduled task for a service.'+ operationId: delete-scheduled-task-by-service-uuidparameters:-- name: cloud_provider_token_uuid- in: query- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- required: false+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: trueschema:type: string-- name: cloud_provider_token_id- in: query- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- required: false- deprecated: true+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: trueschema:type: stringresponses:'200':- description: 'List of Hetzner server types.'+ description: 'Scheduled task deleted.'content:application/json:schema:- type: array- items:- properties: { id: { type: integer }, name: { type: string }, description: { type: string }, cores: { type: integer }, memory: { type: number }, disk: { type: integer }, prices: { type: array, items: { type: object, properties: { location: { type: string, description: 'Datacenter location name' }, price_hourly: { type: object, properties: { net: { type: string }, gross: { type: string } } }, price_monthly: { type: object, properties: { net: { type: string }, gross: { type: string } } } } } } }- type: object+ properties:+ message: { type: string, example: 'Scheduled task deleted.' }+ type: object'401':$ref: '#/components/responses/401''404':@@ -6214,79 +8801,103 @@ paths:security:-bearerAuth: []- /hetzner/images:- get:+ patch:tags:- - Hetzner- summary: 'Get Hetzner Images'- description: 'Get all available Hetzner system images (operating systems).'- operationId: get-hetzner-images+ - 'Scheduled Tasks'+ summary: 'Update Task'+ description: 'Update a scheduled task for a service.'+ operationId: update-scheduled-task-by-service-uuidparameters:-- name: cloud_provider_token_uuid- in: query- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- required: false+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: trueschema:type: string-- name: cloud_provider_token_id- in: query- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- required: false- deprecated: true+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: trueschema:type: string+ requestBody:+ description: 'Scheduled task data'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'The name of the scheduled task.'+ command:+ type: string+ description: 'The command to execute.'+ frequency:+ type: string+ description: 'The frequency of the scheduled task.'+ container:+ type: string+ nullable: true+ description: 'The container where the command should be executed.'+ timeout:+ type: integer+ description: 'The timeout of the scheduled task in seconds.'+ default: 300+ enabled:+ type: boolean+ description: 'The flag to indicate if the scheduled task is enabled.'+ default: true+ type: objectresponses:'200':- description: 'List of Hetzner images.'+ description: 'Scheduled task updated.'content:application/json:schema:- type: array- items:- properties: { id: { type: integer }, name: { type: string }, description: { type: string }, type: { type: string }, os_flavor: { type: string }, os_version: { type: string }, architecture: { type: string } }- type: object+ $ref: '#/components/schemas/ScheduledTask''401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- /hetzner/ssh-keys:+ '/services/{uuid}/scheduled-tasks/{task_uuid}/executions':get:tags:- - Hetzner- summary: 'Get Hetzner SSH Keys'- description: 'Get all SSH keys stored in the Hetzner account.'- operationId: get-hetzner-ssh-keys+ - 'Scheduled Tasks'+ summary: 'List Executions'+ description: 'List all executions for a scheduled task on a service.'+ operationId: list-scheduled-task-executions-by-service-uuidparameters:-- name: cloud_provider_token_uuid- in: query- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- required: false+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: trueschema:type: string-- name: cloud_provider_token_id- in: query- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- required: false- deprecated: true+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: trueschema:type: stringresponses:'200':- description: 'List of Hetzner SSH keys.'+ description: 'Get all executions for a scheduled task.'content:application/json:schema:type: arrayitems:- properties: { id: { type: integer }, name: { type: string }, fingerprint: { type: string }, public_key: { type: string } }- type: object+ $ref: '#/components/schemas/ScheduledTaskExecution''401':$ref: '#/components/responses/401''404':@@ -6294,39 +8905,31 @@ paths:security:-bearerAuth: []- /hetzner/firewalls:- get:+ '/applications/{uuid}/scheduled-tasks/{task_uuid}/execute':+ post:tags:- - Hetzner- summary: 'Get Hetzner Firewalls'- description: 'Get all existing Hetzner firewalls for the current project.'- operationId: get-hetzner-firewalls+ - 'Scheduled Tasks'+ summary: 'Execute Task'+ description: 'Queue immediate execution of a scheduled task for an application.'+ operationId: execute-scheduled-task-by-application-uuidparameters:-- name: cloud_provider_token_uuid- in: query- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- required: false+ name: uuid+ in: path+ description: 'UUID of the application.'+ required: trueschema:type: string-- name: cloud_provider_token_id- in: query- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- required: false- deprecated: true+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: trueschema:type: stringresponses:'200':- description: 'List of Hetzner firewalls.'- content:- application/json:- schema:- type: array- items:- properties: { id: { type: integer }, name: { type: string } }- type: object+ description: 'Scheduled task execution queued.''401':$ref: '#/components/responses/401''404':@@ -6334,354 +8937,475 @@ paths:security:-bearerAuth: []- /hetzner/networks:- get:+ '/services/{uuid}/scheduled-tasks/{task_uuid}/execute':+ post:tags:- - Hetzner- summary: 'Get Hetzner Networks'- description: 'Get all existing Hetzner private networks for the current project.'- operationId: get-hetzner-networks+ - 'Scheduled Tasks'+ summary: 'Execute Task'+ description: 'Queue immediate execution of a scheduled task for a service.'+ operationId: execute-scheduled-task-by-service-uuidparameters:-- name: cloud_provider_token_uuid- in: query- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- required: false+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: trueschema:type: string-- name: cloud_provider_token_id- in: query- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- required: false- deprecated: true+ name: task_uuid+ in: path+ description: 'UUID of the scheduled task.'+ required: trueschema:type: stringresponses:'200':- description: 'List of Hetzner networks.'+ description: 'Scheduled task execution queued.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ /security/keys:+ get:+ tags:+ - 'Private Keys'+ summary: List+ description: 'List all private keys.'+ operationId: list-private-keys+ responses:+ '200':+ description: 'Get all private keys.'content:application/json:schema:type: arrayitems:- properties: { id: { type: integer }, name: { type: string }, ip_range: { type: string } }- type: object+ $ref: '#/components/schemas/PrivateKey''401':$ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'+ '400':+ $ref: '#/components/responses/400'security:-bearerAuth: []- /servers/hetzner:post:tags:- - Hetzner- summary: 'Create Hetzner Server'- description: 'Create a new server on Hetzner and register it in Coolify.'- operationId: create-hetzner-server+ - 'Private Keys'+ summary: Create+ description: 'Create a new private key.'+ operationId: create-private-keyrequestBody:- description: 'Hetzner server creation parameters'required: truecontent:application/json:schema:required:- - location- - server_type- - image- - private_key_uuid+ - private_keyproperties:- cloud_provider_token_uuid:- type: string- example: abc123- description: 'Cloud provider token UUID. Required if cloud_provider_token_id is not provided.'- cloud_provider_token_id:+ name:type: string- example: abc123- description: 'Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.'- deprecated: true- location:+ description:type: string- example: nbg1- description: 'Hetzner location name'- server_type:+ private_key:type: string- example: cx11- description: 'Hetzner server type name'- image:- type: integer- example: 15512617- description: 'Hetzner image ID'+ type: object+ additionalProperties: false+ responses:+ '201':+ description: "The created private key's UUID."+ content:+ application/json:+ schema:+ properties:+ uuid: { type: string }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - 'Private Keys'+ summary: Update+ description: 'Update a private key.'+ operationId: update-private-key+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - private_key+ properties:name:type: string- example: my-server- description: 'Server name (auto-generated if not provided)'- private_key_uuid:+ description:type: string- example: xyz789- description: 'Private key UUID'- enable_ipv4:- type: boolean- example: true- description: 'Enable IPv4 (default: true)'- enable_ipv6:- type: boolean- example: true- description: 'Enable IPv6 (default: true)'- enable_backups:- type: boolean- example: false- description: 'Enable Hetzner server backups after creation (adds 20% to the monthly server fee)'- hetzner_ssh_key_ids:- type: array- items: { type: integer }- description: 'Additional Hetzner SSH key IDs'- hetzner_firewall_ids:- type: array- items: { type: integer }- description: 'Existing Hetzner firewall IDs to apply during server creation'- hetzner_network_ids:- type: array- items: { type: integer }- description: 'Existing Hetzner network IDs to attach during server creation'- cloud_init_script:+ private_key:type: string- description: 'Cloud-init YAML script (optional)'- instant_validate:- type: boolean- example: false- description: 'Validate server immediately after creation'type: object+ additionalProperties: falseresponses:'201':- description: 'Hetzner server created.'+ description: "The updated private key's UUID."content:application/json:schema:properties:- uuid: { type: string, example: og888os, description: 'The UUID of the server.' }- hetzner_server_id: { type: integer, description: 'The Hetzner server ID.' }- ip: { type: string, description: 'The server IP address.' }+ uuid: { type: string }type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404''422':$ref: '#/components/responses/422'- '429':- $ref: '#/components/responses/429'security:-bearerAuth: []- /version:+ '/security/keys/{uuid}':get:- summary: Version- description: 'Get Coolify version.'- operationId: version+ tags:+ - 'Private Keys'+ summary: Get+ description: 'Get key by UUID.'+ operationId: get-private-key-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Private Key UUID'+ required: true+ schema:+ type: stringresponses:'200':- description: 'Returns the version of the application'+ description: 'Get all private keys.'content:- text/html:+ application/json:schema:- type: string- example: v4.0.0+ $ref: '#/components/schemas/PrivateKey''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ description: 'Private Key not found.'security:-bearerAuth: []- /enable:- post:- summary: 'Enable API'- description: 'Enable API (only with root permissions).'- operationId: enable-api+ delete:+ tags:+ - 'Private Keys'+ summary: Delete+ description: 'Delete a private key.'+ operationId: delete-private-key-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Private Key UUID'+ required: true+ schema:+ type: stringresponses:'200':- description: 'Enable API.'+ description: 'Private Key deleted.'content:application/json:schema:properties:- message: { type: string, example: 'API enabled.' }+ message: { type: string, example: 'Private Key deleted.' }type: object- '403':- description: 'You are not allowed to enable the API.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ description: 'Private Key not found.'+ '422':+ description: 'Private Key is in use and cannot be deleted.'content:application/json:schema:properties:- message: { type: string, example: 'You are not allowed to enable the API.' }+ message: { type: string, example: 'Private Key is in use and cannot be deleted.' }type: object- '401':- $ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'security:-bearerAuth: []- /disable:- post:- summary: 'Disable API'- description: 'Disable API (only with root permissions).'- operationId: disable-api+ '/servers/{uuid}/cloudflare-tunnel':+ get:+ tags:+ - Servers+ summary: 'Get Cloudflare Tunnel settings'+ description: 'Get Cloudflare Tunnel settings for a server owned by the authenticated team.'+ operationId: get-server-cloudflare-tunnel+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: stringresponses:'200':- description: 'Disable API.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'API disabled.' }- type: object- '403':- description: 'You are not allowed to disable the API.'+ description: 'Cloudflare Tunnel settings.'content:application/json:schema:properties:- message: { type: string, example: 'You are not allowed to disable the API.' }+ is_cloudflare_tunnel: { type: boolean }+ ip: { type: string }+ ip_previous: { type: [string, 'null'] }type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []- /mcp/enable:+ patch:+ tags:+ - Servers+ summary: 'Update Cloudflare Tunnel settings'+ description: 'Update stored Cloudflare Tunnel settings for a server. Does not run remote cloudflared configuration; use enable/disable for the manual UI actions.'+ operationId: update-server-cloudflare-tunnel+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ is_cloudflare_tunnel:+ type: boolean+ type: object+ responses:+ '200':+ description: 'Updated Cloudflare Tunnel settings.'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ '/servers/{uuid}/cloudflare-tunnel/enable':post:- summary: 'Enable MCP Server'- description: 'Enable the MCP server endpoint at /mcp (only with root permissions).'- operationId: enable-mcp+ tags:+ - Servers+ summary: 'Enable Cloudflare Tunnel (manual)'+ description: 'Manually mark Cloudflare Tunnel as enabled for a server (matches UI manual enable). Does not deploy cloudflared remotely.'+ operationId: enable-server-cloudflare-tunnel+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: stringresponses:'200':- description: 'MCP server enabled.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'MCP server enabled.' }- type: object- '403':- description: 'You are not allowed to enable the MCP server.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'You are not allowed to enable the MCP server.' }- type: object+ description: 'Cloudflare Tunnel enabled.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- /mcp/disable:+ '/servers/{uuid}/cloudflare-tunnel/disable':post:- summary: 'Disable MCP Server'- description: 'Disable the MCP server endpoint at /mcp (only with root permissions).'- operationId: disable-mcp+ tags:+ - Servers+ summary: 'Disable Cloudflare Tunnel'+ description: 'Mark Cloudflare Tunnel as disabled and restore ip_previous when available. Does not remove the remote cloudflared container.'+ operationId: disable-server-cloudflare-tunnel+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: stringresponses:'200':- description: 'MCP server disabled.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'MCP server disabled.' }- type: object- '403':- description: 'You are not allowed to disable the MCP server.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'You are not allowed to disable the MCP server.' }- type: object+ description: 'Cloudflare Tunnel disabled.''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- /health:+ '/servers/{uuid}/docker-cleanup':get:- summary: Healthcheck- description: 'Healthcheck endpoint.'- operationId: healthcheck+ tags:+ - Servers+ summary: 'Get Docker cleanup settings'+ description: 'Get Docker cleanup settings for a server owned by the authenticated team.'+ operationId: get-server-docker-cleanup+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: stringresponses:'200':- description: 'Healthcheck endpoint.'+ description: 'Docker cleanup settings.'content:- text/html:+ application/json:schema:- type: string- example: OK+ properties:+ docker_cleanup_frequency: { type: string }+ docker_cleanup_threshold: { type: integer }+ force_docker_cleanup: { type: boolean }+ delete_unused_volumes: { type: boolean }+ delete_unused_networks: { type: boolean }+ disable_application_image_retention: { type: boolean }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- /projects:- get:+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ patch:tags:- - Projects- summary: List- description: 'List projects.'- operationId: list-projects+ - Servers+ summary: 'Update Docker cleanup settings'+ description: 'Update Docker cleanup settings for a server owned by the authenticated team.'+ operationId: update-server-docker-cleanup+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ docker_cleanup_frequency:+ description: 'Cron / human frequency expression.'+ type: string+ docker_cleanup_threshold:+ type: integer+ maximum: 99+ minimum: 1+ force_docker_cleanup:+ type: boolean+ delete_unused_volumes:+ type: boolean+ delete_unused_networks:+ type: boolean+ disable_application_image_retention:+ type: boolean+ type: objectresponses:'200':- description: 'Get all projects.'+ description: 'Updated Docker cleanup settings.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Project'+ properties:+ docker_cleanup_frequency: { type: string }+ docker_cleanup_threshold: { type: integer }+ force_docker_cleanup: { type: boolean }+ delete_unused_volumes: { type: boolean }+ delete_unused_networks: { type: boolean }+ disable_application_image_retention: { type: boolean }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []+ '/servers/{uuid}/docker-cleanup/run':post:tags:- - Projects- summary: Create- description: 'Create Project.'- operationId: create-project+ - Servers+ summary: 'Run Docker cleanup'+ description: 'Dispatch a manual Docker cleanup job for a server owned by the authenticated team.'+ operationId: run-server-docker-cleanup+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'+ required: true+ schema:+ type: stringrequestBody:- description: 'Project created.'- required: true+ required: falsecontent:application/json:schema:properties:- name:- type: string- description: 'The name of the project.'- description:- type: string- description: 'The description of the project.'+ delete_unused_volumes:+ type: boolean+ delete_unused_networks:+ type: booleantype: objectresponses:- '201':- description: 'Project created.'+ '200':+ description: 'Docker cleanup job dispatched.'content:application/json:schema:properties:- uuid: { type: string, example: og888os, description: 'The UUID of the project.' }+ message: { type: string, example: 'Manual cleanup job started.' }type: object'401':$ref: '#/components/responses/401'@@ -6694,59 +9418,71 @@ paths:security:-bearerAuth: []- '/projects/{uuid}':+ '/servers/{uuid}/docker-cleanup/executions':get:tags:- - Projects- summary: Get- description: 'Get project by UUID.'- operationId: get-project-by-uuid+ - Servers+ summary: 'List Docker cleanup executions'+ description: 'List recent Docker cleanup execution logs for a server owned by the authenticated team.'+ operationId: list-server-docker-cleanup-executionsparameters:-name: uuidin: path- description: 'Project UUID'+ description: 'Server UUID'required: trueschema:type: stringresponses:'200':- description: 'Project details'+ description: 'Recent Docker cleanup executions.'content:application/json:schema:- $ref: '#/components/schemas/Project'+ type: array+ items:+ properties: { uuid: { type: string }, status: { type: string }, message: { type: [string, 'null'] }, finished_at: { type: [string, 'null'] }, created_at: { type: string }, updated_at: { type: string } }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':- description: 'Project not found.'+ $ref: '#/components/responses/404'security:-bearerAuth: []- delete:+ '/servers/{uuid}/log-drains':+ get:tags:- - Projects- summary: Delete- description: 'Delete project by UUID.'- operationId: delete-project-by-uuid+ - Servers+ summary: 'Get log drain settings'+ description: 'Get log drain settings for a server owned by the authenticated team. Sensitive fields require the read:sensitive or root token ability.'+ operationId: get-server-log-drainsparameters:-name: uuidin: path- description: 'UUID of the application.'+ description: 'Server UUID'required: trueschema:type: stringresponses:'200':- description: 'Project deleted.'+ description: 'Log drain settings.'content:application/json:schema:properties:- message: { type: string, example: 'Project deleted.' }+ is_logdrain_newrelic_enabled: { type: boolean }+ logdrain_newrelic_license_key: { description: 'Only present with read:sensitive.', type: string }+ logdrain_newrelic_base_uri: { type: [string, 'null'] }+ is_logdrain_axiom_enabled: { type: boolean }+ logdrain_axiom_dataset_name: { type: [string, 'null'] }+ logdrain_axiom_api_key: { description: 'Only present with read:sensitive.', type: string }+ is_logdrain_custom_enabled: { type: boolean }+ logdrain_custom_config: { description: 'Only present with read:sensitive.', type: string }+ logdrain_custom_config_parser: { description: 'Only present with read:sensitive.', type: string }type: object'401':$ref: '#/components/responses/401'@@ -6754,50 +9490,51 @@ paths:$ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []patch:tags:- - Projects- summary: Update- description: 'Update Project.'- operationId: update-project-by-uuid+ - Servers+ summary: 'Update log drain settings'+ description: 'Update New Relic, Axiom, or custom log drain settings for a server owned by the authenticated team.'+ operationId: update-server-log-drainsparameters:-name: uuidin: path- description: 'UUID of the project.'+ description: 'Server UUID'required: trueschema:type: stringrequestBody:- description: 'Project updated.'required: truecontent:application/json:schema:properties:- name:+ is_logdrain_newrelic_enabled:+ type: boolean+ logdrain_newrelic_license_key:type: string- description: 'The name of the project.'- description:+ logdrain_newrelic_base_uri:+ type: string+ is_logdrain_axiom_enabled:+ type: boolean+ logdrain_axiom_dataset_name:+ type: string+ logdrain_axiom_api_key:+ type: string+ is_logdrain_custom_enabled:+ type: boolean+ logdrain_custom_config:+ type: string+ logdrain_custom_config_parser:type: string- description: 'The description of the project.'type: objectresponses:- '201':- description: 'Project updated.'- content:- application/json:- schema:- properties:- uuid: { type: string, example: og888os }- name: { type: string, example: 'Project Name' }- description: { type: string, example: 'Project Description' }- type: object+ '200':+ description: 'Updated log drain settings.''401':$ref: '#/components/responses/401''400':@@ -6809,279 +9546,275 @@ paths:security:-bearerAuth: []- '/projects/{uuid}/{environment_name_or_uuid}':+ '/servers/{uuid}/proxy':get:tags:- - Projects- summary: Environment- description: 'Get environment by name or UUID.'- operationId: get-environment-by-name-or-uuid+ - Servers+ summary: 'Get server proxy'+ description: 'Get proxy settings for a server owned by the authenticated team. The raw proxy configuration is only returned when the token has `read:sensitive` (or `root`) and the user is a team admin/owner, and only when already stored in the database (no remote fetch).'+ operationId: get-server-proxyparameters:-name: uuidin: path- description: 'Project UUID'- required: true- schema:- type: string- -- name: environment_name_or_uuid- in: path- description: 'Environment name or UUID'+ description: 'Server UUID'required: trueschema:type: stringresponses:'200':- description: 'Environment details'+ description: 'Server proxy settings.'content:application/json:schema:- $ref: '#/components/schemas/Environment'+ properties:+ proxy_type: { type: [string, 'null'], example: TRAEFIK }+ status: { type: [string, 'null'], example: running }+ redirect_enabled: { type: boolean, example: true }+ redirect_url: { type: [string, 'null'], example: 'https://example.com' }+ generate_exact_labels: { type: boolean, example: false }+ configuration: { description: 'Docker Compose proxy configuration when stored in the database. Only present with read:sensitive.', type: [string, 'null'] }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- '/projects/{uuid}/environments':- get:+ patch:tags:- - Projects- summary: 'List Environments'- description: 'List all environments in a project.'- operationId: get-environments+ - Servers+ summary: 'Update server proxy'+ description: 'Update proxy redirect settings, exact labels generation, and optionally the proxy type for a team-owned server.'+ operationId: update-server-proxyparameters:-name: uuidin: path- description: 'Project UUID'+ description: 'Server UUID'required: trueschema:type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ redirect_enabled:+ type: boolean+ redirect_url:+ description: 'Public http(s) redirect URL, or null to clear.'+ type: [string, 'null']+ generate_exact_labels:+ type: boolean+ proxy_type:+ description: 'Proxy type (case-insensitive).'+ type: string+ enum: [traefik, caddy, nginx, none]+ type: objectresponses:'200':- description: 'List of environments'+ description: 'Proxy settings updated.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Environment'+ properties:+ proxy_type: { type: [string, 'null'] }+ status: { type: [string, 'null'] }+ redirect_enabled: { type: boolean }+ redirect_url: { type: [string, 'null'] }+ generate_exact_labels: { type: boolean }+ configuration: { type: [string, 'null'] }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':- description: 'Project not found.'+ $ref: '#/components/responses/404''422':$ref: '#/components/responses/422'security:-bearerAuth: []- post:+ '/servers/{uuid}/proxy/configuration':+ put:tags:- - Projects- summary: 'Create Environment'- description: 'Create environment in project.'- operationId: create-environment+ - Servers+ summary: 'Save server proxy configuration'+ description: 'Save the raw proxy Docker Compose configuration for a team-owned server. Multi-line configuration must be base64 encoded (same pattern as other compose payloads).'+ operationId: save-server-proxy-configurationparameters:-name: uuidin: path- description: 'Project UUID'+ description: 'Server UUID'required: trueschema:type: stringrequestBody:- description: 'Environment created.'required: truecontent:application/json:schema:+ required:+ - configurationproperties:- name:+ configuration:+ description: 'Proxy docker-compose YAML. Prefer base64 encoding for multi-line content.'type: string- description: 'The name of the environment.'type: objectresponses:- '201':- description: 'Environment created.'+ '200':+ description: 'Proxy configuration saved.'content:application/json:schema:properties:- uuid: { type: string, example: env123, description: 'The UUID of the environment.' }+ message: { type: string, example: 'Proxy configuration saved.' }+ proxy_type: { type: [string, 'null'] }+ status: { type: [string, 'null'] }+ redirect_enabled: { type: boolean }+ redirect_url: { type: [string, 'null'] }+ generate_exact_labels: { type: boolean }+ configuration: { type: [string, 'null'] }type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':- description: 'Project not found.'- '409':- description: 'Environment with this name already exists.'+ $ref: '#/components/responses/404''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/projects/{uuid}/environments/{environment_name_or_uuid}':- delete:+ '/servers/{uuid}/proxy/restart':+ post:tags:- - Projects- summary: 'Delete Environment'- description: 'Delete environment by name or UUID. Environment must be empty.'- operationId: delete-environment+ - Servers+ summary: 'Restart server proxy'+ description: 'Queue a proxy restart for a team-owned server.'+ operationId: restart-server-proxyparameters:-name: uuidin: path- description: 'Project UUID'- required: true- schema:- type: string- -- name: environment_name_or_uuid- in: path- description: 'Environment name or UUID'+ description: 'Server UUID'required: trueschema:type: stringresponses:'200':- description: 'Environment deleted.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Environment deleted.' }- type: object- '401':- $ref: '#/components/responses/401'- '400':- description: 'Environment has resources, so it cannot be deleted.'- '404':- description: 'Project or environment not found.'- '422':- $ref: '#/components/responses/422'- security:- -- bearerAuth: []- /resources:- get:- tags:- - Resources- summary: List- description: 'Get all resources.'- operationId: list-resources- responses:- '200':- description: 'Get all resources'+ description: 'Proxy restart queued.'content:application/json:schema:- type: string- example: 'Content is very complex. Will be implemented later.'+ properties:+ message: { type: string, example: 'Proxy restart queued.' }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []- '/applications/{uuid}/scheduled-tasks':+ '/servers/{uuid}/sentinel':get:tags:- - 'Scheduled Tasks'- summary: 'List Tasks'- description: 'List all scheduled tasks for an application.'- operationId: list-scheduled-tasks-by-application-uuid+ - Servers+ summary: 'Get Sentinel settings'+ description: 'Get Sentinel settings for a server owned by the authenticated team. sentinel_token and sentinel_custom_url require the read:sensitive or root token ability.'+ operationId: get-server-sentinelparameters:-name: uuidin: path- description: 'UUID of the application.'+ description: 'Server UUID'required: trueschema:type: stringresponses:'200':- description: 'Get all scheduled tasks for an application.'+ description: 'Sentinel settings.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/ScheduledTask'+ properties:+ is_sentinel_enabled: { type: boolean }+ is_metrics_enabled: { type: boolean }+ is_sentinel_debug_enabled: { type: boolean }+ sentinel_token: { description: 'Only present with read:sensitive.', type: string }+ sentinel_metrics_refresh_rate_seconds: { type: integer }+ sentinel_metrics_history_days: { type: integer }+ sentinel_push_interval_seconds: { type: integer }+ sentinel_custom_url: { description: 'Only present with read:sensitive.', type: string }+ sentinel_updated_at: { type: [string, 'null'] }+ type: object'401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- post:+ patch:tags:- - 'Scheduled Tasks'- summary: 'Create Task'- description: 'Create a new scheduled task for an application.'- operationId: create-scheduled-task-by-application-uuid+ - Servers+ summary: 'Update Sentinel settings'+ description: 'Update Sentinel settings for a server owned by the authenticated team. Changing token/metrics timing fields may restart Sentinel.'+ operationId: update-server-sentinelparameters:-name: uuidin: path- description: 'UUID of the application.'+ description: 'Server UUID'required: trueschema:type: stringrequestBody:- description: 'Scheduled task data'required: truecontent:application/json:schema:- required:- - name- - command- - frequencyproperties:- name:- type: string- description: 'The name of the scheduled task.'- command:- type: string- description: 'The command to execute.'- frequency:- type: string- description: 'The frequency of the scheduled task.'- container:+ is_sentinel_enabled:+ type: boolean+ is_metrics_enabled:+ type: boolean+ is_sentinel_debug_enabled:+ type: boolean+ sentinel_token:type: string- nullable: true- description: 'The container where the command should be executed.'- timeout:+ sentinel_metrics_refresh_rate_seconds:type: integer- description: 'The timeout of the scheduled task in seconds.'- default: 300- enabled:- type: boolean- description: 'The flag to indicate if the scheduled task is enabled.'- default: true+ minimum: 1+ sentinel_metrics_history_days:+ type: integer+ minimum: 1+ sentinel_push_interval_seconds:+ type: integer+ minimum: 10+ sentinel_custom_url:+ type: [string, 'null']type: objectresponses:- '201':- description: 'Scheduled task created.'- content:- application/json:- schema:- $ref: '#/components/schemas/ScheduledTask'+ '200':+ description: 'Updated Sentinel settings.''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -7089,67 +9822,37 @@ paths:security:-bearerAuth: []- '/applications/{uuid}/scheduled-tasks/{task_uuid}':- delete:+ /servers:+ get:tags:- - 'Scheduled Tasks'- summary: 'Delete Task'- description: 'Delete a scheduled task for an application.'- operationId: delete-scheduled-task-by-application-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the application.'- required: true- schema:- type: string- -- name: task_uuid- in: path- description: 'UUID of the scheduled task.'- required: true- schema:- type: string+ - Servers+ summary: List+ description: 'List all servers.'+ operationId: list-serversresponses:'200':- description: 'Scheduled task deleted.'+ description: 'Get all servers.'content:application/json:schema:- properties:- message: { type: string, example: 'Scheduled task deleted.' }- type: object+ type: array+ items:+ $ref: '#/components/schemas/Server''401':$ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'+ '400':+ $ref: '#/components/responses/400'security:-bearerAuth: []- patch:+ post:tags:- - 'Scheduled Tasks'- summary: 'Update Task'- description: 'Update a scheduled task for an application.'- operationId: update-scheduled-task-by-application-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the application.'- required: true- schema:- type: string- -- name: task_uuid- in: path- description: 'UUID of the scheduled task.'- required: true- schema:- type: string+ - Servers+ summary: Create+ description: 'Create Server.'+ operationId: create-serverrequestBody:- description: 'Scheduled task data'+ description: 'Server created.'required: truecontent:application/json:@@ -7157,35 +9860,55 @@ paths:properties:name:type: string- description: 'The name of the scheduled task.'- command:- type: string- description: 'The command to execute.'- frequency:+ example: 'My Server'+ description: 'The name of the server.'+ description:type: string- description: 'The frequency of the scheduled task.'- container:+ example: 'My Server Description'+ description: 'The description of the server.'+ ip:type: string- nullable: true- description: 'The container where the command should be executed.'- timeout:+ example: 127.0.0.1+ description: 'The IP of the server.'+ port:type: integer- description: 'The timeout of the scheduled task in seconds.'- default: 300- enabled:+ example: 22+ description: 'The port of the server.'+ user:+ type: string+ example: root+ description: 'The user of the server.'+ private_key_uuid:+ type: string+ example: og888os+ description: 'The UUID of the private key.'+ is_build_server:type: boolean- description: 'The flag to indicate if the scheduled task is enabled.'- default: true+ example: false+ description: 'Is build server.'+ instant_validate:+ type: boolean+ example: false+ description: 'Instant validate.'+ proxy_type:+ type: string+ enum: [traefik, caddy, none]+ example: traefik+ description: 'The proxy type.'type: objectresponses:- '200':- description: 'Scheduled task updated.'+ '201':+ description: 'Server created.'content:application/json:schema:- $ref: '#/components/schemas/ScheduledTask'+ properties:+ uuid: { type: string, example: og888os, description: 'The UUID of the server.' }+ type: object'401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -7193,131 +9916,150 @@ paths:security:-bearerAuth: []- '/applications/{uuid}/scheduled-tasks/{task_uuid}/executions':+ '/servers/{uuid}':get:tags:- - 'Scheduled Tasks'- summary: 'List Executions'- description: 'List all executions for a scheduled task on an application.'- operationId: list-scheduled-task-executions-by-application-uuid+ - Servers+ summary: Get+ description: 'Get server by UUID.'+ operationId: get-server-by-uuidparameters:-name: uuidin: path- description: 'UUID of the application.'- required: true- schema:- type: string- -- name: task_uuid- in: path- description: 'UUID of the scheduled task.'+ description: "Server's UUID"required: trueschema:type: stringresponses:'200':- description: 'Get all executions for a scheduled task.'+ description: 'Get server by UUID'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/ScheduledTaskExecution'+ $ref: '#/components/schemas/Server''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- '/services/{uuid}/scheduled-tasks':- get:+ delete:tags:- - 'Scheduled Tasks'- summary: 'List Tasks'- description: 'List all scheduled tasks for a service.'- operationId: list-scheduled-tasks-by-service-uuid+ - Servers+ summary: Delete+ description: 'Delete server by UUID.'+ operationId: delete-server-by-uuidparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'UUID of the server.'required: trueschema:type: stringresponses:'200':- description: 'Get all scheduled tasks for a service.'+ description: 'Server deleted.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/ScheduledTask'+ properties:+ message: { type: string, example: 'Server deleted.' }+ type: object'401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- post:+ patch:tags:- - 'Scheduled Tasks'- summary: 'Create Task'- description: 'Create a new scheduled task for a service.'- operationId: create-scheduled-task-by-service-uuid+ - Servers+ summary: Update+ description: 'Update Server.'+ operationId: update-server-by-uuidparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Server UUID'required: trueschema:type: stringrequestBody:- description: 'Scheduled task data'+ description: 'Server updated.'required: truecontent:application/json:schema:- required:- - name- - command- - frequencyproperties:name:type: string- description: 'The name of the scheduled task.'- command:- type: string- description: 'The command to execute.'- frequency:+ description: 'The name of the server.'+ description:type: string- description: 'The frequency of the scheduled task.'- container:+ description: 'The description of the server.'+ ip:type: string- nullable: true- description: 'The container where the command should be executed.'- timeout:+ description: 'The IP of the server.'+ port:type: integer- description: 'The timeout of the scheduled task in seconds.'- default: 300- enabled:+ description: 'The port of the server.'+ user:+ type: string+ description: 'The user of the server.'+ private_key_uuid:+ type: string+ description: 'The UUID of the private key.'+ is_build_server:type: boolean- description: 'The flag to indicate if the scheduled task is enabled.'- default: true+ description: 'Is build server.'+ instant_validate:+ type: boolean+ description: 'Instant validate.'+ proxy_type:+ type: string+ enum: [traefik, caddy, none]+ description: 'The proxy type.'+ concurrent_builds:+ type: integer+ description: 'Number of concurrent builds.'+ dynamic_timeout:+ type: integer+ description: 'Deployment timeout in seconds.'+ deployment_queue_limit:+ type: integer+ description: 'Maximum number of queued deployments.'+ server_disk_usage_notification_threshold:+ type: integer+ description: 'Server disk usage notification threshold (%).'+ server_disk_usage_check_frequency:+ type: string+ description: 'Cron expression for disk usage check frequency.'+ connection_timeout:+ type: integer+ description: 'SSH connection timeout in seconds (1-300). Default: 10.'type: objectresponses:'201':- description: 'Scheduled task created.'+ description: 'Server updated.'content:application/json:schema:- $ref: '#/components/schemas/ScheduledTask'+ $ref: '#/components/schemas/Server''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -7325,103 +10067,109 @@ paths:security:-bearerAuth: []- '/services/{uuid}/scheduled-tasks/{task_uuid}':- delete:+ '/servers/{uuid}/resources':+ get:tags:- - 'Scheduled Tasks'- summary: 'Delete Task'- description: 'Delete a scheduled task for a service.'- operationId: delete-scheduled-task-by-service-uuid+ - Servers+ summary: Resources+ description: 'Get resources by server.'+ operationId: get-resources-by-server-uuidparameters:-name: uuidin: path- description: 'UUID of the service.'- required: true- schema:- type: string- -- name: task_uuid- in: path- description: 'UUID of the scheduled task.'+ description: "Server's UUID"required: trueschema:type: stringresponses:'200':- description: 'Scheduled task deleted.'+ description: 'Get resources by server'content:application/json:schema:- properties:- message: { type: string, example: 'Scheduled task deleted.' }- type: object+ type: array+ items:+ properties: { id: { type: integer }, uuid: { type: string }, name: { type: string }, type: { type: string }, created_at: { type: string }, updated_at: { type: string }, status: { type: string } }+ type: object'401':$ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'+ '400':+ $ref: '#/components/responses/400'security:-bearerAuth: []- patch:+ '/servers/{uuid}/domains':+ get:tags:- - 'Scheduled Tasks'- summary: 'Update Task'- description: 'Update a scheduled task for a service.'- operationId: update-scheduled-task-by-service-uuid+ - Servers+ summary: Domains+ description: 'Get domains by server.'+ operationId: get-domains-by-server-uuidparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: "Server's UUID"required: trueschema:type: string+ responses:+ '200':+ description: 'Get domains by server'+ content:+ application/json:+ schema:+ type: array+ items:+ properties: { ip: { type: string }, domains: { type: array, items: { type: string } } }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:-- name: task_uuid+ bearerAuth: []+ '/servers/{uuid}/validate':+ post:+ tags:+ - Servers+ summary: Validate+ description: 'Validate server by UUID.'+ operationId: validate-server-by-uuid+ parameters:+ -+ name: uuidin: path- description: 'UUID of the scheduled task.'+ description: 'Server UUID'required: trueschema:type: stringrequestBody:- description: 'Scheduled task data'- required: true+ required: falsecontent:application/json:schema:properties:- name:- type: string- description: 'The name of the scheduled task.'- command:- type: string- description: 'The command to execute.'- frequency:- type: string- description: 'The frequency of the scheduled task.'- container:- type: string- nullable: true- description: 'The container where the command should be executed.'- timeout:- type: integer- description: 'The timeout of the scheduled task in seconds.'- default: 300- enabled:+ install:+ description: 'Install missing prerequisites and Docker. This can restart the Docker daemon.'type: boolean- description: 'The flag to indicate if the scheduled task is enabled.'- default: true+ default: falsetype: objectresponses:- '200':- description: 'Scheduled task updated.'+ '201':+ description: 'Server validation started.'content:application/json:schema:- $ref: '#/components/schemas/ScheduledTask'+ properties:+ message: { type: string, example: 'Validation started.' }+ type: object'401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -7429,37 +10177,30 @@ paths:security:-bearerAuth: []- '/services/{uuid}/scheduled-tasks/{task_uuid}/executions':+ '/services/{uuid}/applications':get:tags:- - 'Scheduled Tasks'- summary: 'List Executions'- description: 'List all executions for a scheduled task on a service.'- operationId: list-scheduled-task-executions-by-service-uuid+ - 'Service applications'+ summary: 'List service applications'+ description: 'List compose service applications (containers) for a single service.'+ operationId: list-service-applications-by-service-uuidparameters:-name: uuidin: path- description: 'UUID of the service.'- required: true- schema:- type: string- -- name: task_uuid- in: path- description: 'UUID of the scheduled task.'+ description: 'Service UUID.'required: trueschema:type: stringresponses:'200':- description: 'Get all executions for a scheduled task.'+ description: 'Service applications for this service.'content:application/json:schema:type: arrayitems:- $ref: '#/components/schemas/ScheduledTaskExecution'+ type: object'401':$ref: '#/components/responses/401''404':@@ -7467,1029 +10208,1159 @@ paths:security:-bearerAuth: []- /security/keys:+ '/services/{uuid}/applications/{app_uuid}':get:tags:- - 'Private Keys'- summary: List- description: 'List all private keys.'- operationId: list-private-keys- responses:- '200':- description: 'Get all private keys.'- content:- application/json:- schema:- type: array- items:- $ref: '#/components/schemas/PrivateKey'- '401':- $ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- security:+ - 'Service applications'+ summary: 'Get service application'+ description: 'Get a single compose service application by service UUID and application UUID.'+ operationId: get-service-application-by-service-and-app-uuid+ parameters:-- bearerAuth: []- post:- tags:- - 'Private Keys'- summary: Create- description: 'Create a new private key.'- operationId: create-private-key- requestBody:- required: true- content:- application/json:- schema:- required:- - private_key- properties:- name:- type: string- description:- type: string- private_key:- type: string- type: object- additionalProperties: false+ name: uuid+ in: path+ description: 'Service UUID.'+ required: true+ schema:+ type: string+ -+ name: app_uuid+ in: path+ description: 'Service application UUID.'+ required: true+ schema:+ type: stringresponses:- '201':- description: "The created private key's UUID."+ '200':+ description: 'Service application.'content:application/json:schema:- properties:- uuid: { type: string }type: object'401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- '422':- $ref: '#/components/responses/422'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []patch:tags:- - 'Private Keys'- summary: Update- description: 'Update a private key.'- operationId: update-private-key+ - 'Service applications'+ summary: 'Update service application'+ description: 'Update fields for a compose service application. Use `url` for comma-separated public URLs (same rules as `urls[].url` on PATCH /services/{uuid}).'+ operationId: patch-service-application-by-service-and-app-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Service UUID.'+ required: true+ schema:+ type: string+ -+ name: app_uuid+ in: path+ description: 'Service application UUID.'+ required: true+ schema:+ type: string+ -+ name: force_domain_override+ in: query+ description: 'When true, allow duplicate URLs in the request and proceed despite domain conflicts (same as service PATCH).'+ required: false+ schema:+ type: boolean+ default: falserequestBody:- required: truecontent:application/json:schema:- required:- - private_keyproperties:- name:- type: string+ url:+ description: 'Comma-separated list of URLs (e.g. "http://app.example.com:8080,https://app2.example.com"). Stored as fqdn.'+ type: [string, 'null']+ human_name:+ type: [string, 'null']description:- type: string- private_key:- type: string+ type: [string, 'null']+ image:+ type: [string, 'null']+ exclude_from_status:+ type: [boolean, 'null']+ is_log_drain_enabled:+ type: [boolean, 'null']+ is_gzip_enabled:+ type: [boolean, 'null']+ is_stripprefix_enabled:+ type: [boolean, 'null']type: object- additionalProperties: falseresponses:- '201':- description: "The updated private key's UUID."+ '200':+ description: 'Updated service application.'content:application/json:schema:- properties:- uuid: { type: string }type: object'401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '409':+ description: 'Domain conflicts (unless force_domain_override).''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/security/keys/{uuid}':+ '/services/{uuid}/applications/{app_uuid}/logs':get:tags:- - 'Private Keys'- summary: Get- description: 'Get key by UUID.'- operationId: get-private-key-by-uuid+ - 'Service applications'+ summary: 'Get service application logs'+ description: 'Get Docker logs for a single compose service container.'+ operationId: get-service-application-logs-by-service-and-app-uuidparameters:-name: uuidin: path- description: 'Private Key UUID'+ description: 'Service UUID.'+ required: true+ schema:+ type: string+ -+ name: app_uuid+ in: path+ description: 'Service application UUID.'required: trueschema:type: string+ -+ name: lines+ in: query+ description: 'Number of lines to show from the end of the logs.'+ required: false+ schema:+ type: integer+ format: int32+ default: 100responses:'200':- description: 'Get all private keys.'+ description: Logs.content:application/json:schema:- $ref: '#/components/schemas/PrivateKey'- '401':- $ref: '#/components/responses/401'+ properties:+ logs: { type: string }+ type: object'400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''404':- description: 'Private Key not found.'+ $ref: '#/components/responses/404'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- delete:+ post:tags:- - 'Private Keys'- summary: Delete- description: 'Delete a private key.'- operationId: delete-private-key-by-uuid+ - 'Service applications'+ summary: 'Get service application logs'+ description: 'Get Docker logs for a single compose service container.'+ operationId: post-service-application-logs-by-service-and-app-uuidparameters:-name: uuidin: path- description: 'Private Key UUID'required: trueschema:type: string+ -+ name: app_uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: lines+ in: query+ required: false+ schema:+ type: integer+ format: int32+ default: 100responses:'200':- description: 'Private Key deleted.'+ description: Logs.content:application/json:schema:properties:- message: { type: string, example: 'Private Key deleted.' }+ logs: { type: string }type: object- '401':- $ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- description: 'Private Key not found.'- '422':- description: 'Private Key is in use and cannot be deleted.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Private Key is in use and cannot be deleted.' }- type: object- security:- -- bearerAuth: []- /servers:- get:- tags:- - Servers- summary: List- description: 'List all servers.'- operationId: list-servers- responses:- '200':- description: 'Get all servers.'- content:- application/json:- schema:- type: array- items:- $ref: '#/components/schemas/Server''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []+ '/services/{uuid}/applications/{app_uuid}/start':post:tags:- - Servers- summary: Create- description: 'Create Server.'- operationId: create-server- requestBody:- description: 'Server created.'- required: true- content:- application/json:- schema:- properties:- name:- type: string- example: 'My Server'- description: 'The name of the server.'- description:- type: string- example: 'My Server Description'- description: 'The description of the server.'- ip:- type: string- example: 127.0.0.1- description: 'The IP of the server.'- port:- type: integer- example: 22- description: 'The port of the server.'- user:- type: string- example: root- description: 'The user of the server.'- private_key_uuid:- type: string- example: og888os- description: 'The UUID of the private key.'- is_build_server:- type: boolean- example: false- description: 'Is build server.'- instant_validate:- type: boolean- example: false- description: 'Instant validate.'- proxy_type:- type: string- enum: [traefik, caddy, none]- example: traefik- description: 'The proxy type.'- type: object+ - 'Service applications'+ summary: 'Start or redeploy service application container'+ description: 'Runs docker compose up for a single compose service (no-deps), optionally pulling the image and rebuilding.'+ operationId: post-start-service-application-by-service-and-app-uuid+ parameters:+ -+ name: uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: app_uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: force+ in: query+ required: false+ schema:+ type: boolean+ default: false+ -+ name: latest+ in: query+ required: false+ schema:+ type: boolean+ default: falseresponses:- '201':- description: 'Server created.'+ '200':+ description: 'Deploy request queued.'content:application/json:schema:properties:- uuid: { type: string, example: og888os, description: 'The UUID of the server.' }+ message: { type: string }type: object- '401':- $ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- '/servers/{uuid}':- get:+ '/services/{uuid}/applications/{app_uuid}/restart':+ post:tags:- - Servers- summary: Get- description: 'Get server by UUID.'- operationId: get-server-by-uuid+ - 'Service applications'+ summary: 'Restart service application container'+ description: 'Restarts a single compose service container.'+ operationId: post-restart-service-application-by-service-and-app-uuidparameters:-name: uuidin: path- description: "Server's UUID"+ required: true+ schema:+ type: string+ -+ name: app_uuid+ in: pathrequired: trueschema:type: stringresponses:'200':- description: 'Get server by UUID'+ description: 'Restart queued.'content:application/json:schema:- $ref: '#/components/schemas/Server'- '401':- $ref: '#/components/responses/401'+ properties:+ message: { type: string }+ type: object'400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- delete:+ '/services/{uuid}/applications/{app_uuid}/stop':+ post:tags:- - Servers- summary: Delete- description: 'Delete server by UUID.'- operationId: delete-server-by-uuid+ - 'Service applications'+ summary: 'Stop service application container'+ description: 'Stops a single compose service container.'+ operationId: post-stop-service-application-by-service-and-app-uuidparameters:-name: uuidin: path- description: 'UUID of the server.'+ required: true+ schema:+ type: string+ -+ name: app_uuid+ in: pathrequired: trueschema:type: stringresponses:'200':- description: 'Server deleted.'+ description: 'Stop queued.'content:application/json:schema:properties:- message: { type: string, example: 'Server deleted.' }+ message: { type: string }type: object- '401':- $ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- patch:+ '/services/{uuid}/databases':+ get:tags:- - Servers- summary: Update- description: 'Update Server.'- operationId: update-server-by-uuid+ - 'Service databases'+ summary: 'List service databases'+ description: 'List compose databases for a single service.'+ operationId: list-service-databases-by-service-uuidparameters:-name: uuidin: path- description: 'Server UUID'+ description: 'Service UUID.'required: trueschema:type: string- requestBody:- description: 'Server updated.'- required: true- content:- application/json:- schema:- properties:- name:- type: string- description: 'The name of the server.'- description:- type: string- description: 'The description of the server.'- ip:- type: string- description: 'The IP of the server.'- port:- type: integer- description: 'The port of the server.'- user:- type: string- description: 'The user of the server.'- private_key_uuid:- type: string- description: 'The UUID of the private key.'- is_build_server:- type: boolean- description: 'Is build server.'- instant_validate:- type: boolean- description: 'Instant validate.'- proxy_type:- type: string- enum: [traefik, caddy, none]- description: 'The proxy type.'- concurrent_builds:- type: integer- description: 'Number of concurrent builds.'- dynamic_timeout:- type: integer- description: 'Deployment timeout in seconds.'- deployment_queue_limit:- type: integer- description: 'Maximum number of queued deployments.'- server_disk_usage_notification_threshold:- type: integer- description: 'Server disk usage notification threshold (%).'- server_disk_usage_check_frequency:- type: string- description: 'Cron expression for disk usage check frequency.'- connection_timeout:- type: integer- description: 'SSH connection timeout in seconds (1-300). Default: 10.'- type: objectresponses:- '201':- description: 'Server updated.'+ '200':+ description: 'Service databases.'content:application/json:schema:- $ref: '#/components/schemas/Server'+ type: array+ items:+ type: object'401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- '/servers/{uuid}/resources':+ '/services/{uuid}/databases/{database_uuid}':get:tags:- - Servers- summary: Resources- description: 'Get resources by server.'- operationId: get-resources-by-server-uuid+ - 'Service databases'+ summary: 'Get service database'+ description: 'Get a compose database by service UUID and database UUID.'+ operationId: get-service-database-by-service-and-database-uuidparameters:-name: uuidin: path- description: "Server's UUID"+ description: 'Service UUID.'+ required: true+ schema:+ type: string+ -+ name: database_uuid+ in: path+ description: 'Service database UUID.'required: trueschema:type: stringresponses:'200':- description: 'Get resources by server'+ description: 'Service database.'content:application/json:schema:- type: array- items:- properties: { id: { type: integer }, uuid: { type: string }, name: { type: string }, type: { type: string }, created_at: { type: string }, updated_at: { type: string }, status: { type: string } }- type: object+ type: object'401':$ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ patch:+ tags:+ - 'Service databases'+ summary: 'Update service database'+ description: 'Update mutable fields for a compose service database.'+ operationId: patch-service-database-by-service-and-database-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Service UUID.'+ required: true+ schema:+ type: string+ -+ name: database_uuid+ in: path+ description: 'Service database UUID.'+ required: true+ schema:+ type: string+ requestBody:+ content:+ application/json:+ schema:+ properties:+ human_name:+ type: [string, 'null']+ description:+ type: [string, 'null']+ image:+ type: string+ exclude_from_status:+ type: boolean+ is_log_drain_enabled:+ type: boolean+ is_public:+ type: boolean+ public_port:+ type: [integer, 'null']+ maximum: 65535+ minimum: 1+ public_port_timeout:+ type: [integer, 'null']+ minimum: 1+ type: object+ additionalProperties: false+ responses:+ '200':+ description: 'Updated service database.'+ content:+ application/json:+ schema:+ type: object'400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/servers/{uuid}/domains':+ '/services/{uuid}/databases/{database_uuid}/logs':get:tags:- - Servers- summary: Domains- description: 'Get domains by server.'- operationId: get-domains-by-server-uuid+ - 'Service databases'+ summary: 'Get service database logs'+ description: 'Get Docker logs for a compose database container.'+ operationId: get-service-database-logs-by-service-and-database-uuidparameters:-name: uuidin: path- description: "Server's UUID"required: trueschema:type: string+ -+ name: database_uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: lines+ in: query+ required: false+ schema:+ type: integer+ format: int32+ default: 100responses:'200':- description: 'Get domains by server'+ description: Logs.content:application/json:schema:- type: array- items:- properties: { ip: { type: string }, domains: { type: array, items: { type: string } } }- type: object- '401':- $ref: '#/components/responses/401'+ properties:+ logs: { type: string }+ type: object'400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- '/servers/{uuid}/validate':+ '/services/{uuid}/databases/{database_uuid}/start':post:tags:- - Servers- summary: Validate- description: 'Validate server by UUID.'- operationId: validate-server-by-uuid+ - 'Service databases'+ summary: 'Start or redeploy service database container'+ description: 'Run docker compose up for a single compose database.'+ operationId: start-service-database-by-service-and-database-uuidparameters:-name: uuidin: path- description: 'Server UUID'required: trueschema:type: string- requestBody:- required: false- content:- application/json:- schema:- properties:- install:- description: 'Install missing prerequisites and Docker. This can restart the Docker daemon.'- type: boolean- default: false- type: object+ -+ name: database_uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: force+ in: query+ required: false+ schema:+ type: boolean+ default: false+ -+ name: latest+ in: query+ required: false+ schema:+ type: boolean+ default: falseresponses:- '201':- description: 'Server validation started.'+ '200':+ description: 'Deploy request queued.'content:application/json:schema:properties:- message: { type: string, example: 'Validation started.' }+ message: { type: string }type: object- '401':- $ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- '/services/{uuid}/applications':- get:+ '/services/{uuid}/databases/{database_uuid}/restart':+ post:tags:- - 'Service applications'- summary: 'List service applications'- description: 'List compose service applications (containers) for a single service.'- operationId: list-service-applications-by-service-uuid+ - 'Service databases'+ summary: 'Restart service database container'+ description: 'Restart a compose database container.'+ operationId: restart-service-database-by-service-and-database-uuidparameters:-name: uuidin: path- description: 'Service UUID.'+ required: true+ schema:+ type: string+ -+ name: database_uuid+ in: pathrequired: trueschema:type: stringresponses:'200':- description: 'Service applications for this service.'+ description: 'Restart queued.'content:application/json:schema:- type: array- items:- type: object+ properties:+ message: { type: string }+ type: object+ '400':+ $ref: '#/components/responses/400''401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- '/services/{uuid}/applications/{app_uuid}':- get:+ '/services/{uuid}/databases/{database_uuid}/stop':+ post:tags:- - 'Service applications'- summary: 'Get service application'- description: 'Get a single compose service application by service UUID and application UUID.'- operationId: get-service-application-by-service-and-app-uuid+ - 'Service databases'+ summary: 'Stop service database container'+ description: 'Stop a compose database container.'+ operationId: stop-service-database-by-service-and-database-uuidparameters:-name: uuidin: path- description: 'Service UUID.'required: trueschema:type: string-- name: app_uuid+ name: database_uuidin: path- description: 'Service application UUID.'required: trueschema:type: stringresponses:'200':- description: 'Service application.'+ description: 'Stop queued.'content:application/json:schema:+ properties:+ message: { type: string }type: object+ '400':+ $ref: '#/components/responses/400''401':$ref: '#/components/responses/401''404':$ref: '#/components/responses/404'+ '501':+ description: 'Swarm not supported.'security:-bearerAuth: []- patch:+ /services:+ get:tags:- - 'Service applications'- summary: 'Update service application'- description: 'Update fields for a compose service application. Use `url` for comma-separated public URLs (same rules as `urls[].url` on PATCH /services/{uuid}).'- operationId: patch-service-application-by-service-and-app-uuid- parameters:- -- name: uuid- in: path- description: 'Service UUID.'- required: true- schema:- type: string- -- name: app_uuid- in: path- description: 'Service application UUID.'- required: true- schema:- type: string+ - Services+ summary: List+ description: 'List all services.'+ operationId: list-services+ responses:+ '200':+ description: 'Get all services'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Service'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ security:-- name: force_domain_override- in: query- description: 'When true, allow duplicate URLs in the request and proceed despite domain conflicts (same as service PATCH).'- required: false- schema:- type: boolean- default: false+ bearerAuth: []+ post:+ tags:+ - Services+ summary: 'Create service'+ description: 'Create a one-click / custom service'+ operationId: create-servicerequestBody:+ required: truecontent:application/json:schema:+ required:+ - server_uuid+ - project_uuid+ - environment_name+ - environment_uuidproperties:- url:- description: 'Comma-separated list of URLs (e.g. "http://app.example.com:8080,https://app2.example.com"). Stored as fqdn.'- type: [string, 'null']- human_name:- type: [string, 'null']+ type:+ description: 'The one-click service type (e.g. "actualbudget", "calibre-web", "gitea-with-mysql" ...)'+ type: string+ name:+ type: string+ maxLength: 255+ description: 'Name of the service.'description:- type: [string, 'null']- image:- type: [string, 'null']- exclude_from_status:- type: [boolean, 'null']- is_log_drain_enabled:- type: [boolean, 'null']- is_gzip_enabled:- type: [boolean, 'null']- is_stripprefix_enabled:- type: [boolean, 'null']+ type: string+ nullable: true+ description: 'Description of the service.'+ project_uuid:+ type: string+ description: 'Project UUID.'+ environment_name:+ type: string+ description: 'Environment name. You need to provide at least one of environment_name or environment_uuid.'+ environment_uuid:+ type: string+ description: 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'+ server_uuid:+ type: string+ description: 'Server UUID.'+ destination_uuid:+ type: string+ description: 'Destination UUID. Required if server has multiple destinations.'+ instant_deploy:+ type: boolean+ default: false+ description: 'Start the service immediately after creation.'+ docker_compose_raw:+ type: string+ description: 'The base64 encoded Docker Compose content.'+ urls:+ type: array+ description: 'Array of URLs to be applied to containers of a service.'+ items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, url: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io").' } }, type: object }+ force_domain_override:+ type: boolean+ default: false+ description: 'Force domain override even if conflicts are detected.'+ is_container_label_escape_enabled:+ type: boolean+ default: true+ description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off.'+ tags:+ type: array+ items: { type: string }+ description: 'Tags to assign to the service.'type: objectresponses:- '200':- description: 'Updated service application.'+ '201':+ description: 'Service created successfully.'content:application/json:schema:+ properties:+ uuid: { type: string, description: 'Service UUID.' }+ domains: { type: array, items: { type: string }, description: 'Service domains.' }type: object'401':$ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'+ '400':+ $ref: '#/components/responses/400''409':- description: 'Domain conflicts (unless force_domain_override).'+ description: 'Domain conflicts detected.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }+ warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }+ conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }+ type: object'422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/applications/{app_uuid}/logs':+ '/services/{uuid}':get:tags:- - 'Service applications'- summary: 'Get service application logs'- description: 'Get Docker logs for a single compose service container.'- operationId: get-service-application-logs-by-service-and-app-uuid+ - Services+ summary: Get+ description: 'Get service by UUID.'+ operationId: get-service-by-uuidparameters:-name: uuidin: path- description: 'Service UUID.'- required: true- schema:- type: string- -- name: app_uuid- in: path- description: 'Service application UUID.'+ description: 'Service UUID'required: trueschema:type: string- -- name: lines- in: query- description: 'Number of lines to show from the end of the logs.'- required: false- schema:- type: integer- format: int32- default: 100responses:'200':- description: Logs.+ description: 'Get a service by UUID.'content:application/json:schema:- properties:- logs: { type: string }- type: object- '400':- $ref: '#/components/responses/400'+ $ref: '#/components/schemas/Service''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'security:-bearerAuth: []- post:+ delete:tags:- - 'Service applications'- summary: 'Get service application logs'- description: 'Get Docker logs for a single compose service container.'- operationId: post-service-application-logs-by-service-and-app-uuid+ - Services+ summary: Delete+ description: 'Delete service by UUID.'+ operationId: delete-service-by-uuidparameters:-name: uuidin: path+ description: 'Service UUID'required: trueschema:type: string-- name: app_uuid- in: path- required: true- schema:- type: string- -- name: lines+ name: delete_configurationsin: query+ description: 'Delete configurations.'required: falseschema:- type: integer- format: int32- default: 100- responses:- '200':- description: Logs.- content:- application/json:- schema:- properties:- logs: { type: string }- type: object- '400':- $ref: '#/components/responses/400'- '401':- $ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'- security:- -- bearerAuth: []- '/services/{uuid}/applications/{app_uuid}/start':- post:- tags:- - 'Service applications'- summary: 'Start or redeploy service application container'- description: 'Runs docker compose up for a single compose service (no-deps), optionally pulling the image and rebuilding.'- operationId: post-start-service-application-by-service-and-app-uuid- parameters:- -- name: uuid- in: path- required: true- schema:- type: string+ type: boolean+ default: true-- name: app_uuid- in: path- required: true+ name: delete_volumes+ in: query+ description: 'Delete volumes.'+ required: falseschema:- type: string+ type: boolean+ default: true-- name: force+ name: docker_cleanupin: query+ description: 'Run docker cleanup.'required: falseschema:type: boolean- default: false+ default: true-- name: latest+ name: delete_connected_networksin: query+ description: 'Delete connected networks.'required: falseschema:type: boolean- default: false+ default: trueresponses:'200':- description: 'Deploy request queued.'+ description: 'Delete a service by UUID'content:application/json:schema:properties:- message: { type: string }+ message: { type: string, example: 'Service deletion request queued.' }type: object- '400':- $ref: '#/components/responses/400''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'security:-bearerAuth: []- '/services/{uuid}/applications/{app_uuid}/restart':- post:+ patch:tags:- - 'Service applications'- summary: 'Restart service application container'- description: 'Restarts a single compose service container.'- operationId: post-restart-service-application-by-service-and-app-uuid+ - Services+ summary: Update+ description: 'Update service by UUID.'+ operationId: update-service-by-uuidparameters:-name: uuidin: path+ description: 'UUID of the service.'required: trueschema:type: string- -- name: app_uuid- in: path- required: true- schema:- type: string+ requestBody:+ description: 'Service updated.'+ required: true+ content:+ application/json:+ schema:+ properties:+ name:+ type: string+ description: 'The service name.'+ description:+ type: string+ description: 'The service description.'+ instant_deploy:+ type: boolean+ description: 'The flag to indicate if the service should be deployed instantly.'+ connect_to_docker_network:+ type: boolean+ default: false+ description: 'Connect the service to the predefined docker network.'+ docker_compose_raw:+ type: string+ description: 'The base64 encoded Docker Compose content.'+ urls:+ type: array+ description: 'Array of URLs to be applied to containers of a service.'+ items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, url: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io").' } }, type: object }+ force_domain_override:+ type: boolean+ default: false+ description: 'Force domain override even if conflicts are detected.'+ is_container_label_escape_enabled:+ type: boolean+ default: true+ description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off.'+ type: objectresponses:'200':- description: 'Restart queued.'+ description: 'Service updated.'content:application/json:schema:properties:- message: { type: string }+ uuid: { type: string, description: 'Service UUID.' }+ domains: { type: array, items: { type: string }, description: 'Service domains.' }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '409':+ description: 'Domain conflicts detected.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }+ warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }+ conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }type: object- '400':- $ref: '#/components/responses/400'- '401':- $ref: '#/components/responses/401'- '404':- $ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/applications/{app_uuid}/stop':- post:+ '/services/{uuid}/logs':+ get:tags:- - 'Service applications'- summary: 'Stop service application container'- description: 'Stops a single compose service container.'- operationId: post-stop-service-application-by-service-and-app-uuid+ - Services+ summary: 'Get service logs.'+ description: 'Get logs for a specific service sub-resource by service UUID. The `sub_service_name` query parameter must match the `name` field of one of the service applications or databases returned by `GET /services/{uuid}`.'+ operationId: get-service-logs-by-uuidparameters:-name: uuidin: path+ description: 'UUID of the service.'required: trueschema:type: string+ format: uuid-- name: app_uuid- in: path+ name: sub_service_name+ in: query+ description: 'Sub-service name from `GET /services/{uuid}` under `applications[].name` or `databases[].name`. Do not use `human_name` or the Docker container name with the service UUID suffix.'required: trueschema:type: string+ example: appwrite-console+ -+ name: lines+ in: query+ description: 'Number of lines to show from the end of the logs.'+ required: false+ schema:+ type: integer+ format: int32+ default: 100+ -+ name: show_timestamps+ in: query+ description: 'Show timestamps in the logs.'+ required: false+ schema:+ type: boolean+ default: falseresponses:'200':- description: 'Stop queued.'+ description: 'Get service logs by UUID.'content:application/json:schema:properties:- message: { type: string }+ logs: { type: string }type: object- '400':- $ref: '#/components/responses/400''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'security:-bearerAuth: []- '/services/{uuid}/databases':+ '/services/{uuid}/envs':get:tags:- - 'Service databases'- summary: 'List service databases'- description: 'List compose databases for a single service.'- operationId: list-service-databases-by-service-uuid+ - Services+ summary: 'List Envs'+ description: 'List all envs by service UUID.'+ operationId: list-envs-by-service-uuidparameters:-name: uuidin: path- description: 'Service UUID.'+ description: 'UUID of the service.'required: trueschema:type: stringresponses:'200':- description: 'Service databases.'+ description: 'All environment variables by service UUID.'content:application/json:schema:type: arrayitems:- type: object+ $ref: '#/components/schemas/EnvironmentVariable''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- '/services/{uuid}/databases/{database_uuid}':- get:+ post:tags:- - 'Service databases'- summary: 'Get service database'- description: 'Get a compose database by service UUID and database UUID.'- operationId: get-service-database-by-service-and-database-uuid+ - Services+ summary: 'Create Env'+ description: 'Create env by service UUID.'+ operationId: create-env-by-service-uuidparameters:-name: uuidin: path- description: 'Service UUID.'- required: true- schema:- type: string- -- name: database_uuid- in: path- description: 'Service database UUID.'+ description: 'UUID of the service.'required: trueschema:type: string+ requestBody:+ description: 'Env created.'+ required: true+ content:+ application/json:+ schema:+ properties:+ key:+ type: string+ description: 'The key of the environment variable.'+ value:+ type: string+ description: 'The value of the environment variable.'+ is_preview:+ type: boolean+ description: 'The flag to indicate if the environment variable is used in preview deployments.'+ is_literal:+ type: boolean+ description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'+ is_multiline:+ type: boolean+ description: 'The flag to indicate if the environment variable is multiline.'+ is_shown_once:+ type: boolean+ description: "The flag to indicate if the environment variable's value is shown on the UI."+ type: objectresponses:- '200':- description: 'Service database.'+ '201':+ description: 'Environment variable created.'content:application/json:schema:+ properties:+ uuid: { type: string, example: nc0k04gk8g0cgsk440g0koko }type: object'401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []patch:tags:- - 'Service databases'- summary: 'Update service database'- description: 'Update mutable fields for a compose service database.'- operationId: patch-service-database-by-service-and-database-uuid+ - Services+ summary: 'Update Env'+ description: 'Update env by service UUID.'+ operationId: update-env-by-service-uuidparameters:-name: uuidin: path- description: 'Service UUID.'- required: true- schema:- type: string- -- name: database_uuid- in: path- description: 'Service database UUID.'+ description: 'UUID of the service.'required: trueschema:type: stringrequestBody:+ description: 'Env updated.'+ required: truecontent:application/json:schema:+ required:+ - key+ - valueproperties:- human_name:- type: [string, 'null']- description:- type: [string, 'null']- image:+ key:type: string- exclude_from_status:+ description: 'The key of the environment variable.'+ value:+ type: string+ description: 'The value of the environment variable.'+ is_preview:type: boolean- is_log_drain_enabled:+ description: 'The flag to indicate if the environment variable is used in preview deployments.'+ is_literal:type: boolean- is_public:+ description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'+ is_multiline:type: boolean- public_port:- type: [integer, 'null']- maximum: 65535- minimum: 1- public_port_timeout:- type: [integer, 'null']- minimum: 1+ description: 'The flag to indicate if the environment variable is multiline.'+ is_shown_once:+ type: boolean+ description: "The flag to indicate if the environment variable's value is shown on the UI."type: object- additionalProperties: falseresponses:- '200':- description: 'Updated service database.'+ '201':+ description: 'Environment variable updated.'content:application/json:schema:- type: object- '400':- $ref: '#/components/responses/400'+ $ref: '#/components/schemas/EnvironmentVariable''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -8497,329 +11368,283 @@ paths:security:-bearerAuth: []- '/services/{uuid}/databases/{database_uuid}/logs':- get:+ '/services/{uuid}/envs/bulk':+ patch:tags:- - 'Service databases'- summary: 'Get service database logs'- description: 'Get Docker logs for a compose database container.'- operationId: get-service-database-logs-by-service-and-database-uuid+ - Services+ summary: 'Update Envs (Bulk)'+ description: 'Update multiple envs by service UUID.'+ operationId: update-envs-by-service-uuidparameters:-name: uuidin: path+ description: 'UUID of the service.'required: trueschema:type: string- -- name: database_uuid- in: path- required: true- schema:- type: string- -- name: lines- in: query- required: false- schema:- type: integer- format: int32- default: 100+ requestBody:+ description: 'Bulk envs updated.'+ required: true+ content:+ application/json:+ schema:+ required:+ - data+ properties:+ data:+ type: array+ items: { properties: { key: { type: string, description: 'The key of the environment variable.' }, value: { type: string, description: 'The value of the environment variable.' }, is_preview: { type: boolean, description: 'The flag to indicate if the environment variable is used in preview deployments.' }, is_literal: { type: boolean, description: 'The flag to indicate if the environment variable is a literal, nothing espaced.' }, is_multiline: { type: boolean, description: 'The flag to indicate if the environment variable is multiline.' }, is_shown_once: { type: boolean, description: "The flag to indicate if the environment variable's value is shown on the UI." } }, type: object }+ type: objectresponses:- '200':- description: Logs.+ '201':+ description: 'Environment variables updated.'content:application/json:schema:- properties:- logs: { type: string }- type: object- '400':- $ref: '#/components/responses/400'+ type: array+ items:+ $ref: '#/components/schemas/EnvironmentVariable''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/databases/{database_uuid}/start':- post:+ '/services/{uuid}/envs/{env_uuid}':+ delete:tags:- - 'Service databases'- summary: 'Start or redeploy service database container'- description: 'Run docker compose up for a single compose database.'- operationId: start-service-database-by-service-and-database-uuid+ - Services+ summary: 'Delete Env'+ description: 'Delete env by UUID.'+ operationId: delete-env-by-service-uuidparameters:-name: uuidin: path+ description: 'UUID of the service.'required: trueschema:type: string-- name: database_uuid+ name: env_uuidin: path+ description: 'UUID of the environment variable.'required: trueschema:type: string- -- name: force- in: query- required: false- schema:- type: boolean- default: false- -- name: latest- in: query- required: false- schema:- type: boolean- default: falseresponses:'200':- description: 'Deploy request queued.'+ description: 'Environment variable deleted.'content:application/json:schema:properties:- message: { type: string }+ message: { type: string, example: 'Environment variable deleted.' }type: object- '400':- $ref: '#/components/responses/400''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'security:-bearerAuth: []- '/services/{uuid}/databases/{database_uuid}/restart':+ '/services/{uuid}/move':post:tags:- - 'Service databases'- summary: 'Restart service database container'- description: 'Restart a compose database container.'- operationId: restart-service-database-by-service-and-database-uuid+ - Services+ summary: Move+ description: 'Move service to another project/environment. This is a purely organizational change — running containers are not affected. Note: after moving, the service will pick up shared environment variables from the new environment on the next deployment.'+ operationId: move-service-by-uuidparameters:-name: uuidin: path+ description: 'UUID of the service.'required: trueschema:type: string- -- name: database_uuid- in: path- required: true- schema:- type: string+ requestBody:+ description: 'Target environment to move the service to.'+ required: true+ content:+ application/json:+ schema:+ required:+ - environment_uuid+ properties:+ environment_uuid:+ type: string+ description: 'UUID of the target environment.'+ type: objectresponses:'200':- description: 'Restart queued.'+ description: 'Service moved successfully.'content:application/json:schema:properties:- message: { type: string }+ message: { type: string, example: 'Service moved successfully.' }+ uuid: { type: string }+ project_uuid: { type: string }+ environment_uuid: { type: string }type: object- '400':- $ref: '#/components/responses/400''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/databases/{database_uuid}/stop':+ '/services/{uuid}/start':post:tags:- - 'Service databases'- summary: 'Stop service database container'- description: 'Stop a compose database container.'- operationId: stop-service-database-by-service-and-database-uuid+ - Services+ summary: Start+ description: 'Start service.'+ operationId: start-service-by-uuidparameters:-name: uuidin: path- required: true- schema:- type: string- -- name: database_uuid- in: path+ description: 'UUID of the service.'required: trueschema:type: stringresponses:'200':- description: 'Stop queued.'+ description: 'Start service.'content:application/json:schema:properties:- message: { type: string }+ message: { type: string, example: 'Service starting request queued.' }type: object- '400':- $ref: '#/components/responses/400''401':$ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '501':- description: 'Swarm not supported.'security:-bearerAuth: []- /services:- get:+ '/services/{uuid}/stop':+ post:tags:- Services- summary: List- description: 'List all services.'- operationId: list-services+ summary: Stop+ description: 'Stop service.'+ operationId: stop-service-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: true+ schema:+ type: string+ -+ name: docker_cleanup+ in: query+ description: 'Perform docker cleanup (prune networks, volumes, etc.).'+ schema:+ type: boolean+ default: trueresponses:'200':- description: 'Get all services'+ description: 'Stop service.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Service'+ properties:+ message: { type: string, example: 'Service stopping request queued.' }+ type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []+ '/services/{uuid}/restart':post:tags:- Services- summary: 'Create service'- description: 'Create a one-click / custom service'- operationId: create-service- requestBody:- required: true- content:- application/json:- schema:- required:- - server_uuid- - project_uuid- - environment_name- - environment_uuid- properties:- type:- description: 'The one-click service type (e.g. "actualbudget", "calibre-web", "gitea-with-mysql" ...)'- type: string- name:- type: string- maxLength: 255- description: 'Name of the service.'- description:- type: string- nullable: true- description: 'Description of the service.'- project_uuid:- type: string- description: 'Project UUID.'- environment_name:- type: string- description: 'Environment name. You need to provide at least one of environment_name or environment_uuid.'- environment_uuid:- type: string- description: 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'- server_uuid:- type: string- description: 'Server UUID.'- destination_uuid:- type: string- description: 'Destination UUID. Required if server has multiple destinations.'- instant_deploy:- type: boolean- default: false- description: 'Start the service immediately after creation.'- docker_compose_raw:- type: string- description: 'The base64 encoded Docker Compose content.'- urls:- type: array- description: 'Array of URLs to be applied to containers of a service.'- items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, url: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io").' } }, type: object }- force_domain_override:- type: boolean- default: false- description: 'Force domain override even if conflicts are detected.'- is_container_label_escape_enabled:- type: boolean- default: true- description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off.'- tags:- type: array- items: { type: string }- description: 'Tags to assign to the service.'- type: object+ summary: Restart+ description: 'Restart service.'+ operationId: restart-service-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: true+ schema:+ type: string+ -+ name: latest+ in: query+ description: 'Pull latest images.'+ schema:+ type: boolean+ default: falseresponses:- '201':- description: 'Service created successfully.'+ '200':+ description: 'Restart service.'content:application/json:schema:properties:- uuid: { type: string, description: 'Service UUID.' }- domains: { type: array, items: { type: string }, description: 'Service domains.' }+ message: { type: string, example: 'Service restaring request queued.' }type: object'401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '409':- description: 'Domain conflicts detected.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }- warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }- conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }- type: object- '422':- $ref: '#/components/responses/422'+ '404':+ $ref: '#/components/responses/404'security:-bearerAuth: []- '/services/{uuid}':+ '/services/{uuid}/storages':get:tags:- Services- summary: Get- description: 'Get service by UUID.'- operationId: get-service-by-uuid+ summary: 'List Storages'+ description: 'List all persistent storages and file storages by service UUID.'+ operationId: list-storages-by-service-uuidparameters:-name: uuidin: path- description: 'Service UUID'+ description: 'UUID of the service.'required: trueschema:type: stringresponses:'200':- description: 'Get a service by UUID.'+ description: 'All storages by service UUID.'content:application/json:schema:- $ref: '#/components/schemas/Service'+ properties:+ persistent_storages: { type: array, items: { type: object } }+ file_storages: { type: array, items: { type: object } }+ type: object'401':$ref: '#/components/responses/401''400':@@ -8829,60 +11654,65 @@ paths:security:-bearerAuth: []- delete:+ post:tags:- Services- summary: Delete- description: 'Delete service by UUID.'- operationId: delete-service-by-uuid+ summary: 'Create Storage'+ description: 'Create a persistent storage or file storage for a service sub-resource.'+ operationId: create-storage-by-service-uuidparameters:-name: uuidin: path- description: 'Service UUID'+ description: 'UUID of the service.'required: trueschema:type: string- -- name: delete_configurations- in: query- description: 'Delete configurations.'- required: false- schema:- type: boolean- default: true- -- name: delete_volumes- in: query- description: 'Delete volumes.'- required: false- schema:- type: boolean- default: true- -- name: docker_cleanup- in: query- description: 'Run docker cleanup.'- required: false- schema:- type: boolean- default: true- -- name: delete_connected_networks- in: query- description: 'Delete connected networks.'- required: false- schema:- type: boolean- default: true+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - type+ - mount_path+ - resource_uuid+ properties:+ type:+ type: string+ enum: [persistent, file]+ description: 'The type of storage.'+ resource_uuid:+ type: string+ description: 'UUID of the service application or database sub-resource.'+ name:+ type: string+ description: 'Volume name (persistent only, required for persistent).'+ mount_path:+ type: string+ description: 'The container mount path.'+ host_path:+ type: string+ nullable: true+ description: 'The host path (persistent only, optional).'+ content:+ type: string+ nullable: true+ description: 'File content (file only, optional).'+ is_directory:+ type: boolean+ description: 'Whether this is a directory mount (file only, default false).'+ fs_path:+ type: string+ description: 'Host directory path (required when is_directory is true).'+ type: object+ additionalProperties: falseresponses:- '200':- description: 'Delete a service by UUID'+ '201':+ description: 'Storage created.'content:application/json:schema:- properties:- message: { type: string, example: 'Service deletion request queued.' }type: object'401':$ref: '#/components/responses/401'@@ -8890,15 +11720,17 @@ paths:$ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []patch:tags:- Services- summary: Update- description: 'Update service by UUID.'- operationId: update-service-by-uuid+ summary: 'Update Storage'+ description: 'Update a persistent storage or file storage by service UUID.'+ operationId: update-storage-by-service-uuidparameters:-name: uuid@@ -8908,50 +11740,49 @@ paths:schema:type: stringrequestBody:- description: 'Service updated.'+ description: 'Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.'required: truecontent:application/json:schema:+ required:+ - typeproperties:- name:+ uuid:type: string- description: 'The service name.'- description:+ description: 'The UUID of the storage (preferred).'+ id:+ type: integer+ description: 'The ID of the storage (deprecated, use uuid instead).'+ type:type: string- description: 'The service description.'- instant_deploy:- type: boolean- description: 'The flag to indicate if the service should be deployed instantly.'- connect_to_docker_network:+ enum: [persistent, file]+ description: 'The type of storage: persistent or file.'+ is_preview_suffix_enabled:type: boolean- default: false- description: 'Connect the service to the predefined docker network.'- docker_compose_raw:+ description: 'Whether to add -pr-N suffix for preview deployments.'+ name:type: string- description: 'The base64 encoded Docker Compose content.'- urls:- type: array- description: 'Array of URLs to be applied to containers of a service.'- items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, url: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io").' } }, type: object }- force_domain_override:- type: boolean- default: false- description: 'Force domain override even if conflicts are detected.'- is_container_label_escape_enabled:- type: boolean- default: true- description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. If you want to use env variables inside the labels, turn this off.'+ description: 'The volume name (persistent only, not allowed for read-only storages).'+ mount_path:+ type: string+ description: 'The container mount path (not allowed for read-only storages).'+ host_path:+ type: string+ nullable: true+ description: 'The host path (persistent only, not allowed for read-only storages).'+ content:+ type: string+ nullable: true+ description: 'The file content (file only, not allowed for read-only storages).'type: object+ additionalProperties: falseresponses:'200':- description: 'Service updated.'+ description: 'Storage updated.'content:application/json:schema:- properties:- uuid: { type: string, description: 'Service UUID.' }- domains: { type: array, items: { type: string }, description: 'Service domains.' }type: object'401':$ref: '#/components/responses/401'@@ -8959,28 +11790,18 @@ paths:$ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '409':- description: 'Domain conflicts detected.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }- warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }- conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }- type: object'422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/logs':- get:+ '/services/{uuid}/storages/{storage_uuid}':+ delete:tags:- Services- summary: 'Get service logs.'- description: 'Get logs for a specific service sub-resource by service UUID. The `sub_service_name` query parameter must match the `name` field of one of the service applications or databases returned by `GET /services/{uuid}`.'- operationId: get-service-logs-by-uuid+ summary: 'Delete Storage'+ description: 'Delete a persistent storage or file storage by service UUID.'+ operationId: delete-storage-by-service-uuidparameters:-name: uuid@@ -8989,57 +11810,121 @@ paths:required: trueschema:type: string- format: uuid-- name: sub_service_name- in: query- description: 'Sub-service name from `GET /services/{uuid}` under `applications[].name` or `databases[].name`. Do not use `human_name` or the Docker container name with the service UUID suffix.'+ name: storage_uuid+ in: path+ description: 'UUID of the storage.'required: trueschema:type: string- example: appwrite-console+ responses:+ '200':+ description: 'Storage deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string }+ type: object+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:-- name: lines- in: query- description: 'Number of lines to show from the end of the logs.'- required: false+ bearerAuth: []+ '/services/{uuid}/tags':+ get:+ tags:+ - Services+ summary: 'List Tags'+ description: 'List tags for a service by UUID.'+ operationId: list-tags-by-service-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: trueschema:- type: integer- format: int32- default: 100+ type: string+ responses:+ '200':+ description: 'List of tags.'+ content:+ application/json:+ schema:+ type: array+ items:+ $ref: '#/components/schemas/Tag'+ '401':+ $ref: '#/components/responses/401'+ '400':+ $ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ security:-- name: show_timestamps- in: query- description: 'Show timestamps in the logs.'- required: false+ bearerAuth: []+ post:+ tags:+ - Services+ summary: 'Create Tag'+ description: 'Add tag(s) to a service by UUID.'+ operationId: create-tag-by-service-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'UUID of the service.'+ required: trueschema:- type: boolean- default: false+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ properties:+ tag_name:+ type: string+ description: 'The tag name (min 2 characters). Required if tag_names is not provided.'+ tag_names:+ type: array+ items: { type: string }+ description: 'Array of tag names (each min 2 characters). Required if tag_name is not provided.'+ type: objectresponses:- '200':- description: 'Get service logs by UUID.'+ '201':+ description: 'Tags added successfully.'content:application/json:schema:- properties:- logs: { type: string }- type: object+ type: array+ items:+ $ref: '#/components/schemas/Tag''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/envs':- get:+ '/services/{uuid}/tags/{tag_uuid}':+ delete:tags:- Services- summary: 'List Envs'- description: 'List all envs by service UUID.'- operationId: list-envs-by-service-uuid+ summary: 'Delete Tag'+ description: 'Remove a tag from a service by UUID.'+ operationId: delete-tag-by-service-uuidparameters:-name: uuid@@ -9048,15 +11933,16 @@ paths:required: trueschema:type: string+ -+ name: tag_uuid+ in: path+ description: 'UUID of the tag.'+ required: true+ schema:+ type: stringresponses:'200':- description: 'All environment variables by service UUID.'- content:- application/json:- schema:- type: array- items:- $ref: '#/components/schemas/EnvironmentVariable'+ description: 'Tag removed.''401':$ref: '#/components/responses/401''400':@@ -9066,12 +11952,13 @@ paths:security:-bearerAuth: []+ '/services/{uuid}/clone':post:tags:- Services- summary: 'Create Env'- description: 'Create env by service UUID.'- operationId: create-env-by-service-uuid+ summary: Clone+ description: 'Clone a service to a destination owned by the authenticated team.'+ operationId: clone-service-by-uuidparameters:-name: uuid@@ -9081,44 +11968,28 @@ paths:schema:type: stringrequestBody:- description: 'Env created.'required: truecontent:application/json:schema:+ required:+ - destination_uuidproperties:- key:- type: string- description: 'The key of the environment variable.'- value:+ destination_uuid:type: string- description: 'The value of the environment variable.'- is_preview:- type: boolean- description: 'The flag to indicate if the environment variable is used in preview deployments.'- is_literal:- type: boolean- description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'- is_multiline:- type: boolean- description: 'The flag to indicate if the environment variable is multiline.'- is_shown_once:+ name:+ type: [string, 'null']+ clone_volumes:type: boolean- description: "The flag to indicate if the environment variable's value is shown on the UI."+ default: falsetype: objectresponses:'201':- description: 'Environment variable created.'- content:- application/json:- schema:- properties:- uuid: { type: string, example: nc0k04gk8g0cgsk440g0koko }- type: object- '401':- $ref: '#/components/responses/401'+ description: 'Service cloned.''400':$ref: '#/components/responses/400'+ '401':+ $ref: '#/components/responses/401''404':$ref: '#/components/responses/404''422':@@ -9126,108 +11997,104 @@ paths:security:-bearerAuth: []- patch:+ /team/envs:+ get:tags:- - Services- summary: 'Update Env'- description: 'Update env by service UUID.'- operationId: update-env-by-service-uuid- parameters:+ - 'Shared Environment Variables'+ summary: 'List Team Shared Envs'+ description: 'List shared environment variables for the current team (type=team).'+ operationId: list-team-shared-envs+ responses:+ '200':+ description: 'Team shared environment variables.'+ '401':+ $ref: '#/components/responses/401'+ security:-- name: uuid- in: path- description: 'UUID of the service.'- required: true- schema:- type: string+ bearerAuth: []+ post:+ tags:+ - 'Shared Environment Variables'+ summary: 'Create Team Shared Env'+ description: 'Create a shared environment variable for the current team (type=team).'+ operationId: create-team-shared-envrequestBody:- description: 'Env updated.'required: truecontent:application/json:schema:required:- key- - valueproperties:key:type: string- description: 'The key of the environment variable.'value:- type: string- description: 'The value of the environment variable.'- is_preview:- type: boolean- description: 'The flag to indicate if the environment variable is used in preview deployments.'+ type: [string, 'null']is_literal:type: boolean- description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'is_multiline:type: boolean- description: 'The flag to indicate if the environment variable is multiline.'is_shown_once:type: boolean- description: "The flag to indicate if the environment variable's value is shown on the UI."+ comment:+ type: [string, 'null']type: objectresponses:'201':- description: 'Environment variable updated.'- content:- application/json:- schema:- $ref: '#/components/schemas/EnvironmentVariable'+ description: 'Environment variable created.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'+ '409':+ description: 'Environment variable already exists.''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/envs/bulk':+ '/team/envs/{env_id}':+ delete:+ tags:+ - 'Shared Environment Variables'+ summary: 'Delete Team Shared Env'+ description: 'Delete a team shared environment variable by id.'+ operationId: delete-team-shared-env+ parameters:+ -+ name: env_id+ in: path+ description: 'Shared env id (integer).'+ required: true+ schema:+ type: integer+ responses:+ '200':+ description: 'Environment variable deleted.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []patch:tags:- - Services- summary: 'Update Envs (Bulk)'- description: 'Update multiple envs by service UUID.'- operationId: update-envs-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'Update Team Shared Env'+ description: 'Update a team shared environment variable by id.'+ operationId: update-team-shared-envparameters:-- name: uuid+ name: env_idin: path- description: 'UUID of the service.'+ description: 'Shared env id (integer).'required: trueschema:- type: string- requestBody:- description: 'Bulk envs updated.'- required: true- content:- application/json:- schema:- required:- - data- properties:- data:- type: array- items: { properties: { key: { type: string, description: 'The key of the environment variable.' }, value: { type: string, description: 'The value of the environment variable.' }, is_preview: { type: boolean, description: 'The flag to indicate if the environment variable is used in preview deployments.' }, is_literal: { type: boolean, description: 'The flag to indicate if the environment variable is a literal, nothing espaced.' }, is_multiline: { type: boolean, description: 'The flag to indicate if the environment variable is multiline.' }, is_shown_once: { type: boolean, description: "The flag to indicate if the environment variable's value is shown on the UI." } }, type: object }- type: object+ type: integerresponses:- '201':- description: 'Environment variables updated.'- content:- application/json:- schema:- type: array- items:- $ref: '#/components/schemas/EnvironmentVariable'+ '200':+ description: 'Environment variable updated.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -9235,308 +12102,263 @@ paths:security:-bearerAuth: []- '/services/{uuid}/envs/{env_uuid}':- delete:+ '/projects/{uuid}/envs':+ get:tags:- - Services- summary: 'Delete Env'- description: 'Delete env by UUID.'- operationId: delete-env-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'List Project Shared Envs'+ description: 'List shared environment variables for a project (type=project).'+ operationId: list-project-shared-envsparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'required: trueschema:type: string+ responses:+ '200':+ description: 'Project shared environment variables.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:-- name: env_uuid+ bearerAuth: []+ post:+ tags:+ - 'Shared Environment Variables'+ summary: 'Create Project Shared Env'+ description: 'Create a shared environment variable for a project (type=project).'+ operationId: create-project-shared-env+ parameters:+ -+ name: uuidin: path- description: 'UUID of the environment variable.'+ description: 'Project UUID'required: trueschema:type: stringresponses:- '200':- description: 'Environment variable deleted.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Environment variable deleted.' }- type: object+ '201':+ description: 'Environment variable created.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '409':+ description: 'Environment variable already exists.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/move':- post:+ '/projects/{uuid}/envs/{env_id}':+ delete:tags:- - Services- summary: Move- description: 'Move service to another project/environment. This is a purely organizational change — running containers are not affected. Note: after moving, the service will pick up shared environment variables from the new environment on the next deployment.'- operationId: move-service-by-uuid+ - 'Shared Environment Variables'+ summary: 'Delete Project Shared Env'+ description: 'Delete a project shared environment variable by id.'+ operationId: delete-project-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'required: trueschema:type: string- requestBody:- description: 'Target environment to move the service to.'- required: true- content:- application/json:- schema:- required:- - environment_uuid- properties:- environment_uuid:- type: string- description: 'UUID of the target environment.'- type: object+ -+ name: env_id+ in: path+ description: 'Shared env id (integer).'+ required: true+ schema:+ type: integerresponses:'200':- description: 'Service moved successfully.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Service moved successfully.' }- uuid: { type: string }- project_uuid: { type: string }- environment_uuid: { type: string }- type: object+ description: 'Environment variable deleted.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/start':- post:+ patch:tags:- - Services- summary: Start- description: 'Start service.'- operationId: start-service-by-uuid+ - 'Shared Environment Variables'+ summary: 'Update Project Shared Env'+ description: 'Update a project shared environment variable by id.'+ operationId: update-project-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'required: trueschema:type: string+ -+ name: env_id+ in: path+ description: 'Shared env id (integer).'+ required: true+ schema:+ type: integerresponses:'200':- description: 'Start service.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Service starting request queued.' }- type: object+ description: 'Environment variable updated.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/stop':- post:+ '/projects/{uuid}/environments/{environment_name_or_uuid}/envs':+ get:tags:- - Services- summary: Stop- description: 'Stop service.'- operationId: stop-service-by-uuid+ - 'Shared Environment Variables'+ summary: 'List Environment Shared Envs'+ description: 'List shared environment variables for a project environment (type=environment).'+ operationId: list-environment-shared-envsparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'required: trueschema:type: string-- name: docker_cleanup- in: query- description: 'Perform docker cleanup (prune networks, volumes, etc.).'+ name: environment_name_or_uuid+ in: path+ description: 'Environment name or UUID'+ required: trueschema:- type: boolean- default: true+ type: stringresponses:'200':- description: 'Stop service.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Service stopping request queued.' }- type: object+ description: 'Environment shared environment variables.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- '/services/{uuid}/restart':post:tags:- - Services- summary: Restart- description: 'Restart service.'- operationId: restart-service-by-uuid+ - 'Shared Environment Variables'+ summary: 'Create Environment Shared Env'+ description: 'Create a shared environment variable for a project environment (type=environment).'+ operationId: create-environment-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'required: trueschema:type: string-- name: latest- in: query- description: 'Pull latest images.'+ name: environment_name_or_uuid+ in: path+ description: 'Environment name or UUID'+ required: trueschema:- type: boolean- default: false+ type: stringresponses:- '200':- description: 'Restart service.'- content:- application/json:- schema:- properties:- message: { type: string, example: 'Service restaring request queued.' }- type: object+ '201':+ description: 'Environment variable created.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '409':+ description: 'Environment variable already exists.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/storages':- get:+ '/projects/{uuid}/environments/{environment_name_or_uuid}/envs/{env_id}':+ delete:tags:- - Services- summary: 'List Storages'- description: 'List all persistent storages and file storages by service UUID.'- operationId: list-storages-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'Delete Environment Shared Env'+ description: 'Delete an environment shared environment variable by id.'+ operationId: delete-environment-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'+ required: true+ schema:+ type: string+ -+ name: environment_name_or_uuid+ in: path+ description: 'Environment name or UUID'required: trueschema:type: string+ -+ name: env_id+ in: path+ description: 'Shared env id (integer).'+ required: true+ schema:+ type: integerresponses:'200':- description: 'All storages by service UUID.'- content:- application/json:- schema:- properties:- persistent_storages: { type: array, items: { type: object } }- file_storages: { type: array, items: { type: object } }- type: object+ description: 'Environment variable deleted.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- post:+ patch:tags:- - Services- summary: 'Create Storage'- description: 'Create a persistent storage or file storage for a service sub-resource.'- operationId: create-storage-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'Update Environment Shared Env'+ description: 'Update an environment shared environment variable by id.'+ operationId: update-environment-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Project UUID'required: trueschema:type: string- requestBody:- required: true- content:- application/json:- schema:- required:- - type- - mount_path- - resource_uuid- properties:- type:- type: string- enum: [persistent, file]- description: 'The type of storage.'- resource_uuid:- type: string- description: 'UUID of the service application or database sub-resource.'- name:- type: string- description: 'Volume name (persistent only, required for persistent).'- mount_path:- type: string- description: 'The container mount path.'- host_path:- type: string- nullable: true- description: 'The host path (persistent only, optional).'- content:- type: string- nullable: true- description: 'File content (file only, optional).'- is_directory:- type: boolean- description: 'Whether this is a directory mount (file only, default false).'- fs_path:- type: string- description: 'Host directory path (required when is_directory is true).'- type: object- additionalProperties: false+ -+ name: environment_name_or_uuid+ in: path+ description: 'Environment name or UUID'+ required: true+ schema:+ type: string+ -+ name: env_id+ in: path+ description: 'Shared env id (integer).'+ required: true+ schema:+ type: integerresponses:- '201':- description: 'Storage created.'- content:- application/json:- schema:- type: object+ '200':+ description: 'Environment variable updated.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404''422':@@ -9544,136 +12366,134 @@ paths:security:-bearerAuth: []- patch:+ '/servers/{uuid}/envs':+ get:tags:- - Services- summary: 'Update Storage'- description: 'Update a persistent storage or file storage by service UUID.'- operationId: update-storage-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'List Server Shared Envs'+ description: 'List shared environment variables for a server (type=server).'+ operationId: list-server-shared-envsparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Server UUID'+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Server shared environment variables.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ post:+ tags:+ - 'Shared Environment Variables'+ summary: 'Create Server Shared Env'+ description: 'Create a shared environment variable for a server (type=server).'+ operationId: create-server-shared-env+ parameters:+ -+ name: uuid+ in: path+ description: 'Server UUID'required: trueschema:type: string- requestBody:- description: 'Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.'- required: true- content:- application/json:- schema:- required:- - type- properties:- uuid:- type: string- description: 'The UUID of the storage (preferred).'- id:- type: integer- description: 'The ID of the storage (deprecated, use uuid instead).'- type:- type: string- enum: [persistent, file]- description: 'The type of storage: persistent or file.'- is_preview_suffix_enabled:- type: boolean- description: 'Whether to add -pr-N suffix for preview deployments.'- name:- type: string- description: 'The volume name (persistent only, not allowed for read-only storages).'- mount_path:- type: string- description: 'The container mount path (not allowed for read-only storages).'- host_path:- type: string- nullable: true- description: 'The host path (persistent only, not allowed for read-only storages).'- content:- type: string- nullable: true- description: 'The file content (file only, not allowed for read-only storages).'- type: object- additionalProperties: falseresponses:- '200':- description: 'Storage updated.'- content:- application/json:- schema:- type: object+ '201':+ description: 'Environment variable created.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'+ '409':+ description: 'Environment variable already exists.''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/storages/{storage_uuid}':+ '/servers/{uuid}/envs/{env_id}':delete:tags:- - Services- summary: 'Delete Storage'- description: 'Delete a persistent storage or file storage by service UUID.'- operationId: delete-storage-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'Delete Server Shared Env'+ description: 'Delete a server shared environment variable by id.'+ operationId: delete-server-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Server UUID'required: trueschema:type: string-- name: storage_uuid+ name: env_idin: path- description: 'UUID of the storage.'+ description: 'Shared env id (integer).'required: trueschema:- type: string+ type: integerresponses:'200':- description: 'Storage deleted.'- content:- application/json:- schema:- properties:- message: { type: string }- type: object+ description: 'Environment variable deleted.''401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'- '422':- $ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/tags':- get:+ patch:tags:- - Services- summary: 'List Tags'- description: 'List tags for a service by UUID.'- operationId: list-tags-by-service-uuid+ - 'Shared Environment Variables'+ summary: 'Update Server Shared Env'+ description: 'Update a server shared environment variable by id.'+ operationId: update-server-shared-envparameters:-name: uuidin: path- description: 'UUID of the service.'+ description: 'Server UUID'required: trueschema:type: string+ -+ name: env_id+ in: path+ description: 'Shared env id (integer).'+ required: true+ schema:+ type: integerresponses:'200':- description: 'List of tags.'+ description: 'Environment variable updated.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ '422':+ $ref: '#/components/responses/422'+ security:+ -+ bearerAuth: []+ /tags:+ get:+ tags:+ - Tags+ summary: List+ description: 'List all tags for the current team.'+ operationId: list-tags+ responses:+ '200':+ description: 'All tags for the current team.'content:application/json:schema:@@ -9684,113 +12504,121 @@ paths:$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'security:-bearerAuth: []post:tags:- - Services- summary: 'Create Tag'- description: 'Add tag(s) to a service by UUID.'- operationId: create-tag-by-service-uuid- parameters:- -- name: uuid- in: path- description: 'UUID of the service.'- required: true- schema:- type: string+ - Tags+ summary: Create+ description: 'Create a tag for the current team.'+ operationId: create-tagrequestBody:required: truecontent:application/json:schema:+ required:+ - nameproperties:- tag_name:+ name:type: string- description: 'The tag name (min 2 characters). Required if tag_names is not provided.'- tag_names:- type: array- items: { type: string }- description: 'Array of tag names (each min 2 characters). Required if tag_name is not provided.'+ maxLength: 255+ minLength: 2type: objectresponses:'201':- description: 'Tags added successfully.'+ description: 'Tag created.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Tag'+ $ref: '#/components/schemas/Tag''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'- '404':- $ref: '#/components/responses/404'+ '409':+ description: 'Tag with this name already exists.''422':$ref: '#/components/responses/422'security:-bearerAuth: []- '/services/{uuid}/tags/{tag_uuid}':+ '/tags/{uuid}':delete:tags:- - Services- summary: 'Delete Tag'- description: 'Remove a tag from a service by UUID.'- operationId: delete-tag-by-service-uuid+ - Tags+ summary: Delete+ description: 'Delete a tag for the current team. Detaches the tag from all resources via cascade.'+ operationId: delete-tag-by-uuidparameters:-name: uuidin: path- description: 'UUID of the service.'- required: true- schema:- type: string- -- name: tag_uuid- in: path- description: 'UUID of the tag.'+ description: 'Tag UUID'required: trueschema:type: stringresponses:'200':- description: 'Tag removed.'+ description: 'Tag deleted.'+ content:+ application/json:+ schema:+ properties:+ message: { type: string, example: 'Tag deleted.' }+ type: object'401':$ref: '#/components/responses/401'- '400':- $ref: '#/components/responses/400''404':$ref: '#/components/responses/404'security:-bearerAuth: []- /tags:- get:+ patch:tags:- Tags- summary: List- description: 'List all tags for the current team.'- operationId: list-tags+ summary: Update+ description: 'Update a tag name for the current team.'+ operationId: update-tag-by-uuid+ parameters:+ -+ name: uuid+ in: path+ description: 'Tag UUID'+ required: true+ schema:+ type: string+ requestBody:+ required: true+ content:+ application/json:+ schema:+ required:+ - name+ properties:+ name:+ type: string+ maxLength: 255+ minLength: 2+ type: objectresponses:'200':- description: 'All tags for the current team.'+ description: 'Tag updated.'content:application/json:schema:- type: array- items:- $ref: '#/components/schemas/Tag'+ $ref: '#/components/schemas/Tag''401':$ref: '#/components/responses/401''400':$ref: '#/components/responses/400'+ '404':+ $ref: '#/components/responses/404'+ '409':+ description: 'Tag with this name already exists.'+ '422':+ $ref: '#/components/responses/422'security:-bearerAuth: []@@ -9881,16 +12709,16 @@ paths:security:-bearerAuth: []- /teams/current:+ /team:get:tags:- Teamssummary: 'Authenticated Team'- description: 'Get currently authenticated team.'- operationId: get-current-team+ description: 'Get the team bound to the API token.'+ operationId: get-token-teamresponses:'200':- description: 'Current Team.'+ description: 'Team bound to the API token.'content:application/json:schema:@@ -9902,16 +12730,16 @@ paths:security:-bearerAuth: []- /teams/current/members:+ /team/members:get:tags:- Teamssummary: 'Authenticated Team Members'- description: 'Get currently authenticated team members.'- operationId: get-current-team-members+ description: 'Get members of the team bound to the API token.'+ operationId: get-token-team-membersresponses:'200':- description: 'Currently authenticated team members.'+ description: 'Members of the team bound to the API token.'content:application/json:schema:@@ -10186,6 +13014,96 @@ paths:security:-bearerAuth: []+ '/applications/{uuid}/storages/{storage_uuid}/backups/run':+ post:+ tags:+ - Applications+ summary: 'Run application storage backup'+ description: 'Queue an immediate volume backup for an application storage that has a schedule.'+ operationId: run-application-storage-backup+ parameters:+ -+ name: uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: storage_uuid+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Storage backup queued.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/databases/{uuid}/storages/{storage_uuid}/backups/run':+ post:+ tags:+ - Databases+ summary: 'Run database storage backup'+ description: 'Queue an immediate volume backup for a database storage that has a schedule.'+ operationId: run-database-storage-backup+ parameters:+ -+ name: uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: storage_uuid+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Storage backup queued.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []+ '/services/{uuid}/storages/{storage_uuid}/backups/run':+ post:+ tags:+ - Services+ summary: 'Run service storage backup'+ description: 'Queue an immediate volume backup for a service storage that has a schedule.'+ operationId: run-service-storage-backup+ parameters:+ -+ name: uuid+ in: path+ required: true+ schema:+ type: string+ -+ name: storage_uuid+ in: path+ required: true+ schema:+ type: string+ responses:+ '200':+ description: 'Storage backup queued.'+ '401':+ $ref: '#/components/responses/401'+ '404':+ $ref: '#/components/responses/404'+ security:+ -+ bearerAuth: []/vultr/regions:get:tags:@@ -10562,6 +13480,9 @@ components:preview_url_template:type: stringdescription: 'Preview URL template.'+ max_restart_count:+ type: integer+ description: 'Maximum container restart count before stopping.'destination_type:type: stringdescription: 'Destination type.'@@ -11401,6 +14322,9 @@ tags:-name: Applicationsdescription: Applications+ -+ name: 'Cloud-init Scripts'+ description: 'Cloud-init Scripts'-name: 'Cloud Tokens'description: 'Cloud Tokens'@@ -11419,15 +14343,24 @@ tags:-name: 'GitHub Apps'description: 'GitHub Apps'+ -+ name: 'GitLab Apps'+ description: 'GitLab Apps'-name: Hetznerdescription: Hetzner+ -+ name: Notifications+ description: Notifications-name: Projectsdescription: Projects-name: Resourcesdescription: Resources+ -+ name: 'S3 Storages'+ description: 'S3 Storages'-name: 'Scheduled Tasks'description: 'Scheduled Tasks'@@ -11446,6 +14379,9 @@ tags:-name: Servicesdescription: Services+ -+ name: 'Shared Environment Variables'+ description: 'Shared Environment Variables'-name: Tagsdescription: Tagsdiff --git a/routes/api.php b/routes/api.phpindex b9d2f6c6fc..78f24404bf 100644--- a/routes/api.php+++ b/routes/api.php@@ -1,6 +1,7 @@<?phpuse App\Http\Controllers\Api\ApplicationsController;+use App\Http\Controllers\Api\CloudInitScriptsController;use App\Http\Controllers\Api\CloudProviderTokensController;use App\Http\Controllers\Api\DatabasesController;use App\Http\Controllers\Api\DeployController;@@ -10,16 +11,24 @@ use App\Http\Controllers\Api\GithubController;use App\Http\Controllers\Api\GitlabController;use App\Http\Controllers\Api\HetznerController;use App\Http\Controllers\Api\Internal\FluxResourceStatusController;+use App\Http\Controllers\Api\NotificationsController;use App\Http\Controllers\Api\OtherController;use App\Http\Controllers\Api\ProjectController;use App\Http\Controllers\Api\ResourcesController;+use App\Http\Controllers\Api\S3StoragesController;use App\Http\Controllers\Api\ScheduledTasksController;use App\Http\Controllers\Api\SecurityController;use App\Http\Controllers\Api\SentinelController;+use App\Http\Controllers\Api\ServerCloudflareTunnelController;+use App\Http\Controllers\Api\ServerDockerCleanupController;+use App\Http\Controllers\Api\ServerLogDrainsController;+use App\Http\Controllers\Api\ServerProxyController;use App\Http\Controllers\Api\ServersController;+use App\Http\Controllers\Api\ServerSentinelController;use App\Http\Controllers\Api\ServiceApplicationsController;use App\Http\Controllers\Api\ServiceDatabasesController;use App\Http\Controllers\Api\ServicesController;+use App\Http\Controllers\Api\SharedEnvironmentVariablesController;use App\Http\Controllers\Api\TagsController;use App\Http\Controllers\Api\TeamController;use App\Http\Controllers\Api\VolumeBackupsController;@@ -57,16 +66,46 @@ Route::group([Route::get('/version', [OtherController::class, 'version'])->middleware(['api.ability:read']);Route::get('/teams', [TeamController::class, 'teams'])->middleware(['api.ability:read']);+ // Token's team+ Route::get('/team', [TeamController::class, 'current_team'])->middleware(['api.ability:read']);+ Route::get('/team/members', [TeamController::class, 'current_team_members'])->middleware(['api.ability:read']);+ // Deprecated aliases — same handlers as /team and /team/members (remove in a later release)Route::get('/teams/current', [TeamController::class, 'current_team'])->middleware(['api.ability:read']);Route::get('/teams/current/members', [TeamController::class, 'current_team_members'])->middleware(['api.ability:read']);+ Route::get('/notifications/email', [NotificationsController::class, 'email'])->middleware(['api.ability:read']);+ Route::patch('/notifications/email', [NotificationsController::class, 'update_email'])->middleware(['api.ability:write']);+ Route::get('/notifications/discord', [NotificationsController::class, 'discord'])->middleware(['api.ability:read']);+ Route::patch('/notifications/discord', [NotificationsController::class, 'update_discord'])->middleware(['api.ability:write']);+ Route::get('/notifications/slack', [NotificationsController::class, 'slack'])->middleware(['api.ability:read']);+ Route::patch('/notifications/slack', [NotificationsController::class, 'update_slack'])->middleware(['api.ability:write']);+ Route::get('/notifications/telegram', [NotificationsController::class, 'telegram'])->middleware(['api.ability:read']);+ Route::patch('/notifications/telegram', [NotificationsController::class, 'update_telegram'])->middleware(['api.ability:write']);+ Route::get('/notifications/pushover', [NotificationsController::class, 'pushover'])->middleware(['api.ability:read']);+ Route::patch('/notifications/pushover', [NotificationsController::class, 'update_pushover'])->middleware(['api.ability:write']);+ Route::get('/notifications/webhook', [NotificationsController::class, 'webhook'])->middleware(['api.ability:read']);+ Route::patch('/notifications/webhook', [NotificationsController::class, 'update_webhook'])->middleware(['api.ability:write']);+ Route::get('/team/envs', [SharedEnvironmentVariablesController::class, 'team_envs'])->middleware(['api.ability:read']);+ Route::post('/team/envs', [SharedEnvironmentVariablesController::class, 'team_create_env'])->middleware(['api.ability:write']);+ Route::patch('/team/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'team_update_env'])->middleware(['api.ability:write']);+ Route::delete('/team/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'team_delete_env'])->middleware(['api.ability:write']);Route::get('/teams/{id}', [TeamController::class, 'team_by_id'])->middleware(['api.ability:read']);Route::get('/teams/{id}/members', [TeamController::class, 'members_by_id'])->middleware(['api.ability:read']);Route::get('/projects', [ProjectController::class, 'projects'])->middleware(['api.ability:read']);Route::get('/projects/{uuid}', [ProjectController::class, 'project_by_uuid'])->middleware(['api.ability:read']);Route::get('/projects/{uuid}/environments', [ProjectController::class, 'get_environments'])->middleware(['api.ability:read']);+ // Shared project/environment envs must be registered before the catch-all environment route.+ Route::get('/projects/{uuid}/envs', [SharedEnvironmentVariablesController::class, 'project_envs'])->middleware(['api.ability:read']);+ Route::post('/projects/{uuid}/envs', [SharedEnvironmentVariablesController::class, 'project_create_env'])->middleware(['api.ability:write']);+ Route::patch('/projects/{uuid}/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'project_update_env'])->middleware(['api.ability:write']);+ Route::delete('/projects/{uuid}/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'project_delete_env'])->middleware(['api.ability:write']);+ Route::get('/projects/{uuid}/environments/{environment_name_or_uuid}/envs', [SharedEnvironmentVariablesController::class, 'environment_envs'])->middleware(['api.ability:read']);+ Route::post('/projects/{uuid}/environments/{environment_name_or_uuid}/envs', [SharedEnvironmentVariablesController::class, 'environment_create_env'])->middleware(['api.ability:write']);+ Route::patch('/projects/{uuid}/environments/{environment_name_or_uuid}/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'environment_update_env'])->middleware(['api.ability:write']);+ Route::delete('/projects/{uuid}/environments/{environment_name_or_uuid}/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'environment_delete_env'])->middleware(['api.ability:write']);Route::get('/projects/{uuid}/{environment_name_or_uuid}', [ProjectController::class, 'environment_details'])->middleware(['api.ability:read']);Route::post('/projects/{uuid}/environments', [ProjectController::class, 'create_environment'])->middleware(['api.ability:write']);+ Route::patch('/projects/{uuid}/environments/{environment_name_or_uuid}', [ProjectController::class, 'update_environment'])->middleware(['api.ability:write']);Route::delete('/projects/{uuid}/environments/{environment_name_or_uuid}', [ProjectController::class, 'delete_environment'])->middleware(['api.ability:write']);Route::post('/projects', [ProjectController::class, 'create_project'])->middleware(['api.ability:write']);@@ -87,6 +126,19 @@ Route::group([Route::delete('/cloud-tokens/{uuid}', [CloudProviderTokensController::class, 'destroy'])->middleware(['api.ability:write']);Route::post('/cloud-tokens/{uuid}/validate', [CloudProviderTokensController::class, 'validateToken'])->middleware(['api.ability:write']);+ Route::get('/cloud-init-scripts', [CloudInitScriptsController::class, 'index'])->middleware(['api.ability:read']);+ Route::post('/cloud-init-scripts', [CloudInitScriptsController::class, 'store'])->middleware(['api.ability:write']);+ Route::get('/cloud-init-scripts/{uuid}', [CloudInitScriptsController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/cloud-init-scripts/{uuid}', [CloudInitScriptsController::class, 'update'])->middleware(['api.ability:write']);+ Route::delete('/cloud-init-scripts/{uuid}', [CloudInitScriptsController::class, 'destroy'])->middleware(['api.ability:write']);++ Route::get('/s3-storages', [S3StoragesController::class, 'index'])->middleware(['api.ability:read']);+ Route::post('/s3-storages', [S3StoragesController::class, 'store'])->middleware(['api.ability:write']);+ Route::get('/s3-storages/{uuid}', [S3StoragesController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/s3-storages/{uuid}', [S3StoragesController::class, 'update'])->middleware(['api.ability:write']);+ Route::delete('/s3-storages/{uuid}', [S3StoragesController::class, 'destroy'])->middleware(['api.ability:write']);+ Route::post('/s3-storages/{uuid}/validate', [S3StoragesController::class, 'validateStorage'])->middleware(['api.ability:write']);+Route::get('/deploy', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::post('/deploy', [DeployController::class, 'deploy'])->middleware(['api.ability:deploy']);Route::get('/deployments', [DeployController::class, 'deployments'])->middleware(['api.ability:read']);@@ -98,10 +150,32 @@ Route::group([Route::get('/servers/{uuid}', [ServersController::class, 'server_by_uuid'])->middleware(['api.ability:read']);Route::get('/servers/{uuid}/domains', [ServersController::class, 'domains_by_server'])->middleware(['api.ability:read']);Route::get('/servers/{uuid}/resources', [ServersController::class, 'resources_by_server'])->middleware(['api.ability:read']);+ Route::get('/servers/{uuid}/envs', [SharedEnvironmentVariablesController::class, 'server_envs'])->middleware(['api.ability:read']);+ Route::post('/servers/{uuid}/envs', [SharedEnvironmentVariablesController::class, 'server_create_env'])->middleware(['api.ability:write']);+ Route::patch('/servers/{uuid}/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'server_update_env'])->middleware(['api.ability:write']);+ Route::delete('/servers/{uuid}/envs/{env_id}', [SharedEnvironmentVariablesController::class, 'server_delete_env'])->middleware(['api.ability:write']);++ // Server subsystem APIs (Docker cleanup, log drains, Sentinel, Cloudflare Tunnel).+ Route::get('/servers/{uuid}/docker-cleanup', [ServerDockerCleanupController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/servers/{uuid}/docker-cleanup', [ServerDockerCleanupController::class, 'update'])->middleware(['api.ability:write']);+ Route::post('/servers/{uuid}/docker-cleanup/run', [ServerDockerCleanupController::class, 'run'])->middleware(['api.ability:write']);+ Route::get('/servers/{uuid}/docker-cleanup/executions', [ServerDockerCleanupController::class, 'executions'])->middleware(['api.ability:read']);++ Route::get('/servers/{uuid}/log-drains', [ServerLogDrainsController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/servers/{uuid}/log-drains', [ServerLogDrainsController::class, 'update'])->middleware(['api.ability:write']);++ Route::get('/servers/{uuid}/sentinel', [ServerSentinelController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/servers/{uuid}/sentinel', [ServerSentinelController::class, 'update'])->middleware(['api.ability:write']);++ Route::get('/servers/{uuid}/cloudflare-tunnel', [ServerCloudflareTunnelController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/servers/{uuid}/cloudflare-tunnel', [ServerCloudflareTunnelController::class, 'update'])->middleware(['api.ability:write']);+ Route::post('/servers/{uuid}/cloudflare-tunnel/enable', [ServerCloudflareTunnelController::class, 'enable'])->middleware(['api.ability:write']);+ Route::post('/servers/{uuid}/cloudflare-tunnel/disable', [ServerCloudflareTunnelController::class, 'disable'])->middleware(['api.ability:write']);// Destinations — REST surface for the Coolify "Destinations" UI section (added).Route::get('/destinations', [DestinationsController::class, 'index'])->middleware(['api.ability:read']);Route::get('/destinations/{uuid}', [DestinationsController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/destinations/{uuid}', [DestinationsController::class, 'update'])->middleware(['api.ability:write']);Route::delete('/destinations/{uuid}', [DestinationsController::class, 'delete'])->middleware(['api.ability:write']);Route::get('/servers/{server_uuid}/destinations', [DestinationsController::class, 'index_by_server'])->middleware(['api.ability:read']);Route::post('/servers/{server_uuid}/destinations', [DestinationsController::class, 'create'])->middleware(['api.ability:write']);@@ -109,6 +183,11 @@ Route::group([Route::get('/servers/{uuid}/validate', [OtherController::class, 'post_required'])->middleware(['api.ability:write']);Route::post('/servers/{uuid}/validate', [ServersController::class, 'validate_server'])->middleware(['api.ability:write']);+ Route::get('/servers/{uuid}/proxy', [ServerProxyController::class, 'show'])->middleware(['api.ability:read']);+ Route::patch('/servers/{uuid}/proxy', [ServerProxyController::class, 'update'])->middleware(['api.ability:write']);+ Route::put('/servers/{uuid}/proxy/configuration', [ServerProxyController::class, 'saveConfiguration'])->middleware(['api.ability:write']);+ Route::post('/servers/{uuid}/proxy/restart', [ServerProxyController::class, 'restart'])->middleware(['api.ability:write']);+Route::post('/servers', [ServersController::class, 'create_server'])->middleware(['api.ability:write']);Route::patch('/servers/{uuid}', [ServersController::class, 'update_server'])->middleware(['api.ability:write']);Route::delete('/servers/{uuid}', [ServersController::class, 'delete_server'])->middleware(['api.ability:write']);@@ -136,6 +215,9 @@ Route::group([Route::get('/resources', [ResourcesController::class, 'resources'])->middleware(['api.ability:read']);Route::get('/tags', [TagsController::class, 'tags'])->middleware(['api.ability:read']);+ Route::post('/tags', [TagsController::class, 'create'])->middleware(['api.ability:write']);+ Route::patch('/tags/{uuid}', [TagsController::class, 'update'])->middleware(['api.ability:write']);+ Route::delete('/tags/{uuid}', [TagsController::class, 'delete'])->middleware(['api.ability:write']);Route::get('/applications', [ApplicationsController::class, 'applications'])->middleware(['api.ability:read']);Route::post('/applications/public', [ApplicationsController::class, 'create_public_application'])->middleware(['api.ability:write']);@@ -161,6 +243,9 @@ Route::group([Route::put('/applications/{uuid}/storages/{storage_uuid}/backups', [VolumeBackupsController::class, 'upsert'])->defaults('resource_type', 'application')->middleware(['api.ability:write']);+ Route::post('/applications/{uuid}/storages/{storage_uuid}/backups/run', [VolumeBackupsController::class, 'run'])+ ->defaults('resource_type', 'application')+ ->middleware(['api.ability:write']);Route::delete('/applications/{uuid}/storages/{storage_uuid}/backups', [VolumeBackupsController::class, 'destroy'])->defaults('resource_type', 'application')->middleware(['api.ability:write']);@@ -170,6 +255,12 @@ Route::group([Route::delete('/applications/{uuid}/tags/{tag_uuid}', [ApplicationsController::class, 'delete_tag'])->middleware(['api.ability:write']);Route::post('/applications/{uuid}/move', [ApplicationsController::class, 'move_by_uuid'])->middleware(['api.ability:write']);+ Route::post('/applications/{uuid}/clone', [ApplicationsController::class, 'clone_by_uuid'])->middleware(['api.ability:write']);+ Route::get('/applications/{uuid}/rollback-images', [ApplicationsController::class, 'rollback_images'])->middleware(['api.ability:read']);+ Route::post('/applications/{uuid}/rollback', [ApplicationsController::class, 'rollback_by_uuid'])->middleware(['api.ability:deploy']);+ Route::get('/applications/{uuid}/destinations', [ApplicationsController::class, 'destinations'])->middleware(['api.ability:read']);+ Route::post('/applications/{uuid}/destinations', [ApplicationsController::class, 'add_destination'])->middleware(['api.ability:write']);+ Route::delete('/applications/{uuid}/destinations/{destination_uuid}', [ApplicationsController::class, 'remove_destination'])->middleware(['api.ability:write']);Route::get('/applications/{uuid}/start', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::get('/applications/{uuid}/restart', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::get('/applications/{uuid}/stop', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);@@ -219,6 +310,9 @@ Route::group([Route::put('/databases/{uuid}/storages/{storage_uuid}/backups', [VolumeBackupsController::class, 'upsert'])->defaults('resource_type', 'database')->middleware(['api.ability:write']);+ Route::post('/databases/{uuid}/storages/{storage_uuid}/backups/run', [VolumeBackupsController::class, 'run'])+ ->defaults('resource_type', 'database')+ ->middleware(['api.ability:write']);Route::delete('/databases/{uuid}/storages/{storage_uuid}/backups', [VolumeBackupsController::class, 'destroy'])->defaults('resource_type', 'database')->middleware(['api.ability:write']);@@ -234,6 +328,7 @@ Route::group([Route::delete('/databases/{uuid}/tags/{tag_uuid}', [DatabasesController::class, 'delete_tag'])->middleware(['api.ability:write']);Route::post('/databases/{uuid}/move', [DatabasesController::class, 'move_by_uuid'])->middleware(['api.ability:write']);+ Route::post('/databases/{uuid}/clone', [DatabasesController::class, 'clone_by_uuid'])->middleware(['api.ability:write']);Route::get('/databases/{uuid}/start', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::get('/databases/{uuid}/restart', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::get('/databases/{uuid}/stop', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);@@ -255,6 +350,9 @@ Route::group([Route::put('/services/{uuid}/storages/{storage_uuid}/backups', [VolumeBackupsController::class, 'upsert'])->defaults('resource_type', 'service')->middleware(['api.ability:write']);+ Route::post('/services/{uuid}/storages/{storage_uuid}/backups/run', [VolumeBackupsController::class, 'run'])+ ->defaults('resource_type', 'service')+ ->middleware(['api.ability:write']);Route::delete('/services/{uuid}/storages/{storage_uuid}/backups', [VolumeBackupsController::class, 'destroy'])->defaults('resource_type', 'service')->middleware(['api.ability:write']);@@ -271,6 +369,7 @@ Route::group([Route::delete('/services/{uuid}/tags/{tag_uuid}', [ServicesController::class, 'delete_tag'])->middleware(['api.ability:write']);Route::post('/services/{uuid}/move', [ServicesController::class, 'move_by_uuid'])->middleware(['api.ability:write']);+ Route::post('/services/{uuid}/clone', [ServicesController::class, 'clone_by_uuid'])->middleware(['api.ability:write']);Route::get('/services/{uuid}/start', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::get('/services/{uuid}/restart', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);Route::get('/services/{uuid}/stop', [OtherController::class, 'post_required'])->middleware(['api.ability:deploy']);@@ -302,12 +401,14 @@ Route::group([Route::patch('/applications/{uuid}/scheduled-tasks/{task_uuid}', [ScheduledTasksController::class, 'update_scheduled_task_by_application_uuid'])->middleware(['api.ability:write']);Route::delete('/applications/{uuid}/scheduled-tasks/{task_uuid}', [ScheduledTasksController::class, 'delete_scheduled_task_by_application_uuid'])->middleware(['api.ability:write']);Route::get('/applications/{uuid}/scheduled-tasks/{task_uuid}/executions', [ScheduledTasksController::class, 'executions_by_application_uuid'])->middleware(['api.ability:read']);+ Route::post('/applications/{uuid}/scheduled-tasks/{task_uuid}/execute', [ScheduledTasksController::class, 'execute_scheduled_task_by_application_uuid'])->middleware(['api.ability:write']);Route::get('/services/{uuid}/scheduled-tasks', [ScheduledTasksController::class, 'scheduled_tasks_by_service_uuid'])->middleware(['api.ability:read']);Route::post('/services/{uuid}/scheduled-tasks', [ScheduledTasksController::class, 'create_scheduled_task_by_service_uuid'])->middleware(['api.ability:write']);Route::patch('/services/{uuid}/scheduled-tasks/{task_uuid}', [ScheduledTasksController::class, 'update_scheduled_task_by_service_uuid'])->middleware(['api.ability:write']);Route::delete('/services/{uuid}/scheduled-tasks/{task_uuid}', [ScheduledTasksController::class, 'delete_scheduled_task_by_service_uuid'])->middleware(['api.ability:write']);Route::get('/services/{uuid}/scheduled-tasks/{task_uuid}/executions', [ScheduledTasksController::class, 'executions_by_service_uuid'])->middleware(['api.ability:read']);+ Route::post('/services/{uuid}/scheduled-tasks/{task_uuid}/execute', [ScheduledTasksController::class, 'execute_scheduled_task_by_service_uuid'])->middleware(['api.ability:write']);});Route::group([diff --git a/tests/Feature/Api/ApplicationRollbackImagesApiTest.php b/tests/Feature/Api/ApplicationRollbackImagesApiTest.phpnew file mode 100644index 0000000000..4e61000ba7--- /dev/null+++ b/tests/Feature/Api/ApplicationRollbackImagesApiTest.php@@ -0,0 +1,21 @@+<?php++use App\Http\Controllers\Api\ApplicationsController;++function currentRollbackImageTag(string $imageReference): ?string+{+ $method = new ReflectionMethod(ApplicationsController::class, 'currentRollbackImageTag');+ $method->setAccessible(true);++ return $method->invoke(null, $imageReference);+}++it('extracts the current rollback image tag when the registry includes a port', function () {+ expect(currentRollbackImageTag('registry.example.com:5000/team/application:commit-sha'))+ ->toBe('commit-sha');+});++it('does not treat a digest as the current rollback image tag', function () {+ expect(currentRollbackImageTag('registry.example.com:5000/team/application@sha256:'.str_repeat('a', 64)))+ ->toBeNull();+});diff --git a/tests/Feature/Api/ApplicationSettingsApiTest.php b/tests/Feature/Api/ApplicationSettingsApiTest.phpindex 51ec776b21..6f54e57e88 100644--- a/tests/Feature/Api/ApplicationSettingsApiTest.php+++ b/tests/Feature/Api/ApplicationSettingsApiTest.php@@ -57,6 +57,14 @@ function recommendedApplicationSettingsPayload(): array'is_gzip_enabled' => false,'is_stripprefix_enabled' => false,'is_raw_compose_deployment_enabled' => true,+ 'is_log_drain_enabled' => true,+ 'is_gpu_enabled' => true,+ 'gpu_driver' => 'nvidia',+ 'gpu_count' => '1',+ 'gpu_device_ids' => '0',+ 'gpu_options' => null,+ 'is_consistent_container_name_enabled' => true,+ 'custom_internal_name' => 'my-app-internal',];}@@ -181,3 +189,122 @@ test('raw compose deployment can only be enabled for Docker Compose applications->assertUnprocessable()->assertJsonValidationErrors('is_raw_compose_deployment_enabled');});++function advancedApplicationSettingsPayload(): array+{+ return [+ 'is_log_drain_enabled' => true,+ 'is_gpu_enabled' => true,+ 'gpu_driver' => 'nvidia',+ 'gpu_count' => '1',+ 'gpu_device_ids' => '0',+ 'gpu_options' => 'capabilities=compute,utility',+ 'is_consistent_container_name_enabled' => true,+ 'custom_internal_name' => 'my-app-container',+ ];+}++test('PATCH /api/v1/applications/{uuid} updates advanced application settings', function () {+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/applications/{$this->application->uuid}", advancedApplicationSettingsPayload())+ ->assertOk();++ $settings = $this->application->fresh()->settings;++ foreach (advancedApplicationSettingsPayload() as $field => $value) {+ expect($settings->{$field})->toBe($value);+ }+});++test('PATCH /api/v1/applications/{uuid} updates preview_url_template and max_restart_count', function () {+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/applications/{$this->application->uuid}", [+ 'preview_url_template' => '{{pr_id}}.preview.example.com',+ 'max_restart_count' => 5,+ ])+ ->assertOk();++ $application = $this->application->fresh();++ expect($application->preview_url_template)->toBe('{{pr_id}}.preview.example.com')+ ->and($application->max_restart_count)->toBe(5);+});++test('GET /api/v1/applications/{uuid} includes advanced settings', function () {+ $this->application->settings->update(advancedApplicationSettingsPayload());+ $this->application->update([+ 'preview_url_template' => '{{pr_id}}.preview.example.com',+ 'max_restart_count' => 3,+ ]);++ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->getJson("/api/v1/applications/{$this->application->uuid}")+ ->assertOk()+ ->assertJsonPath('settings.is_log_drain_enabled', true)+ ->assertJsonPath('settings.is_gpu_enabled', true)+ ->assertJsonPath('settings.gpu_driver', 'nvidia')+ ->assertJsonPath('settings.custom_internal_name', 'my-app-container')+ ->assertJsonPath('settings.is_consistent_container_name_enabled', true)+ ->assertJsonPath('preview_url_template', '{{pr_id}}.preview.example.com')+ ->assertJsonPath('max_restart_count', 3);+});++test('application creation accepts advanced application settings', function () {+ Queue::fake();++ $response = $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->postJson('/api/v1/applications/public', array_merge([+ 'project_uuid' => $this->project->uuid,+ 'environment_uuid' => $this->environment->uuid,+ 'server_uuid' => $this->server->uuid,+ 'git_repository' => 'https://gitlab.com/coolify/advanced-settings-test',+ 'git_branch' => 'main',+ 'build_pack' => 'nixpacks',+ 'ports_exposes' => '3000',+ 'autogenerate_domain' => false,+ 'preview_url_template' => '{{pr_id}}.create.example.com',+ 'max_restart_count' => 7,+ ], advancedApplicationSettingsPayload()))+ ->assertCreated();++ $application = Application::where('uuid', $response->json('uuid'))->firstOrFail();+ $settings = $application->settings;++ foreach (advancedApplicationSettingsPayload() as $field => $value) {+ expect($settings->{$field})->toBe($value);+ }++ expect($application->preview_url_template)->toBe('{{pr_id}}.create.example.com')+ ->and($application->max_restart_count)->toBe(7);+});++test('rejects invalid max_restart_count', function () {+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/applications/{$this->application->uuid}", [+ 'max_restart_count' => -1,+ ])+ ->assertUnprocessable()+ ->assertJsonValidationErrors('max_restart_count');+});++test('rejects invalid gpu boolean settings', function () {+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/applications/{$this->application->uuid}", [+ 'is_gpu_enabled' => 'not-a-boolean',+ ])+ ->assertUnprocessable()+ ->assertJsonValidationErrors('is_gpu_enabled');+});++test('rejects swarm fields on application update', function (string $field, mixed $value) {+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/applications/{$this->application->uuid}", [+ $field => $value,+ ])+ ->assertUnprocessable()+ ->assertJsonValidationErrors($field);+})->with([+ 'swarm_replicas' => ['swarm_replicas', 3],+ 'swarm_placement_constraints' => ['swarm_placement_constraints', 'node.role==worker'],+ 'is_swarm_only_worker_nodes' => ['is_swarm_only_worker_nodes', true],+]);diff --git a/tests/Feature/Api/DestinationsApiTest.php b/tests/Feature/Api/DestinationsApiTest.phpindex 2de639b5c5..90875a0a2e 100644--- a/tests/Feature/Api/DestinationsApiTest.php+++ b/tests/Feature/Api/DestinationsApiTest.php@@ -245,6 +245,79 @@ describe('POST /api/v1/servers/{server_uuid}/destinations', function () {});});+describe('PATCH /api/v1/destinations/{uuid}', function () {+ test('updates destination name only', function () {+ $originalNetwork = $this->destination->network;++ $response = $this->withHeaders(destinationsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/destinations/{$this->destination->uuid}", [+ 'name' => 'Renamed Destination',+ ]);++ $response->assertOk()+ ->assertJson([+ 'uuid' => $this->destination->uuid,+ 'name' => 'Renamed Destination',+ 'network' => $originalNetwork,+ 'type' => 'standalone',+ 'server_uuid' => $this->server->uuid,+ ]);++ $this->destination->refresh();+ expect($this->destination->name)->toBe('Renamed Destination')+ ->and($this->destination->network)->toBe($originalNetwork);+ });++ test('requires a write token', function () {+ $readOnlyToken = destinationsApiToken($this->user, $this->team, ['read']);++ $response = $this->withHeaders(destinationsApiHeaders($readOnlyToken))+ ->patchJson("/api/v1/destinations/{$this->destination->uuid}", [+ 'name' => 'Should Fail',+ ]);++ $response->assertForbidden();+ });++ test('rejects update requests from non-admin team members', function () {+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ $memberToken = destinationsApiToken($member, $this->team, ['*']);++ $response = $this->withHeaders(destinationsApiHeaders($memberToken))+ ->patchJson("/api/v1/destinations/{$this->destination->uuid}", [+ 'name' => 'Member Rename',+ ]);++ $response->assertForbidden();+ });++ test('rejects network changes and unknown fields', function () {+ $response = $this->withHeaders(destinationsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/destinations/{$this->destination->uuid}", [+ 'name' => 'Valid Name',+ 'network' => 'new-network',+ ]);++ $response->assertUnprocessable();+ $response->assertJsonValidationErrors(['network']);+ });++ test('does not update another team destination', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);+ $otherDestination = StandaloneDocker::where('server_id', $otherServer->id)->first();++ $response = $this->withHeaders(destinationsApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/destinations/{$otherDestination->uuid}", [+ 'name' => 'Stolen Name',+ ]);++ $response->assertNotFound();+ expect($otherDestination->fresh()->name)->not->toBe('Stolen Name');+ });+});+describe('DELETE /api/v1/destinations/{uuid}', function () {test('requires a write token', function () {$readOnlyToken = destinationsApiToken($this->user, $this->team, ['read']);diff --git a/tests/Feature/Api/EnvironmentUpdateApiTest.php b/tests/Feature/Api/EnvironmentUpdateApiTest.phpnew file mode 100644index 0000000000..7a10adc5c1--- /dev/null+++ b/tests/Feature/Api/EnvironmentUpdateApiTest.php@@ -0,0 +1,166 @@+<?php++use App\Models\Environment;+use App\Models\InstanceSettings;+use App\Models\Project;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Str;++uses(RefreshDatabase::class);++beforeEach(function () {+ config([+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ 'queue.default' => 'sync',+ 'app.maintenance.driver' => 'file',+ ]);++ InstanceSettings::unguarded(fn () => InstanceSettings::firstOrCreate(+ ['id' => 0],+ ['is_api_enabled' => true],+ ));++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);+ session(['currentTeam' => $this->team]);++ $this->bearerToken = environmentUpdateApiToken($this->user, $this->team, ['*']);+ $this->project = Project::factory()->create(['team_id' => $this->team->id]);+ $this->environment = $this->project->environments()->first()+ ?? Environment::factory()->create(['project_id' => $this->project->id, 'name' => 'production']);+});++function environmentUpdateApiHeaders(string $bearerToken): array+{+ return [+ 'Authorization' => 'Bearer '.$bearerToken,+ 'Content-Type' => 'application/json',+ ];+}++function environmentUpdateApiToken(User $user, Team $team, array $abilities): string+{+ $plainTextToken = Str::random(40);+ $token = $user->tokens()->create([+ 'name' => 'environment-update-api-test-'.Str::random(6),+ 'token' => hash('sha256', $plainTextToken),+ 'abilities' => $abilities,+ 'team_id' => $team->id,+ ]);++ return $token->getKey().'|'.$plainTextToken;+}++describe('PATCH /api/v1/projects/{uuid}/environments/{environment_name_or_uuid}', function () {+ test('updates environment name and description by uuid', function () {+ $response = $this->withHeaders(environmentUpdateApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/{$this->environment->uuid}", [+ 'name' => 'staging',+ 'description' => 'Staging environment',+ ]);++ $response->assertOk()+ ->assertJson([+ 'uuid' => $this->environment->uuid,+ 'name' => 'staging',+ 'description' => 'Staging environment',+ ]);++ $this->environment->refresh();+ expect($this->environment->name)->toBe('staging')+ ->and($this->environment->description)->toBe('Staging environment');+ });++ test('updates environment by name path segment', function () {+ $response = $this->withHeaders(environmentUpdateApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/{$this->environment->name}", [+ 'description' => 'Updated description only',+ ]);++ $response->assertOk()+ ->assertJson([+ 'uuid' => $this->environment->uuid,+ 'name' => $this->environment->name,+ 'description' => 'Updated description only',+ ]);+ });++ test('requires a write token', function () {+ $readOnlyToken = environmentUpdateApiToken($this->user, $this->team, ['read']);++ $response = $this->withHeaders(environmentUpdateApiHeaders($readOnlyToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/{$this->environment->uuid}", [+ 'name' => 'should-fail',+ ]);++ $response->assertForbidden();+ expect($this->environment->fresh()->name)->toBe($this->environment->name);+ });++ test('rejects update requests from non-admin team members', function () {+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ $memberToken = environmentUpdateApiToken($member, $this->team, ['*']);++ $response = $this->withHeaders(environmentUpdateApiHeaders($memberToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/{$this->environment->uuid}", [+ 'name' => 'member-rename',+ ]);++ $response->assertForbidden();+ expect($this->environment->fresh()->name)->toBe($this->environment->name);+ });++ test('rejects unknown fields', function () {+ $response = $this->withHeaders(environmentUpdateApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/{$this->environment->uuid}", [+ 'name' => 'valid-name',+ 'unexpected' => 'value',+ ]);++ $response->assertUnprocessable();+ $response->assertJsonValidationErrors(['unexpected']);+ });++ test('returns 404 for another team project', function () {+ $otherTeam = Team::factory()->create();+ $otherProject = Project::factory()->create(['team_id' => $otherTeam->id]);+ $otherEnvironment = $otherProject->environments()->first()+ ?? Environment::factory()->create(['project_id' => $otherProject->id]);++ $response = $this->withHeaders(environmentUpdateApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$otherProject->uuid}/environments/{$otherEnvironment->uuid}", [+ 'name' => 'stolen',+ ]);++ $response->assertNotFound();+ });++ test('returns 409 when renaming to an existing environment name', function () {+ $other = Environment::factory()->create([+ 'project_id' => $this->project->id,+ 'name' => 'already-taken',+ ]);++ $response = $this->withHeaders(environmentUpdateApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/{$this->environment->uuid}", [+ 'name' => $other->name,+ ]);++ $response->assertStatus(409)+ ->assertJson(['message' => 'Environment with this name already exists.']);+ });++ test('returns 404 for missing environment', function () {+ $response = $this->withHeaders(environmentUpdateApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/environments/missing-env", [+ 'name' => 'new-name',+ ]);++ $response->assertNotFound();+ });+});diff --git a/tests/Feature/Api/LifecycleApisTest.php b/tests/Feature/Api/LifecycleApisTest.phpnew file mode 100644index 0000000000..913eac59a5--- /dev/null+++ b/tests/Feature/Api/LifecycleApisTest.php@@ -0,0 +1,419 @@+<?php++use App\Jobs\ScheduledTaskJob;+use App\Models\Application;+use App\Models\CloudInitScript;+use App\Models\Environment;+use App\Models\InstanceSettings;+use App\Models\LocalPersistentVolume;+use App\Models\Project;+use App\Models\ScheduledTask;+use App\Models\Server;+use App\Models\Service;+use App\Models\StandaloneDocker;+use App\Models\StandalonePostgresql;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Facades\Bus;+use Illuminate\Support\Facades\Queue;+use Illuminate\Support\Str;++uses(RefreshDatabase::class);++beforeEach(function () {+ config([+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ 'queue.default' => 'sync',+ 'app.maintenance.driver' => 'file',+ ]);++ InstanceSettings::unguarded(fn () => InstanceSettings::firstOrCreate(+ ['id' => 0],+ ['is_api_enabled' => true],+ ));++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);+ session(['currentTeam' => $this->team]);++ $plainTextToken = Str::random(40);+ $token = $this->user->tokens()->create([+ 'name' => 'lifecycle-api-test',+ 'token' => hash('sha256', $plainTextToken),+ 'abilities' => ['*'],+ 'team_id' => $this->team->id,+ ]);+ $this->headers = [+ 'Authorization' => 'Bearer '.$token->getKey().'|'.$plainTextToken,+ 'Content-Type' => 'application/json',+ ];++ $this->server = Server::factory()->create(['team_id' => $this->team->id]);+ $this->destination = StandaloneDocker::where('server_id', $this->server->id)->firstOrFail();+ $this->project = Project::factory()->create(['team_id' => $this->team->id]);+ $this->environment = $this->project->environments()->first()+ ?? Environment::factory()->create(['project_id' => $this->project->id]);++ $this->application = Application::factory()->create([+ 'environment_id' => $this->environment->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ 'name' => 'source-app',+ ]);+ $this->application->settings->fill([+ 'is_container_label_readonly_enabled' => false,+ ])->save();+});++describe('POST /api/v1/applications/{uuid}/clone', function () {+ test('clones an application and returns the new uuid', function () {+ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/applications/{$this->application->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ 'name' => 'cloned-app',+ ]);++ $response->assertCreated()+ ->assertJsonPath('message', 'Application cloned.')+ ->assertJsonStructure(['uuid', 'message']);++ $newUuid = $response->json('uuid');+ expect($newUuid)->not->toBe($this->application->uuid);++ $cloned = Application::where('uuid', $newUuid)->first();+ expect($cloned)->not->toBeNull()+ ->and($cloned->name)->toBe('cloned-app')+ ->and($cloned->environment_id)->toBe($this->application->environment_id)+ ->and($cloned->destination_id)->toBe($this->destination->id);+ });++ test('returns 404 for another team destination', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);+ $otherDestination = StandaloneDocker::where('server_id', $otherServer->id)->firstOrFail();++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/applications/{$this->application->uuid}/clone", [+ 'destination_uuid' => $otherDestination->uuid,+ ]);++ $response->assertNotFound();+ });++ test('returns 404 for another team application', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);+ $otherDestination = StandaloneDocker::where('server_id', $otherServer->id)->firstOrFail();+ $otherProject = Project::factory()->create(['team_id' => $otherTeam->id]);+ $otherEnvironment = $otherProject->environments()->first()+ ?? Environment::factory()->create(['project_id' => $otherProject->id]);+ $otherApp = Application::factory()->create([+ 'environment_id' => $otherEnvironment->id,+ 'destination_id' => $otherDestination->id,+ 'destination_type' => $otherDestination->getMorphClass(),+ ]);++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/applications/{$otherApp->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ ]);++ $response->assertNotFound();+ });+});++describe('POST /api/v1/databases/{uuid}/clone', function () {+ test('clones a database and returns the new uuid', function () {+ $database = StandalonePostgresql::create([+ 'name' => 'source-db',+ 'image' => 'postgres:17-alpine',+ 'postgres_user' => 'postgres',+ 'postgres_password' => 'password',+ 'postgres_db' => 'postgres',+ 'environment_id' => $this->environment->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ ]);++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/databases/{$database->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ 'name' => 'cloned-db',+ ]);++ $response->assertCreated()+ ->assertJsonPath('message', 'Database cloned.');++ $cloned = StandalonePostgresql::where('uuid', $response->json('uuid'))->first();+ expect($cloned)->not->toBeNull()+ ->and($cloned->name)->toBe('cloned-db')+ ->and($cloned->environment_id)->toBe($database->environment_id)+ ->and($cloned->destination_id)->toBe($this->destination->id)+ ->and(str($cloned->status)->startsWith('exited'))->toBeTrue();+ });++ test('creates renamed volumes when cloning a database with clone_volumes', function () {+ // Prevent remote stop/clone/start from running in unit tests.+ Bus::fake();++ $database = StandalonePostgresql::create([+ 'name' => 'source-db-volumes',+ 'image' => 'postgres:17-alpine',+ 'postgres_user' => 'postgres',+ 'postgres_password' => 'password',+ 'postgres_db' => 'postgres',+ 'environment_id' => $this->environment->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ ]);++ // Factory/create hooks may already create a data volume.+ if ($database->persistentStorages()->count() === 0) {+ LocalPersistentVolume::create([+ 'name' => 'postgres-data-'.$database->uuid,+ 'mount_path' => '/var/lib/postgresql/data',+ 'resource_id' => $database->id,+ 'resource_type' => $database->getMorphClass(),+ ]);+ }++ $sourceVolumeCount = $database->persistentStorages()->count();+ expect($sourceVolumeCount)->toBeGreaterThan(0);++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/databases/{$database->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ 'name' => 'cloned-db-volumes',+ 'clone_volumes' => true,+ ])+ ->assertCreated();++ $cloned = StandalonePostgresql::where('uuid', $response->json('uuid'))->firstOrFail();+ expect($cloned->persistentStorages()->count())->toBe($sourceVolumeCount)+ ->and($cloned->persistentStorages()->first()->name)->not->toBe($database->persistentStorages()->first()->name)+ ->and($cloned->persistentStorages()->first()->name)->toContain($cloned->uuid);+ });++ test('returns 404 for another team database', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);+ $otherDestination = StandaloneDocker::where('server_id', $otherServer->id)->firstOrFail();+ $otherProject = Project::factory()->create(['team_id' => $otherTeam->id]);+ $otherEnvironment = $otherProject->environments()->first()+ ?? Environment::factory()->create(['project_id' => $otherProject->id]);+ $otherDatabase = StandalonePostgresql::create([+ 'name' => 'other-db',+ 'image' => 'postgres:17-alpine',+ 'postgres_user' => 'postgres',+ 'postgres_password' => 'password',+ 'postgres_db' => 'postgres',+ 'environment_id' => $otherEnvironment->id,+ 'destination_id' => $otherDestination->id,+ 'destination_type' => $otherDestination->getMorphClass(),+ ]);++ $this->withHeaders($this->headers)+ ->postJson("/api/v1/databases/{$otherDatabase->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ ])+ ->assertNotFound();+ });+});++describe('POST /api/v1/services/{uuid}/clone', function () {+ test('clones a service and parses applications from compose', function () {+ $service = Service::factory()->create([+ 'name' => 'source-service',+ 'environment_id' => $this->environment->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ 'server_id' => $this->server->id,+ 'docker_compose_raw' => "services:\n web:\n image: nginx:alpine\n",+ 'compose_parsing_version' => '5',+ ]);+ $service->parse();+ expect($service->applications()->count())->toBeGreaterThan(0);++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/services/{$service->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ 'name' => 'cloned-service',+ ]);++ $response->assertCreated()+ ->assertJsonPath('message', 'Service cloned.');++ $cloned = Service::where('uuid', $response->json('uuid'))->first();+ expect($cloned)->not->toBeNull()+ ->and($cloned->name)->toBe('cloned-service')+ ->and($cloned->environment_id)->toBe($service->environment_id)+ ->and($cloned->applications()->count())->toBe($service->applications()->count());+ });++ test('returns 404 for another team service', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);+ $otherDestination = StandaloneDocker::where('server_id', $otherServer->id)->firstOrFail();+ $otherProject = Project::factory()->create(['team_id' => $otherTeam->id]);+ $otherEnvironment = $otherProject->environments()->first()+ ?? Environment::factory()->create(['project_id' => $otherProject->id]);+ $otherService = Service::factory()->create([+ 'environment_id' => $otherEnvironment->id,+ 'destination_id' => $otherDestination->id,+ 'destination_type' => $otherDestination->getMorphClass(),+ 'server_id' => $otherServer->id,+ 'docker_compose_raw' => "services:\n web:\n image: nginx:alpine\n",+ ]);++ $this->withHeaders($this->headers)+ ->postJson("/api/v1/services/{$otherService->uuid}/clone", [+ 'destination_uuid' => $this->destination->uuid,+ ])+ ->assertNotFound();+ });+});++describe('POST /api/v1/applications/{uuid}/scheduled-tasks/{task_uuid}/execute', function () {+ test('dispatches ScheduledTaskJob for an application task', function () {+ Queue::fake();++ $task = ScheduledTask::factory()->create([+ 'application_id' => $this->application->id,+ 'team_id' => $this->team->id,+ 'name' => 'nightly',+ ]);++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/applications/{$this->application->uuid}/scheduled-tasks/{$task->uuid}/execute");++ $response->assertOk()+ ->assertJsonPath('message', 'Scheduled task execution queued.');++ Queue::assertPushed(ScheduledTaskJob::class, fn (ScheduledTaskJob $job) => $job->task->is($task));+ });++ test('returns 404 for unknown task', function () {+ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/applications/{$this->application->uuid}/scheduled-tasks/missing-task/execute");++ $response->assertNotFound();+ });+});++describe('PATCH /api/v1/databases/{uuid} health check fields', function () {+ test('can update database health_check fields', function () {+ $database = StandalonePostgresql::create([+ 'name' => 'pg-health',+ 'uuid' => (string) Str::uuid(),+ 'postgres_password' => 'secret',+ 'environment_id' => $this->environment->id,+ 'destination_id' => $this->destination->id,+ 'destination_type' => $this->destination->getMorphClass(),+ ]);++ $response = $this->withHeaders($this->headers)+ ->patchJson("/api/v1/databases/{$database->uuid}", [+ 'health_check_enabled' => false,+ 'health_check_interval' => 30,+ 'health_check_timeout' => 10,+ 'health_check_retries' => 3,+ 'health_check_start_period' => 20,+ ]);++ $response->assertOk();++ $database->refresh();+ expect($database->health_check_enabled)->toBeFalse()+ ->and($database->health_check_interval)->toBe(30)+ ->and($database->health_check_timeout)->toBe(10)+ ->and($database->health_check_retries)->toBe(3)+ ->and($database->health_check_start_period)->toBe(20);+ });+});++describe('Cloud-init scripts CRUD', function () {+ test('creates lists updates and deletes cloud-init scripts for the team', function () {+ $create = $this->withHeaders($this->headers)+ ->postJson('/api/v1/cloud-init-scripts', [+ 'name' => 'bootstrap',+ 'script' => "#!/bin/bash\necho hello",+ ]);++ $create->assertCreated()+ ->assertJsonPath('name', 'bootstrap')+ ->assertJsonStructure(['uuid', 'name']);++ $uuid = $create->json('uuid');++ $list = $this->withHeaders($this->headers)+ ->getJson('/api/v1/cloud-init-scripts');+ $list->assertOk();+ expect(collect($list->json())->pluck('uuid'))->toContain($uuid);++ $show = $this->withHeaders($this->headers)+ ->getJson("/api/v1/cloud-init-scripts/{$uuid}");+ $show->assertOk()->assertJsonPath('name', 'bootstrap');++ $update = $this->withHeaders($this->headers)+ ->patchJson("/api/v1/cloud-init-scripts/{$uuid}", [+ 'name' => 'bootstrap-v2',+ ]);+ $update->assertOk()->assertJsonPath('name', 'bootstrap-v2');++ $delete = $this->withHeaders($this->headers)+ ->deleteJson("/api/v1/cloud-init-scripts/{$uuid}");+ $delete->assertOk();++ expect(CloudInitScript::where('uuid', $uuid)->exists())->toBeFalse();+ });++ test('returns 404 for another team cloud-init script', function () {+ $otherTeam = Team::factory()->create();+ $script = CloudInitScript::create([+ 'team_id' => $otherTeam->id,+ 'name' => 'other',+ 'script' => "#!/bin/bash\necho other",+ ]);++ $this->withHeaders($this->headers)+ ->getJson("/api/v1/cloud-init-scripts/{$script->uuid}")+ ->assertNotFound();++ $this->withHeaders($this->headers)+ ->patchJson("/api/v1/cloud-init-scripts/{$script->uuid}", ['name' => 'nope'])+ ->assertNotFound();++ $this->withHeaders($this->headers)+ ->deleteJson("/api/v1/cloud-init-scripts/{$script->uuid}")+ ->assertNotFound();+ });+});++describe('Application multi-destination cross-team', function () {+ test('returns 404 when attaching another team destination', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);+ $otherDestination = StandaloneDocker::where('server_id', $otherServer->id)->firstOrFail();++ $response = $this->withHeaders($this->headers)+ ->postJson("/api/v1/applications/{$this->application->uuid}/destinations", [+ 'destination_uuid' => $otherDestination->uuid,+ ]);++ $response->assertNotFound();+ expect($this->application->fresh()->additional_networks)->toHaveCount(0);+ });++ test('lists primary destination', function () {+ $response = $this->withHeaders($this->headers)+ ->getJson("/api/v1/applications/{$this->application->uuid}/destinations");++ $response->assertOk();+ expect($response->json())->toHaveCount(1)+ ->and($response->json('0.uuid'))->toBe($this->destination->uuid)+ ->and($response->json('0.is_primary'))->toBeTrue();+ });+});diff --git a/tests/Feature/Api/NotificationsApiTest.php b/tests/Feature/Api/NotificationsApiTest.phpnew file mode 100644index 0000000000..647c327dee--- /dev/null+++ b/tests/Feature/Api/NotificationsApiTest.php@@ -0,0 +1,342 @@+<?php++use App\Models\DiscordNotificationSettings;+use App\Models\EmailNotificationSettings;+use App\Models\InstanceSettings;+use App\Models\PushoverNotificationSettings;+use App\Models\SlackNotificationSettings;+use App\Models\Team;+use App\Models\TelegramNotificationSettings;+use App\Models\User;+use App\Models\WebhookNotificationSettings;+use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Once;++uses(RefreshDatabase::class);++beforeEach(function () {+ config([+ 'app.maintenance.driver' => 'file',+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ ]);++ InstanceSettings::query()->whereKey(0)->delete();+ $settings = new InstanceSettings(['is_api_enabled' => true]);+ $settings->id = 0;+ $settings->save();+ Once::flush();++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);++ session(['currentTeam' => $this->team]);++ $this->token = $this->user->createToken('test-token', ['*']);+ $this->bearerToken = $this->token->plainTextToken;+});++function authHeaders(string $token): array+{+ return [+ 'Authorization' => 'Bearer '.$token,+ 'Content-Type' => 'application/json',+ 'Accept' => 'application/json',+ ];+}++describe('GET /api/v1/notifications/*', function () {+ test('returns email notification settings for the current team', function () {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->getJson('/api/v1/notifications/email');++ $response->assertSuccessful();+ $response->assertJsonFragment([+ 'team_id' => $this->team->id,+ 'smtp_enabled' => false,+ ]);+ $response->assertJsonStructure([+ 'team_id',+ 'smtp_enabled',+ 'deployment_failure_email_notifications',+ 'use_instance_email_settings',+ ]);+ });++ test('returns settings for every notification channel', function (string $channel) {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->getJson("/api/v1/notifications/{$channel}");++ $response->assertSuccessful();+ $response->assertJsonPath('team_id', $this->team->id);+ })->with([+ 'email',+ 'discord',+ 'slack',+ 'telegram',+ 'pushover',+ 'webhook',+ ]);++ test('hides encrypted secrets without read:sensitive ability', function () {+ $this->team->discordNotificationSettings->update([+ 'discord_webhook_url' => 'https://discord.com/api/webhooks/hidden/secret',+ 'discord_enabled' => true,+ ]);++ $readToken = $this->user->createToken('read-token', ['read'])->plainTextToken;++ $response = $this->withHeaders(authHeaders($readToken))+ ->getJson('/api/v1/notifications/discord');++ $response->assertSuccessful();+ $response->assertJsonMissingPath('discord_webhook_url');+ expect($response->getContent())->not->toContain('hidden/secret');+ });++ test('includes encrypted secrets with read:sensitive ability for admins', function () {+ $this->team->discordNotificationSettings->update([+ 'discord_webhook_url' => 'https://discord.com/api/webhooks/visible/secret-token',+ 'discord_enabled' => true,+ ]);++ $sensitiveToken = $this->user->createToken('read-sensitive-token', ['read', 'read:sensitive'])->plainTextToken;++ $response = $this->withHeaders(authHeaders($sensitiveToken))+ ->getJson('/api/v1/notifications/discord');++ $response->assertSuccessful();+ $response->assertJsonFragment([+ 'discord_webhook_url' => 'https://discord.com/api/webhooks/visible/secret-token',+ ]);+ });++ test('member with read token can view settings but not secrets', function () {+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ session(['currentTeam' => $this->team]);++ $this->team->emailNotificationSettings->update([+ 'smtp_password' => 'super-secret-password',+ 'smtp_enabled' => true,+ ]);++ $memberToken = $member->createToken('member-read', ['read'])->plainTextToken;++ $response = $this->withHeaders(authHeaders($memberToken))+ ->getJson('/api/v1/notifications/email');++ $response->assertSuccessful();+ $response->assertJsonPath('smtp_enabled', true);+ $response->assertJsonMissingPath('smtp_password');+ expect($response->getContent())->not->toContain('super-secret-password');+ });++ test('member cannot use read:sensitive token ability', function () {+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ session(['currentTeam' => $this->team]);++ $memberToken = $member->createToken('member-sensitive', ['read', 'read:sensitive'])->plainTextToken;++ $this->withHeaders(authHeaders($memberToken))+ ->getJson('/api/v1/notifications/email')+ ->assertForbidden();+ });++ test('rejects unauthenticated requests', function () {+ $this->getJson('/api/v1/notifications/email')+ ->assertStatus(401);+ });++ test('firstOrCreate restores missing channel settings', function () {+ DiscordNotificationSettings::query()->where('team_id', $this->team->id)->delete();++ expect(DiscordNotificationSettings::query()->where('team_id', $this->team->id)->exists())->toBeFalse();++ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->getJson('/api/v1/notifications/discord');++ $response->assertSuccessful();+ $response->assertJsonPath('team_id', $this->team->id);+ expect(DiscordNotificationSettings::query()->where('team_id', $this->team->id)->exists())->toBeTrue();+ });+});++describe('PATCH /api/v1/notifications/*', function () {+ test('updates email notification settings', function () {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->patchJson('/api/v1/notifications/email', [+ 'smtp_enabled' => true,+ 'smtp_from_address' => '[email protected]',+ 'smtp_host' => 'smtp.example.com',+ 'smtp_port' => 587,+ 'smtp_encryption' => 'starttls',+ 'deployment_failure_email_notifications' => false,+ ]);++ $response->assertSuccessful();+ $response->assertJsonPath('smtp_enabled', true);+ $response->assertJsonPath('deployment_failure_email_notifications', false);++ $settings = EmailNotificationSettings::query()->where('team_id', $this->team->id)->first();+ expect($settings->smtp_enabled)->toBeTrue()+ ->and($settings->smtp_from_address)->toBe('[email protected]')+ ->and($settings->smtp_host)->toBe('smtp.example.com')+ ->and($settings->smtp_port)->toBe(587)+ ->and($settings->deployment_failure_email_notifications)->toBeFalse();+ });++ test('updates discord notification settings', function () {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->patchJson('/api/v1/notifications/discord', [+ 'discord_enabled' => true,+ 'discord_webhook_url' => 'https://discord.com/api/webhooks/123/abc',+ 'discord_ping_enabled' => false,+ 'deployment_success_discord_notifications' => true,+ ]);++ $response->assertSuccessful();+ $response->assertJsonPath('discord_enabled', true);+ $response->assertJsonPath('discord_ping_enabled', false);++ $settings = DiscordNotificationSettings::query()->where('team_id', $this->team->id)->first();+ expect($settings->discord_enabled)->toBeTrue()+ ->and($settings->discord_webhook_url)->toBe('https://discord.com/api/webhooks/123/abc')+ ->and($settings->discord_ping_enabled)->toBeFalse()+ ->and($settings->deployment_success_discord_notifications)->toBeTrue();+ });++ test('updates slack, telegram, pushover, and webhook channels', function (string $channel, array $payload, string $modelClass, string $enabledField) {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->patchJson("/api/v1/notifications/{$channel}", $payload);++ $response->assertSuccessful();+ $response->assertJsonPath($enabledField, true);++ $settings = $modelClass::query()->where('team_id', $this->team->id)->first();+ expect($settings->{$enabledField})->toBeTrue();+ })->with([+ 'slack' => [+ 'slack',+ [+ 'slack_enabled' => true,+ 'slack_webhook_url' => 'https://hooks.slack.com/services/T00/B00/xxx',+ 'deployment_failure_slack_notifications' => true,+ ],+ SlackNotificationSettings::class,+ 'slack_enabled',+ ],+ 'telegram' => [+ 'telegram',+ [+ 'telegram_enabled' => true,+ 'telegram_token' => '123456:ABC-DEF',+ 'telegram_chat_id' => '-100123',+ 'deployment_failure_telegram_notifications' => true,+ ],+ TelegramNotificationSettings::class,+ 'telegram_enabled',+ ],+ 'pushover' => [+ 'pushover',+ [+ 'pushover_enabled' => true,+ 'pushover_user_key' => 'user-key',+ 'pushover_api_token' => 'api-token',+ 'deployment_failure_pushover_notifications' => true,+ ],+ PushoverNotificationSettings::class,+ 'pushover_enabled',+ ],+ 'webhook' => [+ 'webhook',+ [+ 'webhook_enabled' => true,+ 'webhook_url' => 'https://example.com/hooks/coolify',+ 'deployment_failure_webhook_notifications' => true,+ ],+ WebhookNotificationSettings::class,+ 'webhook_enabled',+ ],+ ]);++ test('rejects unknown fields with 422', function () {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->patchJson('/api/v1/notifications/email', [+ 'smtp_enabled' => true,+ 'not_a_real_field' => 'nope',+ ]);++ $response->assertStatus(422);+ $response->assertJsonPath('errors.not_a_real_field.0', 'This field is not allowed.');+ });++ test('rejects team_id mass assignment attempts', function () {+ $otherTeam = Team::factory()->create();++ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->patchJson('/api/v1/notifications/discord', [+ 'discord_enabled' => true,+ 'team_id' => $otherTeam->id,+ ]);++ $response->assertStatus(422);+ $response->assertJsonPath('errors.team_id.0', 'This field is not allowed.');+ });++ test('requires write ability', function () {+ $readToken = $this->user->createToken('read-only', ['read'])->plainTextToken;++ $response = $this->withHeaders(authHeaders($readToken))+ ->patchJson('/api/v1/notifications/email', [+ 'smtp_enabled' => true,+ ]);++ $response->assertForbidden();+ });++ test('forbids members from updating notification settings', function () {+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ session(['currentTeam' => $this->team]);+ $memberToken = $member->createToken('member-write', ['read', 'write'])->plainTextToken;++ $response = $this->withHeaders(authHeaders($memberToken))+ ->patchJson('/api/v1/notifications/email', [+ 'smtp_enabled' => true,+ ]);++ $response->assertForbidden();+ });++ test('rejects empty json body', function () {+ $response = $this->withHeaders(authHeaders($this->bearerToken))+ ->patchJson('/api/v1/notifications/email', []);++ $response->assertStatus(400);+ });++ test('does not leak updates across teams', function () {+ $otherTeam = Team::factory()->create();+ $otherUser = User::factory()->create();+ $otherTeam->members()->attach($otherUser->id, ['role' => 'owner']);+ session(['currentTeam' => $otherTeam]);+ $otherToken = $otherUser->createToken('other-token', ['*'])->plainTextToken;++ $this->withHeaders(authHeaders($otherToken))+ ->patchJson('/api/v1/notifications/email', [+ 'smtp_enabled' => true,+ 'smtp_from_address' => '[email protected]',+ ])+ ->assertSuccessful();++ $thisTeamSettings = EmailNotificationSettings::query()->where('team_id', $this->team->id)->first();+ $otherSettings = EmailNotificationSettings::query()->where('team_id', $otherTeam->id)->first();++ expect($thisTeamSettings->smtp_enabled)->toBeFalse()+ ->and($otherSettings->smtp_enabled)->toBeTrue()+ ->and($otherSettings->smtp_from_address)->toBe('[email protected]');+ });+});diff --git a/tests/Feature/Api/S3StoragesApiTest.php b/tests/Feature/Api/S3StoragesApiTest.phpnew file mode 100644index 0000000000..f2bd3d5b56--- /dev/null+++ b/tests/Feature/Api/S3StoragesApiTest.php@@ -0,0 +1,543 @@+<?php++use App\Models\InstanceSettings;+use App\Models\S3Storage;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Facades\Log;+use Illuminate\Support\Facades\Storage;+use Illuminate\Support\Once;++uses(RefreshDatabase::class);++beforeEach(function () {+ config([+ 'app.maintenance.driver' => 'file',+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ ]);++ InstanceSettings::query()->whereKey(0)->delete();+ $settings = new InstanceSettings(['is_api_enabled' => true]);+ $settings->id = 0;+ $settings->save();+ Once::flush();++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);++ session(['currentTeam' => $this->team]);++ $this->token = $this->user->createToken('test-token', ['*']);+ $this->bearerToken = $this->token->plainTextToken;+});++function createS3StorageForTeam(Team $team, array $overrides = []): S3Storage+{+ return S3Storage::create(array_merge([+ 'team_id' => $team->id,+ 'name' => 'Team S3 Storage',+ 'description' => 'Test storage',+ 'region' => 'us-east-1',+ 'key' => 'test-access-key',+ 'secret' => 'test-secret-key',+ 'bucket' => 'test-bucket',+ 'endpoint' => 'https://s3.amazonaws.com',+ 'is_usable' => false,+ ], $overrides));+}++function validS3StoragePayload(array $overrides = []): array+{+ return array_merge([+ 'name' => 'My S3 Storage',+ 'description' => 'Backup storage',+ 'endpoint' => 'https://s3.amazonaws.com',+ 'bucket' => 'coolify-backups',+ 'region' => 'us-east-1',+ 'key' => 'AKIAEXAMPLEKEY',+ 'secret' => 'example-secret-value',+ ], $overrides);+}++describe('GET /api/v1/s3-storages', function () {+ test('lists all s3 storages for the team', function () {+ createS3StorageForTeam($this->team, ['name' => 'Storage One', 'bucket' => 'bucket-one']);+ createS3StorageForTeam($this->team, ['name' => 'Storage Two', 'bucket' => 'bucket-two']);+ createS3StorageForTeam($this->team, ['name' => 'Storage Three', 'bucket' => 'bucket-three']);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->getJson('/api/v1/s3-storages');++ $response->assertStatus(200);+ $response->assertJsonCount(3);+ $response->assertJsonStructure([+ '*' => ['uuid', 'name', 'description', 'endpoint', 'bucket', 'region', 'is_usable', 'team_id', 'created_at', 'updated_at'],+ ]);+ });++ test('does not include storages from other teams', function () {+ createS3StorageForTeam($this->team);++ $otherTeam = Team::factory()->create();+ createS3StorageForTeam($otherTeam, ['name' => 'Other Team Storage', 'bucket' => 'other-bucket']);+ createS3StorageForTeam($otherTeam, ['name' => 'Other Team Storage 2', 'bucket' => 'other-bucket-2']);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->getJson('/api/v1/s3-storages');++ $response->assertStatus(200);+ $response->assertJsonCount(1);+ });++ test('rejects request without authentication', function () {+ $response = $this->getJson('/api/v1/s3-storages');+ $response->assertStatus(401);+ });++ test('read token does not include key and secret values', function () {+ createS3StorageForTeam($this->team, [+ 'key' => 'hidden-access-key',+ 'secret' => 'hidden-secret-key',+ ]);++ $readToken = $this->user->createToken('read-token', ['read'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$readToken,+ 'Content-Type' => 'application/json',+ ])->getJson('/api/v1/s3-storages');++ $response->assertSuccessful();+ expect($response->getContent())->not->toContain('hidden-access-key');+ expect($response->getContent())->not->toContain('hidden-secret-key');+ expect($response->getContent())->not->toContain('"key":');+ expect($response->getContent())->not->toContain('"secret":');+ });++ test('read sensitive token includes key and secret values', function () {+ createS3StorageForTeam($this->team, [+ 'key' => 'visible-access-key',+ 'secret' => 'visible-secret-key',+ ]);++ $readSensitiveToken = $this->user->createToken('read-sensitive-token', ['read', 'read:sensitive'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$readSensitiveToken,+ 'Content-Type' => 'application/json',+ ])->getJson('/api/v1/s3-storages');++ $response->assertSuccessful();+ $response->assertJsonFragment([+ 'key' => 'visible-access-key',+ 'secret' => 'visible-secret-key',+ ]);+ });++ test('root token includes key and secret values', function () {+ createS3StorageForTeam($this->team, [+ 'key' => 'root-access-key',+ 'secret' => 'root-secret-key',+ ]);++ $rootToken = $this->user->createToken('root-token', ['root'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$rootToken,+ 'Content-Type' => 'application/json',+ ])->getJson('/api/v1/s3-storages');++ $response->assertSuccessful();+ $response->assertJsonFragment([+ 'key' => 'root-access-key',+ 'secret' => 'root-secret-key',+ ]);+ });+});++describe('GET /api/v1/s3-storages/{uuid}', function () {+ test('gets s3 storage by UUID', function () {+ $storage = createS3StorageForTeam($this->team, [+ 'name' => 'Primary Backup',+ 'bucket' => 'primary-backup',+ ]);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->getJson("/api/v1/s3-storages/{$storage->uuid}");++ $response->assertStatus(200);+ $response->assertJsonFragment([+ 'name' => 'Primary Backup',+ 'bucket' => 'primary-backup',+ 'region' => 'us-east-1',+ ]);+ });++ test('returns 404 for non-existent storage', function () {+ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->getJson('/api/v1/s3-storages/non-existent-uuid');++ $response->assertStatus(404);+ });++ test('cannot access storage from another team', function () {+ $otherTeam = Team::factory()->create();+ $storage = createS3StorageForTeam($otherTeam);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->getJson("/api/v1/s3-storages/{$storage->uuid}");++ $response->assertStatus(404);+ });++ test('read token does not include key and secret by UUID', function () {+ $storage = createS3StorageForTeam($this->team, [+ 'key' => 'hidden-detail-key',+ 'secret' => 'hidden-detail-secret',+ ]);++ $readToken = $this->user->createToken('read-token', ['read'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$readToken,+ 'Content-Type' => 'application/json',+ ])->getJson("/api/v1/s3-storages/{$storage->uuid}");++ $response->assertSuccessful();+ expect($response->getContent())->not->toContain('hidden-detail-key');+ expect($response->getContent())->not->toContain('hidden-detail-secret');+ });++ test('read sensitive token includes key and secret by UUID', function () {+ $storage = createS3StorageForTeam($this->team, [+ 'key' => 'visible-detail-key',+ 'secret' => 'visible-detail-secret',+ ]);++ $readSensitiveToken = $this->user->createToken('read-sensitive-token', ['read', 'read:sensitive'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$readSensitiveToken,+ 'Content-Type' => 'application/json',+ ])->getJson("/api/v1/s3-storages/{$storage->uuid}");++ $response->assertSuccessful();+ $response->assertJsonFragment([+ 'key' => 'visible-detail-key',+ 'secret' => 'visible-detail-secret',+ ]);+ });+});++describe('POST /api/v1/s3-storages', function () {+ test('creates an s3 storage', function () {+ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', validS3StoragePayload());++ $response->assertStatus(201);+ $response->assertJsonStructure(['uuid']);++ $this->assertDatabaseHas('s3_storages', [+ 'team_id' => $this->team->id,+ 'name' => 'My S3 Storage',+ 'bucket' => 'coolify-backups',+ 'region' => 'us-east-1',+ ]);+ });++ test('validates name is required', function () {+ $payload = validS3StoragePayload();+ unset($payload['name']);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', $payload);++ $response->assertStatus(422);+ $response->assertJsonValidationErrors(['name']);+ });++ test('validates key is required', function () {+ $payload = validS3StoragePayload();+ unset($payload['key']);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', $payload);++ $response->assertStatus(422);+ $response->assertJsonValidationErrors(['key']);+ });++ test('validates secret is required', function () {+ $payload = validS3StoragePayload();+ unset($payload['secret']);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', $payload);++ $response->assertStatus(422);+ $response->assertJsonValidationErrors(['secret']);+ });++ test('validates bucket format', function () {+ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', validS3StoragePayload([+ 'bucket' => 'Invalid_Bucket',+ ]));++ $response->assertStatus(422);+ $response->assertJsonValidationErrors(['bucket']);+ });++ test('rejects unsafe endpoints', function () {+ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', validS3StoragePayload([+ 'endpoint' => 'http://127.0.0.1:9000',+ ]));++ $response->assertStatus(422);+ $response->assertJsonValidationErrors(['endpoint']);+ });++ test('rejects extra fields not in allowed list', function () {+ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson('/api/v1/s3-storages', validS3StoragePayload([+ 'invalid_field' => 'invalid_value',+ ]));++ $response->assertStatus(422);+ });+});++describe('PATCH /api/v1/s3-storages/{uuid}', function () {+ test('updates s3 storage name', function () {+ $storage = createS3StorageForTeam($this->team, ['name' => 'Old Name']);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->patchJson("/api/v1/s3-storages/{$storage->uuid}", [+ 'name' => 'New Name',+ ]);++ $response->assertStatus(200);++ $this->assertDatabaseHas('s3_storages', [+ 'uuid' => $storage->uuid,+ 'name' => 'New Name',+ ]);+ });++ test('updates multiple fields', function () {+ $storage = createS3StorageForTeam($this->team);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->patchJson("/api/v1/s3-storages/{$storage->uuid}", [+ 'name' => 'Updated Storage',+ 'region' => 'eu-west-1',+ 'bucket' => 'updated-bucket',+ ]);++ $response->assertStatus(200);++ $this->assertDatabaseHas('s3_storages', [+ 'uuid' => $storage->uuid,+ 'name' => 'Updated Storage',+ 'region' => 'eu-west-1',+ 'bucket' => 'updated-bucket',+ ]);+ });++ test('rejects empty body', function () {+ $storage = createS3StorageForTeam($this->team);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->patchJson("/api/v1/s3-storages/{$storage->uuid}", []);++ $response->assertStatus(400);+ $response->assertJson([+ 'message' => 'Invalid request.',+ 'error' => 'Invalid JSON.',+ ]);+ });++ test('cannot update storage from another team', function () {+ $otherTeam = Team::factory()->create();+ $storage = createS3StorageForTeam($otherTeam);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->patchJson("/api/v1/s3-storages/{$storage->uuid}", [+ 'name' => 'New Name',+ ]);++ $response->assertStatus(404);+ });++ test('rejects extra fields on update', function () {+ $storage = createS3StorageForTeam($this->team);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->patchJson("/api/v1/s3-storages/{$storage->uuid}", [+ 'name' => 'New Name',+ 'team_id' => 999,+ ]);++ $response->assertStatus(422);+ });+});++describe('DELETE /api/v1/s3-storages/{uuid}', function () {+ test('deletes s3 storage', function () {+ $storage = createS3StorageForTeam($this->team);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->deleteJson("/api/v1/s3-storages/{$storage->uuid}");++ $response->assertStatus(200);+ $response->assertJson(['message' => 'S3 storage deleted.']);++ $this->assertDatabaseMissing('s3_storages', [+ 'uuid' => $storage->uuid,+ ]);+ });++ test('cannot delete storage from another team', function () {+ $otherTeam = Team::factory()->create();+ $storage = createS3StorageForTeam($otherTeam);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->deleteJson("/api/v1/s3-storages/{$storage->uuid}");++ $response->assertStatus(404);+ });++ test('returns 404 for non-existent storage', function () {+ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->deleteJson('/api/v1/s3-storages/non-existent-uuid');++ $response->assertStatus(404);+ });+});++describe('POST /api/v1/s3-storages/{uuid}/validate', function () {+ test('validates a working s3 storage connection', function () {+ $storage = createS3StorageForTeam($this->team);++ $disk = Mockery::mock();+ $disk->expects('files')->once()->andReturn([]);+ Storage::expects('build')->once()->andReturn($disk);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson("/api/v1/s3-storages/{$storage->uuid}/validate");++ $response->assertStatus(200);+ $response->assertJson([+ 'valid' => true,+ 'message' => 'S3 storage connection is valid.',+ ]);++ expect($storage->fresh()->is_usable)->toBeTrue();+ });++ test('detects an invalid s3 storage connection', function () {+ $storage = createS3StorageForTeam($this->team, ['is_usable' => true]);++ $disk = Mockery::mock();+ $disk->expects('files')+ ->once()+ ->andThrow(new RuntimeException('Access Denied'));+ Storage::expects('build')->once()->andReturn($disk);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson("/api/v1/s3-storages/{$storage->uuid}/validate");++ $response->assertStatus(200);+ $response->assertJson([+ 'valid' => false,+ 'message' => 'Access Denied',+ ]);++ expect($storage->fresh()->is_usable)->toBeFalse();+ });++ test('cannot validate storage from another team', function () {+ $otherTeam = Team::factory()->create();+ $storage = createS3StorageForTeam($otherTeam);++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson("/api/v1/s3-storages/{$storage->uuid}/validate");++ $response->assertStatus(404);+ });++ test('writes an audit log entry when validating storage', function () {+ $storage = createS3StorageForTeam($this->team, ['name' => 'Audit Storage']);++ $disk = Mockery::mock();+ $disk->expects('files')->once()->andReturn([]);+ Storage::expects('build')->once()->andReturn($disk);++ $auditChannel = Mockery::mock();+ $auditChannel->shouldReceive('info')+ ->once()+ ->with('api.s3_storage.validated', Mockery::on(function (array $context) use ($storage) {+ return $context['s3_storage_uuid'] === $storage->uuid+ && $context['s3_storage_name'] === 'Audit Storage'+ && $context['valid'] === true;+ }));++ Log::shouldReceive('channel')->with('audit')->andReturn($auditChannel);++ $this->withHeaders([+ 'Authorization' => 'Bearer '.$this->bearerToken,+ 'Content-Type' => 'application/json',+ ])->postJson("/api/v1/s3-storages/{$storage->uuid}/validate")+ ->assertOk();+ });+});diff --git a/tests/Feature/Api/ServerProxyApiTest.php b/tests/Feature/Api/ServerProxyApiTest.phpnew file mode 100644index 0000000000..03c88be2a9--- /dev/null+++ b/tests/Feature/Api/ServerProxyApiTest.php@@ -0,0 +1,231 @@+<?php++use App\Actions\Proxy\SaveProxyConfiguration;+use App\Actions\Proxy\StartProxy;+use App\Enums\ProxyTypes;+use App\Jobs\RestartProxyJob;+use App\Models\InstanceSettings;+use App\Models\Server;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Facades\Queue;+use Illuminate\Support\Str;++uses(RefreshDatabase::class);++beforeEach(function () {+ config([+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ 'queue.default' => 'sync',+ 'app.maintenance.driver' => 'file',+ ]);++ InstanceSettings::unguarded(fn () => InstanceSettings::firstOrCreate(+ ['id' => 0],+ ['is_api_enabled' => true],+ ));++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);+ session(['currentTeam' => $this->team]);++ $this->bearerToken = serverProxyApiToken($this->user, $this->team, ['*']);+ $this->server = Server::factory()->create(['team_id' => $this->team->id]);+ $this->server->proxy->set('type', ProxyTypes::TRAEFIK->value);+ $this->server->proxy->set('status', 'exited');+ $this->server->proxy->redirect_enabled = true;+ $this->server->save();+});++function serverProxyApiHeaders(string $bearerToken): array+{+ return [+ 'Authorization' => 'Bearer '.$bearerToken,+ 'Content-Type' => 'application/json',+ ];+}++function serverProxyApiToken(User $user, Team $team, array $abilities): string+{+ $plainTextToken = Str::random(40);+ $token = $user->tokens()->create([+ 'name' => 'server-proxy-api-test-'.Str::random(6),+ 'token' => hash('sha256', $plainTextToken),+ 'abilities' => $abilities,+ 'team_id' => $team->id,+ ]);++ return $token->getKey().'|'.$plainTextToken;+}++test('GET /api/v1/servers/{uuid}/proxy returns proxy settings without configuration when none is stored', function () {+ $sensitiveToken = serverProxyApiToken($this->user, $this->team, ['read', 'read:sensitive']);++ $this->withHeaders(serverProxyApiHeaders($sensitiveToken))+ ->getJson("/api/v1/servers/{$this->server->uuid}/proxy")+ ->assertOk()+ ->assertJsonPath('proxy_type', ProxyTypes::TRAEFIK->value)+ ->assertJsonPath('redirect_enabled', true)+ ->assertJsonPath('redirect_url', null)+ ->assertJsonPath('generate_exact_labels', false)+ ->assertJsonPath('configuration', null);+});++test('GET /api/v1/servers/{uuid}/proxy omits stored configuration without read:sensitive', function () {+ $compose = "services:\n traefik:\n image: traefik:v3.5\n";+ $this->server->proxy->set('last_saved_proxy_configuration', $compose);+ $this->server->save();++ // '*' tokens grant all abilities including read:sensitive; use a read-only token.+ $readToken = serverProxyApiToken($this->user, $this->team, ['read']);++ $this->withHeaders(serverProxyApiHeaders($readToken))+ ->getJson("/api/v1/servers/{$this->server->uuid}/proxy")+ ->assertOk()+ ->assertJsonMissingPath('configuration');+});++test('GET /api/v1/servers/{uuid}/proxy returns stored configuration with read:sensitive for admins', function () {+ $compose = "services:\n traefik:\n image: traefik:v3.5\n";+ $this->server->proxy->set('last_saved_proxy_configuration', $compose);+ $this->server->save();++ $sensitiveToken = serverProxyApiToken($this->user, $this->team, ['read', 'read:sensitive']);++ $this->withHeaders(serverProxyApiHeaders($sensitiveToken))+ ->getJson("/api/v1/servers/{$this->server->uuid}/proxy")+ ->assertOk()+ ->assertJsonPath('configuration', $compose);+});++test('GET /api/v1/servers/{uuid}/proxy hides configuration from non-admin users with read:sensitive', function () {+ $compose = "services:\n traefik:\n image: traefik:v3.5\n";+ $this->server->proxy->set('last_saved_proxy_configuration', $compose);+ $this->server->save();++ // ApiSensitiveData requires admin/owner of the token team even with read:sensitive.+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ session(['currentTeam' => $this->team]);+ $memberToken = serverProxyApiToken($member, $this->team, ['read', 'read:sensitive']);++ // Members may be forbidden from viewing servers via policy; when allowed, config must still be hidden.+ $response = $this->withHeaders(serverProxyApiHeaders($memberToken))+ ->getJson("/api/v1/servers/{$this->server->uuid}/proxy");++ if ($response->status() === 200) {+ $response->assertJsonMissingPath('configuration');+ } else {+ $response->assertForbidden();+ }+});++test('GET /api/v1/servers/{uuid}/proxy does not expose another team server', function () {+ $otherTeam = Team::factory()->create();+ $otherServer = Server::factory()->create(['team_id' => $otherTeam->id]);++ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->getJson("/api/v1/servers/{$otherServer->uuid}/proxy")+ ->assertNotFound();+});++test('PATCH /api/v1/servers/{uuid}/proxy updates redirect and label settings without SSH', function () {+ // Factory servers are not reachable, so setupDefaultRedirect is skipped.+ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/servers/{$this->server->uuid}/proxy", [+ 'redirect_enabled' => false,+ 'redirect_url' => null,+ 'generate_exact_labels' => true,+ ])+ ->assertOk()+ ->assertJsonPath('redirect_enabled', false)+ ->assertJsonPath('redirect_url', null)+ ->assertJsonPath('generate_exact_labels', true);++ $server = $this->server->fresh();++ expect((bool) data_get($server->proxy, 'redirect_enabled'))->toBeFalse()+ ->and(data_get($server->proxy, 'redirect_url'))->toBeNull()+ ->and((bool) $server->settings->generate_exact_labels)->toBeTrue();+});++test('PATCH /api/v1/servers/{uuid}/proxy rejects unknown fields', function () {+ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/servers/{$this->server->uuid}/proxy", [+ 'redirect_enabled' => true,+ 'unknown_field' => 'nope',+ ])+ ->assertUnprocessable()+ ->assertJsonPath('errors.unknown_field.0', 'This field is not allowed.');+});++test('PATCH /api/v1/servers/{uuid}/proxy rejects invalid proxy type', function () {+ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/servers/{$this->server->uuid}/proxy", [+ 'proxy_type' => 'haproxy',+ ])+ ->assertUnprocessable()+ ->assertJsonPath('errors.proxy_type.0', 'Invalid proxy type.');+});++test('PATCH /api/v1/servers/{uuid}/proxy can change proxy type asynchronously', function () {+ StartProxy::shouldRun()->andReturn('OK');++ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->patchJson("/api/v1/servers/{$this->server->uuid}/proxy", [+ 'proxy_type' => 'caddy',+ ])+ ->assertOk()+ ->assertJsonPath('proxy_type', ProxyTypes::CADDY->value);++ expect($this->server->fresh()->proxyType())->toBe(ProxyTypes::CADDY->value);+});++test('PUT /api/v1/servers/{uuid}/proxy/configuration saves base64 configuration via action', function () {+ $compose = "services:\n traefik:\n image: traefik:v3.5\n";++ SaveProxyConfiguration::shouldRun()+ ->once()+ ->withArgs(function (Server $server, string $configuration) use ($compose) {+ return $server->is($this->server) && $configuration === $compose;+ });++ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->putJson("/api/v1/servers/{$this->server->uuid}/proxy/configuration", [+ 'configuration' => base64_encode($compose),+ ])+ ->assertOk()+ ->assertJsonPath('message', 'Proxy configuration saved.');+});++test('PUT /api/v1/servers/{uuid}/proxy/configuration rejects missing configuration', function () {+ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->putJson("/api/v1/servers/{$this->server->uuid}/proxy/configuration", [+ 'foo' => 'bar',+ ])+ ->assertUnprocessable();+});++test('POST /api/v1/servers/{uuid}/proxy/restart queues RestartProxyJob', function () {+ Queue::fake();++ $this->withHeaders(serverProxyApiHeaders($this->bearerToken))+ ->postJson("/api/v1/servers/{$this->server->uuid}/proxy/restart")+ ->assertOk()+ ->assertJsonPath('message', 'Proxy restart queued.');++ Queue::assertPushed(+ RestartProxyJob::class,+ fn (RestartProxyJob $job): bool => $job->server->is($this->server)+ );+});++test('proxy endpoints require authentication', function () {+ $this->getJson("/api/v1/servers/{$this->server->uuid}/proxy")->assertUnauthorized();+ $this->patchJson("/api/v1/servers/{$this->server->uuid}/proxy", ['redirect_enabled' => false])->assertUnauthorized();+ $this->putJson("/api/v1/servers/{$this->server->uuid}/proxy/configuration", ['configuration' => 'x'])->assertUnauthorized();+ $this->postJson("/api/v1/servers/{$this->server->uuid}/proxy/restart")->assertUnauthorized();+});diff --git a/tests/Feature/Api/ServerSubsystemsApiTest.php b/tests/Feature/Api/ServerSubsystemsApiTest.phpnew file mode 100644index 0000000000..e31c8a051b--- /dev/null+++ b/tests/Feature/Api/ServerSubsystemsApiTest.php@@ -0,0 +1,337 @@+<?php++use App\Jobs\DockerCleanupJob;+use App\Models\DockerCleanupExecution;+use App\Models\InstanceSettings;+use App\Models\Server;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Facades\Queue;++uses(RefreshDatabase::class);++beforeEach(function () {+ InstanceSettings::forceCreate(['id' => 0, 'is_api_enabled' => true]);++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);+ session(['currentTeam' => $this->team]);++ $this->server = Server::factory()->create([+ 'team_id' => $this->team->id,+ 'ip' => '10.0.0.10',+ ]);++ $otherTeam = Team::factory()->create();+ $this->otherServer = Server::factory()->create([+ 'team_id' => $otherTeam->id,+ 'ip' => '10.0.0.20',+ ]);++ $this->token = $this->user->createToken('server-subsystems', ['*'])->plainTextToken;+});++function serverSubsystemsHeaders(): array+{+ return [+ 'Authorization' => 'Bearer '.test()->token,+ 'Content-Type' => 'application/json',+ 'Accept' => 'application/json',+ ];+}++describe('Docker cleanup API', function () {+ test('GET returns docker cleanup settings for own team server', function () {+ $this->server->settings->update([+ 'docker_cleanup_frequency' => '0 0 * * *',+ 'docker_cleanup_threshold' => 25,+ 'force_docker_cleanup' => true,+ 'delete_unused_volumes' => true,+ 'delete_unused_networks' => false,+ 'disable_application_image_retention' => true,+ ]);++ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->server->uuid}/docker-cleanup")+ ->assertOk()+ ->assertJsonPath('docker_cleanup_threshold', 25)+ ->assertJsonPath('force_docker_cleanup', true)+ ->assertJsonPath('delete_unused_volumes', true)+ ->assertJsonPath('disable_application_image_retention', true);+ });++ test('PATCH updates docker cleanup settings for own team server', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->server->uuid}/docker-cleanup", [+ 'docker_cleanup_frequency' => '0 */6 * * *',+ 'docker_cleanup_threshold' => 42,+ 'force_docker_cleanup' => true,+ 'delete_unused_volumes' => true,+ 'delete_unused_networks' => true,+ 'disable_application_image_retention' => true,+ ])+ ->assertOk()+ ->assertJsonPath('docker_cleanup_threshold', 42)+ ->assertJsonPath('force_docker_cleanup', true);++ $settings = $this->server->settings->fresh();+ expect($settings->docker_cleanup_threshold)->toBe(42)+ ->and((bool) $settings->force_docker_cleanup)->toBeTrue()+ ->and((bool) $settings->delete_unused_volumes)->toBeTrue()+ ->and((bool) $settings->delete_unused_networks)->toBeTrue()+ ->and((bool) $settings->disable_application_image_retention)->toBeTrue();+ });++ test('POST run dispatches DockerCleanupJob for own team server', function () {+ Queue::fake();++ $this->server->settings->update([+ 'delete_unused_volumes' => true,+ 'delete_unused_networks' => false,+ ]);++ $this->withHeaders(serverSubsystemsHeaders())+ ->postJson("/api/v1/servers/{$this->server->uuid}/docker-cleanup/run")+ ->assertOk()+ ->assertJsonPath('message', fn ($message) => str_contains($message, 'Manual cleanup job started'));++ Queue::assertPushed(DockerCleanupJob::class, function (DockerCleanupJob $job) {+ return $job->server->is($this->server)+ && $job->manualCleanup === true+ && $job->deleteUnusedVolumes === true+ && $job->deleteUnusedNetworks === false;+ });+ });++ test('GET executions lists recent cleanup runs for own team server', function () {+ $execution = DockerCleanupExecution::create([+ 'server_id' => $this->server->id,+ 'status' => 'success',+ 'message' => 'Cleanup completed',+ ]);++ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->server->uuid}/docker-cleanup/executions")+ ->assertOk()+ ->assertJsonCount(1)+ ->assertJsonPath('0.uuid', $execution->uuid)+ ->assertJsonPath('0.status', 'success');+ });++ test('other-team docker cleanup endpoints return 404', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->otherServer->uuid}/docker-cleanup")+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->otherServer->uuid}/docker-cleanup", [+ 'docker_cleanup_threshold' => 50,+ ])+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->postJson("/api/v1/servers/{$this->otherServer->uuid}/docker-cleanup/run")+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->otherServer->uuid}/docker-cleanup/executions")+ ->assertNotFound();+ });+});++describe('Log drains API', function () {+ test('GET returns log drain settings and hides secrets without read:sensitive', function () {+ $this->server->settings->update([+ 'is_logdrain_axiom_enabled' => false,+ 'logdrain_axiom_dataset_name' => 'coolify-logs',+ 'logdrain_axiom_api_key' => 'secret-axiom-key',+ 'logdrain_newrelic_license_key' => 'secret-nr-key',+ ]);++ $readToken = $this->user->createToken('server-subsystems-read', ['read'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$readToken,+ 'Accept' => 'application/json',+ ])+ ->getJson("/api/v1/servers/{$this->server->uuid}/log-drains")+ ->assertOk()+ ->assertJsonPath('logdrain_axiom_dataset_name', 'coolify-logs')+ ->assertJsonPath('is_logdrain_axiom_enabled', false);++ expect($response->json())->not->toHaveKey('logdrain_axiom_api_key')+ ->and($response->json())->not->toHaveKey('logdrain_newrelic_license_key');+ });++ test('PATCH updates log drain settings for own team server', function () {+ Queue::fake();++ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->server->uuid}/log-drains", [+ 'logdrain_axiom_dataset_name' => 'api-dataset',+ 'logdrain_axiom_api_key' => 'axiom-key-123',+ ])+ ->assertOk()+ ->assertJsonPath('logdrain_axiom_dataset_name', 'api-dataset');++ $settings = $this->server->settings->fresh();+ expect($settings->logdrain_axiom_dataset_name)->toBe('api-dataset')+ ->and($settings->logdrain_axiom_api_key)->toBe('axiom-key-123');+ });++ test('other-team log drains endpoints return 404', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->otherServer->uuid}/log-drains")+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->otherServer->uuid}/log-drains", [+ 'logdrain_axiom_dataset_name' => 'nope',+ ])+ ->assertNotFound();+ });+});++describe('Sentinel API', function () {+ test('GET returns sentinel settings without token without read:sensitive', function () {+ // Avoid fields that trigger restartSentinel() on save (token/url/metrics timing).+ $this->server->settings->update([+ 'is_sentinel_enabled' => true,+ 'is_metrics_enabled' => true,+ 'is_sentinel_debug_enabled' => false,+ ]);++ $readToken = $this->user->createToken('server-subsystems-read', ['read'])->plainTextToken;++ $response = $this->withHeaders([+ 'Authorization' => 'Bearer '.$readToken,+ 'Accept' => 'application/json',+ ])+ ->getJson("/api/v1/servers/{$this->server->uuid}/sentinel")+ ->assertOk()+ ->assertJsonPath('is_sentinel_enabled', true)+ ->assertJsonPath('is_metrics_enabled', true);++ expect($response->json())->not->toHaveKey('sentinel_token')+ ->and($response->json())->not->toHaveKey('sentinel_custom_url');+ });++ test('PATCH updates sentinel settings for own team server', function () {+ // Only toggle fields that do not restart Sentinel (avoids remote StartSentinel on sync queue).+ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->server->uuid}/sentinel", [+ 'is_metrics_enabled' => true,+ 'is_sentinel_debug_enabled' => true,+ ])+ ->assertOk()+ ->assertJsonPath('is_metrics_enabled', true)+ ->assertJsonPath('is_sentinel_debug_enabled', true);++ $settings = $this->server->settings->fresh();+ expect((bool) $settings->is_metrics_enabled)->toBeTrue()+ ->and((bool) $settings->is_sentinel_debug_enabled)->toBeTrue();+ });++ test('other-team sentinel endpoints return 404', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->otherServer->uuid}/sentinel")+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->otherServer->uuid}/sentinel", [+ 'is_metrics_enabled' => true,+ ])+ ->assertNotFound();+ });+});++describe('Cloudflare Tunnel API', function () {+ test('GET returns cloudflare tunnel settings for own team server', function () {+ $this->server->settings->update(['is_cloudflare_tunnel' => true]);++ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->server->uuid}/cloudflare-tunnel")+ ->assertOk()+ ->assertJsonPath('is_cloudflare_tunnel', true)+ ->assertJsonPath('ip', '10.0.0.10');+ });++ test('PATCH enables cloudflare tunnel setting for own team server', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->server->uuid}/cloudflare-tunnel", [+ 'is_cloudflare_tunnel' => true,+ ])+ ->assertOk()+ ->assertJsonPath('is_cloudflare_tunnel', true);++ expect((bool) $this->server->settings->fresh()->is_cloudflare_tunnel)->toBeTrue();+ });++ test('POST enable and disable match manual UI actions', function () {+ // Changing ip auto-sets ip_previous to the previous IP via Server model boot.+ $originalIp = (string) $this->server->ip;+ $this->server->update(['ip' => '100.64.0.5']);+ expect((string) $this->server->fresh()->ip_previous)->toBe($originalIp);++ $this->server->settings->update(['is_cloudflare_tunnel' => false]);++ $this->withHeaders(serverSubsystemsHeaders())+ ->postJson("/api/v1/servers/{$this->server->uuid}/cloudflare-tunnel/enable")+ ->assertOk()+ ->assertJsonPath('is_cloudflare_tunnel', true);++ expect((bool) $this->server->settings->fresh()->is_cloudflare_tunnel)->toBeTrue();++ $this->withHeaders(serverSubsystemsHeaders())+ ->postJson("/api/v1/servers/{$this->server->uuid}/cloudflare-tunnel/disable")+ ->assertOk()+ ->assertJsonPath('is_cloudflare_tunnel', false)+ ->assertJsonPath('ip', $originalIp);++ expect((bool) $this->server->settings->fresh()->is_cloudflare_tunnel)->toBeFalse()+ ->and((string) $this->server->fresh()->ip)->toBe($originalIp);+ });++ test('other-team cloudflare tunnel endpoints return 404', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->getJson("/api/v1/servers/{$this->otherServer->uuid}/cloudflare-tunnel")+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->otherServer->uuid}/cloudflare-tunnel", [+ 'is_cloudflare_tunnel' => true,+ ])+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->postJson("/api/v1/servers/{$this->otherServer->uuid}/cloudflare-tunnel/enable")+ ->assertNotFound();++ $this->withHeaders(serverSubsystemsHeaders())+ ->postJson("/api/v1/servers/{$this->otherServer->uuid}/cloudflare-tunnel/disable")+ ->assertNotFound();+ });+});++describe('Server update is_terminal_enabled', function () {+ test('PATCH /servers/{uuid} updates is_terminal_enabled on settings', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->server->uuid}", [+ 'is_terminal_enabled' => true,+ ])+ ->assertCreated()+ ->assertJsonPath('uuid', $this->server->uuid);++ expect((bool) $this->server->settings->fresh()->is_terminal_enabled)->toBeTrue();+ });++ test('PATCH /servers/{uuid} other-team returns 404', function () {+ $this->withHeaders(serverSubsystemsHeaders())+ ->patchJson("/api/v1/servers/{$this->otherServer->uuid}", [+ 'is_terminal_enabled' => true,+ ])+ ->assertNotFound();+ });+});diff --git a/tests/Feature/Api/SharedEnvironmentVariablesApiTest.php b/tests/Feature/Api/SharedEnvironmentVariablesApiTest.phpnew file mode 100644index 0000000000..0097389817--- /dev/null+++ b/tests/Feature/Api/SharedEnvironmentVariablesApiTest.php@@ -0,0 +1,190 @@+<?php++use App\Models\Environment;+use App\Models\InstanceSettings;+use App\Models\Project;+use App\Models\SharedEnvironmentVariable;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;++uses(RefreshDatabase::class);++beforeEach(function () {+ config([+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ 'queue.default' => 'sync',+ 'app.maintenance.driver' => 'file',+ ]);++ InstanceSettings::unguarded(fn () => InstanceSettings::firstOrCreate(['id' => 0], ['is_api_enabled' => true]));++ $this->team = Team::factory()->create();+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);++ session(['currentTeam' => $this->team]);++ $this->token = $this->user->createToken('test-token', ['*']);+ $this->bearerToken = $this->token->plainTextToken;++ $this->project = Project::factory()->create(['team_id' => $this->team->id]);+ $this->environment = Environment::factory()->create(['project_id' => $this->project->id]);+});++function sharedEnvHeaders(string $bearerToken): array+{+ return [+ 'Authorization' => 'Bearer '.$bearerToken,+ 'Content-Type' => 'application/json',+ ];+}++describe('Team shared environment variables API', function () {+ test('creates lists updates and deletes team shared envs', function () {+ $create = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->postJson('/api/v1/team/envs', [+ 'key' => 'TEAM_API_KEY',+ 'value' => 'secret-value',+ 'is_literal' => true,+ 'comment' => 'from api',+ ]);++ $create->assertStatus(201);+ $create->assertJsonStructure(['id']);+ $envId = $create->json('id');++ expect(SharedEnvironmentVariable::query()->whereKey($envId)->first())+ ->type->toBe('team')+ ->team_id->toBe($this->team->id)+ ->project_id->toBeNull()+ ->key->toBe('TEAM_API_KEY');++ $list = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->getJson('/api/v1/team/envs');++ $list->assertOk();+ $list->assertJsonFragment(['key' => 'TEAM_API_KEY', 'id' => $envId]);++ $update = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->patchJson("/api/v1/team/envs/{$envId}", [+ 'value' => 'updated-value',+ 'is_multiline' => true,+ ]);++ $update->assertOk();+ $update->assertJsonFragment(['key' => 'TEAM_API_KEY']);+ expect($update->json('is_multiline'))->toBeTruthy();++ $delete = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->deleteJson("/api/v1/team/envs/{$envId}");++ $delete->assertOk();+ $delete->assertJson(['message' => 'Environment variable deleted.']);+ expect(SharedEnvironmentVariable::query()->whereKey($envId)->exists())->toBeFalse();+ });++ test('hides value without can_read_sensitive', function () {+ SharedEnvironmentVariable::create([+ 'key' => 'HIDDEN_SECRET',+ 'value' => 'should-not-appear',+ 'type' => 'team',+ 'team_id' => $this->team->id,+ ]);++ $readToken = $this->user->createToken('read-token', ['read'])->plainTextToken;++ $response = $this->withHeaders(sharedEnvHeaders($readToken))+ ->getJson('/api/v1/team/envs');++ $response->assertOk();+ $response->assertJsonFragment(['key' => 'HIDDEN_SECRET']);+ expect($response->json('0'))->not->toHaveKey('value');+ });++ test('returns 409 when creating duplicate team key', function () {+ SharedEnvironmentVariable::create([+ 'key' => 'DUP_KEY',+ 'value' => 'one',+ 'type' => 'team',+ 'team_id' => $this->team->id,+ ]);++ $response = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->postJson('/api/v1/team/envs', [+ 'key' => 'DUP_KEY',+ 'value' => 'two',+ ]);++ $response->assertStatus(409);+ });+});++describe('Project shared environment variables API', function () {+ test('creates and lists project shared envs', function () {+ $create = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->postJson("/api/v1/projects/{$this->project->uuid}/envs", [+ 'key' => 'PROJECT_VAR',+ 'value' => 'project-secret',+ ]);++ $create->assertStatus(201);+ $envId = $create->json('id');++ $env = SharedEnvironmentVariable::query()->whereKey($envId)->first();+ expect($env)+ ->type->toBe('project')+ ->project_id->toBe($this->project->id)+ ->team_id->toBe($this->team->id);++ $list = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->getJson("/api/v1/projects/{$this->project->uuid}/envs");++ $list->assertOk();+ $list->assertJsonFragment(['key' => 'PROJECT_VAR', 'id' => $envId]);+ });++ test('returns 404 for project from another team', function () {+ $otherTeam = Team::factory()->create();+ $otherProject = Project::factory()->create(['team_id' => $otherTeam->id]);++ SharedEnvironmentVariable::create([+ 'key' => 'OTHER_TEAM_VAR',+ 'value' => 'nope',+ 'type' => 'project',+ 'team_id' => $otherTeam->id,+ 'project_id' => $otherProject->id,+ ]);++ $list = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->getJson("/api/v1/projects/{$otherProject->uuid}/envs");+ $list->assertStatus(404);++ $create = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->postJson("/api/v1/projects/{$otherProject->uuid}/envs", [+ 'key' => 'SHOULD_FAIL',+ 'value' => 'x',+ ]);+ $create->assertStatus(404);+ });++ test('returns 404 when updating env from another team scope', function () {+ $otherTeam = Team::factory()->create();+ $otherProject = Project::factory()->create(['team_id' => $otherTeam->id]);+ $otherEnv = SharedEnvironmentVariable::create([+ 'key' => 'FOREIGN',+ 'value' => 'secret',+ 'type' => 'project',+ 'team_id' => $otherTeam->id,+ 'project_id' => $otherProject->id,+ ]);++ $response = $this->withHeaders(sharedEnvHeaders($this->bearerToken))+ ->patchJson("/api/v1/projects/{$this->project->uuid}/envs/{$otherEnv->id}", [+ 'value' => 'hacked',+ ]);++ $response->assertStatus(404);+ });+});diff --git a/tests/Feature/Api/TeamTokenTeamApiTest.php b/tests/Feature/Api/TeamTokenTeamApiTest.phpnew file mode 100644index 0000000000..4f45562ea5--- /dev/null+++ b/tests/Feature/Api/TeamTokenTeamApiTest.php@@ -0,0 +1,72 @@+<?php++use App\Models\InstanceSettings;+use App\Models\Team;+use App\Models\User;+use Illuminate\Foundation\Testing\RefreshDatabase;++uses(RefreshDatabase::class);++beforeEach(function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::updateOrCreate(['id' => 0], ['is_api_enabled' => true]));++ $this->team = Team::factory()->create(['name' => 'Token Team']);+ $this->user = User::factory()->create();+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);+ session(['currentTeam' => $this->team]);++ $this->bearerToken = $this->user->createToken('team-token-api-test', ['*'])->plainTextToken;+});++function teamTokenApiHeaders(string $bearerToken): array+{+ return [+ 'Authorization' => 'Bearer '.$bearerToken,+ 'Accept' => 'application/json',+ ];+}++describe('token team endpoints', function () {+ test('GET /team returns the token team', function () {+ $this->withHeaders(teamTokenApiHeaders($this->bearerToken))+ ->getJson('/api/v1/team')+ ->assertOk()+ ->assertJsonPath('id', $this->team->id)+ ->assertJsonPath('name', 'Token Team');+ });++ test('GET /team/members returns members of the token team', function () {+ $this->withHeaders(teamTokenApiHeaders($this->bearerToken))+ ->getJson('/api/v1/team/members')+ ->assertOk()+ ->assertJsonFragment(['id' => $this->user->id]);+ });++ test('deprecated GET /teams/current aliases GET /team', function () {+ $preferred = $this->withHeaders(teamTokenApiHeaders($this->bearerToken))+ ->getJson('/api/v1/team')+ ->assertOk()+ ->json();++ $alias = $this->withHeaders(teamTokenApiHeaders($this->bearerToken))+ ->getJson('/api/v1/teams/current')+ ->assertOk()+ ->json();++ expect($alias)->toBe($preferred);+ });++ test('deprecated GET /teams/current/members aliases GET /team/members', function () {+ $preferred = $this->withHeaders(teamTokenApiHeaders($this->bearerToken))+ ->getJson('/api/v1/team/members')+ ->assertOk()+ ->json();++ $alias = $this->withHeaders(teamTokenApiHeaders($this->bearerToken))+ ->getJson('/api/v1/teams/current/members')+ ->assertOk()+ ->json();++ expect($alias)->toBe($preferred);+ });+});diff --git a/tests/Feature/TagApiTest.php b/tests/Feature/TagApiTest.phpindex 448d7917fe..ad46995a3f 100644--- a/tests/Feature/TagApiTest.php+++ b/tests/Feature/TagApiTest.php@@ -19,6 +19,13 @@ use Livewire\Livewire;uses(RefreshDatabase::class);beforeEach(function () {+ config([+ 'cache.default' => 'array',+ 'session.driver' => 'array',+ 'queue.default' => 'sync',+ 'app.maintenance.driver' => 'file',+ ]);+InstanceSettings::unguarded(fn () => InstanceSettings::updateOrCreate(['id' => 0], ['is_api_enabled' => true]));$this->team = Team::factory()->create();@@ -87,6 +94,140 @@ describe('GET /api/v1/tags', function () {});});+describe('POST /api/v1/tags', function () {+ test('creates a tag for the current team', function () {+ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->postJson('/api/v1/tags', [+ 'name' => 'Production',+ ]);++ $response->assertCreated()+ ->assertJsonFragment(['name' => 'production'])+ ->assertJsonStructure(['uuid', 'name', 'created_at', 'updated_at']);++ expect(Tag::where('team_id', $this->team->id)->where('name', 'production')->exists())->toBeTrue();+ });++ test('rejects duplicate tag names for the team', function () {+ Tag::create(['name' => 'production', 'team_id' => $this->team->id]);++ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->postJson('/api/v1/tags', [+ 'name' => 'production',+ ]);++ $response->assertStatus(409);+ });++ test('rejects unknown fields', function () {+ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->postJson('/api/v1/tags', [+ 'name' => 'valid-tag',+ 'unexpected' => 'value',+ ]);++ $response->assertUnprocessable();+ $response->assertJsonValidationErrors(['unexpected']);+ });++ test('rejects create requests from non-admin team members', function () {+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ session(['currentTeam' => $this->team]);+ $memberToken = $member->createToken('member-token', ['*'])->plainTextToken;++ $response = $this->withHeaders(tagApiAuthHeaders($memberToken))+ ->postJson('/api/v1/tags', [+ 'name' => 'member-tag',+ ]);++ $response->assertForbidden();+ expect(Tag::where('team_id', $this->team->id)->where('name', 'member-tag')->exists())->toBeFalse();+ });+});++describe('PATCH /api/v1/tags/{uuid}', function () {+ test('renames a team tag', function () {+ $tag = Tag::create(['name' => 'old-name', 'team_id' => $this->team->id]);++ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->patchJson("/api/v1/tags/{$tag->uuid}", [+ 'name' => 'New Name',+ ]);++ $response->assertOk()+ ->assertJsonFragment(['uuid' => $tag->uuid, 'name' => 'new name']);++ expect($tag->fresh()->name)->toBe('new name');+ });++ test('does not rename tags from another team', function () {+ $otherTeam = Team::factory()->create();+ $tag = Tag::create(['name' => 'other-tag', 'team_id' => $otherTeam->id]);++ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->patchJson("/api/v1/tags/{$tag->uuid}", [+ 'name' => 'stolen',+ ]);++ $response->assertNotFound();+ expect($tag->fresh()->name)->toBe('other-tag');+ });++ test('rejects renaming to an existing team tag name', function () {+ Tag::create(['name' => 'taken', 'team_id' => $this->team->id]);+ $tag = Tag::create(['name' => 'rename-me', 'team_id' => $this->team->id]);++ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->patchJson("/api/v1/tags/{$tag->uuid}", [+ 'name' => 'taken',+ ]);++ $response->assertStatus(409);+ });+});++describe('DELETE /api/v1/tags/{uuid}', function () {+ test('deletes a tag and detaches it from resources', function () {+ $tag = Tag::create(['name' => 'to-delete', 'team_id' => $this->team->id]);+ $this->application->tags()->attach($tag->id);++ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->deleteJson("/api/v1/tags/{$tag->uuid}");++ $response->assertOk()+ ->assertJson(['message' => 'Tag deleted.']);++ expect(Tag::find($tag->id))->toBeNull()+ ->and($this->application->tags()->count())->toBe(0);+ });++ test('does not delete tags from another team', function () {+ $otherTeam = Team::factory()->create();+ $tag = Tag::create(['name' => 'other-team-tag', 'team_id' => $otherTeam->id]);++ $response = $this->withHeaders(tagApiAuthHeaders($this->bearerToken))+ ->deleteJson("/api/v1/tags/{$tag->uuid}");++ $response->assertNotFound();+ expect(Tag::find($tag->id))->not->toBeNull();+ });++ test('rejects delete requests from non-admin team members', function () {+ $tag = Tag::create(['name' => 'protected', 'team_id' => $this->team->id]);+ $member = User::factory()->create();+ $this->team->members()->attach($member->id, ['role' => 'member']);+ session(['currentTeam' => $this->team]);+ $memberToken = $member->createToken('member-token', ['*'])->plainTextToken;++ $response = $this->withHeaders(tagApiAuthHeaders($memberToken))+ ->deleteJson("/api/v1/tags/{$tag->uuid}");++ $response->assertForbidden();+ expect(Tag::find($tag->id))->not->toBeNull();+ });+});+describe('GET /api/v1/applications/{uuid}/tags', function () {test('returns tags for an application', function () {$tag = Tag::create(['name' => 'production', 'team_id' => $this->team->id]);diff --git a/tests/Unit/DestinationsOpenApiTest.php b/tests/Unit/DestinationsOpenApiTest.phpindex a8686ace2e..a75f0b1d3d 100644--- a/tests/Unit/DestinationsOpenApiTest.php+++ b/tests/Unit/DestinationsOpenApiTest.php@@ -7,6 +7,7 @@ it('defines OpenAPI documentation for every destinations endpoint', function ()expect($model)->toContain("schema: 'Destination'")->and($controller)->toContain("operationId: 'list-destinations'")->and($controller)->toContain("operationId: 'get-destination-by-uuid'")+ ->and($controller)->toContain("operationId: 'update-destination-by-uuid'")->and($controller)->toContain("operationId: 'delete-destination-by-uuid'")->and($controller)->toContain("operationId: 'list-server-destinations'")->and($controller)->toContain("operationId: 'create-server-destination'");diff --git a/tests/Unit/S3StorageEndpointValidationTest.php b/tests/Unit/S3StorageEndpointValidationTest.phpindex d01769b397..6d4a0474a2 100644--- a/tests/Unit/S3StorageEndpointValidationTest.php+++ b/tests/Unit/S3StorageEndpointValidationTest.php@@ -104,3 +104,56 @@ it('accepts explicitly allowlisted intranet S3 endpoints', function (string $end'Self-hosted MinIO on 172.16.x CIDR' => ['http://172.16.0.10:9000', ['172.16.0.0/12']],'Self-hosted MinIO on 192.168.x exact IP' => ['http://192.168.1.50:9000', ['192.168.1.50']],]);++it('accepts allowlisted docker-style MinIO hostnames that resolve to private IPs', function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::query()->updateOrCreate(['id' => 0], [+ 'webhook_allowed_internal_hosts' => ['coolify-minio'],+ ]));++ $validator = Validator::make(+ ['endpoint' => 'http://coolify-minio:9000'],+ ['endpoint' => ['required', 'max:255', new SafeWebhookUrl(fn (string $host): array => ['172.16.0.5'])]],+ );++ expect($validator->passes())->toBeTrue('Expected coolify-minio with private IP to pass when allowlisted');+});++it('rejects docker-style MinIO hostnames resolving to private IPs without allowlist', function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::query()->updateOrCreate(['id' => 0], [+ 'webhook_allowed_internal_hosts' => [],+ ]));++ $validator = Validator::make(+ ['endpoint' => 'http://coolify-minio:9000'],+ ['endpoint' => ['required', 'max:255', new SafeWebhookUrl(fn (string $host): array => ['172.16.0.5'])]],+ );++ expect($validator->fails())->toBeTrue('Expected coolify-minio private IP rejection without allowlist');+});++it('accepts allowlisted docker MinIO hostname after custom DNS miss and system DNS hit', function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::query()->updateOrCreate(['id' => 0], [+ 'custom_dns_servers' => '1.1.1.1',+ 'webhook_allowed_internal_hosts' => ['coolify-minio'],+ ]));++ $rule = new class extends SafeWebhookUrl+ {+ protected function resolveHostWithCustomDnsServers(string $host, array $dnsServers): array+ {+ return [];+ }++ protected function resolveHostWithSystemDns(string $host): array+ {+ return ['172.16.0.5'];+ }+ };++ $validator = Validator::make(+ ['endpoint' => 'http://coolify-minio:9000'],+ ['endpoint' => ['required', 'max:255', $rule]],+ );++ expect($validator->passes())->toBeTrue('Expected S3 endpoint to pass after DNS fallback + allowlist');+});diff --git a/tests/Unit/SafeWebhookUrlTest.php b/tests/Unit/SafeWebhookUrlTest.phpindex de0c06260d..84d1b33ffa 100644--- a/tests/Unit/SafeWebhookUrlTest.php+++ b/tests/Unit/SafeWebhookUrlTest.php@@ -278,3 +278,103 @@ it('redacts webhook URLs for logs', function () {expect(SafeWebhookUrl::redactedUrlForLog('https://hooks.slack.com/services/T000/B000/secret-token?foo=bar'))->toBe('https://hooks.slack.com');});++it('falls back to system DNS when custom DNS returns no answers', function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::query()->updateOrCreate(['id' => 0], [+ 'custom_dns_servers' => '1.1.1.1',+ 'webhook_allowed_internal_hosts' => ['coolify-minio'],+ ]));++ $rule = new class extends SafeWebhookUrl+ {+ /** @var array<int, array{0: string, 1: array<int, string>}> */+ public array $customCalls = [];++ /** @var array<int, string> */+ public array $systemCalls = [];++ protected function resolveHostWithCustomDnsServers(string $host, array $dnsServers): array+ {+ $this->customCalls[] = [$host, $dnsServers];++ // Simulate public DNS (1.1.1.1) having no record for a docker hostname.+ return [];+ }++ protected function resolveHostWithSystemDns(string $host): array+ {+ $this->systemCalls[] = $host;++ return ['172.16.0.5'];+ }+ };++ $validator = Validator::make(+ ['url' => 'http://coolify-minio:9000'],+ ['url' => $rule],+ );++ expect($validator->passes())->toBeTrue('Expected system-DNS fallback for allowlisted docker hostname')+ ->and($rule->customCalls)->toHaveCount(1)+ ->and($rule->customCalls[0][0])->toBe('coolify-minio')+ ->and($rule->customCalls[0][1])->toBe(['1.1.1.1'])+ ->and($rule->systemCalls)->toBe(['coolify-minio']);+});++it('does not fall back to system DNS when custom DNS returns answers', function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::query()->updateOrCreate(['id' => 0], [+ 'custom_dns_servers' => '1.1.1.1',+ ]));++ $rule = new class extends SafeWebhookUrl+ {+ public int $systemCalls = 0;++ protected function resolveHostWithCustomDnsServers(string $host, array $dnsServers): array+ {+ return ['93.184.216.34'];+ }++ protected function resolveHostWithSystemDns(string $host): array+ {+ $this->systemCalls++;++ return ['10.0.0.1'];+ }+ };++ $validator = Validator::make(+ ['url' => 'https://example.com/webhook'],+ ['url' => $rule],+ );++ expect($validator->passes())->toBeTrue()+ ->and($rule->systemCalls)->toBe(0);+});++it('still rejects private targets after system DNS fallback when host is not allowlisted', function () {+ InstanceSettings::unguarded(fn () => InstanceSettings::query()->updateOrCreate(['id' => 0], [+ 'custom_dns_servers' => '1.1.1.1',+ 'webhook_allowed_internal_hosts' => [],+ ]));++ $rule = new class extends SafeWebhookUrl+ {+ protected function resolveHostWithCustomDnsServers(string $host, array $dnsServers): array+ {+ return [];+ }++ protected function resolveHostWithSystemDns(string $host): array+ {+ return ['172.16.0.5'];+ }+ };++ $validator = Validator::make(+ ['url' => 'http://coolify-minio:9000'],+ ['url' => $rule],+ );++ expect($validator->fails())->toBeTrue('Expected private IP rejection without allowlist after fallback');+});