From 0e20bcf23d3913b4921f58f873e6fa1dca0dca50 Mon Sep 17 00:00:00 2001 From: Resinder <18302831+Resinder@users.noreply.github.com> Date: Sat, 7 Nov 2026 17:23:49 +0300 Subject: [PATCH 1/3] docs(self-hosting): choosing a domain and TLS mode; one-hostname upgrade note Minder is served from one hostname (MINDER_DOMAIN) with path routing: / console, /api gateway, /auth sign-in, /c/ and /embed.js public chat. The install guide gains a "Choosing a domain and TLS mode" section (local, proxy, acme) with a generic Caddy + tailnet split-DNS example, the install steps drop the hand-set client SSO URLs and the client.minder.local addresses, and Upgrading gets the migration note. Co-Authored-By: Claude Opus 5.5 --- docs/remote-access.md | 12 +++-- docs/self-hosting.md | 107 +++++++++++++++++++++++++++++++----------- docs/upgrades.md | 22 +++++++++ 3 files changed, 111 insertions(+), 30 deletions(-) diff --git a/docs/remote-access.md b/docs/remote-access.md index 218ee6c..5d8c911 100644 --- a/docs/remote-access.md +++ b/docs/remote-access.md @@ -59,8 +59,14 @@ such a network, you already have everything you need. so if anything looks broken, prefer the hosts-file approach with the exact name. +## A real name on your VPN + +If you run a reverse proxy with a valid certificate (for example Caddy with a +wildcard certificate) and VPN split DNS, give Minder a real name instead of +hosts-file entries. Every device on the VPN then opens it with no setup. See +[Choosing a domain and TLS mode](self-hosting.md#choosing-a-domain-and-tls-mode). + ## What's not supported yet -Public internet exposure with real DNS and a CA-issued certificate isn't set up -out of the box. The VPN approach above is the supported path today — not a -workaround for a first-class feature that exists elsewhere. +Public internet exposure isn't hardened out of the box. The VPN approach above +is the supported path today. diff --git a/docs/self-hosting.md b/docs/self-hosting.md index fa66f51..7fa6892 100644 --- a/docs/self-hosting.md +++ b/docs/self-hosting.md @@ -33,33 +33,86 @@ the steps in sequence; each one ends with a check. Run `wsl --shutdown` once afterwards for it to take effect. -## Step 1 — Decide how you will sign in, then install +## Choosing a domain and TLS mode -The **first administrator** signs in through the bundled identity provider -(Authelia) with the `admin` account the installer creates. Accounts created -with a username and password in the web client are always regular users. They -can't create the first admin. +Minder is served from **one hostname**, `MINDER_DOMAIN`, with path routing: + +| Path | What | +|---|---| +| `/` | the web console | +| `/api/…` | the API gateway | +| `/auth/…` | sign-in (Authelia: SSO, OIDC, the self-service portal) | +| `/c/`, `/embed.js` | public chatbot page and its embed widget | + +Because everything shares one origin, the browser makes no cross-origin calls, +and you need **one DNS record and one certificate**. Sign-in, OIDC redirects, +emailed links and CORS all derive from `MINDER_DOMAIN`. You don't set them one +by one. + +Pick the domain and who terminates TLS for it: -So, **before installing**, tell the web client where its *Sign in with SSO* -button should go. In the repository's root `.env` (copy `.env.example` if it -doesn't exist yet), set: +| `--tls-mode` | Use it when | What happens | +|---|---|---| +| `local` (default) | trying Minder on one machine or a LAN | Minder's own CA signs a certificate for the domain; you trust the CA once per device (`bash setup.sh trust-ca`). The default domain `minder.local` needs a hosts-file line. | +| `proxy` | you already run a TLS-terminating reverse proxy (Caddy, nginx, Traefik, …) with a valid certificate | Minder serves plain HTTP on port 80 for your proxy. It trusts `X-Forwarded-Proto`/`-For` **only** from `--trusted-proxies`, so cookies stay `Secure` and links stay `https`. | +| `acme` | the domain has public DNS pointing at this host and port 443 is reachable | Let's Encrypt (TLS-ALPN-01) issues the certificate. | + +Set them at install time (below) or later: ```bash -CLIENT_OIDC_LOGIN_URL=https://api.minder.local/v1/auth/oidc/login -CLIENT_AUTHELIA_PORTAL_URL=https://authelia.minder.local +bash setup.sh domain minder.example.com --tls-mode proxy --trusted-proxies 192.168.1.10/32 +bash setup.sh restart +bash setup.sh domain # shows the current settings and URLs ``` -Replace `minder.local` with your own domain if you serve Minder under a real -one. These values are built into the web client image, which is why they go in -before the install. +### Example: behind Caddy, reached over a tailnet + +A common home setup has Caddy on one machine holding a wildcard certificate for +`*.home.example.com`, and Minder on another machine. Devices reach both over a +Tailscale tailnet, and split DNS (for example an AdGuard or Pi-hole rewrite) +resolves `minder.home.example.com` to Caddy. + +1. Install Minder in proxy mode, trusting only Caddy's address. Use its LAN + address, or `100.64.0.0/10` if Caddy reaches Minder over the tailnet: -Then install: + ```bash + bash setup.sh install --profile standard \ + --domain minder.home.example.com --tls-mode proxy \ + --trusted-proxies 192.168.1.10/32 + ``` + +2. Add a site to Caddy. Caddy sets `X-Forwarded-Proto: https` and + `X-Forwarded-For` itself: + + ```caddyfile + minder.home.example.com { + tls /etc/caddy/certs/wildcard.crt /etc/caddy/certs/wildcard.key + reverse_proxy http://:80 + } + ``` + +3. Point `minder.home.example.com` at Caddy in your DNS (the split-DNS rewrite). + Phones and laptops on the tailnet then open `https://minder.home.example.com` + with no hosts-file edits and no certificate warnings. + +!!! warning "Keep port 80 closed to everything but the proxy" + In proxy mode the Minder host serves plain HTTP on port 80. Firewall it so + only the proxy can reach it. + +## Step 1 — Install + +The **first administrator** signs in through the bundled identity provider +(Authelia) with the `admin` account the installer creates. Accounts created +with a username and password in the web client are always regular users. They +can't create the first admin. The web client's *Sign in with SSO* button needs +no configuration: it points at `/api` on the console's own domain. ```bash # Requires licensed access: the repository and images come with your license. git clone minder cd minder bash setup.sh install --profile standard # minimal | standard | full +# Your own domain (see above): add --domain [--tls-mode proxy|acme] ``` - `--profile` picks the initial **bundles** (capability groups) to enable. @@ -75,14 +128,14 @@ bash setup.sh install --profile standard # minimal | standard | full **Check:** the install ends with a *Ready!* banner listing the URLs. -## Step 2 — Make the web addresses work on your computer +## Step 2 — Make the web address work on your computer -Minder's web UIs live under `*.minder.local` names behind its own reverse proxy -and TLS certificate. Your computer needs to resolve those names and trust that -certificate: +With your own domain and DNS (proxy or acme mode), skip to the check at the end +of this step. With the default `minder.local` and its local CA, your computer +needs to resolve the name and trust the certificate: 1. **Add the hosts line** printed by the banner, for example - `127.0.0.1 client.minder.local api.minder.local authelia.minder.local …`: + `127.0.0.1 minder.local chat.minder.local …`: - Linux/macOS: `/etc/hosts` - Windows: `C:\Windows\System32\drivers\etc\hosts` (edit as Administrator) 2. **Trust Minder's local certificate authority:** @@ -93,7 +146,8 @@ certificate: Then restart the browser. -**Check:** `https://client.minder.local` opens without a certificate warning. +**Check:** `https://` (for example `https://minder.local`) opens +without a certificate warning. To use Minder from other computers on your network, add the same hosts line there with the server's LAN IP instead of `127.0.0.1`, and trust the CA there @@ -101,7 +155,7 @@ too. ## Step 3 — Sign in as the first administrator -1. Open `https://client.minder.local` and choose **Giriş yap / Sign in** → +1. Open `https://` and choose **Giriş yap / Sign in** → **Sign in with SSO (Authelia)**. 2. Sign in as `admin` with the password from Step 1. 3. You land back in the client as an **instance admin**. The first admin to @@ -109,15 +163,14 @@ too. operator role) automatically, once. See [Platform Admin](platform-admin.md) to grant it to others later. 4. Change the generated password in the Authelia portal - (`https://authelia.minder.local`). See + (`https:///auth/`). See [Authentication](authentication.md#the-admin-password). !!! note "No SSO button on the sign-in page?" - Then the client was built without `CLIENT_OIDC_LOGIN_URL`. Set the two - values from Step 1 in `.env`, rebuild the client with - `bash setup.sh update`, and reload the page. Opening the gateway's SSO URL - directly doesn't work: the client only accepts a sign-in that it started - itself. + Then `.env` sets `CLIENT_OIDC_LOGIN_URL` empty. Set it to + `/api/v1/auth/oidc/login`, rebuild the client with `bash setup.sh update`, + and reload the page. Opening the gateway's SSO URL directly doesn't work: + the client only accepts a sign-in that it started itself. **Check:** the user menu shows `admin`, and the sidebar has *Kuruluş / Organization* and *Sağlayıcılar ve varsayılanlar / Providers & defaults*. diff --git a/docs/upgrades.md b/docs/upgrades.md index 69ccb06..82337c0 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -30,6 +30,28 @@ flow, verification, rollback, and per-image caveats. To change an image version: edit the `image:` tag in the Compose file, then apply with `bash setup.sh update`. +## Upgrade note: one hostname with path routing + +Releases with `MINDER_DOMAIN` serve the console, API, sign-in and public +chatbot from one hostname (`/`, `/api`, `/auth`, `/c/` and `/embed.js`). +The default is `minder.local`. On an existing install: + +- Add `minder.local` to the hosts file of every device you use, or move to a + real name with `bash setup.sh domain `. `bash setup.sh doctor` lists + what is missing. +- `client.minder.local` redirects to the new address for one release. + `api.minder.local`, `authelia.minder.local` and the operator tools keep + their old names for now. +- Sign-in moved under `/auth`: the OIDC issuer is now + `https:///auth`. If you set `AUTHELIA_ISSUER_URL`, + `MINDER_OIDC_REDIRECT_URI`, `MINDER_CLIENT_BASE_URL` or `CORS_ALLOWED_ORIGINS` + yourself, update or remove them. When unset, they derive from the domain. +- Setup moves the old shipped web client URLs in `.env` to same-origin ones + (`/api`, `/api/v1/auth/oidc/login`, `/auth/`) and keeps values you set + yourself. The rebuilt client then talks to `/api` on its own domain. +- Behind your own TLS proxy, see + [Choosing a domain and TLS mode](self-hosting.md#choosing-a-domain-and-tls-mode). + ## Pre-upgrade checklist - [ ] Enough free disk for a backup (databases can be several GB). From ec93cd667ebc0f341d1702c822661ca00f5ed44c Mon Sep 17 00:00:00 2001 From: Resinder <18302831+Resinder@users.noreply.github.com> Date: Tue, 10 Nov 2026 12:13:32 +0300 Subject: [PATCH 2/3] docs(self-hosting): proxy mode needs the proxy's single address; header rules From the security review: --trusted-proxies takes the proxy's own address, never a range (every listed address may forge X-Forwarded-*). The proxy must overwrite X-Forwarded-Host/-Proto/-For and strip X-Forwarded-Uri; Caddy is the tested example (header_up -X-Forwarded-Uri). Ops UIs are not routed in proxy mode. Mention the short /embed.js snippet. Co-Authored-By: Claude Opus 5.5 --- docs/self-hosting.md | 24 +++++++++++++++--------- docs/upgrades.md | 3 +++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/self-hosting.md b/docs/self-hosting.md index 7fa6892..704c286 100644 --- a/docs/self-hosting.md +++ b/docs/self-hosting.md @@ -42,7 +42,7 @@ Minder is served from **one hostname**, `MINDER_DOMAIN`, with path routing: | `/` | the web console | | `/api/…` | the API gateway | | `/auth/…` | sign-in (Authelia: SSO, OIDC, the self-service portal) | -| `/c/`, `/embed.js` | public chatbot page and its embed widget | +| `/c/`, `/embed.js` | public chatbot page and its embed widget: `` | Because everything shares one origin, the browser makes no cross-origin calls, and you need **one DNS record and one certificate**. Sign-in, OIDC redirects, @@ -54,7 +54,7 @@ Pick the domain and who terminates TLS for it: | `--tls-mode` | Use it when | What happens | |---|---|---| | `local` (default) | trying Minder on one machine or a LAN | Minder's own CA signs a certificate for the domain; you trust the CA once per device (`bash setup.sh trust-ca`). The default domain `minder.local` needs a hosts-file line. | -| `proxy` | you already run a TLS-terminating reverse proxy (Caddy, nginx, Traefik, …) with a valid certificate | Minder serves plain HTTP on port 80 for your proxy. It trusts `X-Forwarded-Proto`/`-For` **only** from `--trusted-proxies`, so cookies stay `Secure` and links stay `https`. | +| `proxy` | you already run a TLS-terminating reverse proxy with a valid certificate (Caddy is the tested one) | Minder serves plain HTTP on port 80 and accepts it **only** from the proxy's own address (`--trusted-proxies`, a single address such as `192.168.1.10/32`, never a range). It trusts `X-Forwarded-*` only from there, so cookies stay `Secure` and links stay `https`. The proxy must overwrite `X-Forwarded-Host`, `-Proto` and `-For`, and strip `X-Forwarded-Uri`. The operator UIs on `*.minder.local` are not routed in this mode: reach them over the loopback ports or an SSH tunnel. | | `acme` | the domain has public DNS pointing at this host and port 443 is reachable | Let's Encrypt (TLS-ALPN-01) issues the certificate. | Set them at install time (below) or later: @@ -72,8 +72,11 @@ A common home setup has Caddy on one machine holding a wildcard certificate for Tailscale tailnet, and split DNS (for example an AdGuard or Pi-hole rewrite) resolves `minder.home.example.com` to Caddy. -1. Install Minder in proxy mode, trusting only Caddy's address. Use its LAN - address, or `100.64.0.0/10` if Caddy reaches Minder over the tailnet: +1. Install Minder in proxy mode, trusting only Caddy's own address: the one + Minder sees connections from (its LAN address, or its single tailnet + address such as `100.101.102.103/32`). Never a range: every listed address + may forge `X-Forwarded-*`. Optionally bind port 80 to the interface Caddy + uses with `MINDER_HTTP_BIND=` in `.env`. ```bash bash setup.sh install --profile standard \ @@ -81,13 +84,16 @@ resolves `minder.home.example.com` to Caddy. --trusted-proxies 192.168.1.10/32 ``` -2. Add a site to Caddy. Caddy sets `X-Forwarded-Proto: https` and - `X-Forwarded-For` itself: +2. Add a site to Caddy. With no `trusted_proxies` of its own, Caddy + overwrites `X-Forwarded-For`, `-Proto` and `-Host` with the real values; + the `header_up -X-Forwarded-Uri` line drops a client-supplied one: ```caddyfile minder.home.example.com { tls /etc/caddy/certs/wildcard.crt /etc/caddy/certs/wildcard.key - reverse_proxy http://:80 + reverse_proxy http://:80 { + header_up -X-Forwarded-Uri + } } ``` @@ -96,8 +102,8 @@ resolves `minder.home.example.com` to Caddy. with no hosts-file edits and no certificate warnings. !!! warning "Keep port 80 closed to everything but the proxy" - In proxy mode the Minder host serves plain HTTP on port 80. Firewall it so - only the proxy can reach it. + In proxy mode the Minder host serves plain HTTP on port 80. Minder refuses + every other source address, but firewall it to the proxy as well. ## Step 1 — Install diff --git a/docs/upgrades.md b/docs/upgrades.md index 82337c0..f37a7cd 100644 --- a/docs/upgrades.md +++ b/docs/upgrades.md @@ -49,6 +49,9 @@ The default is `minder.local`. On an existing install: - Setup moves the old shipped web client URLs in `.env` to same-origin ones (`/api`, `/api/v1/auth/oidc/login`, `/auth/`) and keeps values you set yourself. The rebuilt client then talks to `/api` on its own domain. +- The public chatbot snippet can now be the shorter + ``; + the old `/api/public/chat/widget.js` keeps working. - Behind your own TLS proxy, see [Choosing a domain and TLS mode](self-hosting.md#choosing-a-domain-and-tls-mode). From cb857340bc6ad378ed620b48a0e304f3c24ebf45 Mon Sep 17 00:00:00 2001 From: Resinder <18302831+Resinder@users.noreply.github.com> Date: Tue, 10 Nov 2026 12:29:48 +0300 Subject: [PATCH 3/3] docs(self-hosting): use a documentation IP in the trusted-proxy example The private-reference scan flags 100.64.0.0/10 addresses as tailnet IPs. Co-Authored-By: Claude Opus 5.5 --- docs/self-hosting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/self-hosting.md b/docs/self-hosting.md index 704c286..f19bebe 100644 --- a/docs/self-hosting.md +++ b/docs/self-hosting.md @@ -74,7 +74,7 @@ resolves `minder.home.example.com` to Caddy. 1. Install Minder in proxy mode, trusting only Caddy's own address: the one Minder sees connections from (its LAN address, or its single tailnet - address such as `100.101.102.103/32`). Never a range: every listed address + address such as `192.0.2.10/32`). Never a range: every listed address may forge `X-Forwarded-*`. Optionally bind port 80 to the interface Caddy uses with `MINDER_HTTP_BIND=` in `.env`.