Commit graph

13871 commits

Author SHA1 Message Date
peaklabs-dev
fa604f8964
chore: improve storage .gitignore file 2025-11-30 16:58:58 +01:00
peaklabs-dev
495c9a3324
build: add strict .dockerignore file 2025-11-30 16:58:58 +01:00
peaklabs-dev
3f9f400c75
test: improve ArchTest
- add more rules for the entire app
- add Resources rule
- improve existing rules
- adjust formatting
2025-11-30 16:58:58 +01:00
peaklabs-dev
b2406eedb0
test(setup): add base test case and refresh the DB on each test 2025-11-30 16:58:58 +01:00
peaklabs-dev
52dab08027
chore: improve AppServiceProvider
- add automatic eager loading of relationships
- configure Laravel Http Facade to prevent stray requests during tests
- configure Laravel Sleep Facade to be faked during tests
2025-11-30 16:58:58 +01:00
peaklabs-dev
09ca5040ec
chore(config): encrypt sessions 2025-11-30 16:58:58 +01:00
peaklabs-dev
e2f2885f42
chore(config): update config files to the latest skeleton version 2025-11-30 16:58:58 +01:00
peaklabs-dev
675bdf79f4
chore(setup): add tailwind v4 2025-11-30 16:58:58 +01:00
peaklabs-dev
74bfd3dccf
test(setup): configure phpunit.xml 2025-11-30 16:58:58 +01:00
peaklabs-dev
ec7beae5bc
chore: improve composer.json
- improve composer.json metadata
- change license to AGPL-3.0
- add composer scripts
- update dependencies
2025-11-30 16:58:58 +01:00
peaklabs-dev
60587ac13b
chore(deps): bump node packages 2025-11-30 16:58:58 +01:00
peaklabs-dev
a14128c0dc
chore(setup): add bun for node dependencies 2025-11-30 16:58:58 +01:00
peaklabs-dev
93118bfa5a
fix(tooling): remove resources folder from rector config 2025-11-30 16:58:58 +01:00
peaklabs-dev
b6518319fa
chore(tooling): add PHPStan cache folder 2025-11-30 16:58:58 +01:00
peaklabs-dev
480b5099cd
test(setup): add testing folders and pest config 2025-11-30 16:58:58 +01:00
peaklabs-dev
7a8781946a
chore(tooling): make PHPStan rules more strict 2025-11-30 16:58:58 +01:00
peaklabs-dev
01654288b1
chore(tooling): add PHPStan level max 2025-11-30 16:58:58 +01:00
peaklabs-dev
196054c543
style: apply pint to full codebase 2025-11-30 16:58:58 +01:00
peaklabs-dev
b528973f5a
chore(security): prevent indexing of all pages in robots.txt 2025-11-30 16:58:58 +01:00
peaklabs-dev
f3df3bbb93
docs: add improved SECURITY.md file
- new Support Policy table
- improved reporting guide for vulnerabilities
2025-11-30 16:50:04 +01:00
peaklabs-dev
7a71e510a9
chore(repo): add assets folder for readme assets 2025-11-30 16:50:04 +01:00
peaklabs-dev
ea0fd28dd1
chore(repo): add funding.yaml 2025-11-30 16:50:04 +01:00
peaklabs-dev
15fefa1cf6
chore(repo): add new pull request template 2025-11-30 16:50:04 +01:00
peaklabs-dev
80d2b0f06f
chore(tooling): add ray for local debugging 2025-11-30 16:50:04 +01:00
peaklabs-dev
f68b73337d
chore(setup): add new folder structure 2025-11-30 16:50:04 +01:00
peaklabs-dev
9055fadb05
test: add strict ArchTest with custom rules 2025-11-30 16:50:04 +01:00
peaklabs-dev
a55ad5a1da
chore(config): remove unused auth config option 2025-11-30 16:50:04 +01:00
peaklabs-dev
e28e346b7e
chore(config): improve app config 2025-11-30 16:50:04 +01:00
peaklabs-dev
be45e94c39
chore(config): switch from bcrypt to argon2id 2025-11-30 16:50:04 +01:00
peaklabs-dev
350894f2e8
chore(tooling): add peck for typo checking 2025-11-30 16:50:04 +01:00
peaklabs-dev
9cfe936311
chore(tooling): add strict rector configuration 2025-11-30 16:50:04 +01:00
peaklabs-dev
2d0dd50063
chore: add strict AppServiceProvider 2025-11-30 16:50:04 +01:00
peaklabs-dev
a17caf0b68
chore(tooling): add custom pint formatting preset 2025-11-30 16:50:04 +01:00
peaklabs-dev
3cb36b0c41
chore(setup): create core skeleton 2025-11-30 16:50:04 +01:00
peaklabs-dev
4a579ceca7
chore(setup): change license from Apache-2.0 to AGPL-3.0 2025-11-30 16:29:18 +01:00
Andras Bacsai
a528f4c3d1
v4.0.0-beta.452 (#7386) 2025-11-28 20:52:50 +01:00
Andras Bacsai
a56fde7f12 Fix: Adjust badge positioning and enhance coolbox utility styles 2025-11-28 20:48:49 +01:00
Andras Bacsai
1dd2a81f89
Fix: Traefik proxy startup issues (#7400) 2025-11-28 20:39:28 +01:00
Andras Bacsai
627cec16fa
Merge branch 'next' into fix-traefik-startup 2025-11-28 17:54:48 +01:00
Andras Bacsai
cb0f2301f5 Fix: Traefik proxy startup issues - handle null versions and filter predefined networks
Fixes two critical issues preventing Traefik proxy startup:

1. TypeError when restarting proxy: Handle null return from get_traefik_versions()
   - Add null check before dispatching CheckTraefikVersionForServerJob
   - Log warning when version data is unavailable
   - Prevents: "Argument #2 must be of type array, null given"

2. Docker network error: Filter out predefined Docker networks
   - Add isDockerPredefinedNetwork() helper to centralize network filtering
   - Apply filtering in collectDockerNetworksByServer() before operations
   - Apply filtering in generateDefaultProxyConfiguration()
   - Prevents: "operation is not permitted on predefined default network"

Also: Move $cachedVersionsFile assignment after null check in Proxy.php

Tests: Added 7 new unit tests for network filtering function
All existing tests pass with no regressions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:53:26 +01:00
Andras Bacsai
a25e553f88
Fix: Fragile service name parsing with hyphens (#7399) 2025-11-28 17:50:44 +01:00
Andras Bacsai
5598a2ada4
Improve manual update process with better user feedback (#7398) 2025-11-28 17:49:18 +01:00
Andras Bacsai
b7fcb0f362 Fix Alpine state reference and remove unused property in upgrade modal
- Fix incorrect Alpine state reference: Changed `this.$wire.showProgress` to `this.showProgress` in upgrade.blade.php:155
- Remove unused `$showProgress` property from Upgrade.php Livewire component
- The backend property was never set or used; all progress tracking is handled by Alpine state
- This fixes potential race conditions where the guard condition was not working as intended

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:48:52 +01:00
Andras Bacsai
8c40cc607a Fix: Fragile service name parsing in applyServiceApplicationPrerequisites
Changed from `->before('-')` to `->beforeLast('-')` to correctly parse service
names with hyphens. This fixes prerequisite application for ~230+ services
containing hyphens in their template names (e.g., docker-registry,
elasticsearch-with-kibana).

Added comprehensive test coverage for hyphenated service names and fixed
existing tests to use realistic CUID2 UUID format. All unit tests pass.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:42:04 +01:00
Andras Bacsai
702be840b4 Improve manual update process with better user feedback
Add elapsed time tracking and time-aware status messages during updates to inform users about extended downtime. Fix variable scoping issues by properly declaring interval variables in Alpine.js component data, and add error handling for network failures during health checks. Users now see clear, reassuring messages at different stages: update progress, restart phase, and revival with elapsed time.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:57:31 +01:00
Andras Bacsai
4706bc23aa Refactor: Centralize service application prerequisites
Refactors the Appwrite and Beszel service-specific application settings
to use a centralized constant-based approach, following the same pattern
as NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK.

Changes:
- Added NEEDS_TO_DISABLE_GZIP constant for services requiring gzip disabled
- Added NEEDS_TO_DISABLE_STRIPPREFIX constant for services requiring stripprefix disabled
- Created applyServiceApplicationPrerequisites() helper function in bootstrap/helpers/services.php
- Updated all service creation flows to use the centralized helper:
  * app/Livewire/Project/Resource/Create.php (web handler)
  * app/Http/Controllers/Api/ServicesController.php (API handler - BUG FIX)
  * app/Livewire/Project/New/DockerCompose.php (custom compose handler)
  * app/Http/Controllers/Api/ApplicationsController.php (API custom compose handler)
- Added comprehensive unit tests for the new helper function

Benefits:
- Single source of truth for service prerequisites
- DRY - eliminates code duplication between web and API handlers
- Fixes bug where API-created services didn't get prerequisites applied
- Easy to extend for future services (just edit the constant)
- More maintainable and testable

Related commits: 3a94f1ea1 (Beszel), 02b18c86e (Appwrite)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:47:09 +01:00
Andras Bacsai
b246cdffab
Fix: Version downgrade prevention with cache validation (#7396) 2025-11-28 16:31:46 +01:00
Andras Bacsai
4052d1bd05 Refactor color classes from yellow to warning across the application
- Updated color classes in NotifyDemo.php to use warning colors.
- Added new warning color variables in app.css.
- Changed warning icon colors in callout.blade.php.
- Updated loading spinner and hover states in global-search.blade.php.
- Refactored warning messages and styles in project application views.
- Adjusted log display colors in get-logs.blade.php.
- Updated private key status indicators in index.blade.php.
- Changed hover and text colors for documentation links in cloudflare-tunnel.blade.php.
- Refactored server creation messages in by-hetzner.blade.php.
- Updated proxy warning button colors in proxy.blade.php.
- Changed loading spinner colors in show.blade.php.
- Updated deployment status colors in deployments.blade.php and show.blade.php.
2025-11-28 16:23:32 +01:00
Andras Bacsai
cd10796612 Fix: Version downgrade prevention - validate cache and add running version checks
## Changes
- **CheckForUpdatesJob**: Add triple version comparison (CDN vs cache vs running)
  - Never allows version downgrade from currently running version
  - Uses data_set() for safer nested array mutation
  - Prevents incorrect new_version_available flag setting

- **UpdateCoolify**: Add cache validation before fallback
  - Validates cache against running version on CDN failure
  - Throws exception if cache is corrupted/older than running
  - Applies to both manual and automated updates

- **Tests**: Add comprehensive test coverage
  - tests/Unit/CheckForUpdatesJobTest.php (5 tests)
  - tests/Unit/UpdateCoolifyTest.php (3 tests)

## Impact
- Prevents all downgrade scenarios (CDN rollback, corrupted cache, etc.)
- Maintains backward compatibility
- Provides clear logging for debugging

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 16:05:41 +01:00
Andras Bacsai
d9774d2968 Fix: Prevent version downgrades and centralize CDN configuration (#7383)
## Root Cause
Between Nov 25-26, a CDN redirect was added without curl's `-L` flag,
causing version cache corruption and automatic downgrades.

## Three Critical Bugs Fixed

### Bug #1: CheckForUpdatesJob could overwrite newer cached version
- Problem: CDN serving older version would overwrite local cache
- Solution: Smart version merge - keep max Coolify version, update other components
- Location: app/Jobs/CheckForUpdatesJob.php:33-52

### Bug #2: Manual updates bypassed downgrade protection
- Problem: Downgrade guard only applied to auto-updates
- Solution: Always block downgrades for both manual and auto-updates
- Location: app/Actions/Server/UpdateCoolify.php:65-75

### Bug #3: Updates used stale local cache
- Problem: Never validated cache against CDN at update time
- Solution: Fetch fresh CDN data before executing updates
- Location: app/Actions/Server/UpdateCoolify.php:34-49

## Additional Improvement: Centralized CDN Configuration

Added three new config keys for easy CDN management:
- `cdn_url` - Base CDN URL (default: https://cdn.coollabs.io)
- `versions_url` - Full versions.json URL
- `upgrade_script_url` - Full upgrade.sh URL

All configurable via environment variables:
```bash
CDN_URL=https://cdn.coolify.io
VERSIONS_URL=https://custom-cdn.example.com/versions.json
UPGRADE_SCRIPT_URL=https://custom-cdn.example.com/upgrade.sh
```

## Files Modified
- config/constants.php - CDN configuration
- app/Jobs/CheckForUpdatesJob.php - Smart version merge + centralized URL
- app/Actions/Server/UpdateCoolify.php - Downgrade protection + fresh fetch + centralized URLs
- app/Jobs/CheckHelperImageJob.php - Centralized URL
- bootstrap/helpers/shared.php - Centralized URL

## Testing
-  All modified files pass Pint formatting
-  78 unit tests pass (2 pre-existing failures unrelated to changes)

## Impact
- No breaking changes - defaults to current CDN
- Easy CDN migration via environment variables
- Prevents all downgrade scenarios
- Maintains independent Sentinel/Helper/Traefik updates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 15:20:33 +01:00