Commit graph

205 commits

Author SHA1 Message Date
Andras Bacsai
0f54c194d7 Add Garage as a one-click service
Adds support for deploying Garage (S3-compatible object storage) as a
one-click service in Coolify. Includes service template with TOML config,
automatic URL generation for S3, Web, and Admin endpoints with reverse
proxy configuration, and UI fields for credentials and access tokens.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 13:46:57 +01:00
Andras Bacsai
ac9eca3c05 fix: don't show health status for exited containers
Exited containers don't run health checks, so showing "(unhealthy)" is
misleading. This fix ensures exited status displays without health
suffixes across all monitoring systems (SSH, Sentinel, services, etc.)
and at the UI layer for backward compatibility with existing data.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 09:09:37 +01:00
Andras Bacsai
70fb4c6869 refactor: standardize Service model status aggregation to use ContainerStatusAggregator
Fixes inconsistency where Service model used manual state machine logic while
all other components (Application, ComplexStatusCheck, GetContainersStatus)
use the centralized ContainerStatusAggregator service.

Changes:
- Refactored Service::aggregateResourceStatuses() to use ContainerStatusAggregator
- Removed ~60 lines of duplicated state machine logic
- Added comprehensive ServiceExcludedStatusTest with 24 test cases
- Fixed bugs in old logic where paused/starting containers were incorrectly
  marked as unhealthy (should be unknown)

Benefits:
- Single source of truth for status aggregation across all models
- Leverages 42 existing ContainerStatusAggregator tests
- Consistent behavior between Service and Application/Database models
- Easier maintenance (state machine changes only in one place)

All tests pass (37 total):
- ServiceExcludedStatusTest: 24/24 passed
- AllExcludedContainersConsistencyTest: 13/13 passed

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 15:03:18 +01:00
Andras Bacsai
e3746a4b88 fix: preserve unknown health state and handle edge case container states
This commit fixes container health status aggregation to correctly handle
unknown health states and edge case container states across all resource types.

Changes:

1. **Preserve Unknown Health State**
   - Add three-way priority: unhealthy > unknown > healthy
   - Detect containers without healthchecks (null health) as unknown
   - Apply across GetContainersStatus, ComplexStatusCheck, and Service models

2. **Handle Edge Case Container States**
   - Add support for: created, starting, paused, dead, removing
   - Map to appropriate statuses: starting (unknown), paused (unknown), degraded (unhealthy)
   - Prevent containers in transitional states from showing incorrect status

3. **Add :excluded Suffix for Excluded Containers**
   - Parse exclude_from_hc flag from docker-compose YAML
   - Append :excluded suffix to individual container statuses
   - Skip :excluded containers in non-excluded aggregation sections
   - Strip :excluded suffix in excluded aggregation sections
   - Makes it clear in UI which containers are excluded from monitoring

Files Modified:
- app/Actions/Docker/GetContainersStatus.php
- app/Actions/Shared/ComplexStatusCheck.php
- app/Models/Service.php
- tests/Unit/ContainerHealthStatusTest.php

Tests: 18 passed (82 assertions)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 13:19:25 +01:00
Andras Bacsai
498b189286 fix: correct status for services with all containers excluded from health checks
When all containers are excluded from health checks, display their actual status
with :excluded suffix instead of misleading hardcoded statuses. This prevents
broken UI state with incorrect action buttons and provides clarity that monitoring
is disabled.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 10:54:51 +01:00
Andras Bacsai
f81640e316 fix: correct status for services with all containers excluded from health checks
When all services in a Docker Compose file have `exclude_from_hc: true`,
the status aggregation logic was returning invalid states causing broken UI.

**Problems fixed:**
- ComplexStatusCheck returned 'running:healthy' for apps with no monitored containers
- Service model returned ':' (null status) when all services excluded
- UI showed active start/stop buttons for non-running services

**Changes:**
- ComplexStatusCheck: Return 'exited:healthy' when relevantContainerCount is 0
- Service model: Return 'exited:healthy' when both status and health are null
- Added comprehensive unit tests to verify the fixes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 23:24:22 +01:00
Andras Bacsai
e86575d6f7 fix: guard against null or empty docker compose in saveComposeConfigs method 2025-11-07 14:14:43 +01:00
Andras Bacsai
bcd225bd22 feat: Implement required port validation for service applications
- Added `requiredPort` property to `ServiceApplicationView` to track the required port for services.
- Introduced modal confirmation for removing required ports, including methods to confirm or cancel the action.
- Enhanced `Service` model with `getRequiredPort` and `requiresPort` methods to retrieve port information from service templates.
- Implemented `extractPortFromUrl` method in `ServiceApplication` to extract port from FQDN URLs.
- Updated frontend views to display warnings when required ports are missing from domains.
- Created unit tests for service port validation and extraction logic, ensuring correct behavior for various scenarios.
- Added feature tests for Livewire component handling of domain submissions with required ports.
2025-11-06 14:32:36 +01:00
Andras Bacsai
4cf600445a feat(service): add Elasticsearch password handling in extraFields method
- Implemented logic to retrieve and display the default user password for Elasticsearch in the extraFields method of the Service model.
- Enhanced data collection for environment variables related to Elasticsearch, improving service configuration management.
2025-10-03 20:05:43 +02:00
Andras Bacsai
4b0f65c926 refactor(environment-variables): adjust ordering logic for environment variables
- Updated the ordering logic in the environment_variables methods for both Application and Service models to prioritize required variables over service-prefixed keys.
- This change enhances the clarity and organization of environment variable retrieval, ensuring that essential variables are listed first.
2025-10-03 10:28:29 +02:00
Andras Bacsai
f8e97501ce feat(deployments): generate SERVICE_NAME environment variables from Docker Compose services
- Added functionality to generate environment variables for each service defined in the Docker Compose file, transforming service names into uppercase and replacing special characters.
- Updated the service parser to merge these generated variables with existing environment variables, enhancing deployment configuration.
2025-10-03 09:41:59 +02:00
Andras Bacsai
d8d316b5f8 feat(search): implement global search functionality with caching and modal interface 2025-09-19 10:17:55 +02:00
Andras Bacsai
393745b68c Revert "refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency"
This reverts commit 18068857b1.
2025-09-15 17:55:08 +02:00
Andras Bacsai
8e155f25b3 refactor(environment): streamline environment variable handling by replacing sorting methods with direct property access and enhancing query ordering for improved performance 2025-09-12 12:09:03 +02:00
Andras Bacsai
5b3b4bbc43 refactor(environment): remove 'is_build_time' attribute from environment variable handling across the application to simplify configuration 2025-09-11 16:51:56 +02:00
Andras Bacsai
18068857b1 refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency 2025-09-08 14:04:24 +02:00
Andras Bacsai
38c0641734 feat(validation): centralize validation patterns for names and descriptions
- Introduced `ValidationPatterns` class to standardize validation rules and messages for name and description fields across the application.
- Updated various components and models to utilize the new validation patterns, ensuring consistent sanitization and validation logic.
- Replaced the `HasSafeNameAttribute` trait with `HasSafeStringAttribute` to enhance attribute handling and maintain consistency in name sanitization.
- Enhanced the `CleanupNames` command to align with the new validation rules, allowing for a broader range of valid characters in names.
2025-08-19 12:14:48 +02:00
Andras Bacsai
e958b3761d feat(cleanup): add command for sanitizing name fields across models
- Introduced `CleanupNames` command to sanitize name fields by removing invalid characters, ensuring only letters, numbers, spaces, dashes, underscores, and dots are retained.
- Implemented options for dry run, model-specific cleaning, database backup, and forced execution.
- Updated `Init` command to call the new `cleanup:names` command.
- Enhanced project and environment validation to enforce name sanitization rules.
- Added `HasSafeNameAttribute` trait to relevant models for consistent name handling.
2025-08-19 11:04:23 +02:00
Andras Bacsai
c9ddda8ed2 feat(drizzle-gateway): enhance service configuration by adding Master Password field and updating compose file path 2025-08-12 10:07:11 +02:00
Andras Bacsai
e8892b3d29 feat(core): finally fqdn is fqdn and url is url. haha 2025-08-12 10:06:19 +02:00
Andras Bacsai
a0bc4dac55 fix(application): streamline environment variable updates for Docker Compose services and enhance FQDN generation logic 2025-08-12 10:06:19 +02:00
Andras Bacsai
085529dc63 fix(deployment): enhance COOLIFY_URL and COOLIFY_FQDN variable generation for better compatibility 2025-07-07 12:55:35 +02:00
Andras Bacsai
6a90bdf9fa fix(env): Generate literal env variables better 2025-07-07 12:30:44 +02:00
Andras Bacsai
8fc79022f3 feat(service): enhance service status handling and UI updates 2025-06-24 12:52:22 +02:00
Andras Bacsai
200b5cd4fb refactor(service-management): enhance container stopping logic by implementing parallel processing and removing deprecated methods 2025-05-30 12:56:22 +02:00
Andras Bacsai
019ed43448 refactor(actions): standardize method naming for network and configuration deletion across application and service classes 2025-04-30 18:30:43 +02:00
Andras Bacsai
e062edb689 refactor(core): streamline container stopping process and reduce timeout duration; update related methods for consistency 2025-04-30 15:28:59 +02:00
Andras Bacsai
120facfca3 feat(api): unify service creation endpoint and enhance validation 2025-03-21 11:31:17 +01:00
Andras Bacsai
9b55a2fb43 fix: if $SERVICE found in the service specific configuration, then search for it in the db 2025-01-13 12:23:38 +01:00
Andras Bacsai
1fe4dd722b Revert "rector: arrrrr"
This reverts commit 16c0cd10d8.
2025-01-07 15:31:43 +01:00
Andras Bacsai
16c0cd10d8 rector: arrrrr 2025-01-07 14:52:08 +01:00
Andras Bacsai
bf9d89f279
Merge branch 'next' into fix-environement-route 2024-12-17 12:17:50 +01:00
Andras Bacsai
2a9d499251 feat: migrate env variables to polymorphic relationship
fix: proxy status query ui
2024-12-17 10:38:42 +01:00
Andras Bacsai
4901b12279 fix: service status indicator + oauth saving 2024-12-13 12:03:10 +01:00
peaklabs-dev
99eea783ae
feat: scheduled task success and failure notifications 2024-12-10 14:45:47 +01:00
peaklabs-dev
277fd78769
new uuid routes 2024-11-22 16:03:20 +01:00
peaklabs-dev
1c5ddab30d
use one constants file 2024-11-12 15:18:48 +01:00
Andras Bacsai
376a2341af refactor scheduled task job (and related stuffs) 2024-11-07 11:09:38 +01:00
Lucas Michot
1ec224fde1 Inline many variables. 2024-10-31 18:20:11 +01:00
Lucas Michot
8e1444eaa7 Get rid of many useless blank lines 2024-10-31 17:44:01 +01:00
Lucas Michot
d557a22b91 Remove all ray() calls 2024-10-28 13:51:23 +01:00
Andras Bacsai
b75c2dc604 pint 2024-10-17 22:08:23 +02:00
Andras Bacsai
88f1e58c63 feat: required envs 2024-10-11 14:38:22 +02:00
Andras Bacsai
0714fc0e96 chore: Update service extra fields to use dynamic keys 2024-10-11 11:36:57 +02:00
Andras Bacsai
35834ea41d
Merge pull request #3846 from ershisan99/next
fix: use correct env variable for invoice ninja password
2024-10-11 11:33:58 +02:00
Andras Bacsai
9330a3f354 feat: add customHelper to stack-form 2024-10-10 13:28:42 +02:00
andres
9e5551c4dd fix: use correct env variable for invoice ninja password 2024-10-10 13:13:44 +02:00
Andras Bacsai
1b79f78fda fix: Update password variables in Service model 2024-10-10 12:06:17 +02:00
Andras Bacsai
7e32a37729 fix: new services 2024-10-07 11:54:54 +02:00
Andras Bacsai
1c10a43321 fix: new resource selection view
fix: new services
2024-10-07 11:19:14 +02:00