~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
83 lines · 9.7 KB Raw History
# Configuration

The host reads its environment when it starts (`crates/group-host/src/config.rs`).
It refuses to start, and says which variable is wrong, on a `PORT` that
isn't a port, a `PUBLIC_URL` that isn't an `http` or `https` origin, a
`HANDLE_DOMAIN` without a leading dot, a `DID_WEB_SCHEME` other than
`https` or `http`, a `BLOB_UPLOAD_LIMIT` or `LOGS_KEEP` that isn't a
number, a `CONSOLE_URL` that isn't a URL, a `RATE_LIMITS` other than
`on` or `off`, or any of [how it shows itself](#how-it-shows-itself)
that isn't as that says.
It takes the others as given. In a comma-separated list, it trims each
item of spaces and a trailing `/`.

| Variable | What it is | Default |
| --- | --- | --- |
| `PORT` | the port it listens on, or `0` for any free one | `2600` |
| `PUBLIC_URL` | its origin, an `http` or `https` address with no path. On `https`, the host asks a server that someone else names (a `did:web`'s host, a handle's, the PDS or service a DID document names, an OAuth client's metadata, a syncer's endpoint, a group's own domain) only over `https`, at public addresses, and follows no redirect. On `http`, it takes itself to be on a network of test servers, and asks those over `http` too, at any address | `http://localhost:<PORT>` |
| `SERVICE_DID` | its own DID | `did:web:` of `PUBLIC_URL`'s host, a port as `%3A` |
| `HANDLE_DOMAIN` | the domain it makes groups' handles under, with its leading dot | `.test` |
| `DATA_DIR` | where it keeps its database (`host.sqlite`), blobs and keys (`host-secrets.json`), the lines it logged (`logs.sqlite`) and its usage counts (`stats.sqlite`) | `data` |
| `PLC_URL` | the PLC directory it publishes groups' `did:plc`s to | `https://plc.directory` |
| `DID_WEB_SCHEME` | how it reads a `did:web`'s document and a handle's `/.well-known/atproto-did` (`https`, or `http` for test servers, where it also takes any name, as `127.0.0.1:2584`, for a handle). A host whose `PUBLIC_URL` is `https` reads a `did:web`'s or a handle's own host over `https` alone, whatever this says | `https` |
| `DID_WEB_HOSTS` | where it reads the documents of some `did:web`s instead of at their own host, as comma-separated `host=address` pairs, for test servers (`grain.social=127.0.0.1:2584`) | none |
| `HANDLE_RESOLVERS` | how it resolves a handle, trying each in turn until one names a DID: `well-known` for the handle's own `/.well-known/atproto-did` (over the scheme `DID_WEB_SCHEME` says), or a service answering `com.atproto.identity.resolveHandle` (which reads its DNS record). It asks a handle's own host as `PUBLIC_URL` says, and a service as it's set. It drops a trailing `/`. Whose a handle is, it keeps five minutes, but asks again to check a group's own domain or an account moving here | `well-known,https://public.api.bsky.app` |
| `DNS_SERVERS` | the DNS servers, as comma-separated addresses with their ports, it asks for the `_lexicon` TXT record of another app's permission set that an app signing in as a group asks for ([signing in](../design/signing-in.md#narrowing-at-approval)). It reads the set from its publisher's repo as `com.atproto.sync.getRecord` proves it | `1.1.1.1:53,8.8.8.8:53` |
| `GROUP_FOUNDERS` | who the host starts groups for, as comma-separated DIDs, by `createGroup`, `provisionGroup`, or moving a group or an account here | anyone |
| `BLOB_UPLOAD_LIMIT` | the most bytes one blob may be, whether uploaded or brought with a group, an account or a space. `describeServer` answers it | 52428800 (50 MiB) |
| `CONSOLE_URL` | where the console is. The host sends a member there to approve an app or an MCP client (`/authorize`). It's the console's OAuth client id and callbacks when people sign in (`/console/…`) and the one `Origin` the host takes its session cookie from. People sign in only where it's `https` at a public name: anywhere else, its client metadata answers 500. When it's `https`, the cookie is `Secure` and named `__Host-` | `PUBLIC_URL` |
| `PROVISIONING_CLIENTS` | the apps the host makes groups for with `provisionGroup`, as comma-separated OAuth client ids. It matches each as written, a trailing `/` included. `*` allows any | none |
| `ACTOR_SEARCH` | where `searchActors` looks up a handle as someone types it. `plc` reads the handles in `PLC_URL`'s own export a page at a time and keeps them a minute. Otherwise it's the URL of a service answering `tech.waow.typeahead.searchActors` | typeahead.waow.tech's when `PLC_URL` is `https://plc.directory`, else `plc` |
| `SIGNUP_PDS` | the PDS where someone without an account makes one, from the console's "Create one", through its authorization server's sign-up (`prompt=create`). It drops a trailing `/` | `https://bsky.social` |
| `DOMAIN_CHECK_AT` | where the host checks that a group's own domain reaches this host before it serves the group there. It asks this URL in the domain's place, with the domain as its `Host`. Use it when a host can't reach its own public addresses | the domain itself, over https |
| `PDS_CRAWLERS` | relays the host asks to read its firehose with `requestCrawl`, comma-separated, a trailing `/` dropped. It asks them as it starts, before it writes anything, and every 20 minutes after, whether or not it wrote anything ([how relays hear of a group](../design/groups.md#how-relays-hear-of-a-group)) | none |
| `RUST_LOG` | what it logs, as `tracing-subscriber`'s filter reads it. Lines are JSON, written to stdout and kept in `logs.sqlite` for its operators | `info` |
| `HOST_ADMINS` | its operators, as comma-separated DIDs. These accounts may read its logs (`getLogs`) and how it's used (`getStats`) | none |
| `LOGS_KEEP` | how many lines logged at info and below it keeps to read back. It keeps a warning or an error the full 30 days, which is the most it keeps any line | 500000 |
| `RATE_LIMITS` | whether it limits how much one caller asks, `on` or `off` ([limits](../design/limits.md)). Turn it off only where every caller is yours, as on a test network where one address asks for everyone | `on` |

It stops on SIGTERM or ctrl-c, and finishes the requests under way
first.

`group-host move-host` reads the same environment, which then names the
new address.

The console reads `GROUP_HOST`, the host it asks (default
`http://127.0.0.1:2600`). Once built (`node build`), it also reads
what SvelteKit's Node adapter reads. That's `ORIGIN`, the address people
reach it at, and `BODY_SIZE_LIMIT`, the most a request it hands on may
carry (512K by default). Set `BODY_SIZE_LIMIT` to at least
`BLOB_UPLOAD_LIMIT`, or the console refuses a larger upload before the
host sees it.

The `atgrp` command reads its own: `ATGRP_AS` and
`ATGRP_PASSWORD` (who it signs in as), `PDS_URL` (where),
`ATGRP_HOST` and `ATGRP_HOST_DID` (the host it asks),
`ATGRP_SEED_INVITE` (who `group seed` invites),
`ATGRP_IMPORT_PASSWORD` (the account `account import` moves). See
[the commands](cli.md#atgrp).

## How it shows itself

The console, and the host as a PDS describes itself
(`describeServer`), show what the operator sets of these. Each is
optional: unset, or set to nothing but spaces, the console calls itself
Atmosphere Groups and shows no logo or links. The console reads them from
the host (`getBrand`), so they are set on the host alone.

| Variable | What it is |
| --- | --- |
| `SERVICE_NAME` | the host's name, at most 40 characters, in the console's header, its pages' titles and its footer ("Riverside Groups runs Atmosphere Groups at groups.example.com") |
| `LOGO_URL` | an `http` or `https` URL of its logo, a PNG, JPEG, GIF or WebP image of at most 256 KiB, never SVG. The host reads it as it reads an app's logo, and serves it at `/img/host`, so a reader's browser never asks the server it's on. It's drawn beside the name in the header, at 28 pixels high: a mark or wordmark on a clear background reads there, an app icon rarely does |
| `HOME_URL`, `PRIVACY_POLICY_URL`, `TERMS_OF_SERVICE_URL`, `SUPPORT_URL` | `http` or `https` URLs of the operator's pages, linked from the console's footer and from the foot of the page an app's request is approved on. `describeServer` names the privacy policy and terms of service in its `links` |
| `CONTACT_EMAIL` | an email address for the operator, which `describeServer` gives as its `contact` |
| `BACKGROUND_LIGHT_URL`, `BACKGROUND_DARK_URL` | `http` or `https` URLs of the pictures behind the card an app's request is approved on, by the reader's colour scheme, either standing in for the other when one is unset. Each is a PNG, JPEG, GIF or WebP image of at most 2 MiB, read as the logo is and served at `/img/background-light` and `/img/background-dark`. It's drawn to cover the screen, cut at its edges, under an opaque card: one about 2000 pixels wide, with nothing that matters at its edges, reads at any size |
| `PRIMARY_COLOR` | the colour of what acts on the console's pages, its buttons, links and marks, as `#rgb` or `#rrggbb`. Their hover, the soft wash behind what they mark and the line under links are mixed from it, and the text on a button is white or the page's ink, whichever reads better on it |
| `PRIMARY_COLOR_DARK` | the same in a dark colour scheme. Unset, it's `PRIMARY_COLOR` lifted to a lightness dark ink reads on |
| `PALETTE` | the console's colours for everything else, its paper, cards, lines and ink: `paper`, its own warm palette, or a gray faintly tinted toward a hue, to go with a `PRIMARY_COLOR` near it: `slate` (blue, indigo, cyan), `neutral` (no tint, any colour), `sage` (green, teal) or `mauve` (purple, violet, pink). Every palette has the same contrast between its text and its surfaces |

Whether a page is light or dark is the reader's, not the operator's: as
their device has it, or as they choose under Appearance in the menu under
their handle. The console keeps a choice in a cookie of its own,
`appearance` (`light` or `dark`), for a year, and draws every page in it
from its first byte.