Montara Pass
Getting started

Configuration

Every setting of the API, the web app and the extension.

API

Each setting of apps/server is an environment variable, or the command-line flag of the same name in kebab-case (go run ./cmd/api -h).

VariableDefaultPurpose
ENVproductiondevelopment, staging or production. Only development relaxes the session cookie and exempts loopback from the rate limit.
DEBUGfalseLogs every auth query with its values. Refused when ENV=production.
PORT8080Port the API listens on.
APP_NAMEmontara-passName used in auth emails.
APP_SECRETnoneRequired, at least 32 characters. Signs sessions and tokens.
DB_DSNnoneRequired. PostgreSQL 18 connection string.
DB_MAX_OPEN_CONNS25Connection pool size.
DB_MAX_IDLE_CONNS25Idle connections kept.
DB_MAX_IDLE_TIME15mHow long an idle connection is kept.
MIGRATE_ON_BOOTfalseApply the embedded migrations before serving.
SEED_ON_BOOTfalseRun the idempotent seeders before serving. Needs SUPER_USER.
SUPER_USERnoneemail:password of the super user to seed.
CORS_ALLOWED_ORIGINSnoneComma-separated browser origins. Empty means same-origin only, which is enough when the API serves the web app.
RATE_LIMIT_EXEMPT_IPSnoneComma-separated client IPs the rate limiter skips.
TRUSTED_PROXIESnoneIPs or CIDRs trusted to supply X-Forwarded-For. Set it behind a reverse proxy, or the rate limit counts the proxy instead of the visitor.
AUTH_BASE_URLhttp://localhost:$PORTPublic URL of the API, used in email links and the Google callback.
FROM_ADDRESSnoneSender of auth emails. Must be a domain verified in Resend.
RESEND_API_KEYnoneResend API key.
GOOGLE_CLIENT_IDnoneGoogle OAuth client. Empty disables Google sign-in.
GOOGLE_CLIENT_SECRETnoneGoogle OAuth secret.
REDIS_URLnoneRedis for what replicas must share: rate limit counts and idempotent answers, e.g. redis://redis:6379/0 (rediss:// for TLS). Empty keeps them in the process's memory, which is enough for one instance. The API refuses to start when it is set and Redis does not answer.
SENTRY_DSNnoneSentry DSN for error reports.

The Google redirect URI to register is $AUTH_BASE_URL/api/v1/auth/oauth2/callback/google.

Browser extensions are a special case of CORS: the API accepts requests whose origin starts with chrome-extension:// or moz-extension:// without listing them.

Web app

apps/app reads its variables at build time: Vite inlines them into the bundle.

VariableDefaultPurpose
VITE_API_URLthe page's own originOrigin of the API. Leave it empty unless the app is hosted somewhere else than the API.
VITE_APP_NAMEMontara PassName shown in the UI.
VITE_API_PROXY_TARGEThttp://localhost:8080Development only: where the Vite dev server proxies /api.

Browser extension

apps/extension reads its defaults at build time from apps/extension/.env. Without that file a development build (watch) uses the local servers and a production build uses https://app.montarapass.com for both.

VariableDevelopmentPurpose
VITE_DEFAULT_API_URLhttp://localhost:8080Origin of the API.
VITE_DEFAULT_APP_URLhttp://localhost:5173The web app that "Open web app" links to.

A production build's Settings offer one Server URL behind a Self-hosted switch; a development build's show both URLs.

On this page