---
title: "Production"
description: "Run wervt on a server with Coolify, Cloudflare and a Hetzner Storage Box."
canonical_url: "https://docs.dev.lightdrop.cloud/self-hosting/production"
---
# Production

> Run wervt on a server with Coolify, Cloudflare and a Hetzner Storage Box.

The production stack is `deploy/docker-compose.yaml`, deployed by Coolify with the Docker Compose
build pack (base directory `/deploy`). Pushing to `main` deploys it. To run wervt without Coolify,
see [Bare server](https://docs.dev.lightdrop.cloud/self-hosting/bare-server).

That file is generated: Coolify reads a single file, so it's the portable stack
(`deploy/compose.yaml`) merged with the Coolify overlay (`deploy/compose.coolify.yaml`, the Traefik
labels, Coolify's generated secrets and the Coolify database). Edit those two, then write it with:

```bash
vp node deploy/render.ts
```

`vp test` fails while the committed file is out of date, and checks that Docker Compose merges the
two files into the same stack.

## Services

<table>
<thead>
  <tr>
    <th>
      Service
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        runtime
      </code>
    </td>
    
    <td>
      Edge Runtime: the main worker and the app isolates. Only on the stack's network
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        control
      </code>
    </td>
    
    <td>
      Control plane, <code>
        api.wervt.app
      </code>
      
      : deploys, migrations, tasks, logs, storage
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        electric
      </code>
    </td>
    
    <td>
      Live shapes
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        victorialogs
      </code>
    </td>
    
    <td>
      Logs, 14 days, only on the stack's network and behind a login (<code>
        SERVICE_PASSWORD_64_LOGS
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        garage
      </code>
    </td>
    
    <td>
      Object storage (S3 API), <code>
        media.wervt.app
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        imgproxy
      </code>
    </td>
    
    <td>
      Resizes images of the apps' files; internal, reached through the runtime
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        docker-proxy
      </code>
    </td>
    
    <td>
      Read-only Docker API for the dashboard's System page
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        runner
      </code>
    </td>
    
    <td>
      The apps' <a href="https://docs.dev.lightdrop.cloud/guides/services">
        service containers
      </a>
      
      : builds, starts and stops them. Off until it has its tokens
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        proxy-cert
      </code>
    </td>
    
    <td>
      Installs the Cloudflare Origin certificate into Coolify's Traefik
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        media-cert
      </code>
    </td>
    
    <td>
      Gets and renews the Let's Encrypt certificate for <code>
        media.wervt.app
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        storage-backup
      </code>
    </td>
    
    <td>
      Daily copy of Garage to the Storage Box
    </td>
  </tr>
</tbody>
</table>

`runtime-ingress` relays `wervt.app` and `*.wervt.app` from Traefik to the runtime, so the runtime
stays off the coolify network. It is a separate Coolify resource (`deploy/ingress/docker-compose.yaml`,
base directory `/deploy/ingress`), so it keeps running during a stack deploy and holds requests until
the runtime is back instead of answering 502. It shares the `wervt-edge` network with the runtime,
created once on the server: `docker network create --internal wervt-edge`. The System page doesn't
list it, because it only shows the stack's own containers.

Postgres is a separate Coolify database (`wervt-postgres`), so Coolify backs it up. It needs
`wal_level = logical` in its custom configuration for Electric, and the image
`pgvector/pgvector:0.8.7-pg18-trixie` instead of `postgres:18` for apps with `vector` columns
(the same Postgres on the same Debian, plus the extension; restore a dump that contains `vector`
only into a Postgres that has it).

The sign-in, the dashboard and these docs are apps on the stack, not services of it: a merge to
`main` doesn't deploy them, `wervt deploy` does (`pnpm app:deploy docs` from the repo for the docs,
which are the root app, `WERVT_ROOT_APP=docs`, at `wervt.app`).

## Environment

Coolify generates the `SERVICE_*` values on the first deploy and keeps them. Set the rest on the
Coolify app:

<table>
<thead>
  <tr>
    <th>
      Variable
    </th>
    
    <th>
      Value
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        WERVT_PG_URL
      </code>
    </td>
    
    <td>
      Internal URL of <code>
        wervt-postgres
      </code>
      
       (superuser, database <code>
        wervt
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_ADMIN_EMAILS
      </code>
    </td>
    
    <td>
      Emails that may sign in to private apps and manage every app. Other accounts' CLI sessions manage only their own apps
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DEFAULT_APP_LIMIT
      </code>
    </td>
    
    <td>
      Apps a non-admin account may own unless it has its own limit (<code>
        wervt accounts
      </code>
      
      ). Default 3, <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DEFAULT_DATABASE_LIMIT
      </code>
    </td>
    
    <td>
      Database size per app of a non-admin account; deploys warn from 80 % and are refused past it. Default <code>
        1GB
      </code>
      
      , <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DEFAULT_STORAGE_LIMIT
      </code>
    </td>
    
    <td>
      Files per app of a non-admin account, a Garage bucket quota. Default <code>
        5GB
      </code>
      
      , <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DEFAULT_RELEASES_LIMIT
      </code>
    </td>
    
    <td>
      Space all releases of a non-admin account's apps may take. Default <code>
        1GB
      </code>
      
      , <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DEFAULT_SERVICES_LIMIT
      </code>
    </td>
    
    <td>
      Memory the service containers of a non-admin account's apps may ask for together. Default <code>
        0
      </code>
      
      , off
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DEFAULT_IMAGES_LIMIT
      </code>
    </td>
    
    <td>
      Space the service images of a non-admin account's apps and previews may take together, each layer counted once. Default <code>
        10GB
      </code>
      
      , <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_RUNNER_TOKEN
      </code>
      
      , <code>
        WERVT_RUNNER_PROXY_TOKEN
      </code>
    </td>
    
    <td>
      Switch service containers on (see below). Empty by default
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_STATEMENT_TIMEOUT
      </code>
    </td>
    
    <td>
      <code>
        statement_timeout
      </code>
      
       of every app's database role. Default <code>
        30s
      </code>
      
      , <code>
        0
      </code>
      
       for none
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_IDLE_IN_TRANSACTION_TIMEOUT
      </code>
    </td>
    
    <td>
      <code>
        idle_in_transaction_session_timeout
      </code>
      
       of every app's database role. Default <code>
        60s
      </code>
      
      , <code>
        0
      </code>
      
       for none
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_ORIGIN_CERT
      </code>
      
      , <code>
        WERVT_ORIGIN_KEY
      </code>
    </td>
    
    <td>
      The Cloudflare Origin certificate and key for <code>
        *.wervt.app
      </code>
      
       and <code>
        wervt.app
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        STORAGE_BOX_HOST
      </code>
    </td>
    
    <td>
      The Storage Box (sub-)account's host, e.g. <code>
        u123456-sub1.your-storagebox.de
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        STORAGE_BOX_USER
      </code>
      
      , <code>
        STORAGE_BOX_PASSWORD
      </code>
    </td>
    
    <td>
      Its login
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        STORAGE_BOX_DIR
      </code>
    </td>
    
    <td>
      Folder for the Garage backup, relative to the account's root (default <code>
        wervt/garage
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_API_KEY
      </code>
    </td>
    
    <td>
      Brevo API key for apps' mail (<code>
        sendMail
      </code>
      
      ) and sign-in codes. Without it or a mail server, sending answers 503
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_FROM
      </code>
    </td>
    
    <td>
      Sender address, verified in Brevo or allowed on the mail server (default <code>
        mail@wervt.app
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_SMTP_HOST
      </code>
    </td>
    
    <td>
      A mail server of your own, used when there's no <code>
        MAIL_API_KEY
      </code>
      
      , e.g. <code>
        smtp.strato.de
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_SMTP_PORT
      </code>
    </td>
    
    <td>
      Default <code>
        465
      </code>
      
       (TLS from the start); any other port has to offer STARTTLS
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_SMTP_USER
      </code>
      
      , <code>
        MAIL_SMTP_PASSWORD
      </code>
    </td>
    
    <td>
      The mail server's login; the user defaults to <code>
        MAIL_FROM
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_LIMIT_PER_APP
      </code>
    </td>
    
    <td>
      Mails an app may send per hour unless it has its own limit (<code>
        wervt mail-limits
      </code>
      
      ). Default 100, <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        MAIL_LIMIT_PER_RECIPIENT
      </code>
    </td>
    
    <td>
      Mails one address may get per hour, from all apps together. Default 20, <code>
        none
      </code>
      
       for no limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_IDENTITY_KEY
      </code>
    </td>
    
    <td>
      The workload identity's private signing key(s), from <code>
        wervt identity keygen
      </code>
      
       (see below). Without it, apps get no identity tokens
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        CLOUDFLARE_DNS_API_TOKEN
      </code>
    </td>
    
    <td>
      Cloudflare API token for the <code>
        media.wervt.app
      </code>
      
       certificate: <strong>
        Zone > Zone > Read
      </strong>
      
       and <strong>
        Zone > DNS > Edit
      </strong>
      
      , limited to the <code>
        wervt.app
      </code>
      
       zone
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        WERVT_DOMAIN_TARGET
      </code>
    </td>
    
    <td>
      The name apps' custom domains point at (default <code>
        domains.wervt.app
      </code>
      
      , see below)
    </td>
  </tr>
</tbody>
</table>

Generated, don't change them: `SERVICE_PASSWORD_64_DBSECRET` (derives every app's database password,
app token and S3 key, so changing it locks apps out of their data), `_DEPLOY` (admin token), `_READ`
(read token), `_AUTH`, `_ELECTRIC`, `_GARAGEADMIN`, `_POOLER` (PgBouncer's login), `_LOGS`
(VictoriaLogs' login) and
`SERVICE_HEX_64_GARAGERPC`.

`compose.coolify.yaml` pins the Docker proxy's group to the server's docker group (`988` on
frozencloud-04). On another server, put in the group of its socket (`stat -c %g /var/run/docker.sock`) and render again, or the System page stays empty.

### Service containers

The `runner` starts out off: without its two tokens it only answers its health check, and a deploy
of an app with `services` fails with "this server doesn't run service containers". To switch it on:

1. Check that its range is free on the server (`docker network inspect $(docker network ls -q) | grep Subnet`); every service gets a /28 from `WERVT_RUNNER_SUBNETS`, `10.231.0.0/16` by default.
2. Set `WERVT_RUNNER_TOKEN` and `WERVT_RUNNER_PROXY_TOKEN` on the Coolify app, two different values
from `openssl rand -hex 32`, and redeploy. Not as `SERVICE_PASSWORD_*`: Coolify would generate
those on the next deploy and switch the runner on unasked.
3. Give accounts memory for their services (`wervt accounts <email> --services 4GB`); admins' apps
need none.

It runs as nonroot with the server's docker group for the socket, pinned to `988` in
`compose.coolify.yaml` like the Docker proxy. `WERVT_RUNNER_MAX_MEMORY` and
`WERVT_RUNNER_MAX_CPUS` cap one service (`4GB`, `2`), `WERVT_RUNNER_BUILD_MEMORY` and
`WERVT_RUNNER_BUILD_CPUS` a build (`2GB`, `2`). With BuildKit, `WERVT_RUNNER_BUILD_DISK` caps what
a build writes (`20GB`), and `WERVT_RUNNER_BUILD_MIN_FREE` stops one that would leave the server
with less disk (`10GB`); `runner/README.md` lists the rest. Add `runner/**`
to the Coolify app's watch paths, so a change to it redeploys the stack.

Builds run the apps' Dockerfiles on this server, with network access for `RUN` steps, so only give
service memory to accounts you trust with that. By default they use Docker's classic builder, whose
`RUN` steps run on Docker's default bridge, next to other containers there. With
`WERVT_RUNNER_BUILDER=buildkit` each build runs in a rootless BuildKit container of its own, on a
network of its own, with `RUN --mount`, under `WERVT_RUNNER_RUNTIME` like the services. It has no
layer cache between builds, so a changed context runs every step again. Use it together with
gVisor: under runc, BuildKit's user namespace needs the build container without Docker's seccomp
and AppArmor profiles, so the build has more of the kernel in reach than a service.

#### Host ports

Docker lets every container reach the ports the server publishes, and the server itself through
its network's gateway, even on an `internal` network. A service or build could otherwise reach a
published database or SSH. `deploy/runner-guard/` holds a script that closes that for
`WERVT_RUNNER_SUBNETS`, keeping 80 and 443 open, so services still reach this server's apps by
their public names:

```bash
install -m 755 deploy/runner-guard/wervt-runner-guard /usr/local/sbin/
install -m 644 deploy/runner-guard/wervt-runner-guard.service /etc/systemd/system/
systemctl daemon-reload && systemctl enable --now wervt-runner-guard
iptables -S DOCKER-USER   # the two exceptions first, then the drop
```

It adds three rules to `DOCKER-USER` (published ports, after Docker's DNAT) and one to `INPUT`
(the server itself), and runs again whenever Docker starts. With another range, pass it:
`ExecStart=/usr/local/sbin/wervt-runner-guard 10.50.0.0/16`. `wervt-runner-guard --remove` takes
the rules out again.

If `/etc/ufw/after.rules` declares `:DOCKER-USER` itself, as the
[ufw-docker](https://github.com/chaifeng/ufw-docker) block does, every `ufw reload` empties that
chain and the three `DOCKER-USER` rules are gone until Docker starts again. Add them to that block
too, right after `:DOCKER-USER - [0:0]`, then check that they survive a reload:

```text
-A DOCKER-USER -s 10.231.0.0/16 -p tcp -m conntrack --ctstate DNAT --ctorigdstport 80 -j ACCEPT
-A DOCKER-USER -s 10.231.0.0/16 -p tcp -m conntrack --ctstate DNAT --ctorigdstport 443 -j ACCEPT
-A DOCKER-USER -s 10.231.0.0/16 -m conntrack --ctstate DNAT -j DROP
```

#### In gVisor

The containers share the server's kernel by default. With [gVisor](https://gvisor.dev)'s `runsc`
as their runtime, each gets a kernel of its own in user space, so a service that breaks out of its
process has to get through gVisor too.

1. Install `runsc` with its helpers in `gvisor-bin/` next to it, from the newest release under
`storage.googleapis.com/gvisor/releases/release/`:```bash
V=20261116.0
cd "$(mktemp -d)"
curl -fsSLO https://storage.googleapis.com/gvisor/releases/release/$V/x86_64/gvisor.tar.bz2
curl -fsSLO https://storage.googleapis.com/gvisor/releases/release/$V/x86_64/gvisor.tar.bz2.sha512
sha512sum -c gvisor.tar.bz2.sha512 && tar -xjf gvisor.tar.bz2
install -d /opt/gvisor/gvisor-bin
install -m 755 runsc /opt/gvisor/ && install -m 755 gvisor-bin/* /opt/gvisor/gvisor-bin/
```
2. Add it to `/etc/docker/daemon.json` next to what's there, not as `default-runtime`:
`"runtimes": {"runsc": {"path": "/opt/gvisor/runsc"}}`. Then `systemctl reload docker`, which
leaves running containers alone, unlike a restart. `docker run --rm --runtime=runsc busybox dmesg` starts with "Starting gVisor".
3. Set `WERVT_RUNNER_RUNTIME` to `runsc` on the Coolify app and redeploy. New containers run in
gVisor; one that exists keeps its runtime until a deploy replaces it or the app is deleted
(`docker inspect -f '{{.HostConfig.Runtime}}' <container>`).

Under gVisor a service may have 1024 processes and threads instead of 256, as gVisor's own threads
count too, about two per process. Services with `egress` get a `resolv.conf` with
`WERVT_RUNNER_DNS` (`1.1.1.1` and `9.9.9.9` unless set), as Docker's DNS on `127.0.0.11` is out
of their reach. A service sees as many cores as its `cpus`, where runc shows all of the
server's, and takes about 17 MB more memory. Builds run in gVisor only with
`WERVT_RUNNER_BUILDER=buildkit`; the classic builder runs `RUN` steps with Docker's default
runtime.

## DNS and TLS

<table>
<thead>
  <tr>
    <th>
      Record
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Proxied
    </th>
    
    <th>
      Certificate
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        *.wervt.app
      </code>
    </td>
    
    <td>
      A
    </td>
    
    <td>
      yes
    </td>
    
    <td>
      Cloudflare Origin (Cloudflare in Full (strict))
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        wervt.app
      </code>
    </td>
    
    <td>
      A
    </td>
    
    <td>
      yes
    </td>
    
    <td>
      Cloudflare Origin
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        media.wervt.app
      </code>
    </td>
    
    <td>
      A
    </td>
    
    <td>
      <strong>
        no
      </strong>
    </td>
    
    <td>
      Let's Encrypt, from <code>
        media-cert
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        domains.wervt.app
      </code>
    </td>
    
    <td>
      A
    </td>
    
    <td>
      <strong>
        no
      </strong>
    </td>
    
    <td>
      none, it's only a DNS target
    </td>
  </tr>
</tbody>
</table>

`media.wervt.app` serves files and video straight from the server. Cloudflare's terms don't allow
heavy video delivery through the proxy, and serving it directly keeps wervt independent of
Cloudflare for its data.

Traefik doesn't request certificates for names that a stored certificate already covers, and the
Origin certificate covers `*.wervt.app`. So `media-cert` gets the Let's Encrypt certificate itself,
with lego's DNS-01 challenge: it sets a TXT record through the Cloudflare API. Traefik answers
HTTP-01 and TLS-ALPN-01 challenges itself, so those can't reach a sidecar. `media-cert` puts the
certificate into Traefik's configuration, where it wins over the wildcard for `media.wervt.app`,
and renews it when a third of its lifetime is left.

### Custom domains

Apps' own domains (`wervt domains`) point at `domains.wervt.app`, which has to resolve to the
server itself: the control plane verifies a domain by comparing its addresses with this name's, and
Let's Encrypt has to reach the server for the HTTP-01 challenge. For each verified domain, control
writes a router into `/data/coolify/proxy/dynamic/wervt-domains.yaml` (mounted into control),
with Coolify's `letsencrypt` resolver, and Traefik requests the certificate on the first request.
`WERVT_TRAEFIK_CERT_RESOLVER` and `WERVT_TRAEFIK_SERVICE` (default `wervt-apps@docker`, the
runtime ingress's service) change the names it uses.

Check the media certificate with:

```bash
echo | openssl s_client -connect media.wervt.app:443 -servername media.wervt.app 2>/dev/null \
  | openssl x509 -noout -issuer -enddate
```

### Rotating the Origin certificate

1. In Cloudflare, under **SSL/TLS > Origin Server**, create a certificate for `*.wervt.app` and
`wervt.app`.
2. Put the certificate and key into `WERVT_ORIGIN_CERT` and `WERVT_ORIGIN_KEY` in Coolify, and
deploy. `proxy-cert` writes them into Traefik's configuration, and Traefik picks them up
without a restart.
3. Check that the new one is served (its serial and start date):```bash
echo | openssl s_client -connect <server-ip>:443 -servername api.wervt.app 2>/dev/null \
  | openssl x509 -noout -serial -startdate
```
4. Revoke the old certificate in Cloudflare.

### Workload identity keys

Control signs apps' identity tokens (the [AI providers guide](https://docs.dev.lightdrop.cloud/guides/ai-providers)) as the
issuer `https://id.wervt.app`; Traefik routes only `/.well-known/` on that host to control.
`WERVT_IDENTITY_KEY` is a private P-256 JWK with a `kid`, or a JSON list of them: the first signs,
all are published. To rotate:

1. `wervt identity keygen --kid wervt-<date>`, and add the key **second** in the list. Deploy.
2. Wait at least 15 minutes (providers cache the JWKS), then move it to the front. Deploy.
3. After another hour, when no token signed with the old key is still valid, remove the old key.

`wervt identity jwks` prints the published keys, for providers that take them inline.

## First start

1. Create the Postgres database, set the environment above and deploy.
2. The control plane gives Garage its layout and creates a bucket for every app on start.
3. Sign in the CLI: `wervt login --url https://api.wervt.app`, then approve the code on the
dashboard's **Settings** page. Before the dashboard is deployed, use the admin token:
`wervt login --url … --token <SERVICE_PASSWORD_64_DEPLOY>`.
4. Deploy the auth app and the dashboard from the repo: `pnpm app:deploy auth`,
`pnpm app:deploy dashboard`.
5. Give the dashboard its access to the control plane. It keeps the admin token on its server
side only:```bash
wervt env dashboard --set CONTROL_URL=https://api.wervt.app --set CONTROL_TOKEN=…
```

<br />

Admins (`WERVT_ADMIN_EMAILS`) see every app. Make the dashboard invite-only, with
inviting left to admins (anyone in the dashboard may deploy apps):```bash
wervt access dashboard --invite --invite-by owners
```

<br />

Invite people on the dashboard's **Accounts** page: they get an invitation mail with a link to
the dashboard, and see only their own apps there and can sign in the CLI for themselves.
`wervt access dashboard --add friend@example.com` still lets someone in, without a mail.

## Login providers

Passkeys and email (codes, passwords) work without setup. Each other provider shows up on the
login once the auth app has its keys (`wervt env auth --set …`, then deploy the auth app). Register
`https://auth.dev.lightdrop.cloud/api/auth/callback/<provider>` as the callback URL at the provider, e.g.
`…/callback/github`.

<table>
<thead>
  <tr>
    <th>
      Provider
    </th>
    
    <th>
      Variables
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Google, GitHub, Discord, Twitch, Spotify
    </td>
    
    <td>
      <code>
        GOOGLE_CLIENT_ID
      </code>
      
       and <code>
        GOOGLE_CLIENT_SECRET
      </code>
      
      , and so on
    </td>
  </tr>
  
  <tr>
    <td>
      Microsoft
    </td>
    
    <td>
      <code>
        MICROSOFT_CLIENT_ID
      </code>
      
      , <code>
        MICROSOFT_CLIENT_SECRET
      </code>
      
      , optional <code>
        MICROSOFT_TENANT_ID
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Apple
    </td>
    
    <td>
      <code>
        APPLE_CLIENT_ID
      </code>
      
      , <code>
        APPLE_TEAM_ID
      </code>
      
      , <code>
        APPLE_KEY_ID
      </code>
      
      , <code>
        APPLE_PRIVATE_KEY
      </code>
    </td>
  </tr>
</tbody>
</table>

- **Microsoft:** an app registration in Microsoft Entra. Without `MICROSOFT_TENANT_ID` only
personal Microsoft accounts sign in (`consumers`). `common` lets in work and school accounts
too, whose addresses their organization sets as it likes, so those people confirm theirs with a
code before an app sees them.
- **Apple:** needs the Apple Developer Program. `APPLE_CLIENT_ID` is a Services ID with Sign in
with Apple turned on and this server's login domain and return URL entered there (each server
has its own). `APPLE_KEY_ID` and `APPLE_PRIVATE_KEY` are a Sign in with Apple key: the contents
of its `.p8` file, line breaks written as `\n` are fine. The auth app signs the client secret
from it when it starts, so there's nothing to renew every six months.
- People who hide their address from Apple sign in with a relay address
(`…@privaterelay.appleid.com`), which is on no app's list. The "No access" page tells them so.

Backups and restores are on [Backups](https://docs.dev.lightdrop.cloud/self-hosting/backups).


## Sitemap

See the full [sitemap](https://docs.dev.lightdrop.cloud/sitemap.md) for all pages.
