Commit graph

139 commits

Author SHA1 Message Date
Andras Bacsai
2eeb2b94ec fix: auto-inject -f and --env-file flags into custom Docker Compose commands 2025-11-18 14:54:21 +01:00
Andras Bacsai
122766a8e5 fix: remove unused variable in updatedBuildPack method 2025-11-18 14:54:21 +01:00
Andras Bacsai
acfee7d9f3 resolve merge conflict 2025-11-18 14:54:17 +01:00
Andras Bacsai
29e0e08146 fix: remove unused variable in updatedBuildPack method 2025-11-18 14:53:48 +01:00
Andras Bacsai
40f88c0013 merge next 2025-11-18 14:53:23 +01:00
Andras Bacsai
80f3357842 fix: remove unused variable in updatedBuildPack method 2025-11-18 14:51:38 +01:00
Andras Bacsai
0540b2eae5 refactor: move buildpack cleanup logic to model lifecycle hooks
Move buildpack switching cleanup from Livewire component to Application model's boot lifecycle. This improves separation of concerns and ensures cleanup happens consistently regardless of how the buildpack change is triggered. Also clears Dockerfile-specific data when switching away from dockerfile buildpack.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 14:51:38 +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
a45e674c39
Update app/Livewire/Project/Application/General.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-04 09:57: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
3d9c4954c1 feat: Enhance General component with additional properties and validation rules 2025-11-04 08:51:05 +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
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
e2c254a5a8 Changes auto-committed by Conductor 2025-10-16 17:08:08 +02:00
Andras Bacsai
f77ad4cbd9 Complete Livewire legacy model binding migration (25+ components)
This completes the migration from Livewire's legacy `id="model.property"`
pattern to explicit properties with manual synchronization. This allows
disabling the `legacy_model_binding` feature flag.

**Components Migrated (Final Session - 9 components):**
- Server/Proxy.php (1 field)
- Service/EditDomain.php (1 field) - Fixed Collection/string bug & parent sync
- Application/Previews.php (2 fields - array handling)
- Service/EditCompose.php (4 fields)
- Service/FileStorage.php (6 fields)
- Service/Database.php (7 fields)
- Service/ServiceApplicationView.php (10 fields)
- Application/General.php (53 fields) - LARGEST migration
- Application/PreviewsCompose.php (1 field)

**Total Migration Summary:**
- 25+ components migrated across all phases
- 150+ explicit properties added
- 0 legacy bindings remaining (verified via grep)
- All wire:model, id, @entangle bindings updated
- All updater hooks renamed (updatedApplicationX → updatedX)

**Technical Changes:**
- Added explicit public properties (camelCase)
- Implemented syncData(bool $toModel) bidirectional sync
- Updated validation rules (removed model. prefix)
- Updated all action methods (mount, submit, instantSave)
- Fixed updater hooks: updatedBuildPack, updatedBaseDirectory, updatedIsStatic
- Updated Blade views (id & wire:model bindings)
- Applied Collection/string confusion fixes
- Added model refresh + re-sync pattern

**Critical Fixes:**
- EditDomain.php Collection/string confusion (use intermediate variables)
- EditDomain.php parent component sync (refresh + re-sync after save)
- General.php domain field empty (syncData at end of mount)
- General.php wire:model bindings (application.* → property)
- General.php updater hooks (wrong naming convention)

**Files Modified:** 34 files
- 17 PHP Livewire components
- 17 Blade view templates
- 1 MIGRATION_REPORT.md (documentation)

**Ready to disable legacy_model_binding flag in config/livewire.php**

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 15:38:59 +02:00
Andras Bacsai
ae64f8cb86 fix validation on a few views 2025-10-06 21:25:24 +02:00
Andras Bacsai
708a08fdd6 fix(application): enhance domain handling by replacing both dots and dashes with underscores for HTML form binding 2025-09-25 13:19:12 +02:00
Andras Bacsai
4fc62ea33f
Merge pull request #6496 from QarthO/fix/url-validation
fix(domains) url validation silently fails with surrounding whitespace
2025-09-22 12:49:43 +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
501e6a2650 refactor(environment): standardize service name formatting by replacing '-' and '.' with '_' in environment variable keys 2025-09-11 13:59:02 +02:00
Andras Bacsai
a7671ed379 refactor(dns-validation): rename DNS validation functions for consistency and clarity, and remove unused code 2025-09-09 09:00:35 +02:00
QarthO
bfc8a25b72 move domain trimming before URL validation 2025-08-29 09:09:03 -04:00
Andras Bacsai
80499a03d8 feat(domains): implement domain conflict detection and user confirmation modal across application components 2025-08-28 10:52:41 +02:00
Andras Bacsai
e0aa28ba31 refactor(domains): rename check_domain_usage to checkDomainUsage and update references across the application 2025-08-28 10:00:19 +02:00
Andras Bacsai
2e85ce0e0e refactor(urls): replace generateFqdn with generateUrl for consistent URL generation across applications 2025-08-28 09:49:58 +02:00
Andras Bacsai
6ef16f6170 fix(auth): enhance authorization checks in application management 2025-08-23 18:19:50 +02:00
Andras Bacsai
40f108d6e1 feat(auth): implement authorization checks for application management 2025-08-22 16:47:59 +02:00
Andras Bacsai
5c4a265542 refactor(validation): implement centralized validation patterns across components
- Introduced `ValidationPatterns` class to standardize validation rules and messages for various fields across multiple components.
- Updated components including `General`, `StackForm`, `Create`, and `Show` to utilize the new validation patterns, ensuring consistent validation logic.
- Enhanced error messages for required fields and added regex validation for names and descriptions to improve user feedback.
- Adjusted styling in the `create.blade.php` view for better visual hierarchy.
2025-08-19 14:15:31 +02:00
Andras Bacsai
460198bb05 fix(application): clear Docker Compose specific data when switching away from dockercompose 2025-08-18 11:31:14 +02:00
Andras Bacsai
970fd3d9e6 refactor(parsers): streamline domain handling in applicationParser and improve DNS validation logic 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
5ddaf3a61f fix(application): add option to suppress toast notifications when loading compose file 2025-07-18 23:22:24 +02:00
Andras Bacsai
039aa86321 fix(application): update service environment variables when generating domain for Docker Compose 2025-07-18 23:16:12 +02:00
Andras Bacsai
90ccaeba51 feat(application): implement environment variable updates for Docker Compose applications, including creation, updating, and deletion of SERVICE_FQDN and SERVICE_URL variables 2025-07-18 20:48:56 +02:00
Andras Bacsai
3bb28c29be fix(application): sanitize service names for HTML form binding and ensure original names are stored in docker compose domains 2025-07-14 14:45:01 +02:00
Andras Bacsai
78ef80f800 refactor 2025-04-23 13:22:01 +02:00
Andras Bacsai
9e608f7ba5 refactor(http-basic-auth): rename 'http_basic_auth_enable' to 'http_basic_auth_enabled' across application files for consistency 2025-04-22 21:30:27 +02:00
Christopher Kaster
2634f516d5
feat: Add HTTP Basic Authentication 2025-04-17 14:14:32 +02:00
Andras Bacsai
68bd945b09 refactor(Application): rename network_aliases to custom_network_aliases across the application for clarity and consistency 2025-04-09 08:42:50 +02:00
Andras Bacsai
f8607ddf6a
Merge branch 'next' into docker-network-aliases 2025-04-08 13:27:59 +02:00
Andras Bacsai
3176106222 fix(CheckProxy, Status): prevent proxy checks when force_stop is active; remove debug statement in General 2025-04-05 14:32:51 +02:00
Andras Bacsai
fcfd00eebe feat(application): add SPA configuration and update Nginx generation logic 2025-03-31 15:10:50 +02:00
Andras Bacsai
806d892031 refactor(application): streamline healthcheck parsing from Dockerfile 2025-03-24 11:43:10 +01:00
Piotr Wójcik
0baeaa982b
Merge branch 'next' into docker-network-aliases 2025-03-16 14:50:26 +01:00
Andras Bacsai
fddaf9134d fix: disable certain parts if readonly label is turned off 2025-01-27 14:05:18 +01:00
peaklabs-dev
ec9f8de873
fix(labels): generate labels when they are empty not when they are already generated 2025-01-23 14:57:18 +01:00
peaklabs-dev
cc640ad710
fix(labels): docker labels do not generated correctly 2025-01-23 12:42:53 +01:00
Andras Bacsai
4b74ca56c3 feat(core): wip version of coolify.json 2025-01-21 14:09:12 +01:00
peaklabs-dev
3d4e8b9867
chore: switch up readonly lables to make more sense 2025-01-08 17:05:11 +01:00