Commit graph

2963 commits

Author SHA1 Message Date
Andras Bacsai
20099630fc Fix modal width with proper CSS media queries
Previous approach used invalid inline styles with @media queries,
which browsers ignore. Now using:
- Unique modal ID generated with PHP uniqid()
- <style> tag with proper CSS media queries
- ID selector for scoped styling

This properly constrains modal width on large screens while keeping
full width on mobile.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:05:00 +01:00
Andras Bacsai
95b847191b Fix Tailwind JIT issue with dynamic width classes
Tailwind JIT compiler doesn't compile dynamically interpolated classes
like lg:max-w-[{{ $maxWidth }}]. Switched to inline styles with media
queries to support dynamic min/max width values.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:58:53 +01:00
Andras Bacsai
e5f50c2b1f Fix modal width: add maxWidth constraint
The previous fix reduced minWidth but modal still expanded to fit
content. Now:
- Added maxWidth prop to modal-input component (default 48rem)
- Set Edit Domains modal to minWidth=32rem, maxWidth=40rem
- This constrains the modal to a reasonable size range

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:46:05 +01:00
Andras Bacsai
4c7d059469 Reduce width of Edit Domains modal
Reduced the minWidth of the Edit Domains modal from 36rem to 24rem
to provide a more compact and focused user experience. The modal
was previously too wide for the simple domain input form.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 09:44:41 +01:00
Andras Bacsai
71c89d9ba8
Merge branch 'next' into improve-scheduled-tasks 2025-11-10 14:21:03 +01:00
Andras Bacsai
e63a270fea
Enhance container status tracking and improve user notifications (#7182) 2025-11-10 13:58:22 +01:00
Andras Bacsai
99e97900a5 feat: add automated PORT environment variable detection and UI warnings
Add detection system for PORT environment variable to help users configure applications correctly:

- Add detectPortFromEnvironment() method to Application model to detect PORT env var
- Add getDetectedPortInfoProperty() computed property in General Livewire component
- Display contextual info banners in UI when PORT is detected:
  - Warning when PORT exists but ports_exposes is empty
  - Warning when PORT doesn't match ports_exposes configuration
  - Info message when PORT matches ports_exposes
- Add deployment logging to warn about PORT/ports_exposes mismatches
- Include comprehensive unit tests for port detection logic

The ports_exposes field remains authoritative for proxy configuration, while
PORT detection provides helpful suggestions to users.
2025-11-10 13:43:27 +01:00
Andras Bacsai
68a9f2ca77 feat: add container restart tracking and crash loop detection
Track container restart counts from Docker and detect crash loops to provide better visibility into application health issues.

- Add restart_count, last_restart_at, and last_restart_type columns to applications table
- Detect restart count increases from Docker inspect data and send notifications
- Show restart count badge in UI with warning icon on Logs navigation
- Distinguish between crash restarts and manual restarts
- Implement 30-second grace period to prevent false "exited" status during crash loops
- Reset restart count on manual stop, restart, and redeploy actions
- Add unit tests for restart count tracking logic

This helps users quickly identify when containers are in crash loops and need attention, even when the container status flickers between states during Docker's restart backoff period.
2025-11-10 13:04:31 +01:00
Andras Bacsai
b22e79caec feat(jobs): improve scheduled tasks with retry logic and queue cleanup
- Add retry configuration to CoolifyTask (3 tries, 600s timeout)
- Add retry configuration to ScheduledTaskJob (3 tries, configurable timeout)
- Add retry configuration to DatabaseBackupJob (2 tries)
- Implement exponential backoff for all jobs (30s, 60s, 120s intervals)
- Add failed() handlers with comprehensive error logging to scheduled-errors channel
- Add execution tracking: started_at, retry_count, duration (decimal), error_details
- Add configurable timeout field to scheduled tasks (60-3600s, default 300s)
- Update UI to include timeout configuration in task creation/editing forms
- Increase ScheduledJobManager lock expiration from 60s to 90s for high-load environments
- Implement safe queue cleanup with restart vs runtime modes
  - Restart mode: aggressive cleanup (marks all processing jobs as failed)
  - Runtime mode: conservative cleanup (only marks jobs >12h as failed, skips deployments)
- Add cleanup:redis --restart flag for system startup
- Integrate cleanup into Dev.php init() for development environment
- Increase scheduled-errors log retention from 7 to 14 days
- Create comprehensive test suite (unit and feature tests)
- Add TESTING_GUIDE.md with manual testing instructions

Fixes issues with jobs failing after single attempt and "attempted too many times" errors
2025-11-10 11:11:18 +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
239e28630f style: update background colors to use gray-50 for consistency in auth views 2025-11-06 08:43:43 +01:00
Andras Bacsai
6245c9d971 fix: enhance styling for page width component in Blade template 2025-11-05 09:00:25 +01:00
Andras Bacsai
54964d54d4 fix: clean up utility classes and improve readability in Blade templates 2025-11-05 08:59:05 +01:00
Andras Bacsai
e925111595 Merge branch 'next' into light-mode-wtf 2025-11-04 21:16:15 +01:00
Andras Bacsai
8775b3f74d fix: enhance menu item styles and update theme color meta tag 2025-11-04 21:15:59 +01:00
Andras Bacsai
51b5c0a1dd fix: clean up input attributes for PostgreSQL settings in general.blade.php 2025-11-04 21:06:12 +01:00
Andras Bacsai
7b589abfbe fix: fix SPA toggle nginx regeneration and add confirmation modal
- Fix SPA toggle not triggering nginx configuration regeneration by capturing old value before syncData
- Fix similar issue with is_http_basic_auth_enabled using value comparison instead of isDirty
- Remove redundant application settings save() call
- Add confirmation modal to nginx generation button to prevent accidental overwrites
- Pass correct type parameter (spa/static) to generateNginxConfiguration method
2025-11-04 09:48:59 +01:00
Andras Bacsai
fbaa5eb369 feat: Update ApplicationSetting model to include additional boolean casts
- Changed `$cast` to `$casts` in ApplicationSetting model to enable proper boolean casting for new fields.
- Added boolean fields: `is_spa`, `is_build_server_enabled`, `is_preserve_repository_enabled`, `is_container_label_escape_enabled`, `is_container_label_readonly_enabled`, and `use_build_secrets`.

fix: Update Livewire component to reflect new property names

- Updated references in the Livewire component for the new camelCase property names.
- Adjusted bindings and IDs for consistency with the updated model.

test: Add unit tests for ApplicationSetting boolean casting

- Created tests to verify boolean casting for `is_static` and other boolean fields in ApplicationSetting.
- Ensured all boolean fields are correctly defined in the casts array.

test: Implement tests for SynchronizesModelData trait

- Added tests to verify the functionality of the SynchronizesModelData trait, ensuring it correctly syncs properties between the component and the model.
- Included tests for handling non-existent properties gracefully.
2025-11-04 08:43:33 +01:00
Andras Bacsai
f315e4bd9c feat: add dev_helper_version to instance settings and update related functionality 2025-11-03 08:38:43 +01:00
Andras Bacsai
c00de66389 fix: improve run script and enhance sticky header style
The run script has been updated to ensure that all relevant Docker containers are removed before starting the application, which helps prevent conflicts and ensures a clean environment. Additionally, the sticky header in the project selection view now has a background color applied for better visibility against varying content, improving the user experience during scrolling.
2025-11-02 12:51:13 +01:00
Andras Bacsai
2a8fbb3f6e feat: add token validation functionality for Hetzner and DigitalOcean providers 2025-10-29 23:21:38 +01:00
Andras Bacsai
c95e297f39 fix: update boarding flow logic to complete onboarding when server is created 2025-10-29 23:06:39 +01:00
Andras Bacsai
25183d7c71 fix: remove unnecessary step attribute from maximum storage input fields 2025-10-29 20:43:32 +01:00
Andras Bacsai
54a4fa7eee fix: change SMTP port input type to number for better validation 2025-10-29 20:40:16 +01:00
Andras Bacsai
f0db097a90 fix: clean up formatting and remove unnecessary key binding in stack form component 2025-10-27 17:03:19 +01:00
Andras Bacsai
974a8bdf64 fix: add wire:ignore directive to modal component for improved functionality 2025-10-27 17:03:19 +01:00
Andras Bacsai
28fc3feab0 fix: remove wire:ignore from modal and add wire:key to EditCompose component
- Remove wire:ignore from modal-input.blade.php wrapper to allow child Livewire components to be properly tracked
- Add unique wire:key to EditCompose component for proper identification when teleported
- Fixes 'Unable to call component method' error when saving compose files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 17:03:19 +01:00
Andras Bacsai
1ab4b9aa31 refactor: simplify project data retrieval and enhance OAuth settings handling 2025-10-27 17:03:19 +01:00
Andras Bacsai
261dc39f02 fix: Monaco editor empty for docker compose applications
This commit fixes two related issues preventing the Monaco editor from displaying Docker Compose file content:

1. Data Sync Issue:
   - After loadComposeFile() fetches the compose content from Git and updates the database model, the Livewire component properties were never synced
   - Monaco editor binds to component properties via wire:model, so it remained empty
   - Fixed by calling syncFromModel() after refresh() in loadComposeFile() method

2. Script Duplication Issue:
   - Multiple Monaco editors on the same page (compose files, dockerfile, labels) caused race condition
   - Each instance tried to inject the Monaco loader script simultaneously
   - Resulted in "SyntaxError: Identifier '_amdLoaderGlobal' has already been declared"
   - Fixed by adding a global flag to prevent duplicate script injection

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 12:48:20 +01:00
Andras Bacsai
12766695c4 feat: add dynamic viewport-based height for compose editor
- Add Alpine.js reactive height calculation based on viewport size
- Monaco editor now responds to window resize events
- Fix Livewire component structure by moving style tag inside root div
- Update CLAUDE.md to document critical single root element requirement
- Set minimum editor height of 300px with responsive maximum
- Use CSS custom properties to pass calculated height to components
2025-10-27 11:18:25 +01:00
Andras Bacsai
70024f0ca4
Merge pull request #6984 from Cinzya/feature/fix-allowedall-check
fix(settings): prevent false positives in allowed IPs validation
2025-10-26 11:00:15 +01:00
Andras Bacsai
1c33d131c7 fix: clarify warning message for allowed IPs configuration 2025-10-26 10:59:28 +01:00
Andras Bacsai
6e74317cb5 refactor: streamline allowed IPs validation and enhance UI warnings for API access 2025-10-26 10:57:24 +01:00
Andras Bacsai
f5b513fdbe
Merge pull request #7005 from coollabsio/fix-github-source-appid-null
fix: GitHub source creation and configuration issues
2025-10-26 09:54:48 +01:00
Andras Bacsai
3b9eb42eaf fix: use x-cloak instead of inline style to prevent FOUC
Replaced inline style="display: none;" with x-cloak attribute on the
warning callout to properly prevent flash of unstyled content before
Alpine.js initializes. Alpine 3+ automatically handles x-cloak styling.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 09:31:22 +01:00
Andras Bacsai
cae0bb9d52 fix: use break-all to force line wrapping in logs
Changed word-break strategy to properly wrap long lines:
- Changed from break-words to break-all for aggressive wrapping
- Added min-w-0 to container to allow flex shrinking
- Added max-w-full to pre element to respect parent width
- This ensures long URLs and file paths break anywhere to prevent overflow

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:05:47 +02:00
Andras Bacsai
d65bf748c0 fix: prevent horizontal overflow in log text
Added proper overflow handling and word breaking for log content:
- Added overflow-x-hidden to prevent horizontal scrolling in log container
- Added break-words and overflow-wrap-anywhere to force long lines to wrap
- This ensures long log lines (URLs, file paths, etc.) wrap properly on mobile

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:03:23 +02:00
Andras Bacsai
c94aa7bd83 fix: improve proxy logs form layout for better responsive behavior
Restructured the form to prevent overflow issues on mobile:
- Separated input field from controls in distinct sections
- Button and checkboxes now in a wrapping flex container
- All controls stack vertically on mobile for better readability
- Horizontal layout with wrapping on larger screens

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:01:13 +02:00
Andras Bacsai
a1ece556d4 fix: make proxy logs page responsive
The proxy logs form controls were not responsive on mobile devices. The form now stacks vertically on mobile and displays horizontally on larger screens.

Changes:
- Changed form layout to flex-col on mobile, flex-row on sm+ screens
- Made input field full width on mobile (w-full), fixed width (w-96) on sm+ screens
- Adjusted gap spacing for better mobile experience (gap-4 on mobile, gap-2 on sm+)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 11:38:23 +02:00
Andras Bacsai
46158a5fe8 chore: add spacing and format callout text in modal
Added pt-2 for proper spacing between checkbox and warning callout,
and formatted the warning text for better readability.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 11:35:43 +02:00
Andras Bacsai
4f0eeeb8d4 fix: allow callout to take full width in regular view
Removed max-w-2xl constraint and wrapper div from change.blade.php
so the callout takes full available width in the regular page view.
Modal version (create.blade.php) keeps the constraint for centered display.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 11:22:10 +02:00
Andras Bacsai
49f903b9fa fix: left-align callout on regular view, keep centered in modal
Removed mx-auto from change.blade.php (regular page view) so the
callout is left-aligned. The create.blade.php modal version keeps
mx-auto for centered display.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 11:21:18 +02:00
Andras Bacsai
fc285625c2 fix: center system-wide warning callout in modal
Added mx-auto to center the callout horizontally within the modal.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 11:19:52 +02:00
Andras Bacsai
2f2ab6d775 fix: constrain callout width with max-w-2xl and wrap text properly
Set explicit max-width constraint (max-w-2xl) on callout wrapper
and added whitespace-normal to ensure text wraps properly within
the modal instead of expanding it horizontally.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:58:26 +02:00
Andras Bacsai
c892a8ce44 fix: prevent system-wide warning callout from making modal too wide
Added max-width constraints and word breaking to ensure the warning
callout text wraps properly within modal constraints instead of
expanding the modal width excessively.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:56:42 +02:00
Andras Bacsai
6746e44dba fix: make system-wide warning reactive in Create view
The system-wide warning callout was not appearing when the checkbox was toggled because it was only evaluated on initial render.

Changes:
- Wrapped checkbox and warning in Alpine.js x-data scope
- Used @entangle to bind showWarning to the is_system_wide Livewire property
- Added x-show directive to reactively show/hide warning based on checkbox state
- Added x-transition for smooth appearance/disappearance
- Added style="display: none;" to prevent flash of content on load

Now the warning appears immediately when the System Wide checkbox is checked and disappears when unchecked.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:53:25 +02:00
Andras Bacsai
e13a921403 feat: show message when no resources use GitHub App
Improved the Resources section to show a clear message instead of an empty table when no resources are using the GitHub App.

Changes:
- Added conditional check for empty applications collection
- Shows "No resources are currently using this GitHub App." message when empty
- Only displays the table with headers when there are actual resources
- Changed @forelse to @foreach since we now handle empty state explicitly

This provides better UX by giving clear feedback instead of showing an empty table structure.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:51:44 +02:00
Andras Bacsai
a69339804c feat: add warnings for system-wide GitHub Apps
Added warning callouts to inform users that system-wide GitHub Apps are not recommended for security reasons.

Changes:
- Added warning callout in Create view when system-wide checkbox is enabled
- Added warning callout in Change view when GitHub App is system-wide
- Warning explains that system-wide apps are shared across all teams and can access repositories from any team
- Recommends creating team-specific GitHub Apps for better security and isolation

The warnings only appear on self-hosted instances where system-wide option is available (not on cloud).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:50:50 +02:00
Andras Bacsai
06ee7d0132 fix: GitHub source creation and configuration issues
Fixed multiple issues with GitHub App source creation and management:

1. **Fixed null property assignment error on component mount**
   - Changed property types to nullable in Change component (appId, installationId, clientId, etc.)
   - Updated validation rules to allow nullable values
   - Allows mounting component with newly created GitHub Apps that don't have these fields set yet

2. **Fixed Livewire morphing error on manual creation**
   - Modified createGithubAppManually() to redirect after saving
   - Prevents "Cannot read properties of null" error when view structure changes
   - Fields now properly populated after manual creation without requiring page refresh

3. **Fixed is_system_wide not being saved on creation**
   - Removed backwards logic that only saved is_system_wide on cloud instances
   - Added is_system_wide to GithubApp model casts for proper boolean handling
   - System-wide checkbox now works correctly on self-hosted instances

4. **Fixed misleading preview deployment checkbox**
   - Removed instantSave attribute from permission checkboxes in unconfigured state
   - These are configuration options for GitHub App creation, not database fields
   - Prevents "GitHub App updated" success message when nothing was actually saved

5. **Added validation for Refetch Permissions button**
   - Validates App ID and Private Key are set before attempting to fetch
   - Shows clear error messages: "Cannot fetch permissions. Please set the following required fields first: App ID, Private Key"
   - Prevents crash when private key is null or invalid

6. **Better error handling for unsupported private key formats**
   - Detects OpenSSH format keys vs RSA PEM format
   - Shows helpful message: "Please use an RSA private key in PEM format (BEGIN RSA PRIVATE KEY). OpenSSH format keys are not supported."
   - GitHub Apps require RSA PEM format, not OpenSSH format

7. **Made GitHub App view mobile responsive**
   - Updated all flex layouts to stack vertically on mobile (flex-col sm:flex-row)
   - Form fields, buttons, and sections now properly responsive
   - No more cut-off fields on small screens

Added comprehensive test coverage:
- GithubSourceChangeTest.php with 7 tests
- GithubSourceCreateTest.php with 6 tests

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:49:09 +02:00
Andras Bacsai
04ee546a49 fix: make environment variable forms responsive
Replace horizontal scrolling with flex-wrap for checkbox containers
in environment variable forms to improve mobile responsiveness.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 10:22:26 +02:00