Commit Graph
320 Commits
Author SHA1 Message Date
Andras BacsaiandClaude 8d82524331 feat: add Docker registry management UI for servers
Add comprehensive Docker registry management system that allows users to configure,
manage, and sync Docker registry authentication through the Coolify UI instead of
manual SSH configuration.

Key features:
- Database-backed registry storage with encrypted credentials
- Full CRUD operations via Livewire component
- Auto-sync to server's ~/.docker/config.json before deployments
- Credential validation with test connection functionality
- Import existing registries from server config
- Quick-add presets for common registries (Docker Hub, GHCR, GitLab, AWS ECR, etc.)
- Enable/disable registries without deletion
- Dark mode support

Technical changes:
- New DockerRegistry model with encrypted password field
- Migration for docker_registries table with unique constraint
- Server relationship and active scope
- Helper functions for config.json generation, sync, import, and validation
- Integration with ApplicationDeploymentJob for automatic sync
- Comprehensive unit and feature tests
- Server sidebar menu item and routing

This replaces the manual docker login requirement on servers and provides
a centralized way to manage private registry access across deployments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 09:52:09 +01:00
Andras Bacsai 29135e00ba feat: enhance prerequisite validation to return detailed results 2025-11-21 13:14:48 +01:00
Andras Bacsai 01957f2752 feat: implement prerequisite validation and installation for server setup 2025-11-21 09:49:33 +01:00
Andras BacsaiandClaude 5d73b76a44 refactor(proxy): implement centralized caching for versions.json and improve UX
This commit introduces several improvements to the Traefik version tracking
feature and proxy configuration UI:

## Caching Improvements

1. **New centralized helper functions** (bootstrap/helpers/versions.php):
   - `get_versions_data()`: Redis-cached access to versions.json (1 hour TTL)
   - `get_traefik_versions()`: Extract Traefik versions from cached data
   - `invalidate_versions_cache()`: Clear cache when file is updated

2. **Performance optimization**:
   - Single Redis cache key: `coolify:versions:all`
   - Eliminates 2-4 file reads per page load
   - 95-97.5% reduction in disk I/O time
   - Shared cache across all servers in distributed setup

3. **Updated all consumers to use cached helpers**:
   - CheckTraefikVersionJob: Use get_traefik_versions()
   - Server/Proxy: Two-level caching (Redis + in-memory per-request)
   - CheckForUpdatesJob: Auto-invalidate cache after updating file
   - bootstrap/helpers/shared.php: Use cached data for Coolify version

## UI/UX Improvements

1. **Navbar warning indicator**:
   - Added yellow warning triangle icon next to "Proxy" menu item
   - Appears when server has outdated Traefik version
   - Uses existing traefik_outdated_info data for instant checks
   - Provides at-a-glance visibility of version issues

2. **Proxy sidebar persistence**:
   - Fixed sidebar disappearing when clicking "Switch Proxy"
   - Configuration link now always visible (needed for proxy selection)
   - Dynamic Configurations and Logs only show when proxy is configured
   - Better navigation context during proxy switching workflow

## Code Quality

- Added comprehensive PHPDoc for Server::$traefik_outdated_info property
- Improved code organization with centralized helper approach
- All changes formatted with Laravel Pint
- Maintains backward compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 14:53:28 +01:00
Andras BacsaiandClaude 6593b2a553 feat(proxy): enhance Traefik version notifications to show patch and minor upgrades
- Store both patch update and newer minor version information simultaneously
- Display patch update availability alongside minor version upgrades in notifications
- Add newer_branch_target and newer_branch_latest fields to traefik_outdated_info
- Update all notification channels (Discord, Telegram, Slack, Pushover, Email, Webhook)
- Show minor version in format (e.g., v3.6) for upgrade targets instead of patch version
- Enhance UI callouts with clearer messaging about available upgrades
- Remove verbose logging in favor of cleaner code structure
- Handle edge case where SSH command returns empty response

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 09:59:17 +01:00
Andras BacsaiandClaude 11a7f4c8a7 fix(performance): eliminate N+1 query in CheckTraefikVersionJob
This commit fixes a critical N+1 query issue in CheckTraefikVersionJob
that was loading ALL proxy servers into memory then filtering in PHP,
causing potential OOM errors with thousands of servers.

Changes:
- Added scopeWhereProxyType() query scope to Server model for
  database-level filtering using JSON column arrow notation
- Updated CheckTraefikVersionJob to use new scope instead of
  collection filter, moving proxy type filtering into the SQL query
- Added comprehensive unit tests for the new query scope

Performance impact:
- Before: SELECT * FROM servers WHERE proxy IS NOT NULL (all servers)
- After: SELECT * FROM servers WHERE proxy->>'type' = 'TRAEFIK' (filtered)
- Eliminates memory overhead of loading non-Traefik servers
- Critical for cloud instances with thousands of connected servers

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 11:35:22 +01:00
Andras Bacsai 8c77c63043 feat(proxy): add Traefik version tracking with notifications and dismissible UI warnings
- Add automated Traefik version checking job running weekly on Sundays
- Implement version detection from running containers and comparison with versions.json
- Add notifications across all channels (Email, Discord, Slack, Telegram, Pushover, Webhook) for outdated versions
- Create dismissible callout component with localStorage persistence
- Display cross-branch upgrade warnings (e.g., v3.5 -> v3.6) with changelog links
- Show patch update notifications within same branch
- Add warning icon that appears when callouts are dismissed
- Prevent duplicate notifications during proxy restart by adding restarting parameter
- Fix notification spam with transition-based logic for status changes
- Enable system email settings by default in development mode
- Track last saved/applied proxy settings to detect configuration drift
2025-11-14 11:35:22 +01:00
Andras Bacsai f4e5c195fe refactor: replace direct SslCertificate queries with server relationship methods for consistency 2025-10-09 17:00:05 +02:00
Andras Bacsai bf5c08d071 work work on hetzner integration 2025-10-09 16:54:13 +02:00
Andras Bacsai 704ddf2968 improved hetzner features 2025-10-09 12:53:57 +02:00
Andras Bacsai 215301fa8f basics of adding / removing hetzner servers 2025-10-09 10:41:29 +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 4f8dfa598e refactor(server): remove debugging ray call from validateConnection method for cleaner code 2025-09-16 09:43:51 +02:00
Andras Bacsai 133e72336a Revert "refactor(file-transfer): replace base64 encoding with direct file transfer method in various components for improved clarity and efficiency"
This reverts commit feacedbb04.
2025-09-15 17:56:48 +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 4027c1426c feat(sentinel): add support for custom Docker images in StartSentinel and related methods 2025-09-14 19:21:55 +02:00
Andras Bacsai feacedbb04 refactor(file-transfer): replace base64 encoding with direct file transfer method in various components for improved clarity and efficiency 2025-09-09 11:10:38 +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 4bd29bf966 refactor(ssh): enhance error handling in SSH command execution and improve connection validation logging 2025-09-07 18:45:44 +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 0f876db6c8 fix(server): prepend 'mux_' to UUID in muxFilename method for consistent naming 2025-06-28 13:56:57 +02:00
Andras Bacsai ddcb14500d refactor(proxy-status): refactored how the proxy status is handled on the UI and on the backend
feat(cloudflare): improved cloudflare tunnel automated installation
2025-06-06 14:47:54 +02:00
Andras Bacsai 46b4cfac68 feat(terminal-access): implement terminal access control for servers and containers, including UI updates and backend logic 2025-05-29 14:09:05 +02:00
Andras Bacsai 4e82383b94 fix(Server): Correct proxy path formatting for Traefik proxy type 2025-04-29 10:53:39 +02:00
Andras Bacsai 5b9df7fd45 refactor(server): simplify proxy path logic and remove unnecessary conditions 2025-04-23 13:23:27 +02:00
Andras Bacsai c388e30499 refactor(jobs): comment out unused Caddy label handling in ApplicationDeploymentJob and simplify proxy path logic in Server model 2025-04-20 17:58:41 +02:00
Andras Bacsai 8b3c4d7ad9 refactor(Server): remove debug logging from isReachableChanged method to clean up code and improve performance 2025-04-14 10:30:53 +02:00
Andras Bacsai 1b8db2726a refactor(Server): use data_get for safer access to settings properties in isFunctional method 2025-04-05 12:35:36 +02:00
Andras Bacsai d6d1c9ad82 feat(database): add CA certificate generation for database servers 2025-03-31 14:02:15 +02:00
Andras Bacsai e891318396 refactor(configuration): centralize configuration management in ConfigurationRepository 2025-03-24 21:01:27 +01:00
Benjamin Grant 37c2a2b6ad fix: correct some spellings 2025-03-19 19:49:59 +00:00
Andras Bacsai 2f826c56e8 fix(core): Adding a new server should not try to make the default docker network 2025-02-28 11:23:08 +01:00
Andras Bacsai 27e4882d57 feat(core): You can validate compose files with docker compose config
fix(core): labels are now accepted with both compose styles
refactor: remove lots of ray's
2025-02-27 11:29:04 +01:00
Andras Bacsai 65b925252c feat(core): prevent using servers with existing resources as build servers 2025-02-18 16:44:16 +01:00
peaklabs-dev 222af12ef0 feat: dockerCleanupExecutions relationship 2025-01-15 17:14:05 +01:00
Andras Bacsai e6692c95c9 feat: add is_coolify_host to the server api responses 2025-01-13 12:31:03 +01:00
Andras Bacsai b7d18fc28c fix: getcontainer status should timeout after 30s 2025-01-10 12:04:59 +01:00
Andras Bacsai a9ec0b1c3e fix: update healthcheck and port configurations to use port 8080 2024-12-23 21:11:29 +01:00
peaklabs-dev f26853b576 fix: unreachable notifications 2024-12-23 16:51:34 +01:00
peaklabs-dev 2da4e9a274 feat: enable success messages again 2024-12-09 12:08:27 +01:00
Andras Bacsai 00882eeb31 feat: add TLS configuration for default redirect in Server model 2024-12-06 14:19:09 +01:00
Andras Bacsai 5453b9030e fix: dev mode 2024-12-06 13:39:20 +01:00
Andras Bacsai 659309c5b4 refactor: improve proxy configuration and code consistency in Server model
- Standardized spacing in conditional statements for better readability.
- Updated proxy redirect handling to ensure default values are set correctly.
- Modified dynamic configuration path concatenation for clarity.
- Changed router rule to 'PathPrefix' and adjusted priority for better routing behavior.
- Replaced empty check with 'filled' helper for improved code clarity.
2024-12-06 13:08:04 +01:00
🏔️ PeakandGitHub 27395615e6 Merge branch 'next' into feat/disable-default-redirect 2024-12-05 14:46:33 +01:00
Andras BacsaiandGitHub 8fa1fc4df3 Merge pull request #4382 from vishwamartur/fix-metrics-error
Fix metrics error when data is less than selected date
2024-12-05 11:16:19 +01:00
Andras Bacsai 15ac12e131 test: setup database for upcoming tests 2024-12-04 12:43:52 +01:00
Andras Bacsai 669293afc1 disable success notifications for now 2024-12-03 12:22:27 +01:00
Vishwanath Martur f45411f3d6 Fix metrics error when data is less than selected date
Related to #4309

Fix the 'sql: Scan error on column index 5, name "usedPercent": converting NULL to float64 is unsupported' error on the metrics page.

* Update the `getMemoryMetrics` method in `app/Models/Server.php` to handle NULL values for the "usedPercent" field by setting them to 0.0.
* Add a check for NULL values in the `getMemoryMetrics` method before converting to float64.
2024-11-23 13:08:53 +05:30
SierraJC 059639eb42 fix: servers API returning port as a string -> integer 2024-11-23 13:23:13 +11:00