Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

319 changes: 319 additions & 0 deletions app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
# VisualCI's server: every environment variable it reads. Generated from app/src/config.rs (run app/'s tests with
# VISUALCI_GOLDEN_UPDATE=1); the reference is https://visualci.com/docs/self-hosting/environment-variables/

######################################################################################################################
# Blob storage
######################################################################################################################

# Required. The store's S3 endpoint. Example: https://<account>.r2.cloudflarestorage.com.
VISUALCI_S3_ENDPOINT=https://<account>.r2.cloudflarestorage.com

# 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_PUBLIC_ENDPOINT=

# Required. The bucket.
VISUALCI_S3_BUCKET=

# The bucket's region. R2 takes auto.
# VISUALCI_S3_REGION=auto

# Required. Secret. The access key's ID.
VISUALCI_S3_ACCESS_KEY_ID=

# Required. Secret. The access key's secret.
VISUALCI_S3_SECRET_ACCESS_KEY=

######################################################################################################################
# Renderers
######################################################################################################################

# Required. Secret. The token every renderer sends: the same value as the renderers' own VISUALCI_RENDERER_TOKEN.
VISUALCI_RENDERER_TOKEN=

# 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_RENDERER_VERSION=

# Secret. The token for /internal/renderer/metrics (Prometheus). Never give it to the renderers. Empty turns the
# endpoint off: no token matches it.
# VISUALCI_METRICS_TOKEN=

######################################################################################################################
# Hosts
######################################################################################################################

# The marketing site's address. Signed-out visitors to the app's front page go there. Example: https://visualci.com.
# VISUALCI_SITE_URL=https://visualci.com

# The web app's address, also used for the links in emails (http://localhost when unset). Example:
# https://app.visualci.com.
# VISUALCI_APP_URL=https://app.visualci.com

# 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_API_URL=https://api.visualci.com

# The MCP server's address, where coding agents connect, and the OAuth issuer (OAUTH_ISSUER must match it). Example:
# https://mcp.visualci.com.
# VISUALCI_MCP_URL=https://mcp.visualci.com

######################################################################################################################
# Network and database
######################################################################################################################

# 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_TRUSTED_PROXIES=10.0.0.0/8

# 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_MCP_HOSTS=

# 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_ACQUIRE_TIMEOUT=5

# 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.
# VISUALCI_DB_APPLICATION_NAME=

######################################################################################################################
# Sign-ups
######################################################################################################################

# 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.
VISUALCI_WAITLIST=

######################################################################################################################
# Development sign-in
######################################################################################################################

# 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.
# VISUALCI_DEV_LOGIN=false

######################################################################################################################
# GitHub App
######################################################################################################################

# Required in production. The App's ID.
VISUALCI_GITHUB_APP_ID=

# Required in production. Secret. The App's private key: its PEM file, base64-encoded to fit on one line.
VISUALCI_GITHUB_APP_PRIVATE_KEY_BASE64=

# Required in production. Secret. The App's webhook secret. Without it, the webhook (/webhooks/github) answers 404.
VISUALCI_GITHUB_WEBHOOK_SECRET=

######################################################################################################################
# GitLab
######################################################################################################################

# The GitLab VisualCI's OAuth application and bot are on.
# VISUALCI_GITLAB_URL=https://gitlab.com

# Secret. The bot's personal access token, with the api scope: access checks, commit statuses and merge request notes.
# VISUALCI_GITLAB_BOT_TOKEN=

# The bot's username, for telling people whom to invite.
# VISUALCI_GITLAB_BOT_USERNAME=visualci

# Lets requests to an organization's server reach private addresses. Development only, for a local GitLab.
# VISUALCI_FORGE_PRIVATE_ADDRESSES=false

######################################################################################################################
# Email
######################################################################################################################

# Required in production. Secret. The Postmark server's API token.
VISUALCI_POSTMARK_SERVER_TOKEN=

# Who emails come from.
# VISUALCI_MAIL_FROM="VisualCI <support@visualci.com>"

# Where replies go.
# VISUALCI_MAIL_REPLY_TO=support@visualci.com

######################################################################################################################
# Team
######################################################################################################################

# Where new sign-ups and feedback are sent.
# VISUALCI_TEAM_EMAIL=support@visualci.com

######################################################################################################################
# Payments
######################################################################################################################

# Required in production. Secret. Stripe's secret or restricted key: a live one (sk_live_, rk_live_) in production.
VISUALCI_STRIPE_SECRET_KEY=

# Required in production. Secret. The webhook's signing secret. Stripe's endpoint is /webhooks/stripe on the API host.
VISUALCI_STRIPE_WEBHOOK_SECRET=

######################################################################################################################
# Cloudflare
######################################################################################################################

# The zone the gallery's URLs are served from.
# VISUALCI_CLOUDFLARE_ZONE_ID=

# Secret. An API token that may purge that zone's cache.
# VISUALCI_CLOUDFLARE_PURGE_TOKEN=

######################################################################################################################
# Gallery
######################################################################################################################

# The most gallery credits one project is charged in a day: images past it are served free.
# VISUALCI_GALLERY_DAILY_CREDITS=50000

######################################################################################################################
# Heartbeats
######################################################################################################################

# Email delivery (the worker, every five minutes).
# VISUALCI_EMAILS_HEARTBEAT_URL=

# Secret. Email delivery's token.
# VISUALCI_EMAILS_HEARTBEAT_TOKEN=

# Sign-up notices to the team.
# VISUALCI_SIGNUPS_HEARTBEAT_URL=

# Secret. Sign-up notices' token.
# VISUALCI_SIGNUPS_HEARTBEAT_TOKEN=

# The live-update check (every minute): a notification reaches each process's listener.
# VISUALCI_LIVE_HEARTBEAT_URL=

# Secret. The live-update check's token.
# VISUALCI_LIVE_HEARTBEAT_TOKEN=

# Pruning expired device sign-ins.
# VISUALCI_DEVICE_PRUNE_HEARTBEAT_URL=

# Secret. Device sign-in pruning's token.
# VISUALCI_DEVICE_PRUNE_HEARTBEAT_TOKEN=

# Syncing access from GitHub (the hourly recheck).
# VISUALCI_FORGE_SYNC_HEARTBEAT_URL=

# Secret. Forge access sync's token.
# VISUALCI_FORGE_SYNC_HEARTBEAT_TOKEN=

# Image retention (daily).
# VISUALCI_RETENTION_HEARTBEAT_URL=

# Secret. Image retention's token.
# VISUALCI_RETENTION_HEARTBEAT_TOKEN=

# The demo organization's daily reset.
# VISUALCI_DEMO_HEARTBEAT_URL=

# Secret. The demo reset's token.
# VISUALCI_DEMO_HEARTBEAT_TOKEN=

# The sweep of abandoned builds (every five minutes).
# VISUALCI_BUILDS_EXPIRE_HEARTBEAT_URL=

# Secret. The builds sweep's token.
# VISUALCI_BUILDS_EXPIRE_HEARTBEAT_TOKEN=

# The daily check of snapshot groups.
# VISUALCI_GROUPS_CHECK_HEARTBEAT_URL=

# Secret. The groups check's token.
# VISUALCI_GROUPS_CHECK_HEARTBEAT_TOKEN=

######################################################################################################################
# Laravel Rust
######################################################################################################################

# production, local or testing. The image sets production.
# APP_ENV=production

# Required in production. Secret. Laravel's encryption key for sessions and cookies: 32 random characters. A new key
# signs everyone out.
APP_KEY=

# The server's address, for URLs the framework builds. On one host, the only address you set. Example:
# https://visualci.example.com.
# APP_URL=https://visualci.example.com

# Where the app's files are (public/, storage/). The image sets /app.
# APP_BASE_PATH=

# The address the web server listens on. The image sets 0.0.0.0.
# SERVER_HOST=

# The web server's port. The image sets 5150.
# SERVER_PORT=

# Where logs go. The image sets stderr.
# LOG_CHANNEL=

# Secret. The Postgres URL, with its credentials. Example: postgres://visualci:secret@db:5432/visualci.
# DATABASE_URL=postgres://visualci:secret@db:5432/visualci

# pgsql.
# DB_CONNECTION=pgsql

# The most database connections each process holds. Keep the sum across processes within Postgres's limit.
# DB_MAX_CONNECTIONS=10

# database: the cache in Postgres, shared by every process.
# CACHE_STORE=

# database: sign-in sessions in Postgres, shared by every process.
# SESSION_DRIVER=

# database: the job queue in Postgres, worked by queue:work.
# QUEUE_CONNECTION=

# Required in production. The GitHub App's OAuth client ID, for signing in with GitHub.
GITHUB_CLIENT_ID=

# Required in production. Secret. The GitHub App's OAuth client secret.
GITHUB_CLIENT_SECRET=

# The GitLab OAuth application's ID, for signing in with GitLab.
# GITLAB_CLIENT_ID=

# Secret. The GitLab OAuth application's secret.
# GITLAB_CLIENT_SECRET=

######################################################################################################################
# OAuth for MCP clients
######################################################################################################################

# The OAuth issuer: VISUALCI_MCP_URL. With the four hosts set, production refuses to start when it differs. Example:
# https://mcp.visualci.com.
# OAUTH_ISSUER=https://mcp.visualci.com

# The consent page: /oauth/authorize on VISUALCI_APP_URL, checked like OAUTH_ISSUER. Example:
# https://app.visualci.com/oauth/authorize.
# OAUTH_AUTHORIZATION_ENDPOINT=https://app.visualci.com/oauth/authorize

######################################################################################################################
# Development and tests
######################################################################################################################

# Stands in for the clock in credit allowances (RFC 3339), for screenshots of seeded data.
# VISUALCI_NOW=

# 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_DATABASE_URL=

# A folder the email tests write each email's HTML to, for review.
# VISUALCI_EMAIL_SNAPSHOTS=

# 1 makes the tests write their golden files (this page among them) instead of comparing.
# VISUALCI_GOLDEN_UPDATE=
4 changes: 4 additions & 0 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ rmcp = { version = "3.12", features = ["server", "transport-streamable-http-serv
tower = { version = "0.5", features = ["util"] }
url = "2"
regex = "1"
# Typed settings from VISUALCI_ variables, with their docs (config.rs)
envschema = { path = "../crates/envschema" }
# VisualCI's own crates, shared with the CLI.
visualci-core = { path = "../crates/visualci-core", features = ["bundle"] }
snapshot-diff = { path = "../crates/snapshot-diff" }

[dev-dependencies]
regex = "1"
# Capturing logs in config.rs's tests
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "std"] }
# A GitHub App key made at test time, so no private key is committed
rsa = { version = "0.9", features = ["pem"] }
Loading
Loading