mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-24 05:52:19 +00:00
Adds Scaleway Secret Manager as a first-class vault provider alongside HashiCorp Vault/OpenBao, Infisical, AWS, Doppler and Azure Key Vault. - New `scaleway` provider type, zod-validated config (region, project ID, API secret key, overridable API URL) and migration adding the enum value - Plain `fetch` client (no new dependency) against the Secret Manager v1beta1 REST API: access-by-path for reads, paginated listing for the env editor autocomplete, and a connection test - Refs are `[folder/]name[:field]` — the field selector extracts a key from JSON/key-value secrets, like the AWS provider - Secret key masked in API responses like every other provider credential - Settings -> Secrets form with region picker, brand icon and reference format help
171 lines
4.6 KiB
TypeScript
171 lines
4.6 KiB
TypeScript
import { db } from "@dokploy/server/db";
|
|
import {
|
|
type VaultProviderConfig,
|
|
vaultProvider,
|
|
} from "@dokploy/server/db/schema";
|
|
import { eq } from "drizzle-orm";
|
|
import { awsClient } from "./aws";
|
|
import { azureClient } from "./azure";
|
|
import { dopplerClient } from "./doppler";
|
|
import { hashicorpClient } from "./hashicorp";
|
|
import { infisicalClient } from "./infisical";
|
|
import { scalewayClient } from "./scaleway";
|
|
import type { VaultClient } from "./types";
|
|
|
|
export const VAULT_REF_REGEX = /\$\{\{vault\.([a-zA-Z0-9_-]+)\.([^}]+)\}\}/g;
|
|
|
|
const clients: Record<VaultProviderConfig["providerType"], VaultClient> = {
|
|
hashicorp: hashicorpClient as VaultClient,
|
|
infisical: infisicalClient as VaultClient,
|
|
aws: awsClient as VaultClient,
|
|
doppler: dopplerClient as VaultClient,
|
|
azure: azureClient as VaultClient,
|
|
scaleway: scalewayClient as VaultClient,
|
|
};
|
|
|
|
export const getVaultClient = (
|
|
providerType: VaultProviderConfig["providerType"],
|
|
) => clients[providerType];
|
|
|
|
const refKey = (providerName: string, ref: string) => `${providerName} |