Commit graph

465 commits

Author SHA1 Message Date
Andras Bacsai
f1d80d6776 fix: enhance error handling in initialization and cleanup process 2025-11-10 15:29:26 +01:00
Andras Bacsai
4e734492e0 fix: escape shell arguments in syncBunny command execution 2025-11-06 14:57:53 +01:00
Andras Bacsai
24bcce3f9b
Update app/Console/Commands/SyncBunny.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-06 14:36:34 +01:00
Andras Bacsai
23a3b47011 refactor: rename sync function and improve error handling
The function previously named syncGitHubReleases has been renamed to syncReleasesToGitHubRepo for clarity, as it now focuses on syncing releases directly to the GitHub repository instead of the CDN. Additionally, error handling has been enhanced to provide more informative messages during the cloning, branching, and committing processes. This refactor aims to improve the maintainability of the code and ensure better feedback in case of failures.
2025-11-05 14:54:13 +01:00
Andras Bacsai
0865ecd3db refactor: move RestoreDatabase command to Cloud namespace
This change organizes the command within the appropriate Cloud namespace, improving code structure and maintainability. By grouping related commands together, it enhances clarity for future developers and helps in locating files more efficiently.
2025-11-05 14:42:12 +01:00
Andras Bacsai
d291d85311 feat: add RestoreDatabase command for PostgreSQL dump restoration 2025-11-03 13:02:14 +01:00
Andras Bacsai
ea649d2a85 Add artisan command to update service Docker image versions
This command queries Docker registries (Docker Hub, GHCR, Quay, Codeberg) to find and update Docker image versions in service template files.

Features:
- Automatically updates 'latest' tags to semantic versions using digest matching
- Supports multiple version formats: semantic (1.2.3), date-based (2025.10.20), RELEASE timestamps
- Prefers shorter version tags (1.8 over 1.8.1) when both available
- In-memory caching to avoid duplicate API queries for same images
- Detects and reports services with available major version updates
- Preserves YAML formatting and comments
- Supports dry-run mode for preview

Usage:
  php artisan services:update-versions [--dry-run] [--service=name]

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 08:29:11 +01:00
Andras Bacsai
9f87d499dd
Update app/Console/Commands/CleanupRedis.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-24 13:20:24 +02:00
Andras Bacsai
c6a2d1fe0a Fix stale lock issue causing scheduled tasks to stop (#4539)
## Problem
Scheduled tasks, backups, and auto-updates stopped working after 1-2 months
with error: MaxAttemptsExceededException: App\Jobs\ScheduledJobManager has
been attempted too many times.

Root cause: ScheduledJobManager used WithoutOverlapping with only
releaseAfter(60), causing locks without expiration (TTL=-1) that persisted
indefinitely when jobs hung or processes crashed.

## Solution

### Part 1: Prevention (Future Locks)
- Added expireAfter(60) to ScheduledJobManager middleware
- Lock now auto-expires after 60 seconds (matches everyMinute schedule)
- Changed from releaseAfter(60) to expireAfter(60)->dontRelease()
- Follows Laravel best practices and matches other Coolify jobs

### Part 2: Recovery (Existing Locks)
- Enhanced cleanup:redis command with --clear-locks flag
- Scans Redis for stale locks (TTL=-1) and removes them
- Called automatically during app:init on startup/upgrade
- Provides immediate recovery for affected instances

## Changes
- app/Jobs/ScheduledJobManager.php: Added expireAfter(60)->dontRelease()
- app/Console/Commands/CleanupRedis.php: Added cleanupCacheLocks() method
- app/Console/Commands/Init.php: Auto-clear locks on startup
- tests/Unit/ScheduledJobManagerLockTest.php: Test to prevent regression
- STALE_LOCK_FIX.md: Complete documentation

## Testing
- Unit tests pass (2 tests, 8 assertions)
- Code formatted with Pint
- Matches pattern used by CleanupInstanceStuffsJob

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:07:33 +02:00
Andras Bacsai
2b51363b8c Changes auto-committed by Conductor 2025-10-16 17:23:22 +02:00
Andras Bacsai
975d1b8a6b Changes auto-committed by Conductor 2025-10-16 17:13:47 +02:00
Andras Bacsai
64c4ce210e feat: add artisan command to clear global search cache
Add a new artisan command for manually clearing the global search cache
during development and testing. This is useful when testing new navigation
entries or updates to searchable resources without waiting for the 5-minute
cache TTL.

Command: php artisan search:clear

Usage options:
- search:clear              - Clear cache for current user's team
- search:clear --team=1     - Clear cache for specific team ID
- search:clear --all        - Clear cache for all teams

This helps developers test global search changes immediately, especially
when adding new navigation routes like cloud-init scripts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 13:36:14 +02:00
Andras Bacsai
da93a52976 feat(cleanup): add force deletion of stuck servers and orphaned SSL certificates 2025-10-09 16:37:56 +02:00
Andras Bacsai
72f5ae0dc6 feat(user-deletion): implement file locking to prevent concurrent user deletions and enhance error handling 2025-09-29 14:03:49 +02:00
Andras Bacsai
106682b5b8 refactor(cloud-commands): consolidate and enhance subscription management commands
- Deleted obsolete CloudCheckSubscription, CloudCleanupSubscriptions, and CloudDeleteUser commands to streamline the codebase.
- Introduced new CloudDeleteUser and CloudFixSubscription commands with improved functionality for user deletion and subscription management.
- Enhanced subscription handling with options for fixing canceled subscriptions and verifying active subscriptions against Stripe, improving overall command usability and control.
2025-09-23 14:56:58 +02:00
Andras Bacsai
95453bfaaa feat(cloud-check): enhance CloudCheckSubscription command with fix options
- Added options to the CloudCheckSubscription command for fixing canceled subscriptions in the database.
- Implemented a dry-run mode to preview changes without applying them.
- Introduced a flag to limit checks/fixes to the first found subscription, improving command usability and control.
2025-09-23 11:00:24 +02:00
Andras Bacsai
88fa6a4a56 feat(cloud-check): enhance subscription reporting in CloudCheckSubscription command
- Added CSV output for active subscribers, including detailed information on subscription status and invoice status.
- Implemented checks for missing subscription IDs and provided appropriate logging in the CSV for visibility.
- Improved handling of non-active subscriptions with detailed output for better tracking and analysis.
2025-09-23 09:50:44 +02:00
Andras Bacsai
a2a2bfa6c9 feat(user-management): implement user deletion command with phased resource and subscription cancellation, including dry run option 2025-09-13 15:08:30 +02:00
peaklabs-dev
3e9dd6a7bf
chore: remove webhooks table cleanup 2025-09-10 19:56:15 +02:00
Andras Bacsai
a06c79776e feat(dev-command): dispatch CheckHelperImageJob during instance initialization to enhance setup process 2025-09-09 16:46:24 +02:00
Andras Bacsai
2d135071c7 refactor(command): replace forceDelete calls with DeleteResourceJob dispatch for all stuck resources in cleanup process 2025-09-05 19:28:08 +02:00
Andras Bacsai
136ca08305 refactor(command): streamline Init command by removing unnecessary options and enhancing error handling for various operations 2025-09-05 19:27:49 +02:00
Andras Bacsai
28d05f759e refactor(command): remove InitChangelog command as it is no longer needed 2025-09-05 17:45:15 +02:00
Andras Bacsai
49bd0a2a01 refactor(command): improve database collection logic for deletion command by using unique identifiers and enhancing user experience 2025-09-05 17:43:19 +02:00
Andras Bacsai
581b649cd7 fix(command): enhance cleanup process for stuck application previews by adding force delete for trashed records 2025-09-05 17:43:05 +02:00
Andras Bacsai
16447b7391 refactor(command): streamline database deletion process to handle multiple database types and improve user experience 2025-09-05 14:56:30 +02:00
Andras Bacsai
b17c65b224 fix(command): enhance database deletion command to support multiple database types 2025-09-05 14:55:15 +02:00
Andras Bacsai
0bfffb503e feat(command): add option to sync GitHub releases to BunnyCDN and refactor sync logic 2025-09-01 16:14:02 +02:00
Andras Bacsai
d2ed68e605 refactor(jobs): pull github changelogs from cdn instead of github 2025-09-01 16:13:55 +02:00
Andras Bacsai
7d10711a65 fix(servercheck): Properly check server statuses with and without Sentinel 2025-08-22 11:50:56 +02:00
Andras Bacsai
ea5b33b923 fix(init): improve error handling for deployment and template pulling processes 2025-08-19 14:22:48 +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
peaklabs-dev
dbed6c270e
feat: generate category for services 2025-08-18 17:28:20 +02:00
Andras Bacsai
f018d640e5 fix(templates): should generate old SERVICE_FQDN service templates as well 2025-08-12 14:19:17 +02:00
Andras Bacsai
a2ef545b6b feat(changelog): implement automated changelog fetching from GitHub and enhance changelog read tracking 2025-08-12 10:07:11 +02:00
Andras Bacsai
39f25573bf refactor(templates): update service template file handling to use dynamic file name from constants 2025-08-12 10:06:19 +02:00
Andras Bacsai
0e7cc988a6 feat(user): add changelog read tracking and unread count method 2025-08-12 10:06:19 +02:00
Andras Bacsai
fbe98cfd11 refactor(scheduling): replace deprecated job checks with ScheduledJobManager and ServerResourceManager for improved scheduling efficiency 2025-07-12 14:44:52 +02:00
Andras Bacsai
316f233eb8 feat(logging): add frequency filters for scheduled logs command to support hourly, daily, weekly, and monthly job views 2025-07-11 19:26:42 +02:00
Andras Bacsai
36fe235bea feat(logging): implement scheduled logs command and enhance backup/task scheduling with cron checks 2025-07-11 15:10:55 +02:00
Andras Bacsai
2214099c90 feat(scheduling): add frequency filter option for manual execution of scheduled jobs 2025-07-11 15:10:43 +02:00
Andras Bacsai
ea0e02d422 feat(scheduling): add command to manually run scheduled database backups and tasks with options for chunking, delays, and dry runs 2025-07-08 21:03:26 +02:00
Andras Bacsai
ecbfaa9a8a fix(scheduling): change redis cleanup command frequency from hourly to weekly for better resource management 2025-07-08 10:57:09 +02:00
Andras Bacsai
3b7f4bcbbd refactor(init): standardize method naming conventions and improve command structure in Init.php 2025-07-07 09:50:15 +02:00
Andras Bacsai
7817c9cad7 refactor(redis): enhance CleanupRedis command with dry-run option and improved key deletion logic 2025-07-07 09:47:11 +02:00
Andras Bacsai
38e947d704 feat(cleanup): add functionality to delete teams with no members or servers in CleanupStuckedResources command 2025-06-25 11:42:53 +02:00
Andras Bacsai
6ea6d2742b feat(server): implement server patch check notifications
- Added a new job, ServerPatchCheckJob, to handle server patch checks and notifications.
- Introduced a new notification class, ServerPatchCheck, for sending updates via email, Discord, Slack, Pushover, and Telegram.
- Updated notification settings models to include server patch notification options for email, Discord, Slack, Pushover, and Telegram.
- Created a migration to add server patch notification fields to the respective settings tables.
- Enhanced the UI to allow users to enable/disable server patch notifications across different channels.
2025-05-26 14:03:59 +02:00
Péter Gyarmati
9939b10e5a
feat(service): add Marimo service (#5559) 2025-05-14 14:43:39 +02:00
Andras Bacsai
9d56d06352 feat(redis): add scheduled cleanup command for Redis keys and enhance cleanup logic 2025-05-07 22:09:25 +02:00