Merge branch 'canary' into feat/add-network-management

This commit is contained in:
Mauricio Siu
2026-07-21 19:01:28 -06:00
582 changed files with 98035 additions and 10066 deletions

View File

@@ -1,3 +1,4 @@
import { VALID_BRANCH_REGEX } from "@dokploy/server/utils/git-branch-validation";
import { relations } from "drizzle-orm";
import {
bigint,
@@ -50,7 +51,12 @@ import {
UpdateConfigSwarmSchema,
} from "./shared";
import { sshKeys } from "./ssh-key";
import { APP_NAME_MESSAGE, APP_NAME_REGEX, generateAppName } from "./utils";
import {
APP_NAME_MESSAGE,
APP_NAME_REGEX,
encryptedText,
generateAppName,
} from "./utils";
export const sourceType = pgEnum("sourceType", [
"docker",
"git",
@@ -81,11 +87,11 @@ export const applications = pgTable("application", {
.$defaultFn(() => generateAppName("app"))
.unique(),
description: text("description"),
env: text("env"),
previewEnv: text("previewEnv"),
env: encryptedText("env"),
previewEnv: encryptedText("previewEnv"),
watchPaths: text("watchPaths").array(),
previewBuildArgs: text("previewBuildArgs"),
previewBuildSecrets: text("previewBuildSecrets"),
previewBuildArgs: encryptedText("previewBuildArgs"),
previewBuildSecrets: encryptedText("previewBuildSecrets"),
previewLabels: text("previewLabels").array(),
previewWildcard: text("previewWildcard"),
previewPort: integer("previewPort").default(3000),
@@ -104,8 +110,8 @@ export const applications = pgTable("application", {
"previewRequireCollaboratorPermissions",
).default(true),
rollbackActive: boolean("rollbackActive").default(false),
buildArgs: text("buildArgs"),
buildSecrets: text("buildSecrets"),
buildArgs: encryptedText("buildArgs"),
buildSecrets: encryptedText("buildSecrets"),
memoryReservation: text("memoryReservation"),
memoryLimit: text("memoryLimit"),
cpuReservation: text("cpuReservation"),
@@ -434,17 +440,22 @@ export const apiSaveBuildType = createSchema
.required()
.merge(createSchema.pick({ publishDirectory: true, isStaticSpa: true }));
const branchField = z
.string()
.min(1)
.regex(VALID_BRANCH_REGEX, "Invalid branch name");
export const apiSaveGithubProvider = createSchema
.pick({
applicationId: true,
repository: true,
branch: true,
owner: true,
buildPath: true,
githubId: true,
})
.required()
.extend({
branch: branchField,
triggerType: z.enum(["push", "tag"]).default("push"),
})
.required()
@@ -453,7 +464,6 @@ export const apiSaveGithubProvider = createSchema
export const apiSaveGitlabProvider = createSchema
.pick({
applicationId: true,
gitlabBranch: true,
gitlabBuildPath: true,
gitlabOwner: true,
gitlabRepository: true,
@@ -462,11 +472,11 @@ export const apiSaveGitlabProvider = createSchema
gitlabPathNamespace: true,
})
.required()
.extend({ gitlabBranch: branchField })
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveBitbucketProvider = createSchema
.pick({
bitbucketBranch: true,
bitbucketBuildPath: true,
bitbucketOwner: true,
bitbucketRepository: true,
@@ -475,18 +485,19 @@ export const apiSaveBitbucketProvider = createSchema
applicationId: true,
})
.required()
.extend({ bitbucketBranch: branchField })
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveGiteaProvider = createSchema
.pick({
applicationId: true,
giteaBranch: true,
giteaBuildPath: true,
giteaOwner: true,
giteaRepository: true,
giteaId: true,
})
.required()
.extend({ giteaBranch: branchField })
.merge(createSchema.pick({ enableSubmodules: true, watchPaths: true }));
export const apiSaveDockerProvider = createSchema
@@ -501,7 +512,6 @@ export const apiSaveDockerProvider = createSchema
export const apiSaveGitProvider = createSchema
.pick({
customGitBranch: true,
applicationId: true,
customGitBuildPath: true,
customGitUrl: true,
@@ -509,6 +519,7 @@ export const apiSaveGitProvider = createSchema
enableSubmodules: true,
})
.required()
.extend({ customGitBranch: branchField })
.merge(
createSchema.pick({
customGitSSHKeyId: true,