CI / Docker image (push) Successful in 12s
CI / Server (push) Successful in 25s
CI / CLI (push) Successful in 13s
Development image / Development image (push) Successful in 21s
CI / CLI (windows) (push) Successful in 57s
CI / CLI (linux-arm64, static) (push) Successful in 1m37s
Release / Prepare release (push) Successful in 2s
Release / Server (linux-x64) (push) Successful in 53s
Release / CLI (linux-arm64, static) (push) Successful in 1m32s
Release / Docker image (push) Successful in 2m48s
Release / Server (windows-x64) (push) Successful in 6m20s
Release / CLI (windows-x64) (push) Successful in 6m48s
Release / CLI (linux-x64) (push) Successful in 7m8s
Release / Publish release (push) Successful in 1s
Squash the tree into one commit, drop docs/architecture.html, reset the version line to 0.3.0, consolidate the changelog, enable Renovate automerge for non-major updates and add AGENTS.md.
82 lines
4.0 KiB
Markdown
82 lines
4.0 KiB
Markdown
# 🔒 HTTPS
|
|
|
|
frislit never speaks plain HTTP to the internet. Two ways to get there, and you pick one during the guided setup or
|
|
later under **Settings**, **HTTPS**. The options for the other one stay out of your way.
|
|
|
|
## 🧭 Which one
|
|
|
|
| | Behind a proxy | frislit manages it |
|
|
|---|---|---|
|
|
| Certificate | your proxy holds it | frislit orders it from Let's Encrypt |
|
|
| frislit listens on | one plain HTTP port | `443`, plus `80` for redirects |
|
|
| Renewal | your proxy's job | automatic, 30 days before expiry |
|
|
| Needs | nginx, Caddy, Traefik… | a DNS API token, or port 80 reachable |
|
|
|
|
Pick **behind a proxy** if something already terminates TLS on that machine, or if you want one certificate for
|
|
several services. Pick **frislit manages it** if frislit is the only thing on the box.
|
|
|
|
## 🛡️ Behind a proxy
|
|
|
|
The default. frislit serves plain HTTP on `port` (8080) and never sees a certificate. Set up nginx as described in
|
|
[Reverse proxy](/reverse-proxy), then turn on **Trust proxy headers** so tunnels see the real visitor address.
|
|
|
|
> [!WARNING]
|
|
> Only turn that on when nothing but your proxy can reach the port. The per-tunnel IP allowlist and the login rate
|
|
> limit both believe whatever `X-Forwarded-For` carries.
|
|
|
|
## 🔑 frislit manages it
|
|
|
|
frislit binds `443` for traffic and `80` for the redirect and HTTP challenges. In Docker that is just a port
|
|
mapping, because a container may bind low ports already:
|
|
|
|
```sh
|
|
docker run -d --name frislit --restart always -p 443:443 -p 80:80 \
|
|
-v frislit-data:/app/data \
|
|
-e FRISLIT_BASE_DOMAIN=frislit.example.com \
|
|
-e FRISLIT_PUBLIC_URL=https://frislit.example.com \
|
|
-e FRISLIT_TLS_MODE=acme \
|
|
fristy/frislit:latest
|
|
```
|
|
|
|
### Which challenge
|
|
|
|
| Forwarding mode | Certificate | Challenge |
|
|
|---|---|---|
|
|
| Path | `frislit.example.com` | HTTP, or DNS if you prefer |
|
|
| Subdomain | `frislit.example.com` **and** `*.frislit.example.com` | DNS only |
|
|
|
|
A wildcard can only be proven with a DNS challenge, which is a Let's Encrypt rule rather than a frislit one. Subdomain
|
|
forwarding therefore needs a DNS provider; path forwarding can get by with the HTTP challenge and no token at all.
|
|
|
|
### DNS providers
|
|
|
|
**Cloudflare**: create a token with `Zone:DNS:Edit` on the zone, paste it, and press *Test token*. frislit adds and
|
|
removes the `_acme-challenge` record on its own, including at renewal.
|
|
|
|
**Add the record yourself**: frislit shows the exact TXT record and waits. Fine for a first certificate, but
|
|
renewal needs you to be there again, so it is not a good long-term answer.
|
|
|
|
### The first certificate
|
|
|
|
Until there is one, a server in this mode serves the web UI over plain HTTP on port 80, because the page you would
|
|
request the certificate from is otherwise behind a handshake that cannot succeed. Finish the setup, open
|
|
**Settings**, **HTTPS**, press *Request certificate*, and the redirect takes over once it lands.
|
|
|
|
## ⚙️ Keys
|
|
|
|
| Key | Environment variable | Default | Description |
|
|
|---|---|---|---|
|
|
| `tlsMode` | `FRISLIT_TLS_MODE` | `proxy` | `proxy` or `acme`. When set through the environment it is fixed in the web UI, because the container's ports were mapped for it. Otherwise switching needs a restart. |
|
|
| `httpsPort` | `FRISLIT_HTTPS_PORT` | `443` | Where traffic is served in `acme` mode. |
|
|
| `redirectPort` | `FRISLIT_REDIRECT_PORT` | `80` | Redirects to HTTPS and answers HTTP challenges. |
|
|
| `acmeDirectoryUrl` | `FRISLIT_ACME_DIRECTORY` | - | Another ACME server: a private CA, Buypass, or Let's Encrypt staging while you are debugging. |
|
|
|
|
The contact email, the challenge and the DNS token are set in the web UI and stored in the database, not in
|
|
`config.yml`, because a token is a credential rather than configuration.
|
|
|
|
> [!TIP]
|
|
> Let's Encrypt rate-limits failed validations to five per hostname per hour. If you are working through a DNS
|
|
> problem and hit that, point `FRISLIT_ACME_DIRECTORY` at
|
|
> `https://acme-staging-v02.api.letsencrypt.org/directory` until it works. Staging certificates come from an
|
|
> untrusted CA, so browsers will warn about them. Switch back once the challenge succeeds.
|