Skip to content

Commit 1c6fdc1

Browse files
authored
Merge pull request #4374 from Dokploy/fix/better-auth-secret-hardcoded
fix(security): replace hardcoded BETTER_AUTH_SECRET with Docker secret support
2 parents 547ba2d + 6270bad commit 1c6fdc1

17 files changed

Lines changed: 171 additions & 19 deletions

apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ const BitbucketProviderSchema = z.object({
5858
slug: z.string().optional(),
5959
})
6060
.required(),
61-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
61+
branch: z
62+
.string()
63+
.min(1, "Branch is required")
64+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
6265
bitbucketId: z.string().min(1, "Bitbucket Provider is required"),
6366
watchPaths: z.array(z.string()).optional(),
6467
enableSubmodules: z.boolean().optional(),

apps/dokploy/components/dashboard/application/general/generic/save-git-provider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ const GitProviderSchema = z.object({
4242
repositoryURL: z.string().min(1, {
4343
message: "Repository URL is required",
4444
}),
45-
branch: z.string().min(1, "Branch required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
45+
branch: z
46+
.string()
47+
.min(1, "Branch required")
48+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
4649
sshKey: z.string().optional(),
4750
watchPaths: z.array(z.string()).optional(),
4851
enableSubmodules: z.boolean().default(false),

apps/dokploy/components/dashboard/application/general/generic/save-gitea-provider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ const GiteaProviderSchema = z.object({
7373
owner: z.string().min(1, "Owner is required"),
7474
})
7575
.required(),
76-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
76+
branch: z
77+
.string()
78+
.min(1, "Branch is required")
79+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
7780
giteaId: z.string().min(1, "Gitea Provider is required"),
7881
watchPaths: z.array(z.string()).default([]),
7982
enableSubmodules: z.boolean().optional(),

apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ const GithubProviderSchema = z.object({
5656
owner: z.string().min(1, "Owner is required"),
5757
})
5858
.required(),
59-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
59+
branch: z
60+
.string()
61+
.min(1, "Branch is required")
62+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
6063
githubId: z.string().min(1, "Github Provider is required"),
6164
watchPaths: z.array(z.string()).optional(),
6265
triggerType: z.enum(["push", "tag"]).default("push"),

apps/dokploy/components/dashboard/application/general/generic/save-gitlab-provider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ const GitlabProviderSchema = z.object({
5959
id: z.number().nullable(),
6060
})
6161
.required(),
62-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
62+
branch: z
63+
.string()
64+
.min(1, "Branch is required")
65+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
6366
gitlabId: z.string().min(1, "Gitlab Provider is required"),
6467
watchPaths: z.array(z.string()).optional(),
6568
enableSubmodules: z.boolean().default(false),

apps/dokploy/components/dashboard/compose/general/generic/save-bitbucket-provider-compose.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ const BitbucketProviderSchema = z.object({
5858
slug: z.string().optional(),
5959
})
6060
.required(),
61-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
61+
branch: z
62+
.string()
63+
.min(1, "Branch is required")
64+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
6265
bitbucketId: z.string().min(1, "Bitbucket Provider is required"),
6366
watchPaths: z.array(z.string()).optional(),
6467
enableSubmodules: z.boolean().default(false),

apps/dokploy/components/dashboard/compose/general/generic/save-git-provider-compose.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ const GitProviderSchema = z.object({
4242
repositoryURL: z.string().min(1, {
4343
message: "Repository URL is required",
4444
}),
45-
branch: z.string().min(1, "Branch required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
45+
branch: z
46+
.string()
47+
.min(1, "Branch required")
48+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
4649
sshKey: z.string().optional(),
4750
watchPaths: z.array(z.string()).optional(),
4851
enableSubmodules: z.boolean().default(false),

apps/dokploy/components/dashboard/compose/general/generic/save-gitea-provider-compose.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ const GiteaProviderSchema = z.object({
5858
owner: z.string().min(1, "Owner is required"),
5959
})
6060
.required(),
61-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
61+
branch: z
62+
.string()
63+
.min(1, "Branch is required")
64+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
6265
giteaId: z.string().min(1, "Gitea Provider is required"),
6366
watchPaths: z.array(z.string()).optional(),
6467
enableSubmodules: z.boolean().default(false),

apps/dokploy/components/dashboard/compose/general/generic/save-gitlab-provider-compose.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ const GitlabProviderSchema = z.object({
5959
gitlabPathNamespace: z.string().min(1),
6060
})
6161
.required(),
62-
branch: z.string().min(1, "Branch is required").regex(VALID_BRANCH_REGEX, "Invalid branch name"),
62+
branch: z
63+
.string()
64+
.min(1, "Branch is required")
65+
.regex(VALID_BRANCH_REGEX, "Invalid branch name"),
6366
gitlabId: z.string().min(1, "Gitlab Provider is required"),
6467
watchPaths: z.array(z.string()).optional(),
6568
enableSubmodules: z.boolean().default(false),

apps/dokploy/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"wait-for-postgres-dev": "tsx -r dotenv/config wait-for-postgres.ts",
1515
"reset-password": "node -r dotenv/config dist/reset-password.mjs",
1616
"reset-2fa": "node -r dotenv/config dist/reset-2fa.mjs",
17+
"migrate-auth-secret": "tsx -r dotenv/config scripts/migrate-auth-secret.ts",
1718
"dev": "tsx -r dotenv/config ./server/server.ts --project tsconfig.server.json ",
1819
"studio": "drizzle-kit studio --config ./server/db/drizzle.config.ts",
1920
"migration:generate": "drizzle-kit generate --config ./server/db/drizzle.config.ts",

0 commit comments

Comments
 (0)