Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ The configuration on Windows is slightly different compared to Linux or macOS. U
| `DOKPLOY_TIMEOUT` | No | Request timeout in milliseconds (default: `30000`) |
| `DOKPLOY_RETRY_ATTEMPTS` | No | Number of retry attempts (default: `3`) |
| `DOKPLOY_RETRY_DELAY` | No | Delay between retries in milliseconds (default: `1000`) |
| `DOKPLOY_REDACT_ENV` | No | When `true`, redacts secret-bearing fields from API responses before they reach the MCP client (default: `false`). Useful when an LLM consumes responses and you don't want env vars or compose files in its context. |
| `DOKPLOY_REDACT_ENV` | No | Redacts secret-bearing fields (env vars, compose files, passwords, tokens, keys) from API responses before they reach the MCP client (default: `true`). Set to `false` only if you explicitly need raw secret values in LLM context. |
| `DOKPLOY_REDACT_FIELDS` | No | Comma-separated list of response field names to redact when `DOKPLOY_REDACT_ENV=true`. Matched case-insensitively at any nesting depth. Defaults to: `env`, `buildArgs`, `composeFile`, `dockerCompose`, `environment`, `buildSecrets`, `previewBuildSecrets`, `password`, `currentPassword`, `appPassword`, `databasePassword`, `databaseRootPassword`, `redisPassword`, `mariadbPassword`, `mongoPassword`, `mysqlPassword`, `postgresPassword`, `registryPassword`, `token`, `accessToken`, `appToken`, `apiToken`, `botToken`, `refreshToken`, `secret`, `clientSecret`, `apiKey`, `secretAccessKey`, `accessKey`, `licenseKey`, `userKey`, `privateKey`, `privateKeyPass`, `encPrivateKey`, `encPrivateKeyPass`, `sshKey`, `sshPrivateKey`, `customGitSSHKey`, `dockerAuth`. |

For Dokploy instances behind Cloudflare Access or a similar reverse proxy, pass service-token headers with placeholder values like this:
Expand Down
14 changes: 14 additions & 0 deletions src/utils/clientConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,17 @@ describe("parseCustomHeaders", () => {
);
});
});

describe("getClientConfig", () => {
it("enables response redaction by default", async () => {
process.env.DOKPLOY_URL = "https://example.com";
process.env.DOKPLOY_API_KEY = "test-key";
delete process.env.DOKPLOY_REDACT_ENV;

const { getClientConfig } = await import("./clientConfig.js");
const config = getClientConfig();

expect(config.redactEnv).toBe(true);
expect(config.redactFields.length).toBeGreaterThan(0);
});
});
2 changes: 1 addition & 1 deletion src/utils/clientConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ConfigManager {
throw new Error("Environment variable DOKPLOY_API_KEY is not defined");
}

const redactEnv = parseBoolean(process.env.DOKPLOY_REDACT_ENV, false);
const redactEnv = parseBoolean(process.env.DOKPLOY_REDACT_ENV, true);
const parsedFields =
process.env.DOKPLOY_REDACT_FIELDS?.split(",")
.map((f) => f.trim())
Expand Down