Lets a deployment configure the server through the GERBEUR_* environment variables, which it reads once at import, and holds the fixed limits the backend applies. The deno tasks load .env with --env-file, so changing a setting needs a restart.

Type Aliases

T
BandcampPlayer = "embed" | "native"

How the frontend plays Bandcamp. "embed" uses Bandcamp's iframe, which can't autoplay. "native" resolves the page's streams through GET /api/bandcamp/tracks and plays them in the app's player, which autoplays and queues an album's tracks.

Variables

v
ALLOWED_ORIGINS: string[]

The origins that CORS in main.ts and the WebSocket route accept. They are PUBLIC_URL, FRONTEND_URL and the comma-separated GERBEUR_ALLOWED_ORIGINS.

v
ATTACHMENTS_DIR: string

Holds the images pasted into chat messages, comments, dump notes and descriptions. The startup tasks purge those nothing links to.

v
AVATARS_DIR: string

Holds each user's avatar.

v
BANDCAMP_PLAYER: BandcampPlayer

How the frontend plays Bandcamp (GERBEUR_BANDCAMP_PLAYER), passed to it in index.html. Any value but "native" means "embed", so a typo falls back to the player that always works.

v
COMMUNITY_REFRESH_MINUTES: number

How often, in minutes, the /community page's figures are recomputed (GERBEUR_COMMUNITY_REFRESH_MINUTES), 15 by default.

v
DB_PATH: string

The SQLite database file (GERBEUR_DB_PATH). api/test/setup.ts points it at a throwaway file before anything opens the database.

v
DEFAULT_STYLE: StyleName

The instance's style (GERBEUR_DEFAULT_STYLE). The site shows it until a visitor or their account picks one, through index.html, and the emails that aren't a user's own (the welcome and the password reset) are drawn in it. A value that isn't a style means BASE_STYLE.

v
DUMP_ALLOWED_MIME_PREFIXES: string[]

The MIME type prefixes a file dump may have. dump-service also accepts the exact types of DUMP_ALLOWED_MIME_TYPES.

v
DUMP_ALLOWED_MIME_TYPES: Set<string>

The documents and archives a file dump may be, beyond the prefixes.

v
DUMPS_DIR: string

Holds the file of each file dump.

v
EMAIL_ENABLED: boolean

Whether the instance sends email, which is whether SMTPS_URL is set. email-service.ts opens its transport by it, and index.html tells the client, whose settings show the digest switches disabled without it.

v
EMAIL_LOCALE: Locale

The language of every email (GERBEUR_EMAIL_LOCALE). The interface picks each visitor's language in their browser, which the server never learns, so the emails take the instance's. A value that isn't a locale means the source one, English.

v
v
FEDERATION_ALLOW_PRIVATE: boolean

Lets federated sign-in reach instances on private addresses, localhost among them, and over plain http (GERBEUR_FEDERATION_ALLOW_PRIVATE=1), so that two instances on one machine can trust each other in development. Off, remote/gerbeur-instance.ts reaches only public https instances, since an identity is only as safe as the connection it came over.

v
FROM_EMAIL: string

The From address of every email (GERBEUR_FROM_EMAIL), as an address or as Name <address>. email-service.ts refuses to load without it when SMTPS_URL is set.

v
FRONTEND_URL: string

Points password reset links and the Open Graph tags' page URLs at the frontend when it isn't served from PUBLIC_URL, as with a separate Vite server, and allows it as an origin. It is GERBEUR_FRONTEND_URL, without a trailing slash.

v
JWT_SECRET: string

The key lib/jwt.ts signs and verifies tokens with (GERBEUR_JWT_SECRET). The server refuses to start without it.

v
LISTEN_HOST: string

The interface the server binds to (GERBEUR_LISTEN_HOST). The default, 0.0.0.0, lets Docker forward the port; 127.0.0.1 keeps it to loopback.

v
MAX_IMAGE_SIZE_BYTES: number

Caps the size of an image upload, in bytes, for avatars, covers, thumbnails and attachments. lib/upload.ts states it in megabytes in its error.

v
OG_SITE_NAME: string

The site's name (GERBEUR_SITE_NAME). It is filled into index.html, the OG tags, the icons' manifest and the emails.

v
ORPHANED_ATTACHMENTS_RETENTION_HOURS: 1

How long an attachment nothing links to is kept before startup purges it.

v
PAGINATION_DEFAULT_LIMIT: 20

The page size when a request names none.

v
PAGINATION_MAX_LIMIT: 100

The largest page size a request may ask for.

v
PLAYLIST_IMAGES_DIR: string

Holds each playlist's cover.

v
PORT: number

The port the server listens on (GERBEUR_PORT, default 8000).

v
PUBLIC_URL: string

The URL visitors reach the server at (GERBEUR_PUBLIC_URL), without a trailing slash. Behind a reverse proxy it must be the outside URL: it is an allowed origin, it tells links to this site's own pages from other links, and it prefixes the image URLs in their previews.

v
SCALED_DIR: string

Holds the scaled-down copies of the images above, which lib/ffmpeg.ts makes as they are first asked for, each at its upload's path with its width. It can be emptied at any time: the copies are made again.

v
SITE_EMOJI: string

The emoji that serves as the site's logo (GERBEUR_SITE_EMOJI). The icons script draws the favicons from it, and index.html carries it to the app's header, so changing it needs a restart but no rebuild.

v
SMTPS_URL: string

The smtps:// URL of the server email-service.ts sends mail through (GERBEUR_SMTPS_URL). When it is empty, no email is sent: sign-up sends no welcome, a password reset request does nothing, and there are no digests.

v
THEME_COLOR: "#111827"

The background of the generated Apple touch icon, the manifest's colors, and the accent of previews of this site's own pages. index.html's theme-color tags don't follow it.

v
THUMBNAILS_DIR: string

Holds the thumbnails a poster uploads (<id>-custom) and those the thumbnails route generates from file dumps.

v
UNUSED_INVITES_RETENTION_DAYS: 7

How long an invite stays usable. invite-service refuses an older one, and the startup tasks purge it.

v
UPLOADS_DIR: string

The directory uploads are stored under (GERBEUR_UPLOADS_DIR). Each kind has its subdirectory below, created by the first upload, and each file is named after the id of what it belongs to.

v
WELCOME_EMAIL_BODY: string | null

The Markdown of the welcome email sent on registration (GERBEUR_WELCOME_EMAIL_BODY), or null for the built-in one in the EMAIL_LOCALE. api/mail/welcome.ts replaces {{site_name}} and {{username}} in it.