Skip to content

[codex] Allow opt-in self-hosted registration#4438

Open
swhan0329 wants to merge 2 commits into
Dokploy:canaryfrom
swhan0329:codex/allow-self-hosted-registration
Open

[codex] Allow opt-in self-hosted registration#4438
swhan0329 wants to merge 2 commits into
Dokploy:canaryfrom
swhan0329:codex/allow-self-hosted-registration

Conversation

@swhan0329
Copy link
Copy Markdown

@swhan0329 swhan0329 commented May 20, 2026

Summary

Adds an opt-in self-hosted registration path for the unchecked “Enable the option to register new users” item from #1413.

Self-hosted instances still keep the existing safe default: once an owner exists, /register redirects back to login and server-side sign-up is blocked. When an operator explicitly sets DOKPLOY_ALLOW_REGISTRATION=true, the login page exposes the registration link, /register remains reachable, and non-invited email sign-ups can create their own default organization.

Details

  • Adds DOKPLOY_ALLOW_REGISTRATION, defaulting to disabled unless the env value is exactly true.
  • Keeps first-owner setup behavior unchanged for fresh self-hosted installs.
  • Keeps invitation and SSO flows separate from the new open-registration path.
  • Guards invited self-hosted signups so the opt-in open-registration path does not create an extra default owner organization for invitation-based onboarding.
  • Adds the env var to local and production env examples.
  • Adds focused unit coverage for the opt-in flag parser and the default-organization creation decision.

Validation

  • pnpm exec biome check --write --no-errors-on-unmatched --files-ignore-unknown=true packages/server/src/constants/index.ts packages/server/src/lib/auth.ts apps/dokploy/__test__/auth/registration-config.test.ts
  • pnpm --filter=dokploy exec vitest run __test__/auth/registration-config.test.ts --config __test__/vitest.config.ts
  • pnpm --filter=dokploy run typecheck
  • pnpm --filter=@dokploy/server run typecheck

Note: local validation ran on Node v20.18.1, so pnpm emitted the repository engine warning for Node ^24.4.0, but the listed checks completed successfully.

/claim #1413

@swhan0329 swhan0329 requested a review from Siumauricio as a code owner May 20, 2026 18:48
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant