Skip to content

fix(db): add the forgot-password keys to the whitelabelingConfig default - #119

Merged
agentHits merged 1 commit into
AgentHits-Devfrom
fix/whitelabeling-config-default
Oct 28, 2026
Merged

agentHits merged 1 commit into
AgentHits-Devfrom
fix/whitelabeling-config-default

Conversation

@agentHits

@agentHits agentHits commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

Migration 0211_whitelabeling_config_default brings the database default of webServerSettings.whitelabelingConfig in line with the Drizzle schema. The default keeps the same object and adds "passwordResetGuide": null and "supportEmail": null. After this PR, bunx drizzle-kit generate --config ./server/db/drizzle.config.ts in apps/dokploy reports no changes.

Why

Upstream commit 44fc4ccc6 (feat(enterprise): custom forgot password flow in whitelabeling settings) added the two keys to the schema default in packages/server/src/db/schema/web-server-settings.ts but shipped no migration. The upstream sync of 2026-10-26 (#87) brought the change into the fork. Upstream canary still has no migration for it: its latest snapshot (0198) lacks both keys too.

Because of this gap, every drizzle-kit generate emitted ALTER TABLE "webServerSettings" ALTER COLUMN "whitelabelingConfig" SET DEFAULT '{...}'::jsonb. Any unrelated schema change picked the statement up, and #118 had to drop it from its Railpack migration by hand. Now it has its own migration.

Effect on existing panels

  • Only the column default changes, so the keys go only into rows inserted later, i.e. on a fresh install. Existing webServerSettings rows keep their config as it is.
  • No backfill is needed, because every reader treats a missing key as null:
    • getPublicWhitelabelingConfig returns config.passwordResetGuide ?? null and config.supportEmail ?? null;
    • the login page shows the custom forgot-password flow only when !!whitelabeling?.supportEmail, and falls back to the default text when passwordResetGuide is empty;
    • the whitelabeling settings form loads data.passwordResetGuide ?? "" and data.supportEmail ?? "";
    • saving and resetting write the whole object, both keys included.

Order with #118

The migration was first generated as 0210 alongside #118, which also added a 0210. #118 merged first, so this migration was regenerated on top of it as 0211. Its snapshot's prevId is the id of #118's 0210 snapshot, and its journal when (1793209780808) is later than 0210's (1793202867422), so the migrator applies both in order.

Checks

  • drizzle-kit generate after the migration: No schema changes, nothing to migrate.
  • 0211_snapshot.json differs from 0210_snapshot.json only in id/prevId and this default.
  • Migration chain on a fresh Postgres 18, run with the panel's own migration.ts:
    • migrations up to 0210 from AgentHits-Dev applied, then a webServerSettings row was inserted;
    • with this branch's journal, 0211 applied, and the row inserted before it kept its config without the two keys, while a row inserted after it got both as null;
    • a second run changed nothing.
  • Vitest on the whitelabeling and migration tests (update-server-config, migration-exit-code, high-findings-regression, super-password-*, install-agenthits-update, env/encryption): 7 files, 118 passed.
  • bun run typecheck: clean in all four packages.
  • Vitest and typecheck ran before the regeneration on top of fix(image): drop unused binaries, bump bundled tools, scan the image with Trivy #118. This PR changes no TypeScript, and CI runs both again on the current base.

🤖 Generated with Claude Code

The Drizzle schema default of webServerSettings.whitelabelingConfig has
the keys passwordResetGuide and supportEmail, but the database default
set by the migrations does not. Upstream commit 44fc4cc ("custom
forgot password flow in whitelabeling settings") added the keys to the
schema without a migration, and the upstream sync of 2026-10-26 (#87)
brought that into the fork. Upstream canary has no migration for it
either. Every drizzle-kit generate therefore emitted
ALTER COLUMN "whitelabelingConfig" SET DEFAULT, and any schema change
picked it up as an unrelated statement (#118 had to drop it by hand).

Migration 0211_whitelabeling_config_default, right after #118's
0210_railpack_default_0_42_0, sets the column default to the schema's:
the same object plus "passwordResetGuide":null and "supportEmail":null.
drizzle-kit generate now reports no changes.

Only the default changes, so only rows inserted later (a fresh install)
get the keys. Existing rows are not backfilled: every reader treats a
missing key as null (getPublicWhitelabelingConfig with ?? null, the
login page with !!supportEmail, the settings form with ?? ""), and save
and reset write the whole object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agentHits
agentHits force-pushed the fix/whitelabeling-config-default branch from 695cd90 to 72034cb Compare October 28, 2026 17:50
@agentHits
agentHits merged commit 4ddcbdb into AgentHits-Dev Oct 28, 2026
7 checks passed
@agentHits
agentHits deleted the fix/whitelabeling-config-default branch October 29, 2026 00:24
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.

1 participant