ProsewireDocs

Configuration map

Runtime, authentication, email, bootstrap, worker, and documentation-site settings for Prosewire.

Keep production configuration in the deployment platform’s secret store. Do not commit a populated .env file or bake secrets into an image.

Runtime and database

VariableRequiredPurpose
DATABASE_URLYesPostgres connection used by migrations, web, and worker
PROSEWIRE_PUBLIC_URLProductionExternal origin used by the server for links such as invitations
NEXT_PUBLIC_PROSEWIRE_PUBLIC_URLProductionMatching browser-visible origin used by the authentication client
PROSEWIRE_DEFAULT_BLOGNoDevelopment default publication slug; defaults to fieldnotes
PROSEWIRE_MIGRATIONS_DIRContainer defaultOverride the directory containing committed Drizzle migrations
POSTGRES_PASSWORDDefault Compose onlyPassword interpolated into the bundled Postgres service and application URL

Use the same DATABASE_URL for the migration, web, and worker processes. In Compose, choose a URL-safe POSTGRES_PASSWORD because it is interpolated into a connection URL.

The two public URL values should be the same external HTTPS origin seen by users. Do not include a path suffix.

Authentication and email

VariableRequiredPurpose
BETTER_AUTH_SECRETYesUnique authentication secret of at least 32 characters
PROSEWIRE_ALLOW_SIGN_UPNoEnables open account registration; defaults to false
SMTP_URLProduction invitationsSMTP or SMTPS connection URL
EMAIL_FROMProduction emailSender identity; defaults to a localhost address in development

Enable PROSEWIRE_ALLOW_SIGN_UP=true only to create the first owner or when open registration is intentional. Set it back to false and replace web replicas after bootstrap. A valid, unexpired invitation still allows its invited email address to create an account.

Test SMTP delivery and invitation links from the public origin before onboarding a team.

Rolling and multi-instance deployments

VariableRequiredPurpose
NEXT_SERVER_ACTIONS_ENCRYPTION_KEYMulti-instance productionStable base64-encoded 32-byte key shared by web replicas and releases
NEXT_DEPLOYMENT_IDProductionRelease identifier shared by every web replica serving the same build

Generate the server-action key with openssl rand -base64 32 and store it as a secret. Rotating it during a rollout can break requests created by a different replica or release.

Use an immutable version, commit, or digest as NEXT_DEPLOYMENT_ID. Change it when the deployed web assets change, not per replica or restart.

Worker retention

VariableRequiredPurpose
PROSEWIRE_ANALYTICS_RETENTION_DAYSNoPositive integer controlling raw page-view retention; defaults to 365

The worker removes raw view events older than the configured period. Aggregate metrics and your infrastructure’s backup retention are separate concerns.

Development seed only

VariableRequired in developmentPurpose
ADMIN_EMAILYesEmail for the local seeded administrator
ADMIN_PASSWORDYesUnique password of at least 12 characters
PROSEWIRE_SEED_API_KEYNoOne-time local key of at least 24 characters with read and write scopes

The example values are local-only. Development web startup runs migrations and seed logic; production web startup does neither. Production uses the one-shot migration command and account bootstrap flow instead.

Development and test controls

PROSEWIRE_ALLOWED_DEV_ORIGINS is a comma-separated Next.js development-origin allowlist. PROSEWIRE_EXPOSE_TESTING_API=1 exposes framework testing support in production builds and is reserved for controlled acceptance tests; never enable it on a public deployment.

Documentation site

The separate Astro landing page and documentation site uses SITE_URL for canonical links, its sitemap, and robots.txt:

SITE_URL=https://docs.example.com pnpm --filter @prosewire/site build:production

A production build rejects a missing, local, reserved, or known dead origin. SITE_URL configures the documentation site only; it does not configure the Prosewire publishing application.

Security checks

  • Use unique values per environment
  • Keep Postgres on a private network and require TLS for remote connections
  • Store API tokens as hashes and use the narrowest read/write scope
  • Rotate a compromised API key by creating a replacement, changing the consumer, then revoking the old key
  • Back up Postgres and test a restore before launch