Skip to content

docs(env): sync env example files, fix CLAUDE.md drift, add process rule#393

Merged
driaug merged 6 commits into
useplunk:nextfrom
andygrunwald:andygrunwald/sync-env-vars-and-add-process-rule
May 24, 2026
Merged

docs(env): sync env example files, fix CLAUDE.md drift, add process rule#393
driaug merged 6 commits into
useplunk:nextfrom
andygrunwald:andygrunwald/sync-env-vars-and-add-process-rule

Conversation

@andygrunwald
Copy link
Copy Markdown
Contributor

Description

Three sources describe Plunk's environment variables and they had drifted apart:

  • apps/api/.env.example (development defaults)
  • .env.self-host.example (production/self-host template)
  • apps/wiki/content/docs/self-hosting/environment-variables.mdx (user-facing reference)

This PR brings them into parity in one shot and adds a CLAUDE.md rule so future env-var changes are required to touch all three locations.

Type of Change

  • feat: New feature (MINOR version bump)
  • fix: Bug fix (PATCH version bump)
  • feat!: Breaking change - new feature (MAJOR version bump)
  • fix!: Breaking change - bug fix (MAJOR version bump)
  • docs: Documentation update (no version bump)
  • chore: Maintenance/dependencies (no version bump)
  • refactor: Code refactoring (no version bump)
  • test: Adding tests (no version bump)
  • perf: Performance improvement (PATCH version bump)

Checklist

  • PR title follows conventional commits format
  • Code builds successfully (no code changes; docs/templates only)
  • Tests pass locally (n/a — no code paths touched)
  • Documentation updated (the wiki update is part of this PR)

Related Issues

None

andygrunwald and others added 5 commits May 24, 2026 12:55
Brings the self-hosting template into parity with apps/api/.env.example and the
env vars wiki. Adds (mostly commented for visibility without changing default
behaviour):

- NODE_ENV, DATABASE_URL, DIRECT_DATABASE_URL, REDIS_URL, PORT
  (Docker auto-configures these via DB_PASSWORD; the lines document overrides)
- Stripe billing block (STRIPE_SK, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_*,
  STRIPE_METER_EVENT_NAME)
- Attachments (MAX_ATTACHMENT_SIZE_MB, MAX_ATTACHMENTS_COUNT)
- SMTP_ENABLED in the SMTP Server block
- VERIFY_EMAIL_ON_SIGNUP in User Management
- Phishing Detection block (OPENROUTER_*, PHISHING_*)

Each was either present in apps/api/.env.example or documented in the wiki but
missing from the production template, forcing self-hosters to read source or
the wiki to discover them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brings the dev template into parity with the env vars wiki for variables a
developer might toggle locally:

- PORT (in Environment & Security)
- PLUNK_FROM_ADDRESS (in Plunk API)
- New sections: Notifications (NTFY_URL), Attachments, User Management
  (DISABLE_SIGNUPS, VERIFY_EMAIL_ON_SIGNUP), Phishing Detection

All additions are commented so default local behaviour is unchanged. Vars that
only make sense in the bundled Docker stack (SMTP relay ports, Minio internals,
NEXT_PUBLIC_*, NGINX_PORT) are intentionally omitted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both variables exist in .env.self-host.example but were missing from the
user-facing env vars reference, so self-hosters had to read the example file's
inline comments to discover them.

- MAIL_FROM_SUBDOMAIN: added a row to the AWS SES section explaining how the
  prefix combines with a verified domain to construct the MAIL FROM hostname,
  and when to override the default.
- NGINX_PORT: added a new "Advanced" section for variables that almost never
  need tuning, with the host-port override use-case spelled out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CLAUDE.md listed the default as 85, but the source of truth
(apps/api/src/app/constants.ts:137) and the env vars wiki both use 95. Aligning
CLAUDE.md so future contributors don't propagate the stale value into new code
or docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Plunk has three sources of truth for environment variables:

1. apps/api/.env.example — local development defaults
2. .env.self-host.example — self-hosting/production template
3. apps/wiki/content/docs/self-hosting/environment-variables.mdx — user-facing reference

They have drifted repeatedly when new vars land in one location only. Codify
the requirement to update all three in the same change as part of CLAUDE.md so
future Claude-assisted (and human) contributions don't reintroduce the drift.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@driaug
Copy link
Copy Markdown
Member

driaug commented May 24, 2026

.env.self-host.example is minimal on purpose. It is intended as the minimal environment setup needed to run Plunk.

@andygrunwald
Copy link
Copy Markdown
Contributor Author

Understood. Happy to revert the changes on .env.self-host.example.
Do you see the other changes as useful or rather closing the full PR as not merged?

@driaug
Copy link
Copy Markdown
Member

driaug commented May 24, 2026

Just reverting the .env for self hosting is sufficient.

@andygrunwald
Copy link
Copy Markdown
Contributor Author

@driaug Reverted 1c1c95d

@driaug driaug merged commit 6ebbb50 into useplunk:next May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants