mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-06 05:58:14 -04:00
Replace the server-scoped Analytics Livewire component with an app-wide one that filters by server/application and supports live refresh. Add a per-bucket status-class time series endpoint/data class for a stacked-area chart, falling back to the donut when the Sentinel build doesn't support it. Decorate top-path rows with their owning domain, expand breakdown dimensions to agent/ip/useragent, and raise path/breakdown result limits. Capture X-Forwarded-For, User-Agent, and Referer headers in traefik access logs (now enabled in dev too) so IP, browser, and referrer breakdowns work. Add flag-image and referer-host helpers for geo/referrer rendering.
21 lines
1.0 KiB
PHP
21 lines
1.0 KiB
PHP
<?php
|
|
|
|
it('returns empty commands when traffic analytics is disabled', function () {
|
|
expect(traefikAccessLogCommands(false))->toBe([]);
|
|
});
|
|
|
|
it('returns JSON access log + Cloudflare header capture flags when enabled', function () {
|
|
$cmds = traefikAccessLogCommands(true);
|
|
expect($cmds)->toContain('--accesslog=true')
|
|
->toContain('--accesslog.filepath=/traefik/access.log')
|
|
->toContain('--accesslog.format=json')
|
|
->toContain('--accesslog.fields.headers.names.Cf-Connecting-Ip=keep')
|
|
->toContain('--accesslog.fields.headers.names.Cf-Ipcountry=keep')
|
|
->toContain('--accesslog.fields.headers.names.Cf-Cache-Status=keep')
|
|
->toContain('--accesslog.fields.headers.names.Cf-Verified-Bot=keep')
|
|
->toContain('--accesslog.fields.headers.names.Cf-Ray=keep')
|
|
->toContain('--accesslog.fields.headers.names.X-Forwarded-For=keep')
|
|
->toContain('--accesslog.fields.headers.names.User-Agent=keep')
|
|
->toContain('--accesslog.fields.headers.names.Referer=keep');
|
|
});
|