@vibetools/dokploy-mcp 1.2.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -168
- package/dist/api/client.d.ts +2 -1
- package/dist/api/client.js +3 -11
- package/dist/cli/index.js +1 -0
- package/dist/codemode/context/execute-context.d.ts +590 -0
- package/dist/codemode/context/execute-context.js +64 -0
- package/dist/codemode/context/search-context.d.ts +13851 -0
- package/dist/codemode/context/search-context.js +42 -0
- package/dist/codemode/gateway/api-gateway.d.ts +12 -0
- package/dist/codemode/gateway/api-gateway.js +160 -0
- package/dist/codemode/gateway/error-format.d.ts +13 -0
- package/dist/codemode/gateway/error-format.js +9 -0
- package/dist/codemode/gateway/request-normalizer.d.ts +3 -0
- package/dist/codemode/gateway/request-normalizer.js +21 -0
- package/dist/codemode/gateway/trace.d.ts +13 -0
- package/dist/codemode/gateway/trace.js +11 -0
- package/dist/codemode/sandbox/host.d.ts +11 -0
- package/dist/codemode/sandbox/host.js +28 -0
- package/dist/codemode/sandbox/limits.d.ts +2 -0
- package/dist/codemode/sandbox/limits.js +20 -0
- package/dist/codemode/sandbox/runner.d.ts +8 -0
- package/dist/codemode/sandbox/runner.js +113 -0
- package/dist/codemode/sandbox/runtime.d.ts +2 -0
- package/dist/codemode/sandbox/runtime.js +3 -0
- package/dist/codemode/sandbox/serialize.d.ts +1 -0
- package/dist/codemode/sandbox/serialize.js +45 -0
- package/dist/codemode/sandbox/subprocess-runner.d.ts +10 -0
- package/dist/codemode/sandbox/subprocess-runner.js +91 -0
- package/dist/codemode/sandbox/types.d.ts +12 -0
- package/dist/codemode/sandbox/types.js +1 -0
- package/dist/codemode/sandbox/worker-entry.d.ts +1 -0
- package/dist/codemode/sandbox/worker-entry.js +70 -0
- package/dist/codemode/server-codemode.d.ts +2 -0
- package/dist/codemode/server-codemode.js +17 -0
- package/dist/codemode/tools/execute.d.ts +583 -0
- package/dist/codemode/tools/execute.js +64 -0
- package/dist/codemode/tools/index.d.ts +2 -0
- package/dist/codemode/tools/index.js +3 -0
- package/dist/codemode/tools/search.d.ts +2 -0
- package/dist/codemode/tools/search.js +73 -0
- package/dist/generated/dokploy-catalog.d.ts +27 -0
- package/dist/generated/dokploy-catalog.js +16 -0
- package/dist/generated/dokploy-schemas.d.ts +17533 -0
- package/dist/generated/dokploy-schemas.js +20639 -0
- package/dist/generated/dokploy-sdk.d.ts +558 -0
- package/dist/generated/dokploy-sdk.js +561 -0
- package/dist/generated/openapi-index.json +10591 -0
- package/dist/{tools/_factory.js → mcp/tool-factory.js} +7 -5
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -15
- package/package.json +22 -11
- package/dist/tools/_database.d.ts +0 -12
- package/dist/tools/_database.js +0 -115
- package/dist/tools/admin.d.ts +0 -2
- package/dist/tools/admin.js +0 -61
- package/dist/tools/application.d.ts +0 -2
- package/dist/tools/application.js +0 -601
- package/dist/tools/backup.d.ts +0 -2
- package/dist/tools/backup.js +0 -133
- package/dist/tools/certificates.d.ts +0 -2
- package/dist/tools/certificates.js +0 -54
- package/dist/tools/cluster.d.ts +0 -2
- package/dist/tools/cluster.js +0 -38
- package/dist/tools/compose.d.ts +0 -2
- package/dist/tools/compose.js +0 -451
- package/dist/tools/deployment.d.ts +0 -2
- package/dist/tools/deployment.js +0 -107
- package/dist/tools/destination.d.ts +0 -2
- package/dist/tools/destination.js +0 -78
- package/dist/tools/docker.d.ts +0 -2
- package/dist/tools/docker.js +0 -110
- package/dist/tools/domain.d.ts +0 -2
- package/dist/tools/domain.js +0 -147
- package/dist/tools/environment.d.ts +0 -2
- package/dist/tools/environment.js +0 -104
- package/dist/tools/git-provider.d.ts +0 -2
- package/dist/tools/git-provider.js +0 -22
- package/dist/tools/github.d.ts +0 -2
- package/dist/tools/github.js +0 -66
- package/dist/tools/gitlab.d.ts +0 -2
- package/dist/tools/gitlab.js +0 -98
- package/dist/tools/index.d.ts +0 -2
- package/dist/tools/index.js +0 -72
- package/dist/tools/mariadb.d.ts +0 -1
- package/dist/tools/mariadb.js +0 -14
- package/dist/tools/mongo.d.ts +0 -1
- package/dist/tools/mongo.js +0 -13
- package/dist/tools/mounts.d.ts +0 -2
- package/dist/tools/mounts.js +0 -109
- package/dist/tools/mysql.d.ts +0 -1
- package/dist/tools/mysql.js +0 -14
- package/dist/tools/notification.d.ts +0 -2
- package/dist/tools/notification.js +0 -559
- package/dist/tools/patch.d.ts +0 -2
- package/dist/tools/patch.js +0 -179
- package/dist/tools/port.d.ts +0 -2
- package/dist/tools/port.js +0 -54
- package/dist/tools/postgres.d.ts +0 -1
- package/dist/tools/postgres.js +0 -13
- package/dist/tools/preview-deployment.d.ts +0 -2
- package/dist/tools/preview-deployment.js +0 -50
- package/dist/tools/project.d.ts +0 -2
- package/dist/tools/project.js +0 -125
- package/dist/tools/redirects.d.ts +0 -2
- package/dist/tools/redirects.js +0 -53
- package/dist/tools/redis.d.ts +0 -1
- package/dist/tools/redis.js +0 -11
- package/dist/tools/registry.d.ts +0 -2
- package/dist/tools/registry.js +0 -81
- package/dist/tools/rollback.d.ts +0 -2
- package/dist/tools/rollback.js +0 -28
- package/dist/tools/schedule.d.ts +0 -2
- package/dist/tools/schedule.js +0 -92
- package/dist/tools/security.d.ts +0 -2
- package/dist/tools/security.js +0 -48
- package/dist/tools/server.d.ts +0 -2
- package/dist/tools/server.js +0 -192
- package/dist/tools/settings.d.ts +0 -2
- package/dist/tools/settings.js +0 -509
- package/dist/tools/ssh-key.d.ts +0 -2
- package/dist/tools/ssh-key.js +0 -74
- package/dist/tools/user.d.ts +0 -2
- package/dist/tools/user.js +0 -85
- package/dist/tools/volume-backups.d.ts +0 -2
- package/dist/tools/volume-backups.js +0 -96
- /package/dist/{tools/_factory.d.ts → mcp/tool-factory.d.ts} +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ApiError, api } from '../api/client.js';
|
|
2
2
|
function wrapStructured(data) {
|
|
3
|
-
if (Array.isArray(data))
|
|
3
|
+
if (Array.isArray(data)) {
|
|
4
4
|
return { items: data };
|
|
5
|
-
|
|
5
|
+
}
|
|
6
|
+
if (data === null || data === undefined || typeof data !== 'object') {
|
|
6
7
|
return { value: data };
|
|
8
|
+
}
|
|
7
9
|
return data;
|
|
8
10
|
}
|
|
9
11
|
function success(data) {
|
|
@@ -89,9 +91,9 @@ export function getTool(opts) {
|
|
|
89
91
|
},
|
|
90
92
|
handler: async ({ input, api }) => {
|
|
91
93
|
const params = {};
|
|
92
|
-
for (const [
|
|
93
|
-
if (
|
|
94
|
-
params[
|
|
94
|
+
for (const [key, value] of Object.entries(input)) {
|
|
95
|
+
if (value !== undefined && value !== null) {
|
|
96
|
+
params[key] = value;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
return api.get(opts.endpoint, params);
|
package/dist/server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
export declare function createServer(): McpServer;
|
package/dist/server.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { allTools } from './tools/index.js';
|
|
1
|
+
import { createCodeModeServer } from './codemode/server-codemode.js';
|
|
3
2
|
export function createServer() {
|
|
4
|
-
|
|
5
|
-
name: 'dokploy-mcp-server',
|
|
6
|
-
version: '1.0.0',
|
|
7
|
-
});
|
|
8
|
-
for (const tool of allTools) {
|
|
9
|
-
server.registerTool(tool.name, {
|
|
10
|
-
title: tool.title,
|
|
11
|
-
description: tool.description,
|
|
12
|
-
inputSchema: tool.schema,
|
|
13
|
-
annotations: tool.annotations,
|
|
14
|
-
}, tool.handler);
|
|
15
|
-
}
|
|
16
|
-
return server;
|
|
3
|
+
return createCodeModeServer();
|
|
17
4
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibetools/dokploy-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Dokploy MCP server with Code Mode by default",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -16,8 +16,19 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "tsc",
|
|
19
|
+
"build": "npm run clean:dist && npm run build:v2:artifacts && tsc",
|
|
20
|
+
"build:v2:artifacts": "node scripts/v2/resolve-openapi.mjs && node scripts/v2/build-openapi-index.mjs && node scripts/v2/build-runtime-schemas.mjs && node scripts/v2/build-sandbox-sdk.mjs",
|
|
21
|
+
"bench:protocol": "node scripts/v2/measure-tools-list.mjs",
|
|
22
|
+
"bench:search": "node scripts/v2/bench-search.mjs",
|
|
23
|
+
"bench:execute": "node scripts/v2/bench-execute.mjs",
|
|
24
|
+
"bench:sandbox-startup": "node scripts/v2/bench-sandbox-startup.mjs",
|
|
25
|
+
"ci:budgets": "node scripts/v2/check-budgets.mjs",
|
|
26
|
+
"ci:full": "npm test && npm run lint && npm run build && npm run ci:budgets && npm run smoke:mcp && npm run smoke:search && npm run smoke:execute",
|
|
27
|
+
"clean:dist": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
20
28
|
"dev": "tsc --watch",
|
|
29
|
+
"smoke:mcp": "npx -y @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list",
|
|
30
|
+
"smoke:search": "node scripts/v2/smoke-search-live.mjs",
|
|
31
|
+
"smoke:execute": "node scripts/v2/smoke-execute-live.mjs",
|
|
21
32
|
"start": "node dist/index.js",
|
|
22
33
|
"test": "vitest run",
|
|
23
34
|
"test:watch": "vitest",
|
|
@@ -30,19 +41,19 @@
|
|
|
30
41
|
"prepublishOnly": "npm run build"
|
|
31
42
|
},
|
|
32
43
|
"dependencies": {
|
|
33
|
-
"@clack/prompts": "^1.0
|
|
34
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
+
"@clack/prompts": "^1.1.0",
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
35
46
|
"zod": "^4.3.6"
|
|
36
47
|
},
|
|
37
48
|
"devDependencies": {
|
|
38
|
-
"@biomejs/biome": "^2.4.
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"@vitest/coverage-v8": "^4.
|
|
41
|
-
"typescript": "^
|
|
42
|
-
"vitest": "^4.
|
|
49
|
+
"@biomejs/biome": "^2.4.9",
|
|
50
|
+
"@types/node": "^24.0.10",
|
|
51
|
+
"@vitest/coverage-v8": "^4.1.1",
|
|
52
|
+
"typescript": "^6.0.2",
|
|
53
|
+
"vitest": "^4.1.1"
|
|
43
54
|
},
|
|
44
55
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
56
|
+
"node": ">=24.0.0"
|
|
46
57
|
},
|
|
47
58
|
"sideEffects": false,
|
|
48
59
|
"license": "MIT",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type ToolDefinition } from './_factory.js';
|
|
3
|
-
type AnyZodObject = z.ZodObject;
|
|
4
|
-
export interface DatabaseConfig {
|
|
5
|
-
type: string;
|
|
6
|
-
idField: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
defaultImage: string;
|
|
9
|
-
createFields: AnyZodObject;
|
|
10
|
-
}
|
|
11
|
-
export declare function createDatabaseTools(config: DatabaseConfig): ToolDefinition[];
|
|
12
|
-
export {};
|
package/dist/tools/_database.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { getTool, postTool } from './_factory.js';
|
|
3
|
-
export function createDatabaseTools(config) {
|
|
4
|
-
const { type, idField, displayName, defaultImage, createFields } = config;
|
|
5
|
-
const idSchema = z
|
|
6
|
-
.object({ [idField]: z.string().min(1).describe(`Unique ${displayName} database ID`) })
|
|
7
|
-
.strict();
|
|
8
|
-
function tool(action, title, description, schema, opts = {}) {
|
|
9
|
-
const endpoint = `/${type}.${action}`;
|
|
10
|
-
const name = `dokploy_${type}_${action.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`)}`;
|
|
11
|
-
if (opts.get) {
|
|
12
|
-
return getTool({ name, title, description, schema, endpoint, annotations: opts.annotations });
|
|
13
|
-
}
|
|
14
|
-
return postTool({ name, title, description, schema, endpoint, annotations: opts.annotations });
|
|
15
|
-
}
|
|
16
|
-
const one = tool('one', `Get ${displayName} Details`, `Retrieve detailed information about a specific ${displayName} database managed by Dokploy. Returns the full configuration including connection settings, resource limits, environment variables, and current status. Requires the unique ${displayName} database ID.`, idSchema, { get: true });
|
|
17
|
-
const create = tool('create', `Create ${displayName} Database`, `Create a new ${displayName} database instance inside a Dokploy environment. Requires a display name and the target environment ID. Optionally specify an app-level identifier, Docker image, description, or remote server. Returns the newly created database record.`, z
|
|
18
|
-
.object({
|
|
19
|
-
name: z.string().min(1).describe('Display name for the database'),
|
|
20
|
-
appName: z
|
|
21
|
-
.string()
|
|
22
|
-
.min(1)
|
|
23
|
-
.max(63)
|
|
24
|
-
.regex(/^[a-zA-Z0-9._-]+$/)
|
|
25
|
-
.optional()
|
|
26
|
-
.describe('Unique app-level identifier'),
|
|
27
|
-
...createFields.shape,
|
|
28
|
-
environmentId: z.string().min(1).describe('Environment ID to create the database in'),
|
|
29
|
-
dockerImage: z.string().optional().describe(`Docker image (default: ${defaultImage})`),
|
|
30
|
-
description: z.string().nullable().optional().describe('Optional description'),
|
|
31
|
-
serverId: z.string().nullable().optional().describe('Target server ID (null for local)'),
|
|
32
|
-
})
|
|
33
|
-
.strict());
|
|
34
|
-
const update = tool('update', `Update ${displayName} Database`, `Update the configuration of an existing ${displayName} database in Dokploy. Supports modifying the display name, Docker image, resource limits (CPU and memory), custom start command, environment variables, and external port. Requires the ${displayName} database ID. Only the provided fields are updated.`, z
|
|
35
|
-
.object({
|
|
36
|
-
[idField]: z.string().min(1).describe(`Unique ${displayName} database ID`),
|
|
37
|
-
name: z.string().min(1).optional().describe('Display name'),
|
|
38
|
-
appName: z.string().min(1).optional().describe('App-level identifier'),
|
|
39
|
-
description: z.string().nullable().optional().describe('Description'),
|
|
40
|
-
dockerImage: z.string().optional().describe('Docker image'),
|
|
41
|
-
memoryReservation: z.number().nullable().optional().describe('Memory reservation in MB'),
|
|
42
|
-
memoryLimit: z.number().nullable().optional().describe('Memory limit in MB'),
|
|
43
|
-
cpuReservation: z.number().nullable().optional().describe('CPU reservation'),
|
|
44
|
-
cpuLimit: z.number().nullable().optional().describe('CPU limit'),
|
|
45
|
-
command: z.string().nullable().optional().describe('Custom start command'),
|
|
46
|
-
env: z.string().nullable().optional().describe('Environment variables'),
|
|
47
|
-
externalPort: z.number().nullable().optional().describe('External port'),
|
|
48
|
-
})
|
|
49
|
-
.strict());
|
|
50
|
-
const remove = tool('remove', `Remove ${displayName} Database`, `Permanently delete a ${displayName} database from Dokploy. This action removes the database container, its data, and all associated configuration. Requires the ${displayName} database ID. This operation is destructive and cannot be undone.`, idSchema, { annotations: { destructiveHint: true } });
|
|
51
|
-
const move = tool('move', `Move ${displayName} Database`, `Move a ${displayName} database from its current environment to a different environment within Dokploy. Requires the ${displayName} database ID and the destination environment ID. The database configuration and data are preserved during the move.`, z
|
|
52
|
-
.object({
|
|
53
|
-
[idField]: z.string().min(1).describe(`Unique ${displayName} database ID`),
|
|
54
|
-
targetEnvironmentId: z.string().min(1).describe('Destination environment ID'),
|
|
55
|
-
})
|
|
56
|
-
.strict());
|
|
57
|
-
const deploy = tool('deploy', `Deploy ${displayName} Database`, `Deploy a ${displayName} database container in Dokploy. Triggers the build and start process for the specified database. Requires the ${displayName} database ID. Returns the deployment status.`, idSchema);
|
|
58
|
-
const start = tool('start', `Start ${displayName} Database`, `Start a previously stopped ${displayName} database container in Dokploy. The database must already be deployed. Requires the ${displayName} database ID. Returns the updated status after starting.`, idSchema);
|
|
59
|
-
const stop = tool('stop', `Stop ${displayName} Database`, `Stop a running ${displayName} database container in Dokploy. The database data is preserved but the container will no longer accept connections. Requires the ${displayName} database ID. This is a destructive action as it interrupts active connections.`, idSchema, { annotations: { destructiveHint: true } });
|
|
60
|
-
const reload = tool('reload', `Reload ${displayName} Database`, `Reload the ${displayName} database container in Dokploy without a full restart. Applies configuration changes that do not require a rebuild. Requires the ${displayName} database ID and the app-level identifier. Returns the reload status.`, z
|
|
61
|
-
.object({
|
|
62
|
-
[idField]: z.string().min(1).describe(`Unique ${displayName} database ID`),
|
|
63
|
-
appName: z.string().min(1).describe('App-level identifier'),
|
|
64
|
-
})
|
|
65
|
-
.strict());
|
|
66
|
-
const rebuild = tool('rebuild', `Rebuild ${displayName} Database`, `Rebuild the ${displayName} database container from scratch in Dokploy. This tears down the existing container and recreates it with the current configuration. Requires the ${displayName} database ID. Useful after changing the Docker image or when the container is in a broken state.`, idSchema);
|
|
67
|
-
const changeStatus = tool('changeStatus', `Change ${displayName} Status`, `Manually set the application status of a ${displayName} database in Dokploy. Accepts one of: idle, running, done, or error. Requires the ${displayName} database ID and the new status value. Useful for correcting a stale or incorrect status.`, z
|
|
68
|
-
.object({
|
|
69
|
-
[idField]: z.string().min(1).describe(`Unique ${displayName} database ID`),
|
|
70
|
-
applicationStatus: z
|
|
71
|
-
.enum(['idle', 'running', 'done', 'error'])
|
|
72
|
-
.describe('New application status'),
|
|
73
|
-
})
|
|
74
|
-
.strict());
|
|
75
|
-
const saveExternalPort = tool('saveExternalPort', `Save ${displayName} External Port`, `Set or clear the external port mapping for a ${displayName} database in Dokploy. When set, the database is accessible from outside the Docker network on the specified port. Pass null to remove the external port. Requires the ${displayName} database ID.`, z
|
|
76
|
-
.object({
|
|
77
|
-
[idField]: z.string().min(1).describe(`Unique ${displayName} database ID`),
|
|
78
|
-
externalPort: z.number().nullable().describe('External port number (null to remove)'),
|
|
79
|
-
})
|
|
80
|
-
.strict());
|
|
81
|
-
const saveEnvironment = tool('saveEnvironment', `Save ${displayName} Environment`, `Overwrite the environment variables for a ${displayName} database in Dokploy. Replaces all existing environment variables with the provided value. Pass the variables as a single string (one per line, KEY=VALUE format). Requires the ${displayName} database ID.`, z
|
|
82
|
-
.object({
|
|
83
|
-
[idField]: z.string().min(1).describe(`Unique ${displayName} database ID`),
|
|
84
|
-
env: z.string().nullable().optional().describe('Environment variables as a string'),
|
|
85
|
-
})
|
|
86
|
-
.strict());
|
|
87
|
-
const search = tool('search', `Search ${displayName} Databases`, `Search ${displayName} databases in Dokploy by free text or field-specific filters. Supports pagination through limit and offset.`, z
|
|
88
|
-
.object({
|
|
89
|
-
q: z.string().optional().describe('Free-text query'),
|
|
90
|
-
name: z.string().optional().describe('Display name'),
|
|
91
|
-
appName: z.string().optional().describe('App-level identifier'),
|
|
92
|
-
description: z.string().optional().describe('Description'),
|
|
93
|
-
projectId: z.string().optional().describe('Project ID'),
|
|
94
|
-
environmentId: z.string().optional().describe('Environment ID'),
|
|
95
|
-
limit: z.number().min(1).max(100).optional().describe('Maximum number of results'),
|
|
96
|
-
offset: z.number().min(0).optional().describe('Number of results to skip'),
|
|
97
|
-
})
|
|
98
|
-
.strict(), { get: true });
|
|
99
|
-
return [
|
|
100
|
-
one,
|
|
101
|
-
create,
|
|
102
|
-
update,
|
|
103
|
-
remove,
|
|
104
|
-
move,
|
|
105
|
-
deploy,
|
|
106
|
-
start,
|
|
107
|
-
stop,
|
|
108
|
-
reload,
|
|
109
|
-
rebuild,
|
|
110
|
-
changeStatus,
|
|
111
|
-
saveExternalPort,
|
|
112
|
-
saveEnvironment,
|
|
113
|
-
search,
|
|
114
|
-
];
|
|
115
|
-
}
|
package/dist/tools/admin.d.ts
DELETED
package/dist/tools/admin.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { postTool } from './_factory.js';
|
|
3
|
-
// ── tools ────────────────────────────────────────────────────────────
|
|
4
|
-
const setupMonitoring = postTool({
|
|
5
|
-
name: 'dokploy_admin_setup_monitoring',
|
|
6
|
-
title: 'Setup Monitoring',
|
|
7
|
-
description: 'Configure server and container monitoring metrics. Sets up refresh rates, retention policies, callback URLs, resource thresholds, and container service filters for the monitoring system.',
|
|
8
|
-
schema: z
|
|
9
|
-
.object({
|
|
10
|
-
metricsConfig: z
|
|
11
|
-
.object({
|
|
12
|
-
server: z
|
|
13
|
-
.object({
|
|
14
|
-
refreshRate: z
|
|
15
|
-
.number()
|
|
16
|
-
.min(2)
|
|
17
|
-
.describe('Metrics refresh rate in seconds (minimum 2)'),
|
|
18
|
-
port: z.number().min(1).describe('Monitoring port number'),
|
|
19
|
-
token: z.string().describe('Authentication token for metrics endpoint'),
|
|
20
|
-
urlCallback: z.string().url().describe('Callback URL for metrics data'),
|
|
21
|
-
retentionDays: z.number().min(1).describe('Number of days to retain metrics data'),
|
|
22
|
-
cronJob: z
|
|
23
|
-
.string()
|
|
24
|
-
.min(1)
|
|
25
|
-
.describe('Cron expression for scheduled metrics collection'),
|
|
26
|
-
thresholds: z
|
|
27
|
-
.object({
|
|
28
|
-
cpu: z.number().min(0).describe('CPU usage threshold percentage'),
|
|
29
|
-
memory: z.number().min(0).describe('Memory usage threshold percentage'),
|
|
30
|
-
})
|
|
31
|
-
.strict(),
|
|
32
|
-
})
|
|
33
|
-
.strict(),
|
|
34
|
-
containers: z
|
|
35
|
-
.object({
|
|
36
|
-
refreshRate: z
|
|
37
|
-
.number()
|
|
38
|
-
.min(2)
|
|
39
|
-
.describe('Container metrics refresh rate in seconds (minimum 2)'),
|
|
40
|
-
services: z
|
|
41
|
-
.object({
|
|
42
|
-
include: z
|
|
43
|
-
.array(z.string())
|
|
44
|
-
.optional()
|
|
45
|
-
.describe('Service names to include in monitoring'),
|
|
46
|
-
exclude: z
|
|
47
|
-
.array(z.string())
|
|
48
|
-
.optional()
|
|
49
|
-
.describe('Service names to exclude from monitoring'),
|
|
50
|
-
})
|
|
51
|
-
.strict(),
|
|
52
|
-
})
|
|
53
|
-
.strict(),
|
|
54
|
-
})
|
|
55
|
-
.strict(),
|
|
56
|
-
})
|
|
57
|
-
.strict(),
|
|
58
|
-
endpoint: '/admin.setupMonitoring',
|
|
59
|
-
});
|
|
60
|
-
// ── export ───────────────────────────────────────────────────────────
|
|
61
|
-
export const adminTools = [setupMonitoring];
|