Environments and configuration
We propose isolating local, staging and production data, secrets and publishing addresses.
A test generation must not change a real site or use its private materials.
Environments
| Environment | Purpose | Status |
|---|---|---|
| Local | Development and checks in a particular checkout | Startup commands exist in the repository |
| Staging | Generation, publishing, migrations and recovery on test data | Needs preparation and verification |
| Production | Customer sites and live data | The full service was not confirmed in this audit |
| Documentation | Public product description | Runs separately on DigitalOcean |
Staging needs separate database credentials, file space and a test domain. Tests do not use production keys or run bulk generations at customers' expense.
Local work
Startup and port assignment are defined by AGENTS.md, the Makefile and the current environment's port registry. Use make setup, make dev, make ports; make dev puts demo data into an empty database by itself, and make seed resets the database to it. For documentation-only work, install its dependencies and run make dev-docs DOCS_PORT=<available-allowed-port>.
An uncommitted local port migration was found in the root checkout during the review, so this page does not introduce another competing address table. After changing checkouts, inspect actual make ports output. make archive stops the checkout while preserving the shared database; make down stops the database too.
Environment files. api/.env.example holds exactly what the local stand needs: the database, the two secrets make dev generates, MAIL_TRANSPORT=memory (letters become files in api/storage/outbox) and PUBLISH_DOMAIN=localhost. make dev copies it to api/.env.dev once and passes the ports and addresses itself; the app, admin and website have no env file of their own. The local Agentfy needs no keys: the seed knows the local partner's. Snapshots additionally need Chromium, installed once with cd api && bun run browser. The root .env holds the owner's tools only (.env.tools.example); production compose reads .env.prod (.env.prod.example).
Application configuration
| Purpose | Existing variables |
|---|---|
| Database | DATABASE_URL |
| Authentication | JWT_SECRET (32+ characters), JWT_ACCESS_TTL, JWT_REFRESH_TTL; platform administrators via bun run platform-admin grant <email> |
| Settings encryption | SETTINGS_KEY, and SETTINGS_KEY_PREVIOUS during rotation |
Agentfy connection (development env source and Import only; production reads Settings) | AGENTFY_INTEGRATION_MODE, AGENTFY_URL, AGENTFY_ORG_ID, AGENTFY_ORG_ENVIRONMENT, AGENTFY_ORG_KEY (the one organization key, for agent creation and chat), MCP_PUBLIC_URL, AGENTFY_MODEL_ID |
| Public API | PUBLIC_URL, CORS_ORIGIN |
| Local files | STORAGE_DRIVER=local, STORAGE_ROOT |
| S3-compatible files | STORAGE_DRIVER=s3, S3_BUCKET, S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY |
| Additional S3 options | S3_REGION, S3_FORCE_PATH_STYLE |
| Payments | BILLING_PROVIDER (paypal, the default, or accounting), ACCOUNTING_URL (api, default https://pay.dreamvention.com), ACCOUNTING_PAY_URL (where widget.js is served; default ACCOUNTING_URL), ACCOUNTING_KEY (sk_test_…/sk_live_…, a secret), ACCOUNTING_WEBHOOK_SECRET (whsec_…, a secret); see below |
| Error reports (GlitchTip) | SENTRY_DSN, SENTRY_ENVIRONMENT (prod, dev, local), SENTRY_RELEASE; see operations |
Do not put secret values in documentation, client bundles or logs. Integration settings in the current application may also be stored in the database; moving an environment requires coordinated transfer of encrypted data and its key, not just env changes.
In the existing image, public Nuxt settings are embedded at build time. /v1 and /admin/ are defined in the Dockerfile; changing a runtime variable does not rewrite built JavaScript.
Browser errors (GlitchTip). The app, the admin panel and the website report errors that happen in the visitor's browser, each to its own GlitchTip project. The build reads APP_SENTRY_DSN, ADMIN_SENTRY_DSN and WEBSITE_SENTRY_DSN; an empty DSN means no tracking and no requests. SENTRY_ENVIRONMENT must be prod, dev or local (anything else keeps reporting off) and SENTRY_RELEASE is the git sha, the same values the API reads. Expected refusals, network drops and browser extensions are not reported; a report carries the account id only, and addresses lose their query. Source maps are uploaded only when the build has SENTRY_AUTH_TOKEN (with SENTRY_URL, SENTRY_ORG and the *_SENTRY_PROJECT names) and are never published. Locally, APP_SENTRY_DSN=… make dev turns it on as local.
Payments (accounting). BILLING_PROVIDER=paypal keeps Bonsite's own PayPal, configured in the panel, exactly as before. BILLING_PROVIDER=accounting sends new subscriptions and credit top-ups to accounting's checkout (pay.dreamvention.com) instead, and adds the team's Billing section (/team/billing, the team owner only): accounting's embeddable widget, with a 15-minute token the API asks accounting for (POST /api/v1/customer-tokens), themed with Bonsite's primary colour; PayPal subscriptions already running are still followed. accounting is on only when ACCOUNTING_KEY and ACCOUNTING_WEBHOOK_SECRET are set; otherwise plans and top-ups are given without paying, as with PayPal off. The team is accounting's customer (externalId = team id) and the owner who pays gives the email and name. accounting's plan codes are bonsite-<plan>-month|year and bonsite-credits-<credits> for the top-up; its webhook URL is the API's address + /v1/billing/accounting/webhook. A subscription is cancelled or changed in that widget (accounting has no cancel call), the widget's origin must allow Bonsite's app origin (accounting's per-product allowedOrigins; localhost is allowed for test keys), a refund is recorded and takes no credits back (as with PayPal). In production the two secrets live in Infisical, never in git. Locally make dev uses BILLING_PROVIDER=accounting and reads the ACCOUNTING_* values from ~/Sites/dreamvention/tools/accounting/.local/bonsite.env when the local accounting has written it (tools repo, accounting README «Локально с продуктом»); make dev ACCOUNTING_ENV=<file> reads another file, make dev BILLING_PROVIDER=paypal brings PayPal back.
Proposed hosting
DigitalOcean remains a platform candidate: application, separate worker, PostgreSQL and S3-compatible files. Cloudflare is the target domain mechanism in publishing. Resource sizes, regions, pricing plans and specific database/queue products have not been approved or purchased.