Skip to content

Commit 959dece

Browse files
authored
feat: add Laravel Kick integration (#62)
* feat: add Laravel Kick integration Integrate laravel-kick for enhanced application introspection. When an app has KICK_TOKEN and KICK_ENABLED=true in its environment variables, a new "Kick" tab appears in the dashboard showing: - Health checks (database, cache, storage, redis) - System stats (CPU, memory, disk, uptime) - Log viewer with level filtering and search - Queue status and failed jobs list - Artisan command execution Backend: - KickClient: HTTP client for kick endpoints - KickRepository: Contract for kick integration - CoolifyKickRepository: Implementation that fetches config from Coolify - KickController: API endpoints proxying to remote kick - DashboardStatsController: Includes kick availability in stats Frontend: - Kick.vue: Full-featured page with tabs for all kick features - Layout.vue: Conditionally shows Kick nav item - api.js: Kick API methods Configuration: - coolify.kick.enabled: Toggle integration globally - coolify.kick.cache_ttl: Cache config lookups - coolify.kick.timeout: Request timeout * docs: add Laravel Kick integration section to README * fix: downgrade to Tailwind v3 for compatibility * fix: migrate to Tailwind v4 properly * ui: show app name and environment in Kick header * test: add comprehensive tests for Kick integration Add tests for KickClient, KickRepository, and KickController covering: - Health, stats, logs, queue, and artisan endpoints - Authentication and error handling - Config retrieval from Coolify env vars - Caching behavior * fix: address PR review feedback for Kick integration - Add logging to exception catch blocks instead of silent failures - Catch specific exceptions (CoolifyApiException, KickApiException, etc.) - Add path traversal validation in logRead endpoint - Add clearCache() method to KickRepository interface - Add declare(strict_types=1) to KickRepository interface - Add rate limiting (10/min) to artisan execution endpoint - Use onBeforeUnmount for guaranteed cleanup in Vue component - Fix DashboardTest HTTP fake for kick config lookup
1 parent 218e26a commit 959dece

30 files changed

+2922
-85
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- Potential bugs or issues
4242
- Performance considerations
4343
- Security concerns
44-
- Test coverage
44+
- Test coverage
4545
4646
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
4747

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,28 @@ The dashboard shows everything at a glance:
7373
- Recent deployments with inline build logs
7474
- Quick actions for deploy, restart, stop
7575

76+
### Laravel Kick Integration
77+
78+
Install [laravel-kick](https://github.com/StuMason/laravel-kick) on your deployed app for enhanced introspection:
79+
80+
```bash
81+
# On your deployed app
82+
composer require stumason/laravel-kick
83+
```
84+
85+
Add to the app's Coolify environment:
86+
```
87+
KICK_ENABLED=true
88+
KICK_TOKEN=your-secure-token
89+
```
90+
91+
A new **Kick** tab appears with:
92+
- Health checks (database, cache, storage, redis)
93+
- System stats (CPU, memory, disk, uptime)
94+
- Log viewer with filtering and search
95+
- Queue status and failed jobs
96+
- Artisan command execution
97+
7698
## Artisan Commands
7799

78100
| Command | Description |

config/coolify.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,32 @@
222222
],
223223
],
224224

225+
/*
226+
|--------------------------------------------------------------------------
227+
| Laravel Kick Integration
228+
|--------------------------------------------------------------------------
229+
|
230+
| Enable integration with laravel-kick for enhanced application monitoring.
231+
| When enabled, the dashboard will check if apps have KICK_TOKEN configured
232+
| in their environment variables and display health, stats, logs, and
233+
| queue information from the kick endpoints.
234+
|
235+
| For an application to show the Kick tab, it needs:
236+
| - KICK_TOKEN=your_secret_token (in its Coolify environment variables)
237+
| - KICK_ENABLED=true (in its Coolify environment variables)
238+
| - Optionally: KICK_PREFIX=custom_path (defaults to 'kick')
239+
|
240+
*/
241+
242+
'kick' => [
243+
// Enable or disable kick integration globally
244+
'enabled' => env('COOLIFY_KICK_ENABLED', true),
245+
246+
// How long to cache kick configuration lookups (seconds)
247+
'cache_ttl' => env('COOLIFY_KICK_CACHE_TTL', 60),
248+
249+
// Timeout for kick API requests (seconds)
250+
'timeout' => env('COOLIFY_KICK_TIMEOUT', 10),
251+
],
252+
225253
];

dist/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/app.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/chunks/Kick-fhCS2P5B.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)