Commit Graph

93 Commits

Author SHA1 Message Date
Andras Bacsai 3a8f52ce16 fix(team): mark servers unreachable when subscription ends
Set unreachable_count to 3 and unreachable_notification_sent to true
on all team servers in subscriptionEnded(), so the existing cleanup
command can pick them up after the 7-day grace period.

Also adds feature tests for the subscription-ended cleanup flow and
casts server IP to string in existing unreachable server tests to fix
type comparison.
2026-04-15 15:12:29 +02:00
Andras Bacsai 7d2c776ae7 fix(team): transfer instance-wide sources to root team on deletion
Instead of nullifying source references on applications when a team is
deleted, transfer instance-wide GitHub/GitLab apps to the root team
(team_id=0) so they remain available to other teams that depend on them.

Non-instance-wide sources are still deleted along with the team.
2026-04-09 14:51:52 +02:00
Andras Bacsai 3f564f9b2e fix(user-deletion): handle GitHub app sources across team cleanup
Limit team cleanup to apps owned by the deleted team and nullify cross-team application source references before deleting team-owned sources. Adds feature tests covering user deletion with GitHub app-backed applications, preserving system-wide apps, and nullifying external source links.
2026-04-05 18:08:06 +02:00
Andras Bacsai cb97a18a78 Merge remote-tracking branch 'origin/next' into pr-7764-shadow/add-shared-server-env 2026-03-31 10:52:31 +02:00
Andras Bacsai b3256d4df1 fix(security): harden model assignment and sensitive data handling
Restrict mass-assignable attributes across user/team/redis models and
switch privileged root/team creation paths to forceFill/forceCreate.

Encrypt legacy ClickHouse admin passwords via migration and cast the
correct ClickHouse password field as encrypted.

Tighten API and runtime exposure by removing sensitive team fields from
responses and sanitizing Git/compose error messages.

Expand security-focused feature coverage for command-injection and mass
assignment protections.
2026-03-29 20:56:04 +02:00
Andras Bacsai 67a4fcc2ab fix: add mass assignment protection to models
Replace $guarded = [] with explicit $fillable whitelists across all
models. Update controllers to use request->only($allowedFields) when
assigning request data. Switch Livewire components to forceFill() for
explicit mass assignment. Add integration tests for mass assignment
protection.
2026-03-28 12:32:57 +01:00
Andras Bacsai 520e048ed5 refactor(team): update serverOverflow to use static serverLimit 2026-03-24 08:08:57 +01:00
Andras Bacsai e37cb98c7c refactor(team): make server limit methods accept optional team parameter
Allow serverLimit() and serverLimitReached() to accept an optional team
parameter instead of relying solely on the current session. This improves
testability and makes the methods more flexible by allowing them to work
without session state.

Add comprehensive tests covering various scenarios including no session,
team at limit, and team under limit.
2026-03-23 21:56:50 +01:00
Andras Bacsai 566744b2e0 fix(stripe): add error handling and resilience to subscription operations
- Record refunds immediately before cancellation to prevent retry issues if cancel fails
- Wrap Stripe API calls in try-catch for refunds and quantity reverts with internal notifications
- Add null check in Team.subscriptionEnded() to prevent NPE when subscription doesn't exist
- Fix control flow bug in StripeProcessJob (add missing break statement)
- Cap dynamic server limit with MAX_SERVER_LIMIT in subscription updates
- Add comprehensive tests for refund failures, event handling, and null safety
2026-03-18 15:21:59 +01:00
Andras Bacsai bf51ed905f chore: prepare for PR 2026-02-23 13:02:06 +01:00
ShadowArcanist 5ed308dcf0 feat: predefined server variables (COOLIFY_SERVER_NAME, COOLIFY_SERVER_UUID)
These are not visible on shared env page but user can use these variables like they use the COOLIFY_RESOURCE_UUID
2025-12-24 13:58:50 +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 635af44539 Merge pull request #6837 from coollabsio/andrasbacsai/custom-webhooks
feat: add custom webhook notification support
2025-10-12 10:57:47 +02:00
Andras Bacsai 556d93ecb8 refactor: remove SendsWebhook interface
Simplified webhook channel implementation to match TelegramChannel pattern without typed interface.

Changes:
- Removed SendsWebhook interface file
- Removed interface from Team model
- Removed routeNotificationForWebhook() method
- WebhookChannel now uses untyped $notifiable like TelegramChannel

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 18:08:37 +02:00
Andras Bacsai dc15bee980 feat: implement actual webhook delivery with Ray debugging
Added actual HTTP POST delivery for webhook notifications and comprehensive Ray debugging for development.

Changes:
- Updated Team model to implement SendsWebhook interface
- Added routeNotificationForWebhook() method to Team
- Enhanced SendWebhookJob with Ray logging for request/response
- Added Ray debugging to WebhookChannel for dispatch tracking
- Added Ray debugging to Webhook Livewire component

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 18:07:04 +02:00
Andras Bacsai 27879377a0 feat: add custom webhook notification support
Add basic infrastructure for custom webhook notifications:
- Create webhook_notification_settings table with event toggles
- Add WebhookNotificationSettings model with encrypted URL
- Integrate webhook settings into Team model and HasNotificationSettings trait
- Create Livewire component and Blade view for webhook configuration
- Add webhook navigation route and UI

This provides the foundation for sending webhook notifications to custom HTTP/HTTPS endpoints when events occur in Coolify.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 15:37:00 +02:00
Andras Bacsai c1bcc41546 init of cloud providers 2025-10-08 20:47:50 +02:00
Andras Bacsai 3f71f7becf Merge pull request #6628 from heavygee/fix/team-invitation-email-case-sensitivity
Fix team invitation email case sensitivity bug
2025-09-25 09:29:24 +02:00
Andras Bacsai c97874eb45 fix(team): clear stripe_subscription_id on subscription end
- Updated the subscriptionEnded method to set stripe_subscription_id to null when a subscription ends, ensuring proper handling of subscription state.
2025-09-23 11:00:10 +02:00
GitHub Actions c1c149968e Fix team invitation email case sensitivity bug
- Add email normalization to TeamInvitation model using setEmailAttribute()
- Add HasFactory trait to Team model for testing support
- Create TeamFactory for testing
- Add tests to verify email normalization works correctly
- Fixes issue where mixed case emails in invitations would cause lookup failures
- Resolves #6291

The bug occurred because:
1. User model normalizes emails to lowercase
2. TeamInvitation model did not normalize emails
3. When invitation was created with mixed case, it was stored as-is
4. User lookup failed due to case mismatch during invitation acceptance
5. This caused users to not be able to see teams they were invited to

This fix ensures both models normalize emails consistently.
2025-09-16 15:31:48 +01: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 32326bb7dd feat(subscription): enhance subscription management with loading states and Stripe status checks 2025-04-14 10:31:13 +02:00
Andras Bacsai e7f32a1c44 refactor(notifications): standardize getRecipients method signatures 2025-03-24 17:55:10 +01:00
Andras Bacsai 07cbec7ddc feat(billing): Add Stripe past due subscription status tracking 2025-03-01 12:43:12 +01:00
🏔️ Peak e73c9b5f98 fix: system-wide GitHub apps (#5114)
- fix(ui): system-wide GitHub Apps are not shown in the create a new Application dialog
- fix: query logic error that shows all system-wide apps, regardless of whether they are public or private.
- fix: clicking on a system-wide GitHub app from a team other than the one that created it resulted in a 404 error.
2025-02-11 17:07:57 +01:00
peaklabs-dev db5786efc9 fix: instance wide GitHub apps are not available on other teams then the source team 2025-01-13 12:14:36 +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 2b8c559662 refactor: server limit
remove envs from constants related to server limit
2024-12-28 14:10:26 +01:00
peaklabs-dev 5571aa4530 feat: use new ServerReachabilityChanged event instead of isDirty 2024-12-16 14:06:16 +01:00
peaklabs-dev 866abfb1d4 fix: typo in pushover user key 2024-12-11 19:31:25 +01:00
peaklabs-dev 92fec9582c fix: make pushover settings more clear
- Rename User to User Key
- Rename Token to API Token
- fix: helper and docs links
2024-12-11 19:18:39 +01:00
Zao Soula ef35429533 feat(notification): add Pushover 2024-12-11 18:13:16 +01:00
peaklabs-dev bd36149f09 feat: use new notification stuff inside team model
- Use new notification relationships
- Use trait
- Make sure that when a new team is created, notification settings are also created
- reorder team model for better readability
2024-12-09 12:33:27 +01:00
Marvin von Rappard 7bdac8b42f Merge branch 'next' into main 2024-11-14 12:54:04 +01:00
Marvin von Rappard eb0686fe20 feat: slack notifications 2024-11-12 22:37:55 +01:00
peaklabs-dev 1c5ddab30d use one constants file 2024-11-12 15:18:48 +01:00
Andras Bacsai 1faa8be615 fix: cloud + stripe related 2024-11-11 22:18:15 +01:00
Andras Bacsai 904ffc894d fix: server limit check 2024-11-05 16:35:56 +01:00
Andras Bacsai 5ce6c3ded1 refactor server limit check job + email notifications view 2024-11-05 11:22:23 +01:00
Lucas Michot 1ec224fde1 Inline many variables. 2024-10-31 18:20:11 +01:00
Lucas Michot d557a22b91 Remove all ray() calls 2024-10-28 13:51:23 +01:00
Andras Bacsai 3cb6ba1a9d Refactor code to improve server limit retrieval in Team model 2024-10-28 10:08:52 +01:00
Andras Bacsai 2e9ce3ed2a feat: add notification settings to server_disk_usage 2024-10-22 14:47:01 +02:00
Andras Bacsai 2d3a6a4528 openapi work work 2024-07-09 10:45:10 +02:00
Andras Bacsai 9c821e2480 init openapi generator 2024-07-06 14:34:15 +02:00
Thijmen d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai 98b6aec203 feat: admin view for deleting users 2024-05-21 14:29:06 +02:00
Andras Bacsai db8ffe50ac fix: isMember 2024-04-05 18:47:07 +02:00