Skip to content
Peal
Esc
↑↓navigate↵open⌘Jpreview
On this page

Environment variables

Every environment variable the Peal server, the web app and the command line read, whether it is required, its default, and what it does.

The server, the web app and the command line read plain environment variables, so you can run them on any host. The values on this page are examples.

The server runs in production mode when NODE_ENV is production, which its image sets. In production, a setting marked “required in production” has no default, and the server won’t start without it. Elsewhere it defaults to the development stack, so a server you run from source needs only DATABASE_URL.

Server

Core

The server needs DATABASE_URL to start, and PUBLIC_URL too in production. The rest are optional:

Variable Default What it does
DATABASE_URL none: required The Postgres database, such as postgres://peal:secret@postgres:5432/peal. Connect directly, or through a pooler in session mode. Never use a pooler in transaction mode.
DATABASE_POOL_MAX 20 How many database connections each server process opens at most, for the API and the jobs. Raise it with the number of requests, keeping every process’s connections, AUTH_DB_POOL_MAX included, under Postgres’s max_connections (100 by default). A value that isn’t a whole number from 1 to 1,000 stops the server at startup.
PUBLIC_URL required in production; http://localhost:3001 The address people open Peal at, which is the web app’s, such as https://peal.example.com. Peal builds the links in emails, sign-in, the platforms’ redirects and the MCP endpoint’s address from its origin. MCP clients can sign in only when it’s HTTPS, or on a loopback host such as localhost. If you change it, give the platforms their new addresses (Addresses to register).
NODE_ENV development production turns on production mode, with required settings, sign-in rate limits and no development defaults.
PORT 3000 The port the HTTP server listens on.
HOSTNAME peal-server The server’s name among the job runners recorded in the database. Each server process needs its own. Docker sets it to the container id.
PEAL_CLUSTER_RETENTION 30 days How long Peal keeps the records of finished jobs, such as a published post’s, before a daily cleanup deletes them. Write it as a duration, such as 7 days. Jobs still waiting are always kept.
PEAL_ANALYTICS_CONCURRENCY 16 How many channels the hourly collections of post counts and of accounts’ followers each read at the same time, with one call at a time per channel. Use a value from 1 to 256. Any other value stops the server. A run stops 50 minutes after its scheduled time and leaves the rest to the next one. Raise this when the server logs that the collection couldn’t finish and the metric peal.analytics.collection.left stays above zero.
PEAL_ENGAGEMENT_CONCURRENCY 8 How many channels the collection of comments, which runs every ten minutes, reads at the same time, with one call at a time per channel. Use a value from 1 to 256. Any other value stops the server. A run stops 8 minutes after its scheduled time and leaves the rest to the next one. Raise this when the server logs that the comments collection couldn’t finish before the next run.
PEAL_ENGAGEMENT_WINDOW_DAYS 30 How many days after a post goes live Peal reads the comments under it, from 1 to 90. Any other value stops the server. Each thread is deleted 30 days after its window ends. Comments are other people’s personal data, so a longer window keeps them longer, and your privacy policy should say so. See Inbox.
PEAL_INBOX_PLATFORMS unset The platforms whose comments the inbox reads besides Mastodon and Bluesky, comma-separated, among facebook, instagram, youtube, linkedin and googleBusiness. Unset or empty, it reads none. Posts on a platform listed here can also carry a first comment, which takes the same permission. The platform’s sign-ins then ask for the comment permissions, as optional. Meta grants them for accounts other than your own app’s people only after its App Review, and Google only once it has verified your app for youtube.force-ssl. Each platform needs its app: facebook needs META_APP_ID and META_APP_SECRET, instagram needs them or INSTAGRAM_APP_ID and INSTAGRAM_APP_SECRET, and youtube needs YOUTUBE_CLIENT_ID and YOUTUBE_CLIENT_SECRET. linkedin (company pages only) needs LINKEDIN_PAGES_CLIENT_ID and LINKEDIN_PAGES_CLIENT_SECRET, on an app LinkedIn granted the comment scopes, or LinkedIn refuses every pages sign-in. googleBusiness reads the reviews of Google Business Profile locations. It needs GOOGLE_BUSINESS_CLIENT_ID and GOOGLE_BUSINESS_CLIENT_SECRET, on a project Google gave access to the Business Profile APIs (the quota is zero until then), and its sign-in asks for nothing more. If you take a platform out, a post already scheduled there with a first comment is refused when its time comes, before anything goes out. Taking linkedin out also forgets, within a day, the member who connected each page, so once it’s back each page’s calls are counted on their own until the page is reconnected. Any other name, or a platform without its app, stops the server at startup.
PEAL_INBOX_MESSAGES unset The platforms whose direct messages the inbox reads and answers, comma-separated, among mastodon, bluesky, facebook (Pages’ Messenger) and instagram. Unset or empty, none, because messages are private correspondence that Peal reads only once you say so. With bluesky, Peal can ask for the chat methods’ scopes, in its client metadata, and with facebook and instagram for Meta’s messaging permissions. A sign-in asks for them only when a member turns a channel’s messages on, which reconnects the account. facebook needs Meta’s main app (META_APP_ID, META_APP_SECRET), instagram either of its ways in, and both need META_WEBHOOK_VERIFY_TOKEN, or the server stops at startup. Meta grants their permissions for the accounts of people without a role on the app only after its App Review (Meta). Even then, Peal reads a channel’s messages only once a member of its workspace turns them on for it. On facebook and instagram, that also lets members send a comment’s author its one private reply. Peal keeps each message 30 days after it was sent. It deletes a channel’s conversations at once when its messages are turned off or the channel is disconnected. Any other name stops the server at startup.
PEAL_META_HUMAN_AGENT false true once Meta’s App Review has granted the server’s Meta app its Human Agent feature, which also takes business verification. A member signed in to Peal’s web app can then answer a Messenger or Instagram direct message by hand until 7 days after the person’s last message, past Meta’s 24 hours. The answer goes out with Meta’s HUMAN_AGENT tag. An API key, an application (the command line, an AI assistant), staff acting as a member and a rule can never send one. It does nothing while PEAL_INBOX_MESSAGES names neither facebook nor instagram. Leave it unset until Meta has reviewed the feature, because Meta refuses the tagged messages before that. Unset or empty, off. Any value other than true or false (1, on, yes…) stops the server at startup.
PEAL_API_REQUESTS_PER_MINUTE 600 How many requests a minute each API key may send to the API and the MCP endpoint together, and each OAuth application for each user it acts for. Use a positive integer. Sessions of the web app aren’t counted. On a server that bills, this is the limit for billing accounts with a payment method or a plan priced by channels. A billing account without a payment method gets the rate card’s 60, and staff can give a workspace its own limit. Every answer says what’s left in the RateLimit headers, and past the limit the server answers 429 (Rate limits). A value that isn’t a positive integer stops the server at startup.
PEAL_DOCS_URL unset The address of your copy of this documentation, such as https://docs.example.com. With it, the documents that tell programs where the API and the MCP endpoint are (/.well-known/api-catalog and /llms.txt) link to its pages. Without it, they link to no documentation (Discovery). A value that isn’t a URL stops the server at startup.
PEAL_LEGAL_RETENTION false Whether the server keeps what French law has a host keep to identify whoever contributed content. That’s the connections that create, change or delete content (1 year). Once an account closes, it’s also the holder’s name and address (5 years) and how they signed in (1 year), which only a legal request can read. Set it to true if you’re established in France, or offer your Peal there, and you store content for other people. Otherwise leave it off. Legal retention says who must turn it on, and what turning it off again does.
PEAL_PRIVACY_DECLARATION_FILE none The path of a JSON file that declares what only you know about your processing: who the controller is and how to reach them, your privacy policy’s address, the providers you use and your supervisory authority. Each user’s data export repeats it (Privacy declaration). Unset, the export says that none was declared. A file that’s missing or malformed stops the server. The Compose stack sets it, and mounts the file that PEAL_PRIVACY_DECLARATION names.

Sign-in

These settings cover sessions, sign-in and who can make an account:

Variable Default What it does
BETTER_AUTH_SECRET required in production; a development secret Signs sessions and encrypts what sign-in stores. Use at least 32 random characters, such as the output of openssl rand -base64 32. Anyone who has it can sign in as anyone, so keep it secret. It also encrypts the keys and recovery codes of two-step verification. If you replace it, keep the old one in BETTER_AUTH_SECRETS. Without it, those keys can’t be read, and nobody who has two-step verification on can sign in until staff reset it.
BETTER_AUTH_SECRETS unset Rotates the secret. List version:secret entries separated by commas, newest first, such as 2:<new>,1:<old>. Better Auth reads it itself. When it’s set, Better Auth uses the first entry’s secret, and the others, with BETTER_AUTH_SECRET, still decrypt what older secrets encrypted.
AUTH_IP_HEADERS required in production; x-forwarded-for The headers, separated by commas, that carry the client’s address. Sign-in rate limits and the web app’s error reports count by that address. Name only a header your edge sets and replaces: cf-connecting-ip behind Cloudflare, x-forwarded-for behind Caddy. The docs server reads it too, for its assistant’s rate limit (ten questions each ten minutes per IPv4 address or IPv6 /64), and so does the web app, for the address it relays with a site’s events (PEAL_POSTHOG_SITE). See In front of Peal.
AUTH_TRUSTED_PROXIES none The addresses or CIDR ranges, separated by commas, of proxies that append to X-Forwarded-For. Peal then reads the client’s address from the right, past them.
TRUSTED_ORIGINS none Origins besides PUBLIC_URL, separated by commas, that may send signed-in requests that change something. media-cors also lets them upload media.
AUTH_REQUIRE_EMAIL_VERIFICATION true false lets people sign in before they confirm their email address. Nobody has then proven an address: anyone can register any address, and its real owner takes the account back with a password reset.
AUTH_DB_POOL_MAX 5 How many database connections sign-in opens, on top of the server’s (DATABASE_POOL_MAX).
MCP_DYNAMIC_REGISTRATION false true lets MCP clients register themselves, which most of them need before they can sign in. Anyone can then register a client under any name, and the consent page says that Peal hasn’t checked it.
PEAL_PARTNER_SELF_SERVICE false true lets the owners and admins of any workspace open a partner account for it themselves, in its settings. Unset or false, only staff open one, from the staff console. Another value stops the server.
PEAL_STAFF_TWO_STEP false true refuses the staff console to staff whose own account doesn’t have two-step verification on. Anyone else still finds no console. Members turn two-step verification on themselves, and owners can require it in a workspace, without any setting. Another value stops the server.
PEAL_SIGN_UP open Who can make an account. open lets anyone. invitation lets in only someone who opens a pending invitation’s link and signs up with the address it went to, and the first account of a server that has none (Who may sign up). Another value stops the server.

Better Auth also reads BETTER_AUTH_TRUSTED_ORIGINS, which adds origins the way TRUSTED_ORIGINS does. Use TRUSTED_ORIGINS instead, because media-cors reads it too.

Sign-in providers

Each provider is off until you set its settings, and a group set only in part stops the server (Single sign-on). A provider takes these settings:

Variable Default What it does
PEAL_OIDC_ISSUER unset: no provider Your OpenID Connect provider’s issuer, an https:// URL. Use http:// only on a loopback host, to try it on one machine. Peal reads <issuer>/.well-known/openid-configuration. Identities are kept under the issuer, so after a change people join their accounts again by a confirmed address (Changing the provider).
PEAL_OIDC_CLIENT_ID unset The client ID you registered at the provider, with the redirect URI <PUBLIC_URL>/api/auth/callback/oidc.
PEAL_OIDC_CLIENT_SECRET unset Its secret. Keep it secret.
PEAL_OIDC_NAME Single sign-on The name the button shows after “Continue with”. One line, 40 characters at most.
PEAL_OIDC_SCOPES openid email profile The scopes Peal asks for, separated by spaces. They must include openid and email.
GOOGLE_SIGN_IN_CLIENT_ID unset: no Google The client ID of a Google OAuth client of type “Web application”, with the redirect URI <PUBLIC_URL>/api/auth/callback/google. With the secret, the sign-in and sign-up pages offer Google.
GOOGLE_SIGN_IN_CLIENT_SECRET unset Its secret. Keep it secret.

Email

Peal sends email through Resend when RESEND_API_KEY is set, and over SMTP otherwise:

Variable Default What it does
MAIL_FROM required in production; Peal <[email protected]> The sender, such as Peal <[email protected]>, or any address your mail service lets you send from.
PEAL_MAIL_PERSONAL_FROM unset: MAIL_FROM The sender of the emails a person signs, written as MAIL_FROM is, such as Ada at Example <[email protected]>. Every other email comes from MAIL_FROM. A value that isn’t one address stops the server at startup.
RESEND_API_KEY unset Sends email through Resend’s API. Keep it secret.
SMTP_URL required in production without RESEND_API_KEY; smtp://127.0.0.1:11025 The SMTP server, such as smtp://user:[email protected]:587, or smtps:// for TLS from the first byte. Peal uses it when RESEND_API_KEY is unset. Keep it secret when it holds a password.
PEAL_MAIL_WELCOME_SIGNER unset: no welcome The name that signs the welcome each new account gets once its address is confirmed (Welcome new accounts). One line, 60 characters at most. Anything else stops the server at startup.
PEAL_MAIL_IDENTITY unset: no line Who sends, such as Example SAS, on one line under every email and at the end of its text version. 300 characters at most. A value with a line break, or a longer one, stops the server at startup.
PEAL_MAIL_IDENTITY_FR unset: French readers get PEAL_MAIL_IDENTITY The same line for French readers, in their language. It has the same limits.

Channels

Members can connect a platform once you’ve set its app’s settings. Platform apps shows how to register each app:

Variable Default What it does
PEAL_TOKEN_KEYS unset The keys that encrypt the tokens of connected channels, the signing secrets of webhooks, and the keys of the image and text providers that workspaces bring to the assistant. List keyId:key entries separated by commas, such as k2:<key>,k1:<key>, with each key 32 random bytes in base64 (openssl rand -base64 32). The first key encrypts, and every listed key decrypts. Unset or empty, the server starts, but connecting a channel or adding a webhook endpoint fails. A malformed value stops the server at startup. Keep a copy: without the keys, every channel has to be reconnected, and no webhook delivery can be signed.
PEAL_OUTBOUND_ALLOWED_HOSTS unset Hosts on your own network that members may name, such as a website on a private address. List host names or addresses, separated by commas, with no scheme, port or wildcard, and put an IPv6 address in brackets ([fd00::10]). Peal reaches what members name (a Mastodon server, a website, a feed, an assistant provider) over HTTPS on the default port, and only at public addresses. It reaches a host listed here whatever its address, still over HTTPS on the default port. Everything members name can then reach that host: websites, media imported from a link, Mastodon and Bluesky servers, webhook endpoints, feeds and assistant providers. List only hosts you’d trust every member with, because this is how a request could reach a service inside your network. Anything but host names stops the server at startup, and so does an IPv6 address without its brackets.
BLUESKY_CLIENT_KEYS unset The keys of Peal’s Bluesky client, from bun nx run peal-server:bluesky-key. List keyId:key entries separated by commas, and the first one signs. They need PUBLIC_URL on HTTPS without a port. Without them, only a server on localhost outside production can connect Bluesky, with the development client. A malformed value stops the server at startup.
LINKEDIN_CLIENT_ID unset The client id of the app you registered on LinkedIn, with the OpenID Connect and Share on LinkedIn products (see LinkedIn). With LINKEDIN_CLIENT_SECRET, members can connect LinkedIn. Without both, LinkedIn isn’t offered. One without the other stops the server at startup.
LINKEDIN_CLIENT_SECRET unset The app’s primary client secret. Keep it secret.
LINKEDIN_PAGES_CLIENT_ID unset The client id of a second LinkedIn app, which has the Community Management API and no other product (see LinkedIn company pages). With LINKEDIN_PAGES_CLIENT_SECRET, members can connect the company pages they administer. Without both, LinkedIn connects profiles only. One without the other stops the server at startup.
LINKEDIN_PAGES_CLIENT_SECRET unset That app’s primary client secret. Keep it secret.
LINKEDIN_API_VERSION 202610 The version of LinkedIn’s API that Peal calls, as YYYYMM. LinkedIn retires a version a year after its release, so set a newer one to move ahead before a Peal release does. A value that isn’t a month stops the server at startup.
LINKEDIN_DAILY_COMMENT_CALLS 200 The calls the inbox may make each UTC day to read LinkedIn pages’ comments, across the pages app. They come out of the Development tier’s 500 a day for every call, posting included. Past the limit, comments wait for the next day. Replies aren’t counted. 0 reads none, and a value that isn’t a whole number stops the server at startup.
LINKEDIN_DAILY_COMMENT_CALLS_PER_MEMBER 40 The same calls for one member, out of the Development tier’s 100 a member. Every page the administrator connected shares them. A page connected before Peal kept who connected it is counted on its own.
META_APP_ID unset The id of Meta’s app, from its dashboard. It connects Facebook Pages, and Instagram professional accounts through Facebook Login. Set it with META_APP_SECRET, or set neither: Facebook Pages and Instagram through Facebook Login are offered only when both are set. One without the other stops the server at startup.
META_APP_SECRET unset That app’s secret. It also signs every Facebook call and every Instagram call through Facebook Login or a business portfolio (appsecret_proof), and checks Meta’s data deletion and deauthorization requests. Keep it secret.
META_INSTAGRAM_CONFIG_ID unset The id of a Facebook Login for Business configuration on Meta’s app, for Instagram through Meta’s Unified login (the Instagram use case’s API setup with Unified login; see Threads, Instagram and Facebook Pages). The configuration holds what the sign-in asks for: make it for Instagram accounts, with a system user token that never expires and instagram_basic, instagram_content_publish, instagram_manage_insights and instagram_manage_comments among its permissions. With it, members connect the Instagram professional accounts a business portfolio shares, signing in with Instagram or Facebook, without a Facebook Page, and that way comes first. It isn’t a secret: it’s in the sign-in’s address. It needs META_APP_ID and META_APP_SECRET: without them, or set to anything but digits, it stops the server at startup.
INSTAGRAM_APP_ID unset The Instagram app id of the same app, for the Instagram API with Instagram Login (see Threads, Instagram and Facebook Pages). The business login settings of the app’s Instagram use case show it apart from the main id. Set it with INSTAGRAM_APP_SECRET, or set neither. With both, members connect Instagram professional accounts on Instagram, without a Facebook Page, and that way comes before Facebook Login. One without the other stops the server at startup.
INSTAGRAM_APP_SECRET unset The Instagram app secret, which also checks Instagram’s data deletion and deauthorization requests. Keep it secret.
META_WEBHOOK_VERIFY_TOKEN unset The Verify Token you type in the Webhooks settings of Meta’s apps, at least 32 characters (openssl rand -hex 32). Meta sends it back once to check that PUBLIC_URL/api/platform-events/meta/facebook (the main app) and /instagram (Instagram Login) are your server’s. After that, Peal checks each event at those addresses with its app’s secret before reading anything from it. For Instagram Login, that’s INSTAGRAM_APP_SECRET or META_APP_SECRET, because Meta’s pages don’t say which one signs it. An event Meta sent more than a day ago is left out. The addresses must answer Meta with no login page in front of them. Unset or empty, the server takes no event from Meta, and both addresses answer 404. A shorter value stops the server at startup. Keep it secret.
THREADS_APP_ID unset The Threads app id of the same app, which its Threads use case shows apart from the main id. Set it with THREADS_APP_SECRET, or set neither: Threads is offered only when both are set.
THREADS_APP_SECRET unset The Threads app secret, which also checks Threads’ data deletion requests. Keep it secret.
PINTEREST_APP_ID unset The id of the app you registered on Pinterest’s developer site (see Pinterest). With PINTEREST_APP_SECRET, members can connect Pinterest accounts. Without both, Pinterest isn’t offered. One without the other stops the server at startup.
PINTEREST_APP_SECRET unset The app’s secret key. Keep it secret.
PINTEREST_SANDBOX false true sends every Pinterest call to Pinterest’s Sandbox (api-sandbox.pinterest.com), where an app with Trial access creates boards and Pins that only their creator sees. Unset it once Pinterest grants the app Standard access. Accounts connected in the Sandbox then have to be connected again.
WORDPRESS_COM_CLIENT_ID unset The client ID of the application you registered on WordPress.com (see WordPress.com). With WORDPRESS_COM_CLIENT_SECRET, members can connect sites on WordPress.com. Without both, WordPress.com isn’t offered. One without the other stops the server at startup.
WORDPRESS_COM_CLIENT_SECRET unset The application’s client secret. Keep it secret.
SLACK_CLIENT_ID unset The client ID of the app you registered on Slack (see Slack). With SLACK_CLIENT_SECRET, members can connect Slack channels. Without both, Slack isn’t offered. One without the other stops the server at startup.
SLACK_CLIENT_SECRET unset The app’s client secret. Keep it secret.
SNAPCHAT_CLIENT_ID unset The client id of the OAuth app you made in Snap’s Business Manager (see Snapchat). With SNAPCHAT_CLIENT_SECRET, members can connect Snapchat once Snap has allowlisted the id. Without both, Snapchat isn’t offered. One without the other stops the server at startup.
SNAPCHAT_CLIENT_SECRET unset The app’s client secret. Keep it secret.
TIKTOK_CLIENT_KEY unset The client key of the app you registered on TikTok for Developers, with Login Kit, the Content Posting API with Direct Post, and the Display API (see TikTok). With TIKTOK_CLIENT_SECRET, members can connect TikTok. Without both, TikTok isn’t offered. One without the other stops the server at startup.
TIKTOK_CLIENT_SECRET unset The app’s client secret. Keep it secret.
X_CLIENT_ID unset The OAuth 2.0 client id of the app you registered on X, as a web app with read and write permissions (see X). With X_CLIENT_SECRET, members can connect X. Without both, X isn’t offered. One without the other stops the server at startup.
X_CLIENT_SECRET unset The app’s OAuth 2.0 client secret. Keep it secret.
X_ANALYTICS false Whether the server reads counts and followers on X. X bills your app for each post and each account a read returns (pay per use, see X’s pricing), once a UTC day for the same one, so this is off unless you set true. When it’s off, X channels have no analytics, and their capabilities say so.
X_ANALYTICS_DAILY_READS 500 With X_ANALYTICS on a server that doesn’t bill, how many posts and accounts each workspace may read on X per UTC day. Reading the same one again that day isn’t counted twice. Past the limit, reads wait for the next day. A server that bills reads X only for the workspaces that turned X’s reads on, and bills each read at X’s rates within the account’s ceiling. The metric peal.analytics.paid_reads counts what was read, by platform. 0 reads nothing, and a value that isn’t a whole number stops the server at startup.
X_THREADS true Whether the server sends a post’s later parts to X, as a thread. X documents that an app on self-serve access may post a reply only under a post whose author mentioned or quoted the replying account. It says nothing about a reply to the account’s own post. If X refuses your app the second part of a thread, the post is partly published, with the reason that X doesn’t allow this app to post replies. Set false, and X takes a post on its own: scheduling refuses parts there, and the capabilities say so. To find out which applies to your app, schedule a post of two parts on an X account you own, and look at its page once it has gone out.
YOUTUBE_CLIENT_ID unset The client id of the web application OAuth client you made in a Google Cloud project with the YouTube Data API v3 turned on (see YouTube). With YOUTUBE_CLIENT_SECRET, members can connect YouTube channels. Without both, YouTube isn’t offered. One without the other stops the server at startup.
YOUTUBE_CLIENT_SECRET unset That client’s secret. Keep it secret.
YOUTUBE_DAILY_COMMENT_UNITS 3000 The units of the Google project’s general quota that the inbox may spend reading YouTube comments each day, across every channel, at one unit a page. Days start at midnight Pacific Time. Past the limit, or once YouTube says the quota is spent, comments wait for the next day. Replies, hides and withdrawals don’t count toward it. 0 reads none, and a value that isn’t a whole number stops the server at startup.
YOUTUBE_DAILY_THUMBNAILS 80 How many custom thumbnails the server sets on YouTube videos each day, across every channel. Days start at midnight Pacific Time. Each thumbnail draws about 50 units of the Google project’s general quota (10,000 a day unless Google grants more), so the default takes about 4,000. With the 3,000 for comment reads (YOUTUBE_DAILY_COMMENT_UNITS), that leaves 3,000 for everything else. Past the limit, a video goes out with the thumbnail YouTube picks, and its post says so. 0 sets none, and a value that isn’t a whole number stops the server at startup.
YOUTUBE_DAILY_UPLOADS 100 How many videos the server uploads to YouTube each day, across every channel. It counts in units of the Google project’s Video Uploads quota, where an upload costs one, and days start at midnight Pacific Time. Past the limit, an upload waits for the next day. Raise it when Google grants the project more. 0 uploads nothing, and a value that isn’t a whole number stops the server at startup.
GOOGLE_BUSINESS_CLIENT_ID unset The client id of the web application OAuth client you made in the Google Cloud project that Google gave access to the Business Profile APIs (see Google Business Profile). With GOOGLE_BUSINESS_CLIENT_SECRET, members can connect Business Profile locations. Without both, Google Business Profile isn’t offered. One without the other stops the server at startup. A project that also has the YouTube Data API can use the same client as YOUTUBE_CLIENT_ID.
GOOGLE_BUSINESS_CLIENT_SECRET unset That client’s secret. Keep it secret.

Media

Media goes in an S3-compatible store. These settings say where, and when the server cleans it up:

Variable Default What it does
PEAL_S3_ENDPOINT required in production; http://127.0.0.1:18333 The URL of the S3 API that stores media, such as https://<account>.eu.r2.cloudflarestorage.com for a bucket in R2’s EU jurisdiction. You choose that jurisdiction when you create the bucket.
PEAL_S3_BUCKET required in production; peal-media The bucket media goes in.
PEAL_S3_ACCESS_KEY_ID required in production; the development key The store’s access key. Keep it secret.
PEAL_S3_SECRET_ACCESS_KEY required in production; the development secret That key’s secret. Keep it secret.
PEAL_S3_REGION auto The region requests are signed for, such as eu-west-1. auto suits Cloudflare R2.
PEAL_S3_FORCE_PATH_STYLE false in production; true otherwise true puts the bucket in the URL’s path instead of its host name, which SeaweedFS needs.
PEAL_S3_KEY_PREFIX none A folder that every key goes under, such as staging/, so several instances can share a bucket. It ends with /.
PEAL_MEDIA_PUBLIC_BASE_URL unset Where the bucket is served publicly, if it is, such as https://media.example.com. Unset, pages read media through short-lived signed links.
PEAL_ERASURE_LEDGER_BUCKET the media bucket The bucket where the server keeps its ledger of erasures, under erasures/. It must be on the same store, reachable with the same key. The ledger holds the id and time of each deleted account and workspace, so they’re deleted again after a backup is restored (Deletions and backups). Name a private bucket of its own when the media bucket is served publicly.
TIKTOK_MEDIA_URL_PREFIX unset The URL prefix you verified for the TikTok app, or https:// and a domain with a /, under which PEAL_MEDIA_PUBLIC_BASE_URL serves the store, such as https://media.example.com/. With it, TikTok fetches videos and photos from the store. Without it, videos go up in parts, and TikTok posts with photos are refused. Anything but an HTTPS URL stops the server at startup.
PEAL_FFPROBE_PATH ffprobe The ffprobe program that reads a video’s dimensions, duration and codec. The server’s image ships one at /usr/local/bin/ffprobe. Without it, videos still upload, but nothing reads them.
PEAL_MAX_CONCURRENT_UPLOADS one per GiB of the container’s memory, from 2 to 8 How many large files (videos above 16 MiB) the server sends to platforms at once. It streams each one from the store, holding one part at a time. The others wait their turn and go out as slots free up. Anything but a whole number above 0 stops the server.
PEAL_MEDIA_SWEEPS on in production; off otherwise on runs the hourly sweeps of the media folder below. off stops them all, so nothing is listed or deleted. Turn them off before you start a server on a restored database, until the restore is final (Unfinished uploads). In development, a server on a database of its own beside another’s sets its own PEAL_S3_KEY_PREFIX before turning them on. Anything else stops the server.
PEAL_MEDIA_SWEEP_PENDING_AFTER 1 day How long after it started an upload that was never completed is deleted, with its file, by an hourly sweep (media.pending-sweep). Write it as a duration, such as 2 days. The upload stops counting against the plan’s storage once its links expire, after 6 hours. Under 7 hours stops the server at startup.
PEAL_MEDIA_SWEEP_UPLOADS_AFTER 1 day How long after it started a multipart upload left open in the store is aborted, with the parts it holds, by an hourly sweep (media.upload-sweep). Under 7 hours stops the server at startup. A lifecycle rule on the bucket does the same, as a second guard (Unfinished uploads).
PEAL_MEDIA_SWEEP_ORPHANS_AFTER 1 day How old a file under media/ that no Peal media file holds must be, by the store’s date, before an hourly sweep (media.orphan-sweep) deletes it. One example is a file uploaded with a link signed before its media was deleted. The sweep touches only keys Peal writes. Under 7 hours stops the server at startup.
PEAL_MEDIA_SWEEP_BATCH 500 The most each sweep deletes in one run. What’s left goes in the next run. Anything but a whole number from 1 to 10000 stops the server.
PEAL_MEDIA_SWEEP_ORPHANS_LIMIT 100 The most files that one page of the bucket’s listing may hold with no media in the database holding them. Past it, the orphan sweep stops and deletes nothing on that page. It also stops when more than a fifth of a page of 50 old files or more is unheld. Either case means the database probably isn’t the bucket’s newest one. Anything but a whole number from 1 to 10000 stops the server.
PEAL_MEDIA_SWEEP_PENDING_LIMIT 100 The most workspaces with never-completed uploads that one run of their sweep may find. Past it, the sweep stops and deletes none, because that many at once means a database that lost the completions it once had. One workspace’s backlog never counts for more than one. Raise it for one run to clear a breaker, once you know the database is sound. Anything but a whole number from 1 to 10000 stops the server.

Writing assistant

The writing assistant is off until you set PEAL_AI_PROVIDER, and its images until you set PEAL_AI_IMAGE_PROVIDER:

Variable Default What it does
PEAL_AI_PROVIDER unset: the assistant is off The provider: anthropic, openai, google, mistral, xai, groq, togetherai, deepseek, openrouter, cerebras or fireworks, or openai-compatible for any other endpoint that serves /chat/completions, such as a model server you run. Unset or empty, the web app hides the assistant and its endpoints answer AssistantUnavailable. Any other value stops the server at startup.
PEAL_AI_API_KEY unset The provider’s key. It’s required with every provider but openai-compatible, which needs one only for an endpoint that asks for one. Keep it secret.
PEAL_AI_MODEL claude-opus-5-5 with anthropic The model the assistant asks. Required with every provider but anthropic.
PEAL_AI_BASE_URL the provider’s own API The API’s base URL: for anthropic the one /v1/messages follows, for the others the one /chat/completions follows, such as http://127.0.0.1:8000/v1. Required with openai-compatible. With a named provider, you need it only to go through a proxy. The server calls it directly, so it can be on a private network.
PEAL_AI_IMAGE_PROVIDER unset: no images The image provider: openai, google, xai or togetherai, or openai-compatible for any endpoint that serves /images/generations. That’s the model the assistant makes images with, separate from the writing model. Unset or empty, the web app hides Generate an image and the endpoint answers AssistantUnavailable. Any other value stops the server at startup.
PEAL_AI_IMAGE_BASE_URL the provider’s own API The image API’s base URL. Required with openai-compatible, as the one /images/generations follows. With a named provider, you need it only to go through a proxy. The server calls it directly, so it can be on a private network. When the provider answers with an address, Peal fetches it through the guard that keeps platform calls on public addresses.
PEAL_AI_IMAGE_MODEL unset The image model. Required with a provider.
PEAL_AI_IMAGE_API_KEY unset The image provider’s key. It’s required with every provider but openai-compatible, which needs one only for an endpoint that asks for one. Keep it secret.
PEAL_AI_DAILY_REQUESTS 100 How many requests each workspace may send the assistant per UTC day, on an instance that doesn’t bill. With billing, each plan sets its own. 0 lets none through. A negative or malformed value stops the server at startup.

If you name a provider without the settings it needs, the server stops at startup, and the error names the missing variable. Writing assistant explains the rest.

Ads

Ads are off until you set PEAL_ADS:

Variable Default What it does
PEAL_ADS off What the server offers of ads. off offers nothing. With read, workspaces connect ad accounts and read their campaigns and numbers, and nothing spends. With spend, they can also boost published posts, which spends their money at Meta. Unset or empty means off. read and spend need PEAL_TOKEN_KEYS to encrypt the sign-ins’ tokens, and the app or client of each network in PEAL_ADS_NETWORKS. Any other value stops the server at startup.
PEAL_ADS_NETWORKS meta The ad networks offered while PEAL_ADS is on, separated by commas. meta is Facebook and Instagram, on META_APP_ID and META_APP_SECRET, an app Meta gave ads access. google is Google Ads, read only, on GOOGLE_ADS_CLIENT_ID and GOOGLE_ADS_CLIENT_SECRET. Unset or empty means meta. Any other name stops the server at startup, and so does a network named without its app or client, or PEAL_ADS=spend without meta, because Google Ads is read only.
GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET unset The OAuth client that members sign in to Google Ads with, when PEAL_ADS_NETWORKS names google. It’s a web application client of the Google Cloud project that has the Google Ads API enabled. Set both or neither, because one without the other stops the server at startup. There’s no developer token to set: Google retired them, and it reads the project’s access level instead (Google Ads). Keep GOOGLE_ADS_CLIENT_SECRET secret.

Ads on Meta use Meta’s main app, the one Facebook Pages connect with. What Meta asks of the operator lists the permissions and reviews it takes. Stay on read until Meta has granted the app ads_management.

Google Ads needs a client of its own, and access that Google gives the client’s project. Google Ads shows how to get both.

Short links are off until you give them an address:

Variable Default What it does
PEAL_SHORT_LINK_BASE unset: short links are off Where short links live: an absolute https address ending in / (http outside production), followed by a seven-character code, such as https://go.example.com/ or https://peal.example.com/api/l/. Unset or empty, posts go out as written. Its host must be a public domain that the platforms recognise as a link, because X and Mastodon would otherwise count the short address in full. localhost, an IP address or a name without a known top-level domain stops the server at startup, and so does any other value that isn’t such an address. A domain of its own needs its proxy to send /<code> to /api/l/<code> (Short links). If you change or remove it, the short links already sent stop working.

Billing

Billing is off until you set a Stripe key:

Variable Default What it does
STRIPE_SECRET_KEY unset: billing is off The Stripe API key that bills workspaces, such as sk_live_…. Unset or empty, there are no plans and nothing is limited. Keep it secret.
STRIPE_WEBHOOK_SECRET required with a key The signing secret of the webhook endpoint that sends PUBLIC_URL/api/auth/stripe/webhook the customer.subscription.* events, such as whsec_…. Set without a key, it stops the server. Keep it secret.
STRIPE_METER_WEBHOOK_SECRET unset: refused The signing secret of the Stripe event destination that sends PUBLIC_URL/api/stripe/meter-errors the meter error events, such as whsec_…. Those are v1.billing.meter.error_report_triggered and v1.billing.meter.no_meter_found, as thin events. Unset or empty, the endpoint refuses every event, and nobody hears about meter events that Stripe took but couldn’t count.
STRIPE_LOOKUP_KEY_PREFIX peal The start of the Stripe prices’ lookup keys. The plans’ keys are <prefix>_<plan>_monthly and <prefix>_<plan>_yearly. Per-account pricing’s are <prefix>_accounts, <prefix>_outbound_messages…, which are also its meters’ event names. stripe-catalogue reads it too. Use lowercase letters, digits and underscores, 81 characters at most, so a meter’s event name stays within Stripe’s 100. Another value stops the server at startup.
PEAL_BILLING_GRACE_UNTIL unset: no grace A day, such as 2027-01-31. Until its first instant (UTC), a workspace on the free tier that holds more connected accounts than the tier includes still schedules and publishes on the accounts it had connected before the server first ran with a grace, whatever day the grace was set to. Every workspace made before billing was turned on may be in that case. It can’t connect more, and its billing managers are told once. The grace never covers an account connected since, even when the day is moved later, nor a billing account that staff required a payment method of. A billing account whose subscription ends during the grace keeps the accounts it had connected before. After the day, nothing is published until a payment method is added or the extra accounts are disconnected. Set it before you turn billing on, and before you upgrade a server that billed on the plans priced by channels, whose free plan held 3 accounts. Without it, those workspaces stop publishing at once, and the server warns at startup. Unset or empty, there’s no grace. Another value stops the server at startup.
STRIPE_API_URL Stripe’s API Another address for Stripe’s API, such as http://127.0.0.1:12111 for stripe-mock in tests. The server itself won’t start against stripe-mock, because it checks Stripe’s prices and catalogue when it starts, and the mock’s aren’t Peal’s.

Billing explains the plans and what they limit.

Captcha

The captcha is off until you set both Turnstile keys:

Variable Default What it does
TURNSTILE_SITE_KEY unset: the captcha is off The site key of a Cloudflare Turnstile widget, which the sign-up and password reset forms show. Set it with TURNSTILE_SECRET_KEY: one without the other stops the server.
TURNSTILE_SECRET_KEY unset: the captcha is off The widget’s secret key, which the server checks tokens with. Keep it secret.
TURNSTILE_VERIFY_URL Cloudflare’s siteverify Another address to check tokens at, such as a fake one in tests.

Support chat

With the web app’s support chat on (PEAL_CRISP_WEBSITE_ID), the server can sign the address the chat names each signed-in person with, so Crisp marks their conversation verified:

Variable Default What it does
PEAL_CRISP_IDENTITY_SECRET unset: no address is verified The identity verification secret of your Crisp website (Crisp’s Settings, Workspace Settings, Advanced configuration, Identity Verification, once you turn on verifying user emails). The server signs each person’s own account address with it (HMAC-SHA256), never one a browser sends, and the app hands the signature to the chat. Keep it secret. Unset, the chat names people unverified, and an address in a conversation proves nothing.

Product analytics

Product analytics is off until you set PEAL_POSTHOG_KEY. The server then sends PostHog events about how your server is used, from the server alone. They hold identifiers, names Peal chose and numbers, never a post’s content, a name or an address.

Variable Default What it does
PEAL_POSTHOG_KEY unset: product analytics is off The project token of your PostHog project, which starts with phc_. Unset or empty, nothing is sent and none of the settings below is read.
PEAL_POSTHOG_HOST https://eu.i.posthog.com Where events go: PostHog’s EU Cloud, or a PostHog of your own. It must be https, or http on localhost, 127.0.0.1 or [::1], and anything else stops the server at startup. The server sends a batch of up to 100 events every 2 seconds at most, and never sends an event twice.
PEAL_POSTHOG_ENVIRONMENT production when NODE_ENV is production, development otherwise The environment property of every event, so one project can hold several servers. It takes 1 to 32 lowercase letters, digits and dashes, starting with a letter.
PEAL_POSTHOG_PERSONAL_API_KEY unset A personal API key with the person:write scope on the project. With PEAL_POSTHOG_PROJECT_ID, closing an account or deleting a workspace also deletes its persons and their events at PostHog. Without them, the server warns at startup and logs each erasure’s ids (peal.erasure.analytics_manual) for you to delete by hand. One without the other stops the server. Keep it secret.
PEAL_POSTHOG_PROJECT_ID unset The project’s numeric id, set with PEAL_POSTHOG_PERSONAL_API_KEY.
PEAL_POSTHOG_APP_HOST https://eu.posthog.com Where persons are deleted. It follows the same rule as PEAL_POSTHOG_HOST.
PEAL_POSTHOG_EXCLUDED_IDS none User and workspace ids, separated by commas. The server sends nothing about an excluded user, and nothing about an excluded workspace, whoever acts in it, its own service identity included. Use it for a person or a customer who objected. A value that isn’t such an id stops the server. Delete what PostHog already holds about them by hand.
PEAL_POSTHOG_WEB off on turns on the web app’s measurement too. The server and the web app both read it, and anything but on or off stops the server. It needs PEAL_POSTHOG_KEY set to a project token (phc_), which the web app reads too, since browsers send it. Every page of the signed-in app then counts a page view under a random id kept in memory, with nothing kept in the browser, and asks each person on their home whether to link what they do to their account and record their sessions, masked. Staff acting as someone, excluded ids and a browser that sends Do Not Track or Global Privacy Control are never measured. The web app relays the browser’s events, recordings and project configuration to PEAL_POSTHOG_HOST at /pulse, with no cookie, IP address or other header of the browser’s.
PEAL_POSTHOG_SITE off on turns on the measurement of a website, documentation or blog of yours that runs PostHog and sends its events to /pulse/site on its own host name. The server and the web app both read it, and anything but on or off stops the server. It needs PEAL_POSTHOG_KEY set to a project token (phc_). Route /pulse/site/* of those host names to the web app, which relays their events alone to PEAL_POSTHOG_HOST, with the visitor’s IP address (from the header AUTH_IP_HEADERS names) and their browser’s description, from which PostHog works out a visitor’s identifier for the day, and no cookie or other header. When a visitor who allowed it in that site’s consent notice creates an account in the same browser, the server links their visits to the account once, at the sign-up, then removes the visitor’s cookie. Nothing is linked at a sign-in.
PEAL_POSTHOG_SITE_COOKIE_DOMAIN unset: a cookie of the host alone The registrable domain your website, your docs and your app share, such as example.com (never www.example.com): PostHog’s code sets the visitor’s cookie there, and a sign-up on the app’s host name removes it there. Give the same value as SITE_POSTHOG_COOKIE_DOMAIN. Read only with PEAL_POSTHOG_SITE=on. A value that isn’t a host name stops the server.

Telemetry

The server exports nothing until you set an OTLP endpoint:

Variable Default What it does
OTEL_EXPORTER_OTLP_ENDPOINT unset The OTLP/HTTP address of the OpenTelemetry collector that receives logs, metrics and traces, such as http://otel-collector:4318. Unset, nothing is exported.
OTEL_SERVICE_NAME peal-server The service name that telemetry is reported under.
OTEL_TRACES_EXPORTER otlp none stops exporting traces once an endpoint is set. OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER do the same for metrics and logs.
OTEL_TRACES_SAMPLER parentbased_traceidratio in production, parentbased_always_on elsewhere Which traces are exported, by OpenTelemetry’s sampler names: always_on, always_off, traceidratio, parentbased_always_on, parentbased_always_off or parentbased_traceidratio. The parentbased_ ones follow the decision a request came with. Another value stops the server.
OTEL_TRACES_SAMPLER_ARG 0.1 in production, 1 elsewhere The share of traces the traceidratio samplers keep, from 0 to 1. Production keeps one trace in ten unless you set otherwise.

The sampler decides when a trace begins, before anyone knows how it ends. Whatever the ratio, the server keeps the traces you’ll look for:

  • Every attempt to publish a post on a channel is traced, with the calls to the platform under it.
  • From a trace that wasn’t sampled, the server still exports the spans that ended in a bug, the requests it answered with a 5xx, and the spans that lasted 10 seconds or more, each with the spans above it.
  • Logs and metrics are never sampled. Every error is logged with its trace id, and every request is counted in the metric peal.http.requests, by status class, which the stack’s alerts read.

always_off and parentbased_always_off turn all of this off, and no trace begins on the server.

The server exports telemetry as JSON over HTTP, so point the endpoint at the collector’s OTLP/HTTP port, 4318 by default, not at its gRPC one. It also reads these OpenTelemetry variables, and no others (OTEL_EXPORTER_OTLP_PROTOCOL included):

  • OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_COMPRESSION and OTEL_EXPORTER_OTLP_TIMEOUT, and the per-signal forms of these and of the endpoint, such as OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
  • OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_VERSION
  • OTEL_SDK_DISABLED
  • the batching settings, OTEL_BSP_* for traces and OTEL_BLRP_* for logs
  • OTEL_METRIC_EXPORT_INTERVAL, OTEL_METRIC_EXPORT_TIMEOUT and OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE

Job runner

The library that runs Peal’s jobs also reads its own settings from the environment, under these names: SHARDS_PER_GROUP, SHARD_GROUPS, AVAILABLE_SHARD_GROUPS, RUNNER_SHARD_WEIGHT, SHARD_LOCK_REFRESH_INTERVAL, SHARD_LOCK_EXPIRATION, SHARD_LOCK_DISABLE_ADVISORY, PREEMPTIVE_SHUTDOWN, ENTITY_MAILBOX_CAPACITY, ENTITY_MAILBOX_METRICS, MAX_RESIDENT_ENTITIES, UNPROCESSED_MESSAGE_BATCH_SIZE, ENTITY_MAX_IDLE_TIME, ENTITY_REGISTRATION_TIMEOUT, ENTITY_REPLY_POLL_INTERVAL, SEND_RETRY_INTERVAL, REFRESH_ASSIGNMENTS_INTERVAL, RUNNER_JOIN_DEBOUNCE, RUNNER_HEALTH_CHECK_INTERVAL, SIMULATE_REMOTE_SERIALIZATION, LISTEN_HOST and LISTEN_PORT.

Leave them unset. Peal is tested with their defaults, and SHARD_LOCK_DISABLE_ADVISORY=true would let two servers run the same jobs.

Web app

The web app reads its own settings, apart from the server’s:

Variable Default What it does
PEAL_API_URL required in production; http://localhost:3000 Where the web app reaches the server, such as http://peal-server:3000. It forwards /api/* and /.well-known/oauth-* there, and renders pages with it. It’s read at each request, so one build runs against any server.
PORT 3000; 3001 in the web app’s image The port the web app listens on.
HOSTNAME 0.0.0.0 The address the web app listens on. In a container, Docker sets HOSTNAME to the container id, so set it to 0.0.0.0, as the web app’s image does.
KEEP_ALIVE_TIMEOUT Node’s How long, in milliseconds, an idle connection stays open. Set it for a proxy in front that keeps connections open longer.
PEAL_RELEASE unknown The release that the web app’s error reports name, such as 2026.11.0. Read at each request. The production stack sets it to PEAL_VERSION.
PEAL_TERMS_URL unset The address of your terms of service, such as https://peal.example.com/terms. The sign-up form links to it, because creating an account accepts them, and so does the billing page before an order. Read at each request. Unset, both name the terms without a link.
PEAL_PRIVACY_URL unset The address of your privacy policy, such as https://peal.example.com/privacy, which the sign-up form links to. Read at each request. Unset, the form doesn’t mention it.
PEAL_DPA_URL unset The address of your data processing agreement (GDPR Article 28), such as https://peal.example.com/dpa, which the sign-up page links to. Read at each request. Unset, the page doesn’t mention it.
PEAL_CONTACT_URL unset Where to write for more than the largest plan allows, as a page’s address or a mailto: link. The upgrade dialog shows it on a server that bills, and Support, in the Help menu at the foot of the app’s pages, opens it. Read at each request. Unset, the dialog says to write to the people who run the server, and Help has no Support.
PEAL_DOCS_URL unset The address of your copy of this documentation, such as https://docs.example.com, the same one the server reads. Docs, in the Help menu at the foot of the app’s pages, opens it. Read at each request. Unset, Help has no Docs.
PEAL_CRISP_WEBSITE_ID unset A Crisp website’s id, a UUID (Crisp’s Settings, Workspace, in the address), which turns on a support chat: Support, in the account menu at the foot of the app’s pages, opens it, loading Crisp only then, and names the signed-in person and their workspace. Never offered while staff act as someone. Read at each request. Unset, there’s no chat. A value that isn’t a Crisp website’s id fails the app’s pages. Name Crisp in your privacy policy before you set it.
PEAL_SETUP_HIDDEN_PLATFORMS unset Platforms to leave off the setup card that a new workspace’s home shows, by name and separated by commas, such as facebook,instagram,threads while Meta reviews your apps: someone outside your app’s testers would stop on the platform’s sign-in page. New channel still offers them. Read at each request. Unset, the card offers every platform the server signs in to.
NODE_ENV production for a build The built web app always runs in production mode, where PEAL_API_URL is required.

Command line

The peal command line reads these settings. Where a flag does the same, the row names it:

Variable Default What it does
PEAL_API_URL http://localhost:3000 The address of the instance, such as https://peal.example.com, unless you pass --api-url. With PEAL_API_KEY, one of the two is required: a key is never sent to the default.
PEAL_INSECURE_HTTP false true lets the sign-in or the API key go over plain HTTP to a server that isn’t this machine, as --insecure-http does. Use it only for a server without TLS on a network you trust.
PEAL_API_KEY unset A workspace API key to run with instead of a saved sign-in, for runs nobody attends.
PEAL_WORKSPACE unset The workspace that commands act in, by slug or id, unless you pass --workspace. With an API key, the key’s own when unset.
TZ this computer’s zone The IANA time zone that peal analytics summary counts days in, unless you pass --time-zone.
PEAL_CONFIG_DIR unset The folder where sign-ins are saved, in credentials.json.
XDG_CONFIG_HOME unset Without PEAL_CONFIG_DIR, sign-ins go in its peal folder.
APPDATA Windows sets it Without either, sign-ins go in its peal folder.
HOME the system sets it Otherwise, sign-ins go in ~/.config/peal.

Docker Compose stack

compose.production.yaml, in packages/peal-docker, passes the server the settings above. If a setting marked “required” below is missing, Compose stops and names it. With Docker Compose and Caddy shows the whole setup. The stack also reads its own settings:

Variable Default What it does
POSTGRES_PASSWORD none: required The database’s password, which DATABASE_URL is built with. Keep it URL-safe, such as the output of openssl rand -hex 32, and keep it secret.
PEAL_DATABASE_USER, PEAL_DATABASE_PASSWORD unset: the superuser A role of its own that the server signs in to Postgres as, with its password, in place of the superuser that POSTGRES_PASSWORD signs in. Set both or neither. The role needs LOGIN and nothing more, and must own the peal database and everything in it before the server starts as it (ALTER DATABASE peal OWNER TO …, then ALTER … OWNER TO … for each schema, table, sequence, view, function and type). A superuser can run programs in Postgres’s container, which holds the backup bucket’s key, so the server is safer as a role of its own. Keep the password URL-safe and secret.
GRAFANA_ADMIN_PASSWORD none: required The password of Grafana’s admin account, set when Grafana first starts. Keep it secret.
PEAL_DOMAIN required with Caddy The host name of PUBLIC_URL, which Caddy (compose.self-host.yaml) gets a certificate for.
PEAL_SITE_DOMAIN, PEAL_DOCS_DOMAIN unset The host names that Caddy (compose.self-host.yaml) serves the marketing site and the docs at, once you uncomment their blocks in self-host/Caddyfile.
PEAL_SHORT_LINK_DOMAIN unset The host name that Caddy serves short links at, once you uncomment its block in self-host/Caddyfile. Set PEAL_SHORT_LINK_BASE to https://, then this name, then /.
PEAL_VERSION local The tag of the images the stack runs and builds. PEAL_POSTGRES_VERSION is the Postgres image’s tag.
PEAL_SERVER_CONFIG_HASH, PEAL_OTEL_COLLECTOR_CONFIG_HASH, PEAL_LOKI_CONFIG_HASH, PEAL_TEMPO_CONFIG_HASH, PEAL_PROMETHEUS_CONFIG_HASH, PEAL_GRAFANA_CONFIG_HASH, PEAL_CADDY_CONFIG_HASH unset The label social.peal.config-hash of each service that mounts files from the stack’s folder (Caddy’s is in compose.self-host.yaml). Docker Compose recreates a service when its definition changes, but not when only the files it mounts do. After you change those files, change the service’s value, such as to a hash of them, and the next up recreates that service alone, which then reads them again. Peal’s own release sets each one to a hash of the service’s files.
SITE_URL, SITE_DOCS_URL unset Read when the static image is built. SITE_URL is the marketing site’s public origin, for canonical and alternate-language links. SITE_DOCS_URL is the docs’ origin, and adds links to them. Unset or empty leaves each out.
SITE_APP_URL unset Read when the static image is built. The web app’s public origin (PUBLIC_URL). With it, the marketing site’s header links to the app’s sign-in and sign-up pages. Unset or empty leaves the links out.
SITE_DISCORD_URL unset Read when the static image is built. An invitation to a Discord server, such as https://discord.gg/…, which the marketing site’s header, its Resources menu and its footer link to. Unset or empty leaves Discord out.
SITE_CRISP_WEBSITE_ID unset Read when the static image is built. A Crisp website’s id, as PEAL_CRISP_WEBSITE_ID, which adds the support chat’s launcher to the bottom right of the marketing site’s pages. Unset or empty leaves it out; a value that isn’t a Crisp website’s id stops the build.
SITE_POSTHOG_KEY, SITE_POSTHOG_HOST unset Read when the static image is built. The PostHog project token (phc_…) and where the marketing site sends what it measures: a path on its own origin that reaches the web app’s relay, such as /pulse/site (with PEAL_POSTHOG_SITE on), or an https:// origin. With both set, the site counts page views without a cookie and asks each visitor, in a consent notice, whether it may keep one. Unset or empty measures nothing and shows no notice; a malformed value stops the build.
SITE_POSTHOG_COOKIE_DOMAIN unset: host-only cookies Read when the static image is built. The registrable domain the site and the docs share, such as example.com (never www.example.com), which the answer cookie and the visitor cookie are set on, so one answer covers both: PostHog’s code sets its cookie there in any case.
SITE_POSTHOG_ENVIRONMENT production Read when the static image is built. The environment property of every event the site sends.
DOCS_SITE_URL unset Read when the static and docs images are built. The docs’ public origin, for absolute links in llms.txt, the sitemap and Open Graph images. Unset or empty builds relative links.
DOCS_POSTHOG_KEY, DOCS_POSTHOG_HOST, DOCS_POSTHOG_COOKIE_DOMAIN, DOCS_POSTHOG_ENVIRONMENT unset Read when the static and docs images are built. The same as the site’s SITE_POSTHOG_*, for the docs, whose consent notice opens from a Cookie settings row at the foot of each page.
DOCS_PRIVACY_URL unset: no link Read when the static and docs images are built. The privacy policy’s English address on the marketing site, such as https://www.example.com/privacy, which the docs’ consent notice links to (with /fr after the origin in French).
DOCS_CRISP_WEBSITE_ID unset Read when the static and docs images are built. A Crisp website’s id, as PEAL_CRISP_WEBSITE_ID, which adds the support chat’s launcher to the bottom right of the docs’ pages. Unset or empty leaves it out; a value that isn’t a Crisp website’s id stops the build.
DOCS_APP_URL unset Read when the static and docs images are built. The web app’s public origin (PUBLIC_URL). With it, the docs’ sidebar shows a Dashboard button that links to it. Unset or empty leaves the button out.
DOCS_ASSISTANT_MODEL unset: no assistant Read when the docs image is built, which requires it. The Anthropic model the docs’ assistant answers with, such as claude-haiku-5-5. The assistant answers from a server route, so the docs then run as a Node server, the docs image (profile docs). The docs’ host name goes to that image instead of the static one, whose docs stay static files. Unset, nothing changes.
DOCS_TURNSTILE_SITE_KEY unset: no bot check Read when the docs image is built. The site key of a Cloudflare Turnstile widget whose host names include the docs’, which checks each reader before a question. Set DOCS_TURNSTILE_SECRET_KEY with it.
DOCS_ANTHROPIC_API_KEY unset Read by the docs server (profile docs) with each question. It’s the Anthropic API key the assistant answers with. Until it’s set, the assistant says it isn’t set up. Use a key of its own, with a spending limit at Anthropic, and keep it secret.
DOCS_TURNSTILE_SECRET_KEY unset Read by the docs server with each question, when the image has DOCS_TURNSTILE_SITE_KEY. It’s the widget’s secret key, which the image hands to Blume as TURNSTILE_SECRET_KEY. It has a name of its own because the server’s TURNSTILE_SECRET_KEY without TURNSTILE_SITE_KEY stops the server. If you run Blume’s Node build yourself, set TURNSTILE_SECRET_KEY. Keep it secret.
PEAL_POSTGRES_ARCHIVE_MODE off on archives Postgres’s write-ahead log with pgBackRest, to the bucket below, so you can restore backups to any moment.
PEAL_POSTGRES_SHARED_BUFFERS 128MB Postgres’s shared_buffers, the memory it keeps for its own cache, read only when Postgres starts. PostgreSQL suggests a quarter of the memory on a server that runs only Postgres. Peal’s stack shares the server, so take a quarter of the memory Postgres may use, not of the machine’s. Because it’s given on Postgres’s command line, it replaces any value set with ALTER SYSTEM or in postgresql.conf.
PEAL_POSTGRES_EFFECTIVE_CACHE_SIZE 4GB Postgres’s effective_cache_size: how much of the disk the planner counts on finding in memory, in its buffers and the system’s file cache together. It reserves nothing (PostgreSQL). Because it’s given on Postgres’s command line, it replaces any value set with ALTER SYSTEM or in postgresql.conf.
PEAL_POSTGRES_MAINTENANCE_WORK_MEM 64MB Postgres’s maintenance_work_mem: the memory each vacuum (each autovacuum worker too), index build or new foreign key may use (PostgreSQL). Because it’s given on Postgres’s command line, it replaces any value set with ALTER SYSTEM or in postgresql.conf.
PEAL_POSTGRES_RANDOM_PAGE_COST 4 Postgres’s random_page_cost: what the planner counts for reading a page out of order. PostgreSQL models storage that reads at random cheaply with a lower value, and 1.1 is a common choice on solid-state disks. Because it’s given on Postgres’s command line, it replaces any value set with ALTER SYSTEM or in postgresql.conf.
PGBACKREST_REPO1_S3_ENDPOINT, PGBACKREST_REPO1_S3_BUCKET, PGBACKREST_REPO1_S3_KEY, PGBACKREST_REPO1_S3_KEY_SECRET unset The bucket backups go to, and a key that can read and write in it. For a bucket in R2’s EU jurisdiction, that’s an endpoint such as <account>.eu.r2.cloudflarestorage.com (a host, without a scheme) and a bucket such as peal-backups. You choose the jurisdiction when you create the bucket. Keep the key secret.
PGBACKREST_REPO1_CIPHER_PASS unset The passphrase that encrypts the backups, such as the output of openssl rand -base64 48. Keep it secret, and keep a copy away from the server, because the backups can’t be read without it.
PGBACKREST_REPO1_TYPE, PGBACKREST_REPO1_PATH, PGBACKREST_REPO1_S3_REGION, PGBACKREST_REPO1_S3_URI_STYLE s3, /peal, auto, path The kind of repository (posix for a folder), where in it the backups go, the region requests are signed for, and whether the bucket’s name goes in the path or in the host name (host).
PEAL_GRAFANA_URL http://localhost:13000 The address people open Grafana at.
PEAL_GRAFANA_ACCESS_TEAM, PEAL_GRAFANA_ACCESS_AUD unset A Cloudflare Zero Trust team, and the audience tag of the Access application in front of Grafana. When they’re set, Grafana signs in, as admins, the people Access lets through.
PEAL_GRAFANA_CONTACT_POINTS no contact point The file of alert contact points that Grafana loads. ./config/production/grafana/alerting/telegram.yaml sends every alert to the Telegram chat TELEGRAM_CHAT_ID, through the bot TELEGRAM_BOT_TOKEN. ./config/production/grafana/alerting/telegram-slack.yaml sends the same alerts to that chat and to the Slack channel of the incoming webhook SLACK_ALERTS_WEBHOOK_URL.
SLACK_ALERTS_WEBHOOK_URL unset A Slack incoming webhook’s URL, read by telegram-slack.yaml. Grafana won’t start without it when that file is loaded. Its messages name the rule, its state, the environment and the alert’s labels, and never an annotation, a value or a log line. Keep it secret.
PEAL_GRAFANA_ENVIRONMENT production The environment that Slack’s alert messages name, such as production or sandbox.
PEAL_PRIVACY_DECLARATION ./config/production/privacy-declaration.json, which declares nothing The file on the host that declares what you do with personal data, mounted read-only in the server (Privacy declaration).
PEAL_GRAFANA_HEARTBEAT no heartbeat ./config/production/grafana/alerting/heartbeat.yaml sends a heartbeat to an outside checker about every 5 minutes, and the checker alerts when the heartbeats stop. See Watching it from outside.
PEAL_HEARTBEAT_URL, PEAL_HEARTBEAT_TOKEN unset Where Grafana posts its heartbeat, such as a Gatus external endpoint’s address, and the bearer token the checker gave you for it. Keep the token secret.
PEAL_SERVER_PORT, PEAL_WEB_PORT, PEAL_SITE_PORT, PEAL_DOCS_PORT, PEAL_DOCS_SERVER_PORT, PEAL_GRAFANA_PORT, PEAL_OTLP_HTTP_PORT 3000, 3001, 4321, 4322, 4323, 13000, 14318 The ports on 127.0.0.1 that the server, the web app, the marketing site and the docs (profile static), the docs server (profile docs), Grafana and the collector’s OTLP/HTTP receiver publish.

Tools

bun nx run peal-server:media-cors puts the upload CORS rule on the bucket. It reads the media store’s PEAL_S3_* variables, PUBLIC_URL and TRUSTED_ORIGINS, with the same defaults as the server. bun nx run peal-server:bluesky-key reads nothing.

bun packages/peal-server/scripts/ads-trial.ts sends the ads adapter’s requests to Meta from your machine, and prints each one with Meta’s whole answer. Run it with Bun from the repository root, never through Nx, because Nx keeps a copy of every task’s terminal output in its cache.

It reads these from the environment only, so export them from your keychain rather than typing them on the command line:

  • META_APP_ID and META_APP_SECRET
  • PEAL_ADS_TRIAL_TOKEN, a user token from the Marketing API Tools page of the app dashboard, trimmed and never printed
  • PEAL_ADS_TRIAL_ACTIVATE, which guards the activate step

Everything the script makes is paused and named peal-trial-…, and it pauses and deletes only what bears that name. Its activate step runs only on an object of the trial’s, in the ad account given as --sandbox-account, and only when PEAL_ADS_TRIAL_ACTIVATE holds today’s date in UTC (YYYY-MM-DD). The script appends what it sent and received, with credentials masked, to .local/ads-trial.log at the repository root, readable by you alone.

Was this page helpful?