diff --git a/apps/dokploy/components/dashboard/database/backups/show-backups.tsx b/apps/dokploy/components/dashboard/database/backups/show-backups.tsx index 1e0ed4db..b9a75e6f 100644 --- a/apps/dokploy/components/dashboard/database/backups/show-backups.tsx +++ b/apps/dokploy/components/dashboard/database/backups/show-backups.tsx @@ -124,7 +124,7 @@ export const ShowBackups = ({ {data?.length === 0 ? ( -
+
To create a backup it is required to set at least 1 provider. diff --git a/apps/dokploy/drizzle/0089_dazzling_marrow.sql b/apps/dokploy/drizzle/0089_dazzling_marrow.sql deleted file mode 100644 index acda5de2..00000000 --- a/apps/dokploy/drizzle/0089_dazzling_marrow.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "backup" ADD COLUMN "metadata" jsonb; \ No newline at end of file diff --git a/apps/dokploy/drizzle/0088_same_ezekiel.sql b/apps/dokploy/drizzle/0089_eminent_winter_soldier.sql similarity index 87% rename from apps/dokploy/drizzle/0088_same_ezekiel.sql rename to apps/dokploy/drizzle/0089_eminent_winter_soldier.sql index 756b7042..e6dc5a1f 100644 --- a/apps/dokploy/drizzle/0088_same_ezekiel.sql +++ b/apps/dokploy/drizzle/0089_eminent_winter_soldier.sql @@ -2,4 +2,5 @@ CREATE TYPE "public"."backupType" AS ENUM('database', 'compose');--> statement-b ALTER TABLE "backup" ADD COLUMN "serviceName" text;--> statement-breakpoint ALTER TABLE "backup" ADD COLUMN "backupType" "backupType" DEFAULT 'database' NOT NULL;--> statement-breakpoint ALTER TABLE "backup" ADD COLUMN "composeId" text;--> statement-breakpoint +ALTER TABLE "backup" ADD COLUMN "metadata" jsonb;--> statement-breakpoint ALTER TABLE "backup" ADD CONSTRAINT "backup_composeId_compose_composeId_fk" FOREIGN KEY ("composeId") REFERENCES "public"."compose"("composeId") ON DELETE cascade ON UPDATE no action; \ No newline at end of file diff --git a/apps/dokploy/drizzle/meta/0089_snapshot.json b/apps/dokploy/drizzle/meta/0089_snapshot.json index 67f8f0b8..62488f21 100644 --- a/apps/dokploy/drizzle/meta/0089_snapshot.json +++ b/apps/dokploy/drizzle/meta/0089_snapshot.json @@ -1,6 +1,6 @@ { - "id": "83185289-c593-420c-b8da-a90143aebf8b", - "prevId": "7fea81ef-e2a7-4a8b-b755-e98903a08b57", + "id": "12ebb86a-87e3-4023-a64d-0c5df96507fb", + "prevId": "c7eae4ce-5acc-439b-962f-bb2ef8922187", "version": "7", "dialect": "postgresql", "tables": { @@ -2107,11 +2107,29 @@ "primaryKey": false, "notNull": true }, + "startedAt": { + "name": "startedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "finishedAt": { + "name": "finishedAt", + "type": "text", + "primaryKey": false, + "notNull": false + }, "errorMessage": { "name": "errorMessage", "type": "text", "primaryKey": false, "notNull": false + }, + "scheduleId": { + "name": "scheduleId", + "type": "text", + "primaryKey": false, + "notNull": false } }, "indexes": {}, @@ -2167,6 +2185,19 @@ ], "onDelete": "cascade", "onUpdate": "no action" + }, + "deployment_scheduleId_schedule_scheduleId_fk": { + "name": "deployment_scheduleId_schedule_scheduleId_fk", + "tableFrom": "deployment", + "tableTo": "schedule", + "columnsFrom": [ + "scheduleId" + ], + "columnsTo": [ + "scheduleId" + ], + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -5261,6 +5292,167 @@ "policies": {}, "checkConstraints": {}, "isRLSEnabled": false + }, + "public.schedule": { + "name": "schedule", + "schema": "", + "columns": { + "scheduleId": { + "name": "scheduleId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cronExpression": { + "name": "cronExpression", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serviceName": { + "name": "serviceName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "shellType": { + "name": "shellType", + "type": "shellType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'bash'" + }, + "scheduleType": { + "name": "scheduleType", + "type": "scheduleType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "script": { + "name": "script", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composeId": { + "name": "composeId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverId": { + "name": "serverId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "userId": { + "name": "userId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "schedule_applicationId_application_applicationId_fk": { + "name": "schedule_applicationId_application_applicationId_fk", + "tableFrom": "schedule", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schedule_composeId_compose_composeId_fk": { + "name": "schedule_composeId_compose_composeId_fk", + "tableFrom": "schedule", + "tableTo": "compose", + "columnsFrom": [ + "composeId" + ], + "columnsTo": [ + "composeId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schedule_serverId_server_serverId_fk": { + "name": "schedule_serverId_server_serverId_fk", + "tableFrom": "schedule", + "tableTo": "server", + "columnsFrom": [ + "serverId" + ], + "columnsTo": [ + "serverId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "schedule_userId_user_temp_id_fk": { + "name": "schedule_userId_user_temp_id_fk", + "tableFrom": "schedule", + "tableTo": "user_temp", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false } }, "enums": { @@ -5439,6 +5631,24 @@ "active", "inactive" ] + }, + "public.scheduleType": { + "name": "scheduleType", + "schema": "public", + "values": [ + "application", + "compose", + "server", + "dokploy-server" + ] + }, + "public.shellType": { + "name": "shellType", + "schema": "public", + "values": [ + "bash", + "sh" + ] } }, "schemas": {}, diff --git a/apps/dokploy/drizzle/meta/_journal.json b/apps/dokploy/drizzle/meta/_journal.json index 1f9e9e02..44136332 100644 --- a/apps/dokploy/drizzle/meta/_journal.json +++ b/apps/dokploy/drizzle/meta/_journal.json @@ -624,6 +624,13 @@ "when": 1746256928101, "tag": "0088_illegal_ma_gnuci", "breakpoints": true + }, + { + "idx": 89, + "version": "7", + "when": 1746287354535, + "tag": "0089_eminent_winter_soldier", + "breakpoints": true } ] } \ No newline at end of file diff --git a/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx b/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx index 5e6cd528..6d86dd3d 100644 --- a/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx +++ b/apps/dokploy/pages/dashboard/project/[projectId]/services/compose/[composeId].tsx @@ -219,10 +219,10 @@ const Service = ( className={cn( "lg:grid lg:w-fit max-md:overflow-y-scroll justify-start", isCloud && data?.serverId - ? "lg:grid-cols-8" + ? "lg:grid-cols-9" : data?.serverId - ? "lg:grid-cols-7" - : "lg:grid-cols-8", + ? "lg:grid-cols-8" + : "lg:grid-cols-9", )} > General @@ -230,8 +230,8 @@ const Service = ( Domains Deployments Backups - Logs Schedules + Logs {((data?.serverId && isCloud) || !data?.server) && ( Monitoring )} diff --git a/packages/server/package.json b/packages/server/package.json index cef43fea..a02d7c21 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,32 +1,21 @@ { "name": "@dokploy/server", "version": "1.0.0", - "main": "./dist/index.js", + "main": "./src/index.ts", "type": "module", "exports": { - ".": { - "import": "./dist/index.js", - "require": "./dist/index.cjs.js" - }, + ".": "./src/index.ts", "./db": { - "import": "./dist/db/index.js", + "import": "./src/db/index.ts", "require": "./dist/db/index.cjs.js" }, - "./*": { - "import": "./dist/*", - "require": "./dist/*.cjs" + "./setup/*": { + "import": "./src/setup/*.ts", + "require": "./dist/setup/index.cjs.js" }, - "./dist": { - "import": "./dist/index.js", - "require": "./dist/index.cjs.js" - }, - "./dist/db": { - "import": "./dist/db/index.js", - "require": "./dist/db/index.cjs.js" - }, - "./dist/db/schema": { - "import": "./dist/db/schema/index.js", - "require": "./dist/db/schema/index.cjs.js" + "./constants": { + "import": "./src/constants/index.ts", + "require": "./dist/constants.cjs.js" } }, "scripts": {