|
| 1 | +--- |
| 2 | +title: Laravel Kick Integration |
| 3 | +description: Enhanced application introspection with Laravel Kick |
| 4 | +--- |
| 5 | + |
| 6 | +The dashboard integrates with [Laravel Kick](https://github.com/StuMason/laravel-kick) to provide deep introspection into your running applications. |
| 7 | + |
| 8 | +## What is Laravel Kick? |
| 9 | + |
| 10 | +Laravel Kick is a package you install on your **deployed application** that exposes secure endpoints for: |
| 11 | + |
| 12 | +- Health checks (database, cache, storage, redis) |
| 13 | +- System stats (CPU, memory, disk, uptime) |
| 14 | +- Log file viewing with filtering |
| 15 | +- Queue status and failed jobs |
| 16 | +- Artisan command execution |
| 17 | + |
| 18 | +## Setup |
| 19 | + |
| 20 | +### 1. Install Kick on Your Deployed App |
| 21 | + |
| 22 | +```bash |
| 23 | +composer require stumason/laravel-kick |
| 24 | +``` |
| 25 | + |
| 26 | +### 2. Configure Environment Variables |
| 27 | + |
| 28 | +Add to your application's Coolify environment variables: |
| 29 | + |
| 30 | +```bash |
| 31 | +KICK_ENABLED=true |
| 32 | +KICK_TOKEN=your-secure-random-token |
| 33 | +``` |
| 34 | + |
| 35 | +Generate a secure token: |
| 36 | + |
| 37 | +```bash |
| 38 | +openssl rand -base64 32 |
| 39 | +``` |
| 40 | + |
| 41 | +### 3. Deploy |
| 42 | + |
| 43 | +After deployment, a **Kick** tab appears in the dashboard for that application. |
| 44 | + |
| 45 | +## Dashboard Features |
| 46 | + |
| 47 | +### Overview Tab |
| 48 | + |
| 49 | +- **Health Checks** - Real-time status of database, cache, storage, and redis connections |
| 50 | +- **System Stats** - CPU load, memory usage, disk space, and uptime |
| 51 | +- **Queue Status** - Quick view of pending jobs and failed count |
| 52 | + |
| 53 | +### Logs Tab |
| 54 | + |
| 55 | +- **File Selection** - Browse all Laravel log files |
| 56 | +- **Level Filtering** - Filter by DEBUG, INFO, WARNING, ERROR, etc. |
| 57 | +- **Search** - Full-text search across log entries |
| 58 | +- **Line Limits** - Control how many lines to display |
| 59 | + |
| 60 | +### Queue Tab |
| 61 | + |
| 62 | +- **Connection Info** - Current queue driver and status |
| 63 | +- **Queue Sizes** - Pending jobs per queue (default, high, low) |
| 64 | +- **Failed Jobs** - List of failed jobs with exception details |
| 65 | + |
| 66 | +### Artisan Tab |
| 67 | + |
| 68 | +- **Command List** - All whitelisted artisan commands |
| 69 | +- **Execution** - Run commands directly from the dashboard |
| 70 | +- **Output** - View command output and exit codes |
| 71 | + |
| 72 | +## Security |
| 73 | + |
| 74 | +### Token Authentication |
| 75 | + |
| 76 | +All Kick endpoints require the `KICK_TOKEN` for authentication. The token is: |
| 77 | + |
| 78 | +- Sent as a Bearer token in the Authorization header |
| 79 | +- Never exposed in the dashboard UI |
| 80 | +- Required for every request |
| 81 | + |
| 82 | +### Command Whitelisting |
| 83 | + |
| 84 | +Artisan commands must be explicitly whitelisted in your Kick configuration. By default, only safe read-only commands are allowed. |
| 85 | + |
| 86 | +### Rate Limiting |
| 87 | + |
| 88 | +The artisan execution endpoint is rate-limited to 10 requests per minute to prevent abuse. |
| 89 | + |
| 90 | +## Configuration |
| 91 | + |
| 92 | +In your **Laravel Coolify** config (`config/coolify.php`): |
| 93 | + |
| 94 | +```php |
| 95 | +'kick' => [ |
| 96 | + // Enable/disable kick integration globally |
| 97 | + 'enabled' => env('COOLIFY_KICK_ENABLED', true), |
| 98 | + |
| 99 | + // Cache TTL for kick config lookups (seconds) |
| 100 | + 'cache_ttl' => env('COOLIFY_KICK_CACHE_TTL', 60), |
| 101 | + |
| 102 | + // Timeout for kick API requests (seconds) |
| 103 | + 'timeout' => env('COOLIFY_KICK_TIMEOUT', 10), |
| 104 | +], |
| 105 | +``` |
| 106 | + |
| 107 | +In your **deployed app's** Coolify environment: |
| 108 | + |
| 109 | +```bash |
| 110 | +KICK_ENABLED=true |
| 111 | +KICK_TOKEN=your-secure-token |
| 112 | +KICK_PREFIX=kick # Optional, defaults to 'kick' |
| 113 | +``` |
| 114 | + |
| 115 | +## Troubleshooting |
| 116 | + |
| 117 | +### "Kick Service Unavailable" Error |
| 118 | + |
| 119 | +This usually means: |
| 120 | + |
| 121 | +1. **Route cache needs rebuilding** - Run `php artisan route:cache` on the server |
| 122 | +2. **Application is restarting** - Wait for deployment to complete |
| 123 | +3. **Kick package not installed** - Verify with `composer show stumason/laravel-kick` |
| 124 | + |
| 125 | +### Tab Not Appearing |
| 126 | + |
| 127 | +The Kick tab only appears when: |
| 128 | + |
| 129 | +1. `KICK_ENABLED=true` is set in the app's environment |
| 130 | +2. `KICK_TOKEN` is configured |
| 131 | +3. The Kick endpoints are reachable |
| 132 | + |
| 133 | +### Authentication Errors |
| 134 | + |
| 135 | +Verify your `KICK_TOKEN` matches between: |
| 136 | + |
| 137 | +- The app's Coolify environment variables |
| 138 | +- What Laravel Kick expects on the deployed app |
0 commit comments