Commit Graph
17 Commits
Author SHA1 Message Date
Andras Bacsai 1a2a5362ad fix(security): secure remote command secrets and clone volume data 2026-10-27 09:47:18 +01:00
cf6350e665 feat(analytics): city-level traffic analytics, sortable tables, lighter globe (#12158)
Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:24:06 +02:00
Andras Bacsai 06b5a708b8 refactor(traffic): remove fallbacks for unreleased Sentinel builds
Every released Sentinel with traffic analytics (1.0.0 and later) has
the dashboard and series routes and the requests, bytes_in and app
fields, so the fallbacks for builds without them are not needed.

- Keep "no data" handling for Sentinel without traffic routes (0.0.x)
- Keep the resource-scope fallback, which Sentinel 1.0.1 needs
2026-10-06 10:29:04 +02:00
Andras Bacsai 554bd354bf fix: support host storage paths and clean up cancelled deployments
Allow validated host file and directory mounts outside resource directories
while protecting external paths from deletion.

Clean up cancelled deployment containers and clear tracked process IDs.
Preserve legacy KeyDB and Dragonfly password parsing, accept server backup
paths without extension restrictions, and allow Compose variable proxy ports.
2026-10-05 11:08:52 +02:00
Andras BacsaiandClaude Opus 5.5 1501a44cfe fix(sentinel): pass the traffic API token to curl on stdin
The token is no longer a process argument that other users on the server
can read in /proc. Also correct the docker login comment about where the
registry password is visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:01:20 +02:00
Andras Bacsai 6dc332c203 perf(sentinel): cache traffic per minute, skip unsafe keys, batch owner lookups
- Align the traffic window to the minute so the 60 s cache is used.
- Skip only an unsafe key instead of hiding the whole server.
- Look up unknown container owners in one query per push.
2026-09-30 18:10:10 +02:00
Andras Bacsai 1c3de6a4cd fix(sentinel): surface remote fetch errors instead of a TypeError
Let instant_remote_process throw on failed SSH/docker commands so the
real error (e.g. a missing coolify-sentinel container or an unreadable
SSH key) is reported. A null result, such as a literal "null" body, is
turned into an empty string, which guard() rejects as an invalid response.

Run curl with -sS so progress output stays out of the output while
errors are still reported.

Add tests for a failed docker exec and a literal null body.
2026-09-28 08:27:47 +02:00
Andras BacsaiandClaude Opus 5.5 8d6871d1c7 feat(analytics): use Sentinel resource scope for exact unique visitors
A resource with several traffic keys (Compose services, previews) was
queried key by key, and unique visitors were summed, so one visitor
on two keys counted twice. When Sentinel has the new
/api/resource/{uuid}/traffic routes, Coolify now asks once per
resource and gets merged unique visitors and latency percentiles; the
"approximate" badges go away for a resource on one server. Older
Sentinel versions answer 404: Coolify remembers this for 5 minutes and
uses the per-key merge as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 23:49:21 +02:00
Andras BacsaiandClaude Opus 5.5 510a2d838b feat(analytics): log Compose resources on Caddy and add service analytics
Traffic analytics now covers every resource on both proxies:

- Caddy: Compose applications and services get access-log labels. The
  log_append key is {uuid}-{service}, the same key Sentinel reads from
  Traefik router names.
- A resource owns the Sentinel key {uuid} and every key that starts
  with {uuid}-. Application pages and the traffic card now merge all
  keys, so Compose applications and previews show data on Traefik too.
- Global analytics: the leaderboard groups the keys of one resource
  into one row, lists services, and never names keys of other teams.
- New service analytics page (project.service.analytics) with the same
  view and authorization as the application page.
- Switching the proxy type restarts Sentinel when analytics is on, so
  it reads the new log path. Sentinel gets no traffic mount when the
  proxy has no analytics support.
- Caddy servers show a note that resources log only after a redeploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:00:55 +02:00
Aditya Tripathi dd422e6608 fix(traffic-analytics): clear stale chart and cache dashboard 404s
- Dispatch the chart refresh event even when loadData() finds no
  overviews, so a wire:ignore'd chart flips to its no-data state
  instead of keeping stale data.
- Cache dashboard-route absence for 60s in SentinelTrafficClient so
  older Sentinel installs that 404 the dashboard endpoint aren't
  re-probed over SSH on every refresh within the same window.
- Make Pest's loadLazy() throw when no __lazyLoad trigger is found
  instead of silently testing the un-mounted placeholder.
2026-08-22 11:42:41 +00:00
Aditya Tripathi 19752da6af feat(analytics): lazy-load traffic pages and batch Sentinel calls
- Mark Analytics, Dashboard\TrafficAnalytics and Project\Application\Analytics
  Livewire components #[Lazy] with skeleton placeholder() views so pages render
  instantly while Sentinel data loads in a deferred request
- Add SentinelTrafficClient::prefetchServerWide() to warm all server-wide
  endpoints in a single batched docker exec instead of ~14-15 serial SSH
  round-trips, and refactor overview/paths/breakdown URL building into shared
  helpers
- Cap per-app leaderboard overviews fetched via MAX_LEADERBOARD_APPS to bound
  requests on servers with many apps
- Add hasRequestSeries() to detect empty request charts and render a no-data
  state instead of a blank chart
- Gate ServerSetting's automatic Sentinel restart on is_sentinel_enabled so
  tuning geoip/traffic settings no longer silently enables Sentinel
- Add reusable skeleton UI components (skeleton, skeleton/table, skeleton/tiles)
  for the new placeholder views
2026-08-22 11:13:49 +00:00
Aditya Tripathi 7c01f63f53 fix(traffic-analytics): stop leaking geoip key and gate sentinel restart
- Only send GEOIP_MAXMIND_LICENSE_KEY to Sentinel when GeoIP is enabled
- Skip restarting Sentinel when disabling analytics unless it was already running
- Validate Sentinel API responses are JSON objects before reading them
- Restore "live" toggle state from localStorage instead of only disabling it
- Use content-based wire:key for breakdown/path rows instead of loop index
- Add missing Kosovo country code and require update permission for geoip listbox
2026-08-21 11:22:36 +00:00
Aditya Tripathi a5cfa7c238 feat(traffic): add global analytics page with status time series
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.
2026-08-12 08:50:58 +00:00
Aditya Tripathi 872f8aafb8 feat(traffic): add live refresh, geo maps, and app overview widget
- Add live 24h polling toggle to server/application analytics views
- Add geo visualization (world map, country flags/names) for traffic
- Add dashboard nudge for servers eligible but not yet analytics-enabled
- Add lazy-loaded TrafficOverview widget to application General page
- Default-enable traffic analytics on new eligible server settings
- Rotate Caddy access logs via lumberjack roll options
- Add Traefik logrotate sidecar for copytruncate access-log rotation
2026-08-11 10:55:50 +00:00
Aditya Tripathi 0c06b5e0d1 fix(traffic): validate sentinel app keys, gate caddy log volume + swarm toggle, null-safe link 2026-08-11 03:32:16 +00:00
Aditya Tripathi 9ad210c7b0 feat(traffic): cache Sentinel traffic responses for 60s 2026-08-10 19:58:13 +00:00
Aditya Tripathi 2ce3bce608 feat(traffic): add Sentinel traffic pull client 2026-08-10 19:52:17 +00:00