Bug: Initial Admin Role, HTTPS Session 403, and Git Provider Access on Self-Hosted
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 3k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 73
Description
To Reproduce
Summary
When running Dokploy self-hosted, three interrelated permission and authentication issues affect initial setup, domain access over HTTPS, and Git provider access:
Issue 1: Initial Registration Role set to user instead of admin
During the initial setup/registration of a self-hosted Dokploy instance, the first registered user is created in the user table with role: "user" instead of role: "admin".
- Impact: The primary administrator/owner account lacks global admin privileges out of the box, requiring manual database updates (
UPDATE "user" SET role = 'admin') to grant full platform access.
Issue 2: Hardcoded useSecureCookies: false in auth.ts Causes 403 Forbidden on HTTPS Custom Domains
In packages/server/src/lib/auth.ts, useSecureCookies and secure cookie attributes are hardcoded to false for non-cloud (self-hosted) instances:
...(!IS_CLOUD
? {
advanced: {
useSecureCookies: false,
defaultCookieAttributes: {
sameSite: "lax",
secure: false,
httpOnly: true,
path: "/",
},
},
}
: {}),
### Current vs. Expected behavior
Expected initial admin registration to assign role: 'admin', HTTPS domain sessions to validate without 403, and Git providers to load for organization owners. Currently 403 Forbidden is returned over HTTPS and member permissions default to false.
### Provide environment information
```bash
Operating System: Ubuntu 24.04 LTS (x86_64)
Dokploy version: v0.30.2
VPS Provider: Azure
Which area(s) are affected? (Select all that apply)
Installation, Local Development, Databases
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
No response
Will you send a PR to fix it?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/server/src/lib/auth.ts to inspect the cookie settings related to HTTPS sessions. Then trace the initial registration role assignment and Git provider member-permission paths. Done means the first self-hosted user is an admin, HTTPS custom-domain sessions avoid 403 responses, and Git providers load for organization owners.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, authorization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100