Environment variables

The server reads its settings from environment variables. VisualCI's own all start with VISUALCI_; the framework's and the OAuth server's keep their own names. Set them for every process (serve, queue:work, schedule:work and migrate); Self-hosting says which ones a first server needs. app/.env.example in the repository lists the same variables as a file to fill in.

The server refuses to start when a required variable is missing or any variable has a value its type can't take, and lists every such problem at once. With APP_ENV=production the variables marked required in production are required too. At startup it logs the settings it runs with, secrets masked, and warns about each VISUALCI_ variable it doesn't read, naming the closest one it knows: a typo, or a setting that was renamed. The CLI's variables (VISUALCI_TOKEN, VISUALCI_PROJECT and the rest) are ignored.

A boolean takes true or false (or 1/0, yes/no, on/off). An empty value, or null, is the same as not setting the variable.

Blob storage

S3-compatible storage for uploads, rendered pages and diff images: R2 in production, RustFS or MinIO in development and CI. The app doesn't start without its endpoint, bucket and keys, so production never falls back to a development store.

Variable Type Default Description
VISUALCI_S3_ENDPOINT string Required. The store's S3 endpoint. Example: https://<account>.r2.cloudflarestorage.com.
VISUALCI_S3_PUBLIC_ENDPOINT string The endpoint browsers and the CLI upload to and download from, when it differs from the one the server uses (a store the server reaches on a cluster-internal address). Images in the web app's Content-Security-Policy come from here too.
VISUALCI_S3_BUCKET string Required. The bucket.
VISUALCI_S3_REGION string auto The bucket's region. R2 takes auto.
VISUALCI_S3_ACCESS_KEY_ID string Required. Secret. The access key's ID.
VISUALCI_S3_SECRET_ACCESS_KEY string Required. Secret. The access key's secret.

Renderers

The renderers' API (/internal/renderer): the renderers claim PDFs to draw with a shared token, and a metrics scraper reads their numbers with a token of its own.

Variable Type Default Description
VISUALCI_RENDERER_TOKEN string Required. Secret. The token every renderer sends: the same value as the renderers' own VISUALCI_RENDERER_TOKEN.
VISUALCI_RENDERER_VERSION string Required. The renderer version documents are drawn with: part of every render's cache key, and what a renderer's claim must match exactly. The image sets it from docker/renderer.version; don't set it yourself.
VISUALCI_METRICS_TOKEN string (empty) Secret. The token for /internal/renderer/metrics (Prometheus). Never give it to the renderers. Empty turns the endpoint off: no token matches it.

Hosts

Routing by hostname: one server answers for the app, the API and the MCP server, and each host serves only its own paths. Set all four, each its own host, or none: a self-hosted server on one host serves everything there.

Variable Type Default Description
VISUALCI_SITE_URL string The marketing site's address. Signed-out visitors to the app's front page go there. Example: https://visualci.com.
VISUALCI_APP_URL string The web app's address, also used for the links in emails (http://localhost when unset). Example: https://app.visualci.com.
VISUALCI_API_URL string The API's address, where the CLI and CI send builds. The CLI's own VISUALCI_API_URL names the same address. Example: https://api.visualci.com.
VISUALCI_MCP_URL string The MCP server's address, where coding agents connect, and the OAuth issuer (OAUTH_ISSUER must match it). Example: https://mcp.visualci.com.

Network and database

Behind a load balancer: which proxies' X-Forwarded-For to believe, and how the database pool behaves.

Variable Type Default Description
VISUALCI_TRUSTED_PROXIES comma-separated list 10.0.0.0/8 The proxies in front of the app whose X-Forwarded-For is believed, as addresses or CIDR ranges. Behind them, a request's address is the nearest one that isn't a trusted proxy. Never include addresses untrusted code can send from, such as the renderers'.
VISUALCI_MCP_HOSTS comma-separated list (empty) More host names the MCP endpoint answers for, besides the configured hosts, the app's address and localhost (DNS rebinding protection). For a development server reached by another name.
VISUALCI_DB_ACQUIRE_TIMEOUT integer 5 How long, in seconds, a request waits for a pooled database connection before it fails with a 503 and Retry-After, rather than hanging while the queue grows.
VISUALCI_DB_APPLICATION_NAME string The application_name of this process's database connections, in Postgres's metrics and pg_stat_activity, such as visualci-web or visualci-worker. Letters, digits, dashes and underscores, at most 63 characters; anything else is ignored.

Sign-ups

Whether new people can sign up.

Variable Type Default Description
VISUALCI_WAITLIST boolean Required in production. true keeps sign-ups closed: someone new goes on the waitlist instead of getting an account. Production must set it either way, so a dropped setting never opens sign-ups by surprise; elsewhere they're open unless it's set.

Development sign-in

Development and tests only.

Variable Type Default Description
VISUALCI_DEV_LOGIN boolean false Lets anyone sign in as anyone by email, for local work and CI's screenshots. Only where APP_ENV is local or testing: anywhere else the app refuses to start with it on.

GitHub App

The VisualCI GitHub App: checks and comments on pull requests, its webhook, and access that follows GitHub. Sign-in with GitHub is its OAuth client, GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET (Laravel Rust, below).

Variable Type Default Description
VISUALCI_GITHUB_APP_ID string Required in production. The App's ID.
VISUALCI_GITHUB_APP_PRIVATE_KEY_BASE64 string Required in production. Secret. The App's private key: its PEM file, base64-encoded to fit on one line.
VISUALCI_GITHUB_WEBHOOK_SECRET string Required in production. Secret. The App's webhook secret. Without it, the webhook (/webhooks/github) answers 404.

GitLab

GitLab, on gitlab.com or a GitLab of your own. Sign-in is its OAuth application, GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET (Laravel Rust, below). GitLab has no app installations: a project gives VisualCI access by adding its bot as a member.

Variable Type Default Description
VISUALCI_GITLAB_URL string https://gitlab.com The GitLab VisualCI's OAuth application and bot are on.
VISUALCI_GITLAB_BOT_TOKEN string Secret. The bot's personal access token, with the api scope: access checks, commit statuses and merge request notes.
VISUALCI_GITLAB_BOT_USERNAME string visualci The bot's username, for telling people whom to invite.
VISUALCI_FORGE_PRIVATE_ADDRESSES boolean false Lets requests to an organization's server reach private addresses. Development only, for a local GitLab.

Email

Email through Postmark's API. Without a token nothing is sent, and the outbox keeps the emails pending.

Variable Type Default Description
VISUALCI_POSTMARK_SERVER_TOKEN string Required in production. Secret. The Postmark server's API token.
VISUALCI_MAIL_FROM string VisualCI <support@visualci.com> Who emails come from.
VISUALCI_MAIL_REPLY_TO string support@visualci.com Where replies go.

Team

The people running this VisualCI.

Variable Type Default Description
VISUALCI_TEAM_EMAIL string support@visualci.com Where new sign-ups and feedback are sent.

Payments

Payments through Stripe. Production refuses to start on a test key, which would take no real payments while granting real plans and credits.

Variable Type Default Description
VISUALCI_STRIPE_SECRET_KEY string Required in production. Secret. Stripe's secret or restricted key: a live one (sk_live_, rk_live_) in production.
VISUALCI_STRIPE_WEBHOOK_SECRET string Required in production. Secret. The webhook's signing secret. Stripe's endpoint is /webhooks/stripe on the API host.

Cloudflare

Cloudflare, for purging public gallery URLs from its cache after a change. Unset, nothing is purged.

Variable Type Default Description
VISUALCI_CLOUDFLARE_ZONE_ID string (empty) The zone the gallery's URLs are served from.
VISUALCI_CLOUDFLARE_PURGE_TOKEN string (empty) Secret. An API token that may purge that zone's cache.

Public galleries.

Variable Type Default Description
VISUALCI_GALLERY_DAILY_CREDITS integer 50000 The most gallery credits one project is charged in a day: images past it are served free.

Live updates

The server-sent event streams the build and project pages and the CLI's --wait follow. The limits are each web process's own: a stream past one is refused with a 429, and the page or the CLI reads on its own instead. A stream holds no database connection while it waits.

Variable Type Default Description
VISUALCI_LIVE_MAX_STREAMS integer 2000 The most streams one web process keeps open at once.
VISUALCI_LIVE_MAX_STREAMS_PER_PRINCIPAL integer 30 The most streams one person, project token or visitor's address keeps open in one web process.
VISUALCI_LIVE_MAX_STREAMS_PER_BUILD integer 100 The most streams following one build in one web process.
VISUALCI_LIVE_STREAM_SECONDS integer 1800 How long one stream lasts, in seconds. It then ends, and the browser or the CLI connects again, so access is checked again.

Abuse limits

Limits on the work anyone on the internet can start: the GitHub App is public, so anyone can install it and send its webhook deliveries, and MCP clients register themselves with the OAuth server. Each count is shared by every web process (the cache store). A count fills at once and empties evenly: 60 a minute allows a burst of 60, then one a second.

Variable Type Default Description
VISUALCI_GITHUB_WEBHOOKS_PER_INSTALLATION integer 600 GitHub App deliveries a minute acted on at once for one installation set up for an organization on a paid plan (or linked to a project of one). Past it a delivery is kept and acted on later at this rate (GitHub never redelivers on its own). A paid installation's deliveries count against nothing shared.
VISUALCI_GITHUB_WEBHOOKS_PER_FREE_INSTALLATION integer 120 The same for an installation set up for an organization on the free plan, which anyone can make. Its deliveries also count against VISUALCI_GITHUB_WEBHOOKS_TOTAL.
VISUALCI_GITHUB_WEBHOOKS_PER_UNCLAIMED_INSTALLATION integer 60 GitHub App deliveries a minute for one installation nobody has set up. Past it a delivery is dropped (a 202, and a warning in the log): nothing of a customer's depends on it. Its installation deliveries (installed, suspended, removed), which setting it up needs, count only in VISUALCI_GITHUB_WEBHOOKS_TOTAL.
VISUALCI_GITHUB_WEBHOOKS_UNCLAIMED_TOTAL integer 600 GitHub App deliveries a minute for all the installations nobody has set up, together, so many strangers' installations can't crowd out customers' deliveries. Dropped as above past it.
VISUALCI_GITHUB_WEBHOOKS_TOTAL integer 6000 GitHub App deliveries a minute for unclaimed and free installations together (paid installations' don't count). A free installation's delivery past it is kept for later; an unclaimed one's dropped.
VISUALCI_GITHUB_WEBHOOKS_DEFERRED_PER_INSTALLATION_MB integer 50 The most megabytes of deliveries kept for later for one paid installation. Past a cap, a delivery is answered 503 (GitHub logs it as failed, and the redelivery check sends it again later) with an error in the log.
VISUALCI_GITHUB_WEBHOOKS_DEFERRED_PER_FREE_INSTALLATION_MB integer 5 The most megabytes kept for later for one free installation.
VISUALCI_GITHUB_WEBHOOKS_DEFERRED_FREE_TOTAL_MB integer 50 The most megabytes kept for later for every free installation together, so free installations, which anyone can make, can't fill the store paid ones need.
VISUALCI_GITHUB_WEBHOOKS_DEFERRED_TOTAL_MB integer 500 The most megabytes kept for later for every installation together.
VISUALCI_OAUTH_REGISTRATIONS_PER_REDIRECT_HOST integer 50 OAuth client registrations (/oauth/register) a day from one address (an IPv6 address's /64, since one host gets a whole /64) for one redirect URI host. Hosted platforms (such as claude.ai's connectors) register their users' clients from shared addresses with their own callback host, so each gets a count of its own.
VISUALCI_OAUTH_REGISTRATIONS_PER_ADDRESS integer 60 OAuth client registrations a day from one address (or IPv6 /64) across every redirect host that isn't a known platform's, and three times that from an IPv6 /48.
VISUALCI_OAUTH_REDIRECT_HOSTS_PER_ADDRESS integer 3 How many different redirect hosts (other than known platforms') one address registers clients for in a day.
VISUALCI_OAUTH_PLATFORM_REDIRECT_HOSTS comma-separated list claude.ai,claude.com,chatgpt.com Known platforms' callback hosts (a host or any subdomain of it): their users' MCP clients register from the platform's shared addresses, so each gets VISUALCI_OAUTH_REGISTRATIONS_PER_PLATFORM_HOST a day per address, outside the per-address limit.
VISUALCI_OAUTH_REGISTRATIONS_PER_PLATFORM_HOST integer 2000 OAuth client registrations a day for one known platform's callback host from one address in the platform's published egress ranges.
VISUALCI_OAUTH_PLATFORM_ADDRESSES string (empty) Replaces known platforms' egress ranges: host=cidr,cidr;host=cidr. Unset, claude.ai and claude.com use Anthropic's published outbound ranges and chatgpt.com OpenAI's published list, read daily.
VISUALCI_OAUTH_PLATFORM_UNVERIFIED_PER_DAY integer 2000 OAuth client registrations a day for one known platform's callback host from every address outside its egress ranges together: a shared pool, so naming a platform's host from elsewhere can use up only this.
VISUALCI_OAUTH_PLATFORM_UNVERIFIED_PER_ADDRESS integer 500 Of that pool, how many one address may use in a day.
VISUALCI_OAUTH_UNUSED_CLIENTS integer 100000 The most registered OAuth clients that have never connected. A registration past it first deletes the oldest of them registered over a day ago with no sign-in under way (a warning in the log), and is refused with a 429 while none is that old; oauth:prune deletes the rest after a week.
VISUALCI_OAUTH_UNUSED_CLIENTS_CEILING integer 150000 Past this many clients that have never connected, the oldest are deleted whatever their age, so young registrations can't keep new ones out.

Heartbeats

Each scheduled job pushes its result to a Gatus external endpoint, so a run that failed, or no run at all, alerts. Each pair is the endpoint's URL and its token; a job without a URL pushes nothing.

Variable Type Default Description
VISUALCI_EMAILS_HEARTBEAT_URL string Email delivery (the worker, every five minutes).
VISUALCI_EMAILS_HEARTBEAT_TOKEN string Secret. Email delivery's token.
VISUALCI_SIGNUPS_HEARTBEAT_URL string Sign-up notices to the team.
VISUALCI_SIGNUPS_HEARTBEAT_TOKEN string Secret. Sign-up notices' token.
VISUALCI_LIVE_HEARTBEAT_URL string The live-update check (every minute): a notification reaches each process's listener.
VISUALCI_LIVE_HEARTBEAT_TOKEN string Secret. The live-update check's token.
VISUALCI_DEVICE_PRUNE_HEARTBEAT_URL string Pruning expired device sign-ins.
VISUALCI_DEVICE_PRUNE_HEARTBEAT_TOKEN string Secret. Device sign-in pruning's token.
VISUALCI_FORGE_SYNC_HEARTBEAT_URL string Syncing access from GitHub (the hourly recheck).
VISUALCI_FORGE_SYNC_HEARTBEAT_TOKEN string Secret. Forge access sync's token.
VISUALCI_RETENTION_HEARTBEAT_URL string Image retention (daily).
VISUALCI_RETENTION_HEARTBEAT_TOKEN string Secret. Image retention's token.
VISUALCI_DEMO_HEARTBEAT_URL string The demo organization's daily reset.
VISUALCI_DEMO_HEARTBEAT_TOKEN string Secret. The demo reset's token.
VISUALCI_BUILDS_EXPIRE_HEARTBEAT_URL string The sweep of abandoned builds (every five minutes).
VISUALCI_BUILDS_EXPIRE_HEARTBEAT_TOKEN string Secret. The builds sweep's token.
VISUALCI_GROUPS_CHECK_HEARTBEAT_URL string The daily check of snapshot groups.
VISUALCI_GROUPS_CHECK_HEARTBEAT_TOKEN string Secret. The groups check's token.
VISUALCI_CREDIT_OVERRIDES_HEARTBEAT_URL string The daily reminder to organizations whose credit override ends within a week.
VISUALCI_CREDIT_OVERRIDES_HEARTBEAT_TOKEN string Secret. The credit override reminder's token.
VISUALCI_WEBHOOK_REDELIVERY_HEARTBEAT_URL string The check for GitHub App deliveries that failed (every ten minutes), which asks GitHub to redeliver them.
VISUALCI_WEBHOOK_REDELIVERY_HEARTBEAT_TOKEN string Secret. The redelivery check's token.
VISUALCI_PLATFORM_ADDRESSES_HEARTBEAT_URL string Reading known platforms' published egress ranges (hourly; healthy while the copy kept is under two days old).
VISUALCI_PLATFORM_ADDRESSES_HEARTBEAT_TOKEN string Secret. The platform ranges check's token.

Build processing

Processing builds (the worker).

Variable Type Default Description
VISUALCI_FINGERPRINT_CONCURRENCY integer 8 How many new image files one build's processing downloads and fingerprints at once. Each is decoded on a thread of its own, off the threads that serve requests and keep locks alive.

Laravel Rust

The framework reads these itself, under its own names.

Variable Type Default Description
APP_ENV string production production, local or testing. The image sets production.
APP_KEY string Required in production. Secret. Laravel's encryption key for sessions and cookies: 32 random characters. A new key signs everyone out.
APP_URL string The server's address, for URLs the framework builds. On one host, the only address you set. Example: https://visualci.example.com.
APP_BASE_PATH string Where the app's files are (public/, storage/). The image sets /app.
SERVER_HOST string The address the web server listens on. The image sets 0.0.0.0.
SERVER_PORT integer The web server's port. The image sets 5150.
LOG_CHANNEL string Where logs go. The image sets stderr.
DATABASE_URL string Secret. The Postgres URL, with its credentials. Example: postgres://visualci:secret@db:5432/visualci.
DB_CONNECTION string pgsql pgsql.
DB_MAX_CONNECTIONS integer 10 The most database connections each process holds. Keep the sum across processes within Postgres's limit.
CACHE_STORE string database: the cache in Postgres, shared by every process.
SESSION_DRIVER string database: sign-in sessions in Postgres, shared by every process.
QUEUE_CONNECTION string database: the job queue in Postgres, worked by queue:work.
GITHUB_CLIENT_ID string Required in production. The GitHub App's OAuth client ID, for signing in with GitHub.
GITHUB_CLIENT_SECRET string Required in production. Secret. The GitHub App's OAuth client secret.
GITLAB_CLIENT_ID string The GitLab OAuth application's ID, for signing in with GitLab.
GITLAB_CLIENT_SECRET string Secret. The GitLab OAuth application's secret.

OAuth for MCP clients

The OAuth server MCP clients sign in through (oauth-provider-laravel) reads these.

Variable Type Default Description
OAUTH_ISSUER string The OAuth issuer: VISUALCI_MCP_URL. With the four hosts set, production refuses to start when it differs. Example: https://mcp.visualci.com.
OAUTH_AUTHORIZATION_ENDPOINT string The consent page: /oauth/authorize on VISUALCI_APP_URL, checked like OAUTH_ISSUER. Example: https://app.visualci.com/oauth/authorize.

Development and tests

Never set these in production.

Variable Type Default Description
VISUALCI_NOW string Stands in for the clock in credit allowances (RFC 3339), for screenshots of seeded data.
VISUALCI_APP_TEST_DATABASE_URL string The tests' Postgres (each test borrows a copy of it). Default: CI's, postgres://visualci:visualci@127.0.0.1:55433/visualci_app_test.
VISUALCI_APP_TEST_S3_ENDPOINT string The tests' blob store (RustFS or MinIO). Default: CI's, http://127.0.0.1:59000.
VISUALCI_EMAIL_SNAPSHOTS string A folder the email tests write each email's HTML to, for review.
VISUALCI_GOLDEN_UPDATE string 1 makes the tests write their golden files (this page among them) instead of comparing.