Sign in

Mod for swag

Dashboard

This mod adds a dashboard to SWAG powered by Goaccess.

arch
amd64
built

Use it#

Set DOCKER_MODS on the swag container and recreate it. The mod is pulled on every start; several mods are separated with |.

DOCKER_MODS=ghcr.io/linuxserver-playground/mods:swag-dashboard

:swag-dashboard always gets the newest build. To stay on this one, pin its tag:

DOCKER_MODS=ghcr.io/linuxserver-playground/mods:swag-dashboard-513969b
services:
  swag:
    image: ghcr.io/linuxserver-playground/swag:latest
    environment:
      - DOCKER_MODS=ghcr.io/linuxserver-playground/mods:swag-dashboard

Details#

Currently only works with a subdomain, not a subfolder.

Enable

Internal access using <server-ip>:81

Add a mapping of 81:81 to swag’s docker run command or compose.

Internal access using dashboard.domain.com

Requires an internal DNS, add a rewrite of dashboard.domain.com to your server’s IP address.

External access using dashboard.domain.com

Remove the allow/deny lines in /config/nginx/proxy-confs/dashboard.subdomain.com, and instead secure it some other way (like Authelia for example).

Usage

  • The application discovery scans for a list of known services, as well as enabled custom proxy confs that contain the following format:
      set $upstream_app <container/address>;
      set $upstream_port <port>;
      set $upstream_proto <protocol>;
      proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  • Either Swag Maxmind mod or Swag DBIP mod are required to enable the geo location graph.
  • Either Maxmind’s or DB-IP’s ASN mmdb are required under /config/geoip2db/asn.mmdb to enable the ASN graph.
  • To clear the dashboard stats, you must remove the logs (/config/log/nginx) and recreate the container.

Dashboard Support

There’s a stats endpoint for integration with dashboards under https://dashboard.domain.com/?stats=true.

External Support

  • External fail2ban (not required when using swag’s fail2ban) can be supported by mounting it to swag - /path/to/host/fail2ban.sqlite3:/dashboard/fail2ban.sqlite3:ro.
  • External logs (not required when using swag’s logs) can be supported by mounting it to swag - /path/to/host/logs:/dashboard/logs:ro.

Example

Example

Community project

Improve this mod, or make your own

Mods are how LinuxServer images grow without getting heavier: a Dockerfile, a few scripts and a mod.yml. If this one is missing something, or you need one like it for another image, an AI agent in our harness can build and test it with you.

Ask your agent

  • The swag-dashboard mod <what is wrong>. Fix it, test it and draft the PR.
  • Make a mod like swag-dashboard for <another image>, and test it.

Making a mod Every way to help Get the harness (opens in a new tab)

Source: swag-dashboard branch (opens in a new tab). Every mod