diff --git a/README.md b/README.md index c246a70..22db7a9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Docker Architectures Caddy - Version + Version

Why Site Gateway · diff --git a/ROADMAP.md b/ROADMAP.md index dfe9132..9df37ff 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -6,15 +6,13 @@ `v0.13.0` is a real batch under that same convention, not a targeted fix, even though none of it changes what the app *does*: the in-app light theme has been removed entirely (the app is dark-only now, including the two visitor-facing themed pages -- the default-site 404/welcome/custom-HTML page and the Access-List sign-in page, both previously following the visitor's OS light/dark preference and now fixed dark for consistency with the rest of the app), the full color/spacing/radius design-token system begun in v0.12.0 has been completed (zero hardcoded color literals remain anywhere outside the token definitions), and `styles.css` has been restructured into commented, page-aligned sections matching the convention already used in `app.js`/`features.js`/`server.js`. A handful of small pre-existing bugs (a duplicate CSS custom property, some dead/duplicate rules, a decorative background glow that rendered incorrectly at certain aspect ratios) were also found and fixed along the way. -`v0.14.0` adds config-drift detection, a backup-encryption readiness check, and an app-wide dialog cleanup, and scopes out (but does not yet ship) a larger set of previously-discussed features tracked below as follow-up work. +`v0.14.0` adds config-drift detection, a backup-encryption readiness check, and an app-wide dialog cleanup. -- **Configuration drift detection** — a background check every 10 minutes compares Caddy's live running configuration (via its admin API `/config/` endpoint) against what Site Gateway's saved routes would currently generate (via `/adapt`). If they disagree \u2014 for example after a manual edit to the Caddyfile outside the app, or a Caddy restart that didn't pick up the latest reload \u2014 a "Configuration drift" item appears in the dashboard's Needs Attention list and a "Resync now" callout appears under Administration \u2192 Default site, both driven by a new `POST /api/gateway/resync` route that re-runs the normal Caddy sync and clears the flag. +- **Configuration drift detection** — a background check every 10 minutes compares Caddy's live running configuration (via its admin API `/config/` endpoint) against what Site Gateway's saved routes would currently generate (via `/adapt`). If they disagree \u2014 for example after a manual edit to the Caddyfile outside the app, or a Caddy restart that didn't pick up the latest reload \u2014 a "Configuration drift" item appears in the dashboard's Needs Attention list, driven by a new `POST /api/gateway/resync` route that re-runs the normal Caddy sync and clears the flag. - **Backup-encryption readiness** — the "Encrypt scheduled backups" checkbox no longer lets you configure something that will silently fail later. `/api/config` now reports whether the `BACKUP_PASSWORD` environment variable is actually set; the checkbox is disabled with an explanatory message when it isn't, and if it was previously saved as enabled and `BACKUP_PASSWORD` has since been removed, it shows a distinct warning instead of failing quietly at the next scheduled run. - **Dialog cleanup** \u2014 every themed popout dialog's redundant "\u00d7" close button (in the dialog-heading row) has been removed app-wide; each dialog already has a working Cancel/Close button in its actions row, so this is pure de-duplication with no loss of function. New dialogs are expected to follow this pattern going forward. -### Follow-up work carried from this release's planning - -A larger feature set was scoped for `v0.14.0` and intentionally deferred rather than shipped partially-verified. These remain on the roadmap for a future release: +`v0.15.0` ships the full set of features scoped alongside `v0.14.0` and deferred at the time — nothing here was cut: - **REST API with issuable tokens** \u2014 admin-issued bearer tokens (full or read-only scope) for scripting against the Site Gateway API outside the browser session, bound to the issuing user's session version so a password reset/deactivation revokes them automatically. - **Backup/restore history** \u2014 a durable, database-backed history of every backup, restore, and deletion (including failed attempts), shown as a human-readable timeline that never displays raw backup filenames. @@ -22,6 +20,19 @@ A larger feature set was scoped for `v0.14.0` and intentionally deferred rather - **"View Caddy config" popout** \u2014 a read-only, prettified view of the exact Caddy configuration block generated for a given site, proxy, or redirect, built from the same code path that generates the real deployed config so it can never drift from it. - **Performance screen overhaul** \u2014 clock-aligned time-axis labels, a y-axis unit, hover tooltips with error counts, p95 latency, bandwidth and unique-visitor columns, a 4xx/5xx-colored error breakdown, top-paths-per-host, and a slowest-requests panel. - **Dashboard tile color unification** \u2014 normalizing all "normal count" tiles to a shared green baseline that reacts to warning/danger states the same way the existing Needs Attention tile does. +- Two pre-existing bugs found and fixed along the way: `sessionVersion` was never actually rotated anywhere, meaning a password change, MFA disable, or admin-forced deactivation didn't invalidate existing sessions/API tokens as documented; and the redirect card's "Change icon" menu action was silently falling through to the enable/disable toggle handler instead of opening the icon picker. +- Also folds in the config-drift attention-tile click-through fix from `v0.14.1` (never separately released): clicking the dashboard's "Configuration drift" item now goes to Administration \u2192 Gateway Defaults, not the generic Administration landing tab. + +`v0.15.1` is a fix-list batch from live testing of `v0.15.0`, not new features: + +- Native `Searches every heading, field name, and explanation on this page.

Introduction

Why Site Gateway exists

Reverse proxies often expose powerful settings without explaining what they change. Site Gateway provides a visual, Caddy-powered control plane for static sites, proxy routes, redirects, raw TCP/UDP streams, HTTPS, health checks, access control, and recovery — covering everything from a single ZIP upload to a full homelab of proxied applications.

How this manual is organized

Each area below has an overview article (what it’s for and how to configure the common case) followed by a field reference article covering every advanced control, one at a time. Use the sidebar to jump straight to a section, or search for any field name, error message, or setting — search matches headings, body text, and field names together.

Novice path

Create one route, test it locally, then add a domain and TLS. Keep defaults until you have a reason to change them.

Expert note

Configuration is stored in SQLite under /data and every generated Caddy configuration is validated before reload — if validation fails, the previous working configuration stays active and the failure is explained in Gateway Events.

Getting started

From installation to your first route

Install the container with persistent /data storage, open the management port (8080 by default), and complete the administrator setup screen shown on first launch. Before publishing public domains, confirm DNS already points to this server and that ports 80 and 443 are free for Site Gateway to use.

Choosing your first route type

  • Hosted Site: you have static files (a ZIP or a single index.html) and want Site Gateway to serve them directly.
  • Proxy Host: you already have an application running somewhere — another container, a LAN device, another server — and want a domain and HTTPS in front of it.
  • Redirect Host: you want a domain to simply forward visitors to a different address.
  • Streaming Host: you need to forward a raw TCP or UDP port (SSH, Minecraft, a game server) with no domain and no HTTPS involved.

Example

Publish a ZIP on a direct port first so you can confirm it works over LAN, then add www.example.com once DNS and port forwarding are ready and Automatic HTTPS can issue a certificate.

Dashboard

What each panel is telling you

The Dashboard is a glance-and-go summary — every number and status on it links back to a full section elsewhere, so you never have to act on the Dashboard itself.

Metric strip

Counts of Hosted Sites, Proxy Hosts, and Certificates needing attention, plus a Throughput chip showing live requests in the last minute across every configured domain — click it to open the full Performance tab.

Live Health

  • Reverse proxy / Certificates / Persistent storage: the original health tiles.
  • Streaming ports: how many enabled Streaming Hosts are actually bound and listening, versus configured.
  • Upstreams: how many Proxy Hosts are currently passing their health check.

Runtime & System

Container and version facts, plus a Public IP tile showing your gateway's current public address, rechecked automatically every 60 minutes — prep work for future Dynamic DNS support. This is a status fact, not a job you configure.

Scheduled Jobs

Background jobs shown as status tiles — proxy health checks, backups, log pruning, certificate/domain readiness checks, and the Public IP check — each showing its schedule and last result.

Needs Attention

Lists anything that needs a decision (a failing health check, an expiring certificate). Clicking an item jumps straight to it. When nothing needs attention, the panel collapses to a single all-clear banner instead of an empty list.

Recent Activity

The last several configuration and operational events, with relative timestamps (“4 hours ago”). This is a shortcut, not a separate log — the same events are searchable in full under Logs → Gateway Events.

Hosted Sites

Overview: publish a static website

A Hosted Site serves files you upload directly — no separate application or container required. Use it for a static site, a single-page app build, documentation, or anything that’s just HTML/CSS/JS.

Creating a Hosted Site

  • Name: the label shown in Site Gateway; it doesn’t need to match the domain.
  • Primary domain Optional: leave blank for port-only LAN access, or set a hostname to serve the same files there once DNS is ready.
  • Additional domains: one alias per line — every alias serves the same files under the same TLS settings as the primary domain.
  • Port: the direct LAN port this site answers on. Must fall inside the configured port range (shown as a hint on the form, default 9000–9099) and not already be used by another site.
  • TLS: Automatic public HTTPS (default, requires a working domain and open ports 80/443), Internal HTTPS for trusted local devices, or HTTP only.
  • Enable HSTS after HTTPS is verified: only turn this on once you’ve confirmed HTTPS works for every client — HSTS tells browsers to refuse HTTP entirely for this domain going forward, and that’s hard to undo quickly.
  • Website files: upload a ZIP whose root contains index.html (a single top-level folder inside the ZIP is automatically flattened), or upload a bare index.html file directly. Up to 250 MB.

Updating an existing site

Use Replace files from the card’s menu to upload a new ZIP or HTML file without recreating the site or losing its domain/TLS/health settings. Use Domain & TLS to change the domain, TLS mode, or any advanced setting below.

Expected behavior

Files are served immediately on the chosen port and, once configured, through the domain as well.

Hosted Sites

Advanced options and health monitoring

Expand Advanced options on the create or edit form for these controls:

  • Access List: applies a reusable network or login restriction before any visitor reaches this site. Choose Public — no Access List to leave it open.
  • Compression: Automatic zstd + gzip (default), gzip only, or Off.
  • Request headers / Response headers: one Name: value pair per line, up to 30 each. Request headers are added before Caddy processes the request; response headers are added to what visitors receive.
  • Apply HSTS to subdomains: adds includeSubDomains to the HSTS header; only takes effect when HSTS itself is on and TLS isn’t HTTP only.
  • Custom Caddy configuration: expert-only raw Caddyfile lines appended to this site’s block, validated before reload. Lines that would touch the global config block, the admin API, storage, or import/persist_config directives are rejected outright, since those could affect every other route on the gateway.

Monitoring this site

Hosted Sites can be health-checked the same way Proxy Hosts are: a Health-check path (default /), method (GET or HEAD), expected status (a code, list, or range such as 200, 200,204, or 200-499), a timeout in seconds (1–60, default 4), up to 3 retries, and a Monitor this site toggle. Turning monitoring off shows the card as “Monitoring paused” instead of running a periodic check.

Proxy Hosts

Overview: connect a local application

A Proxy Host puts a domain and HTTPS in front of something already running elsewhere — another container, a LAN device, or a remote service.

Creating a Proxy Host

  • Name: the label shown in Site Gateway.
  • Primary domain and Additional domains: same behavior as Hosted Sites.
  • Forward to: the upstream address, e.g. http://192.168.1.20:8123. Use the container name, LAN address, or application URL — no path or query string beyond a trailing slash.
  • Upstream pool Optional: found under Advanced options — additional http(s):// targets, one per line, up to 10. When present, Caddy distributes requests across every healthy target instead of using the single Forward-to address alone, and the Advanced options’ Load balancing setting controls how.
  • TLS: Automatic public HTTPS, Internal HTTPS, Custom uploaded certificate, or HTTP only.
  • Enable HSTS after HTTPS is verified.

Example

For Jellyfin at 192.168.1.20:8096, use domain jellyfin.example.com and forward target http://192.168.1.20:8096. Site Gateway checks the upstream continuously and Caddy manages an eligible public HTTPS certificate automatically.

Proxy Hosts

Advanced options, field by field

Most applications only need a domain, Forward-to target, and TLS choice. These controls are for applications with unusual paths, authentication needs, response codes, headers, or performance requirements.

  • Access List: applies reusable login and network rules before the upstream is reached.
  • Health-check path and method: the request Site Gateway makes when checking this application (path default /; GET or HEAD).
  • Expected status: accepts a single code, a comma list, or a range — 200, 200,204, or 200-399.
  • Timeout in seconds: 1–60, default 4.
  • Monitor this upstream: when off, the status shows “Monitoring paused” and no periodic request is made.
  • Compression: Automatic zstd + gzip, gzip only, or Off.
  • Block common exploits: when enabled, Site Gateway checks the request’s URL path against one fixed, built-in pattern and responds 403 before the request ever reaches the upstream if it matches. The pattern currently checks the path for: path traversal sequences (../ or ..\); direct requests for /etc/passwd; WordPress probing (/wp-login.php, /wp-admin/, /xmlrpc.php); exposed config/VCS paths (/.env, /.git/, /.aws/); exposed PHPUnit test endpoints (/vendor/phpunit, /phpunit/); the literal strings eval( and base64_decode(; a SQL UNION SELECT sequence; and <script. Matching is case-insensitive. Important: this only inspects the URL path — it does not inspect the query string, request body, cookies, or headers, so a SQL-injection or XSS payload sent as a query parameter (e.g. ?id=1 UNION SELECT...) is not caught by this toggle. This is a small, fixed, path-only ruleset, not a full web application firewall — it will not catch every attack, cannot currently be extended with custom patterns, and should not replace keeping the upstream application itself patched.
  • Custom Locations: send specific paths to a different upstream. One per line: /api/* | http://192.168.1.20:3001 | strip or preservestrip removes the matched prefix before forwarding, preserve keeps it. Up to 20 entries.
  • Request headers / Response headers: same Name: value-per-line format as Hosted Sites.
  • Upstream TLS server name: an optional SNI name expected by the upstream certificate. Only meaningful when every upstream target uses https:// — the field is disabled otherwise.
  • Ignore upstream TLS certificate errors: use only for a trusted internal HTTPS service with a self-signed or hostname-mismatched certificate; also requires an HTTPS upstream to take effect.
  • Apply HSTS to subdomains.
  • Custom Caddy configuration: same validation rules as Hosted Sites’ custom configuration. NGINX syntax is not supported — Site Gateway generates Caddyfile syntax.
  • Upstream pool: additional http(s):// targets, one per line, up to 10 — the same field described in the Overview, now editable here too on an existing Proxy Host, not just when first creating it. Once Upstream pool has any entries, Caddy uses only those targets — the single Forward-to address above is not automatically added to the pool alongside them, so include it as one of the pool lines too if it should keep receiving traffic.
  • Load balancing: only takes effect once Upstream pool has 2 or more entries — Forward to is never counted toward this, per the note above. Random (Caddy’s own default) picks a target at random per request; Round Robin rotates through targets evenly; Least Connections sends each request to whichever target currently has the fewest active requests; IP Hash sends a given client’s requests to the same target each time (sticky sessions), useful for applications that keep session state on one backend. This only affects which upstream Caddy sends a request to — it does not change the separate Health-check settings below, which only drive Site Gateway’s own dashboard status.
  • How to verify a change

    Save one setting at a time, watch the card’s upstream status line, check Access Logs, and compare against a direct request to the application. If Caddy rejects a custom configuration, Site Gateway keeps the last known-good configuration active and shows the rejection reason.

    Proxy Hosts

    Custom uploaded certificates

    Choosing Custom uploaded certificate as the TLS mode reveals two file fields: Certificate PEM and Private key PEM. Both are required together — Site Gateway verifies the private key’s public key actually matches the certificate before accepting the pair, and confirms the certificate’s Subject Alternative Names cover every domain configured on that Proxy Host. A certificate that doesn’t cover every alias is rejected rather than silently applied to only some of them.

    Accepted files are stored under /data/certificates/custom and included in complete backups. Replacing a custom certificate later works the same way — upload both files again through the same field.

    Redirect Hosts

    Overview: move an address safely

    A Redirect Host sends visitors from one domain straight to another, with no files hosted and no application behind it.

    Fields

    • Name.
    • Source domain: the old address people currently use.
    • Additional source domains: further aliases that redirect the same way.
    • Destination: a complete http:// or https:// URL to send visitors to.
    • Redirect type: 302 Temporary (default), 301 Permanent, 307 Temporary — preserve method, 308 Permanent — preserve method.
    • TLS: Automatic HTTPS, HTTP only, or Internal HTTPS — this governs the source domain, not the destination.
    • Preserve path and query (on by default): when enabled, old.example.com/library?id=2 becomes new.example.com/library?id=2 instead of always landing on the destination’s root.
    • Access List Optional: protects the source domain the same way it protects Hosted Sites and Proxy Hosts.

    Choosing a redirect type

    Use 301 or 308 only when the move is meant to be permanent — browsers and search engines cache these aggressively. Use 302 or 307 while you’re still testing the new destination.

    Streaming Hosts

    Overview: raw TCP/UDP port forwarding

    A Streaming Host forwards a raw TCP or UDP port straight to another host and port — there’s no domain, no HTTPS, and no HTTP layer involved at all, unlike every other route type in Site Gateway. Use it for services that speak their own protocol directly over a port: SSH, a Minecraft or other game server, a VPN endpoint, or any similar TCP/UDP service.

    The one prerequisite: publish the port first

    Streaming Hosts listen for connections from inside the Site Gateway container itself — they are not routed through Caddy the way domains are. That means the incoming port must already be published on the container (added to your docker-compose.yaml or Unraid port mappings, with the container recreated) before you create the matching Streaming Host in the UI, or nothing outside the container will ever reach it.

    Example docker-compose port mapping

    To forward SSH (22) and a Minecraft server (25565):

    ports:
      - "22:22/tcp"
      - "25565:25565/tcp"

    Creating a Streaming Host

    • Name.
    • Incoming port: 1–65535. Cannot be the admin port, 80, 443, a port already inside the Hosted Sites port range, or a port already used by another Streaming Host.
    • Forward to: a plain host:port address, e.g. 192.168.1.20:25565. No http:// — this is a raw socket forward, not a web address.
    • TCP / UDP: enable one or both. At least one must stay checked.
    • Monitor this target: runs a TCP reachability probe against the forward address every check cycle, even for UDP-only streams (UDP itself has no reliable way to “ping” a service).

    Streaming Hosts

    How the forwarding actually works

    TCP is a full one-to-one relay: every inbound connection gets its own fresh outbound connection to the forward target, and the two are piped together in both directions. Closing or erroring either side tears down the other.

    UDP is connectionless, so Site Gateway multiplexes many remote clients over one listening port by tracking a short-lived “session” per unique client address, each with its own outbound socket to the forward target. An idle session is cleaned up automatically after about a minute of inactivity.

    Health monitoring

    The monitor always performs a plain TCP reachability check against the forward address, with a 4-second timeout — this confirms the target host and port are reachable, not that the specific game or service protocol is fully healthy. Disabling monitoring shows the card as “Monitoring paused” rather than unreachable.

    Practical examples

    • SSH: incoming port 2222, forward to 192.168.1.30:22, TCP only.
    • Minecraft: incoming port 25565, forward to 192.168.1.20:25565, TCP (and UDP if the specific server/mod needs it — vanilla Minecraft is TCP-only).

    Editing a Streaming Host

    Changing the port, target, or protocol checkboxes restarts the listener immediately to apply the change; toggling Enable/Disable does the same.

    Certificates

    Overview: automatic HTTPS prerequisites

    For Automatic HTTPS to succeed, a domain must resolve to your public address, inbound ports 80 and 443 must reach Site Gateway, and no other service (including another reverse proxy) can already own those ports on this host.

    Domain readiness checks

    • DNS: confirms the domain actually resolves, and to what address.
    • HTTP / HTTPS: confirms Caddy itself is listening on ports 80/443 inside the container — this does not by itself prove the internet can reach you, only that the gateway is ready to answer if it can.
    • TLS: reflects the certificate status for that domain (healthy, renewing soon, critical, expired, or “Waiting for Caddy,” meaning issuance hasn’t completed yet — not that anything is broken).
    • Upstream (Proxy Hosts only): the latest health-check result for that route.

    Check now

    Forces an immediate re-check of every certificate, domain readiness result, and health probe instead of waiting for the periodic background check.

    Novice workflow

    Confirm DNS, forward ports 80 and 443, stop any competing proxy, then run Check now. Don’t troubleshoot an upstream application until the domain and HTTPS checks themselves are healthy.

    Certificate health thresholds

    See Certificates → Field reference for what Renewing-soon warning, Critical warning, and Stale health data actually control.

    Certificates

    Field reference and thresholds

    Expanding a certificate’s details shows: status, valid-from date, issuer, every domain it covers, serial number, SHA-256 fingerprint, and when it was last detected — deliberately excluding private key material.

    Status thresholds

    Set from Administration → Security & Health:

    • Renewing-soon warning: days remaining before a certificate is flagged as renewing soon (8–120, default 30).
    • Critical warning: days remaining before it’s flagged critical; must stay lower than the renewing-soon threshold (default 7).
    • Stale health data: minutes before a displayed check is considered old and worth re-running (2–1440, default 10).

    A status of mismatch means a custom certificate was uploaded for that route but its coverage doesn’t include every configured domain — upload a replacement covering all of them.

    Access Lists

    Overview: protect a route

    An Access List restricts who can reach a Hosted Site, Proxy Host, or Redirect Host, by network address, by login, or both. Assign a saved list from that route’s Advanced options.

    Fields

    • Name.
    • Allowed networks: one IP, CIDR range, or the literal private_ranges per line. When set, every network not listed is denied — this is an allow-list, not a suggestion.
    • Denied networks Optional: evaluated before allowed networks and logins, so a denied entry always wins even if it would otherwise be allowed.
    • Logins: add one or more username/password pairs directly on the Access List (passwords need at least 8 characters; leaving a password blank while editing an existing login keeps it unchanged).
    • Groups: alternatively, let members of a Group (Administration → Users & Groups) authenticate with their own Site Gateway username and password instead of a separate Access-List-only login. A disabled Group (Administration → Users & Groups) stops granting access immediately, even though it still appears assigned here — see Users & Groups for details.

    At least one rule — a network rule, a denied-network rule, or a login — is required before the list can be saved.

    Assigning and inspecting

    Use a route’s Advanced options to assign an Access List to it, or use the Access List’s own View assigned hosts menu action to see everywhere it’s currently in use. An Access List can’t be deleted while anything still references it — unassign it from every host first.

    Users & Groups

    Overview: control who can change the gateway

    Every account has a role:

    • Administrator: full access, including Users, Groups, Settings, and Backups.
    • Standard User: can manage Hosted Sites, Proxy Hosts, Redirect Hosts, Streaming Hosts, and Access Lists, but not Users, Groups, Settings, or Backups.
    • Viewer: read-only — can inspect everything but change nothing.

    Creating a user

    • Display name.
    • Username: 3–64 characters, letters/numbers/._-, must be unique.
    • Role.
    • Temporary password: at least 8 characters — share it securely and have the person change it after their first sign-in.

    Managing an existing user

    An administrator can change a user’s role from the card’s role dropdown, reset their password, archive them (a reversible soft-disable distinct from deleting), or delete them outright. Delete and Change icon live under the card’s “•••” menu, matching Hosted Sites and Proxy Hosts; role, password reset, and archive stay as visible buttons. You cannot disable, archive, delete, or change the role of your own account — another administrator has to do that — and Site Gateway always keeps at least one active Administrator, refusing any action that would leave zero. Resetting a user’s password here does not disable their two-factor authentication if they have it enabled — see My Account for how 2FA works. If a user is locked out of their own 2FA (lost authenticator, no recovery codes left), an administrator can disable it for them from the card’s “•••” menu — Disable 2FA appears there only when that user currently has 2FA enabled. This clears their authenticator, secret, and any unused recovery codes; they can set 2FA up again afterward if they choose to. The action is logged to the Audit log, since it removes a security control from someone else’s account.

    Groups

    A Group is simply a named set of users. Its only purpose is authentication: assign a Group to an Access List so its members can log in with their own Site Gateway credentials instead of a separate Access-List-only login.

    Every Group has its own enable/disable toggle, separate from deleting it. Disabling a Group immediately stops it from granting access through any Access List it’s assigned to — the assignment itself is untouched and still shows as assigned, but its members can no longer authenticate through it until the Group is re-enabled. This is a common surprise: disabling a Group is not the same as archiving it for later cleanup, it has an immediate access-control effect. If the Group is currently assigned to at least one enabled Access List, disabling it now asks for confirmation first, naming exactly which Access List(s) will stop authenticating that Group’s members — the same pattern already used when disabling an Access List that protects active hosts.

    Audit history

    Administration includes an Audit log — a searchable, filterable, immutable record of who did what, filterable by outcome (success/failed) and free-text search across the user, action, and target. Audit entries can’t be edited or deleted.

    My Account

    Managing your own profile, password, and two-factor authentication

    My Account is available to every role — Administrator, Standard User, and Viewer alike — and only ever affects your own account. It sits in the sidebar next to Administration and Documentation.

    Profile

    Shows your display name, username, and role. These are read-only here; an administrator changes them from Administration → Users.

    Changing your password

    Enter your current password once, then your new password twice. This works for every role — previously, only an administrator could change a user’s password (Administration → Users → Reset password), which meant every routine password change had to go through an admin. My Account closes that gap for everyone’s own account.

    Two-factor authentication (2FA)

    Optional and off by default for every account. When enabled, signing in requires your password plus a 6-digit code from an authenticator app (or a recovery code), using the standard TOTP algorithm (RFC 6238) — any authenticator app works, not a Site Gateway-specific one.

    Enabling 2FA

    1. Choose Enable two-factor authentication.
    2. Scan the QR code with your authenticator app, or enter the shown key manually.
    3. Enter the 6-digit code it generates to confirm setup.
    4. Save the 10 recovery codes shown immediately afterward — each works once, and this is the only time they’re shown in full.

    Signing in with 2FA enabled

    After your username and password are accepted, you’re prompted for a code. Enter the current 6-digit code from your authenticator app, or one of your unused recovery codes if you don’t have the app available. A wrong code shows an inline error without sending you back to the username/password screen.

    Disabling 2FA, or regenerating recovery codes

    Both require re-entering your current password as confirmation. Regenerating recovery codes immediately invalidates the previous set.

    An administrator resetting your password does not disable your 2FA — you’ll still need your authenticator app or a recovery code at your next sign-in. Only you can turn off your own 2FA, from My Account.

    Administration

    Gateway Defaults: handling unknown addresses

    Controls what happens when a visitor reaches Site Gateway on HTTP using a hostname that isn’t configured. (Unknown HTTPS hostnames are always rejected outright, regardless of this setting, since serving anything else would need a certificate Site Gateway doesn’t have — and issuing a misleading one would be worse.)

    Response modes

    • Themed route-not-found page (404) — the safest public default.
    • Gateway ready page (200) — useful while confirming HTTP routing during initial setup.
    • No response — close connection.
    • Redirect elsewhere: set a destination URL, redirect code, and whether to preserve the requested path and query.
    • Custom HTML: administrator-authored markup, served exactly as written with no sanitization — up to 250,000 characters.

    The themed page’s heading and explanation text are also editable here, independent of which mode is active. It displays the Site Gateway icon and wordmark, matching the branding used throughout the rest of the app.

    Live preview

    Configuration drift detection

    Every 10 minutes (and once shortly after startup), Site Gateway compares Caddy’s live running configuration against what your saved routes would currently generate. If they disagree — for example after a manual edit outside the app, or a Caddy restart that didn’t pick up the latest reload — a “Configuration drift” item appears on the Dashboard’s Needs Attention list, and a “Resync now” callout appears at the top of this Default site page. Resyncing simply re-runs the normal save-and-reload path and clears the flag; it does not change any of your saved settings.

    Administration

    Backup & Restore

    A Configuration only backup contains a consistent SQLite snapshot of every route, user, group, Access List, and setting, plus a portable JSON export of the same data. A Complete backup adds uploaded Hosted Site files, icons, the default-site page, and certificates (both managed and custom).

    Scheduled backups

    • Enable scheduled backups.
    • Type: Complete (the recommended default) or Configuration only. If scheduled backups are enabled while Configuration only is selected, a warning appears explaining that Hosted Site files, icons, and certificates won’t be included.
    • Schedule: Daily, Weekly, or Monthly, plus the hour of day to run.
    • Keep: how many scheduled backups to retain (1–100, default 7) — older ones beyond this count are deleted automatically after each run.
    • Include logs.
    • Encrypt scheduled backups: uses the container’s BACKUP_PASSWORD environment value. This checkbox is disabled with an explanation if BACKUP_PASSWORD isn’t currently set on the container — it can’t be turned on until that value exists. If it was previously enabled and BACKUP_PASSWORD was later removed from the container’s environment, it stays checked but shows a warning instead of failing silently at the next scheduled run — set the variable again (and restart the container) to resolve it.

    Manual backup, encryption password

    The optional backup password field on this page is used only for manually created backups and for restoring an encrypted archive — it is never stored by Site Gateway. A manually created backup is saved to /data/backups and appears in the list below; it does not download automatically — use that entry’s Download button when you want a local copy.

    Restore checklist

    1. Download or import the .sgbackup archive (importing just stages the file — restoring is a separate, explicit action).
    2. Supply its password if it’s encrypted.
    3. Choose Restore and allow validation to finish.
    4. Confirm hosts, certificates, and upstream health afterward.

    Site Gateway verifies every file’s checksum and automatically creates a safety backup of the current state before restoring anything. If the restored configuration turns out to be invalid, it automatically rolls back to that safety backup rather than leaving the gateway in a broken state.

    Configuration safety & updates

    Site Gateway validates every generated Caddy configuration before reload and keeps the previous working configuration active if validation fails. Container updates are installed by pulling a new pinned image — create a backup first.

    Administration

    Logs & Retention

    Set how many days of Access, Activity, Audit, Certificate, and Security records to keep (7–3650 days each) and whether automatic pruning is enabled. Prune Now shows exactly how many records in each category are eligible before you confirm, and Download Logs exports them.

    Administration

    Danger Zone

    Two separate, deliberately distinct destructive actions — kept apart so a routine preference correction is never confused with a full rebuild. Both require re-entering your own administrator username and password, typing an exact confirmation phrase, and then confirming a second themed dialog by typing YES.

    Restore Defaults

    Confirmation phrase: RESTORE DEFAULT. Resets Gateway Defaults, backup schedule settings, and certificate-health thresholds back to their starting values. It does not remove any hosts, uploaded files, users, groups, Access Lists, certificates, logs, or backups.

    Factory Reset

    Confirmation phrase: FACTORY RESET. Deletes everything under /data — every host of every kind, uploaded files, certificates (managed and custom), logs, backups, icons, users, and settings. Docker-mounted files outside /data are untouched. The container returns to the initial setup screen without needing a manual restart. Because backups themselves live under /data/backups, they’re deleted too — recovery is only possible from a backup taken beforehand and stored elsewhere (downloaded, or on separately mounted storage).

    When to use a backup instead

    If you want to undo a recent change while keeping the rest of the installation intact, restore a backup — Factory Reset is not a rollback tool.

    Logs

    Access Logs and Gateway Events

    Access Logs

    Every request Caddy handles, with domain, path, response status, latency, and upstream outcome. Filter by host or by status-code range (2xx/3xx/4xx/5xx). Sensitive query-string values — tokens, secrets, passwords, session identifiers, API keys, credentials — are redacted before they’re ever stored, regardless of filter settings.

    Gateway Events

    Configuration and operational changes, filterable by severity (Normal/Warnings/Errors) and by category (certificate, health, authentication, backup, configuration, or system).

    Example

    Filter Access Logs for a 502, then compare the target address against a direct LAN request to the same upstream to isolate whether the problem is the gateway or the application itself.

    Performance

    Throughput by domain, over time

    Built entirely from the same request data already collected for Access Logs — no new logging or extra overhead, just a different view of it.

    Filters

    Domain narrows the Trend chart to one host (default: all domains combined). Range sets the Trend window — Last hour, 3, 6 (default), 12, or 24 hours, or 3 or 7 days.

    Trend

    Request volume over the selected range, bucketed into 15-minute (up to 24h) or hourly (3–7 days) points.

    Per-route table

    One row per domain that has received traffic, sorted by 24-hour volume:

    • Last hour / Last 24h: request count for that window; a red count after the divider is how many of those responses were 4xx or 5xx. This includes routine noise (expired-token 401s, bots probing by raw IP, scanners hitting invalid hosts) as well as genuine failures — it isn’t a health verdict by itself.
    • Avg. response: the mean response time across every request to that domain in the last 24 hours — a fixed 24h window regardless of the Range filter above, and a straight average, so a handful of slow outliers can pull it up more than most visitors actually experience.

    Common Interface Controls

    Menus, toggles, and role gating

    The same card language is used throughout Hosted Sites, Proxy Hosts, Redirect Hosts, Streaming Hosts, Access Lists, Groups, and Users, so learning one area transfers directly to the next.

    The three-dot menu

    Contains actions that change or inspect a card: Edit opens the full form, kind-specific extras appear where relevant (Replace files on Hosted Sites, View assigned hosts on Access Lists), and Delete removes the record after a confirmation.

    The toggle switch

    A slide switch, separate from the menu, turns a route or account on or off without deleting its saved configuration — useful during maintenance or testing when you expect to reuse the exact same settings shortly after.

    Who can use each control

    Administrators can manage everything. Standard Users can manage Hosted Sites, Proxy Hosts, Redirect Hosts, Streaming Hosts, and Access Lists, but not Users, Groups, Settings, or Backups. Viewers can inspect information but cannot create, edit, disable, assign, or delete anything — their menus and toggles are hidden entirely. This is enforced on the server independently of what the interface shows, so hiding a button is a convenience, not the actual security boundary.

    Update notifications

    While signed in, Site Gateway checks every 60 seconds whether a newer version has been deployed. If so, a small banner appears with Refresh and Dismiss — Refresh reloads the page to pick up the new version; Dismiss hides the banner, but it reappears on the next check if you’re still on the old version. This only matters for a tab left open across a deploy; closing and reopening the tab, or signing in fresh, always loads the current version automatically.

    Icons

    Changing a card’s icon

    Every Hosted Site, Proxy Host, Redirect Host, Streaming Host, Access List, Group, and User can have its own icon. Open the picker from a card’s icon tile or its “Change icon” menu action.

    • Search by service name: type at least 2 characters (e.g. Jellyfin, Plex) to search a large built-in icon catalog and pick a match.
    • Upload a custom image: PNG, JPEG, WebP, GIF, or SVG, up to 2 MB, stored locally under /data/icons. Uploaded SVGs are checked for embedded scripts or external references before being accepted.
    • Image URL: paste a direct https:// image link instead of uploading a file.
    • Use two-letter fallback: clears any icon and reverts to initials derived from the name.

    If a custom icon URL ever stops loading, the card automatically falls back to showing initials instead of a broken image.

    Troubleshooting

    When HTTPS is not detected

    Confirm public DNS actually points to this server, that router/firewall forwarding reaches ports 80 and 443, and that NGINX Proxy Manager or another reverse proxy isn’t still holding those ports. Then check Certificates and Logs → Gateway Events for the specific rejection reason. Site Gateway cannot request a public certificate while another gateway is receiving the ACME challenge on its behalf.

    A route rejected its configuration

    Check the error shown on save — it names the specific problem (duplicate address, invalid upstream, malformed custom configuration, certificate/TLS issue) rather than a generic failure, and the previous working configuration stays active while you fix it.

    A Streaming Host isn’t reachable from outside

    This is almost always the port not being published on the container yet — see Streaming Hosts → Overview for the docker-compose/Unraid port mapping requirement.

    A user is locked out after enabling two-factor authentication

    If they still have an unused recovery code, they can sign in with it in place of the 6-digit code. If not, an administrator can disable that user’s 2FA from Administration → Users — open the locked-out user’s “•••” menu and choose Disable 2FA. The user can sign in with just their password afterward and set 2FA up again whenever they’re ready.

    +