coolify/bootstrap/helpers
Andras Bacsai a2096c6f68 feat(observability): add structured audit log channel for API and webhook events
Introduce a dedicated `audit` log channel (daily rotation, configurable retention via
LOG_AUDIT_DAYS) and a small `auditLog()` / `auditLogWebhookFailure()` helper used to
record state-changing API operations and webhook events.

Instrumented:

- API mutation endpoints (create / update / delete / start / stop / restart) across
  applications, services, databases (incl. backups, env vars, storage), servers,
  projects + environments, scheduled tasks, private keys, GitHub apps, cloud provider
  tokens, Hetzner server provisioning, instance enable/disable.
- Webhook signature verification outcomes for GitHub, GitLab, Bitbucket, Gitea and
  Stripe, plus the Sentinel push endpoint.
- Authentication and authorization outcomes via the global exception handler and
  the `ApiAbility` middleware (unauthenticated, ability-denied, policy-denied).

The helper is wrapped in try/catch so logging failures never affect the request
path. Successful operations log at `info`; suspicious/denied requests log at
`warning`. Operators wanting a failures-only feed can set `LOG_AUDIT_LEVEL=warning`.

Includes a feature test suite covering the helper, the webhook providers and the
new auth/authorization log paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 14:50:37 +02:00
..
api.php fix(healthcheck): user input is rejected if path contains comma and semicolon (#9223) 2026-04-14 10:41:55 +02:00
applications.php fix(models): replace forceFill/forceCreate with fill/create and add fillable guards 2026-03-31 13:45:31 +02:00
audit.php feat(observability): add structured audit log channel for API and webhook events 2026-04-28 14:50:37 +02:00
constants.php Merge branch 'next' into shadow/add-shared-server-env 2026-01-14 05:26:06 +01:00
databases.php refactor: scope destination and resource lookups by current team 2026-04-19 11:55:12 +02:00
docker.php fix(deployment): properly escape shell arguments in nixpacks commands 2026-03-23 21:55:46 +01:00
domains.php fix(api): include docker_compose_domains in domain conflict check 2026-01-14 15:22:43 +01:00
github.php feat(github): implement processing for GitHub pull request webhooks and add helper functions for commit and PR file retrieval 2026-01-05 11:13:18 +01:00
notifications.php refactor(configuration): centralize configuration management in ConfigurationRepository 2025-03-24 21:01:27 +01:00
parsers.php fix(models): replace forceFill/forceCreate with fill/create and add fillable guards 2026-03-31 13:45:31 +02:00
proxy.php fix: add validation and escaping for Docker network names 2026-03-28 12:28:59 +01:00
remoteProcess.php refactor: simplify remote process chain and harden ActivityMonitor 2026-03-26 13:26:16 +01:00
services.php chore: prepare for PR 2026-03-10 17:37:13 +01:00
shared.php fix(navigation): replace wire:navigate.hover with wire:navigate 2026-04-22 20:55:09 +02:00
socialite.php refactor(dashboard): remove deployment loading logic and introduce DeploymentsIndicator component for better UI management 2025-09-30 11:43:30 +02:00
subscriptions.php chore: prepare for PR 2026-02-24 10:17:16 +01:00
sudo.php fix: add additional bash keywords to prevent sudo prefix in command parsing 2025-11-27 10:51:59 +01:00
timezone.php refactor: improve data formatting and UI 2025-01-15 18:35:20 +01:00
versions.php refactor(proxy): implement centralized caching for versions.json and improve UX 2025-11-18 14:53:49 +01:00