mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #971 from drudge/cert-enhancements
fix(certificates): ensure certificates are accessible by traefik
This commit is contained in:
@@ -264,21 +264,21 @@ export const AddDomain = ({
|
|||||||
name="certificateType"
|
name="certificateType"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="col-span-2">
|
<FormItem className="col-span-2">
|
||||||
<FormLabel>Certificate</FormLabel>
|
<FormLabel>Certificate Provider</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
defaultValue={field.value || ""}
|
defaultValue={field.value || ""}
|
||||||
>
|
>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a certificate" />
|
<SelectValue placeholder="Select a certificate provider" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="none">None</SelectItem>
|
<SelectItem value="none">None</SelectItem>
|
||||||
<SelectItem value={"letsencrypt"}>
|
<SelectItem value={"letsencrypt"}>
|
||||||
Letsencrypt (Default)
|
Let's Encrypt
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -265,21 +265,21 @@ export const AddPreviewDomain = ({
|
|||||||
name="certificateType"
|
name="certificateType"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="col-span-2">
|
<FormItem className="col-span-2">
|
||||||
<FormLabel>Certificate</FormLabel>
|
<FormLabel>Certificate Provider</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
defaultValue={field.value || ""}
|
defaultValue={field.value || ""}
|
||||||
>
|
>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a certificate" />
|
<SelectValue placeholder="Select a certificate provider" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="none">None</SelectItem>
|
<SelectItem value="none">None</SelectItem>
|
||||||
<SelectItem value={"letsencrypt"}>
|
<SelectItem value={"letsencrypt"}>
|
||||||
Letsencrypt (Default)
|
Let's Encrypt
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -222,21 +222,21 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
|
|||||||
name="previewCertificateType"
|
name="previewCertificateType"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Certificate</FormLabel>
|
<FormLabel>Certificate Provider</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
defaultValue={field.value || ""}
|
defaultValue={field.value || ""}
|
||||||
>
|
>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a certificate" />
|
<SelectValue placeholder="Select a certificate provider" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="none">None</SelectItem>
|
<SelectItem value="none">None</SelectItem>
|
||||||
<SelectItem value={"letsencrypt"}>
|
<SelectItem value={"letsencrypt"}>
|
||||||
Letsencrypt (Default)
|
Let's Encrypt
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -400,21 +400,21 @@ export const AddDomainCompose = ({
|
|||||||
name="certificateType"
|
name="certificateType"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="col-span-2">
|
<FormItem className="col-span-2">
|
||||||
<FormLabel>Certificate</FormLabel>
|
<FormLabel>Certificate Provider</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
defaultValue={field.value || ""}
|
defaultValue={field.value || ""}
|
||||||
>
|
>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
<SelectValue placeholder="Select a certificate" />
|
<SelectValue placeholder="Select a certificate provider" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="none">None</SelectItem>
|
<SelectItem value="none">None</SelectItem>
|
||||||
<SelectItem value={"letsencrypt"}>
|
<SelectItem value={"letsencrypt"}>
|
||||||
Letsencrypt (Default)
|
Let's Encrypt
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export const AddApplication = ({ projectId, projectName }: Props) => {
|
|||||||
name="appName"
|
name="appName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>AppName</FormLabel>
|
<FormLabel>App Name</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="my-app" {...field} />
|
<Input placeholder="my-app" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export const AddCompose = ({ projectId, projectName }: Props) => {
|
|||||||
name="appName"
|
name="appName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>AppName</FormLabel>
|
<FormLabel>App Name</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="my-app" {...field} />
|
<Input placeholder="my-app" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ export const AddDatabase = ({ projectId, projectName }: Props) => {
|
|||||||
name="appName"
|
name="appName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>AppName</FormLabel>
|
<FormLabel>App Name</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="my-app" {...field} />
|
<Input placeholder="my-app" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ import { z } from "zod";
|
|||||||
const certificateDataHolder =
|
const certificateDataHolder =
|
||||||
"-----BEGIN CERTIFICATE-----\nMIIFRDCCAyygAwIBAgIUEPOR47ys6VDwMVB9tYoeEka83uQwDQYJKoZIhvcNAQELBQAwGTEXMBUGA1UEAwwObWktZG9taW5pby5jb20wHhcNMjQwMzExMDQyNzU3WhcN\n------END CERTIFICATE-----";
|
"-----BEGIN CERTIFICATE-----\nMIIFRDCCAyygAwIBAgIUEPOR47ys6VDwMVB9tYoeEka83uQwDQYJKoZIhvcNAQELBQAwGTEXMBUGA1UEAwwObWktZG9taW5pby5jb20wHhcNMjQwMzExMDQyNzU3WhcN\n------END CERTIFICATE-----";
|
||||||
|
|
||||||
|
const privateKeyDataHolder =
|
||||||
|
"-----BEGIN PRIVATE KEY-----\nMIIFRDCCAyygAwIBAgIUEPOR47ys6VDwMVB9tYoeEka83uQwDQYJKoZIhvcNAQELBQAwGTEXMBUGA1UEAwwObWktZG9taW5pby5jb20wHhcNMjQwMzExMDQyNzU3WhcN\n-----END PRIVATE KEY-----";
|
||||||
|
|
||||||
const addCertificate = z.object({
|
const addCertificate = z.object({
|
||||||
name: z.string().min(1, "Name is required"),
|
name: z.string().min(1, "Name is required"),
|
||||||
certificateData: z.string().min(1, "Certificate data is required"),
|
certificateData: z.string().min(1, "Certificate data is required"),
|
||||||
@@ -154,7 +157,7 @@ export const AddCertificate = () => {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Textarea
|
<Textarea
|
||||||
className="h-32"
|
className="h-32"
|
||||||
placeholder={certificateDataHolder}
|
placeholder={privateKeyDataHolder}
|
||||||
{...field}
|
{...field}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
"settings.server.domain.description": "Add a domain to your server application.",
|
"settings.server.domain.description": "Add a domain to your server application.",
|
||||||
"settings.server.domain.form.domain": "Domain",
|
"settings.server.domain.form.domain": "Domain",
|
||||||
"settings.server.domain.form.letsEncryptEmail": "Let's Encrypt Email",
|
"settings.server.domain.form.letsEncryptEmail": "Let's Encrypt Email",
|
||||||
"settings.server.domain.form.certificate.label": "Certificate",
|
"settings.server.domain.form.certificate.label": "Certificate Provider",
|
||||||
"settings.server.domain.form.certificate.placeholder": "Select a certificate",
|
"settings.server.domain.form.certificate.placeholder": "Select a certificate",
|
||||||
"settings.server.domain.form.certificateOptions.none": "None",
|
"settings.server.domain.form.certificateOptions.none": "None",
|
||||||
"settings.server.domain.form.certificateOptions.letsencrypt": "Let's Encrypt (Default)",
|
"settings.server.domain.form.certificateOptions.letsencrypt": "Let's Encrypt",
|
||||||
|
|
||||||
"settings.server.webServer.title": "Web Server",
|
"settings.server.webServer.title": "Web Server",
|
||||||
"settings.server.webServer.description": "Reload or clean the web server.",
|
"settings.server.webServer.description": "Reload or clean the web server.",
|
||||||
|
|||||||
@@ -5,34 +5,22 @@ export const IS_CLOUD = process.env.IS_CLOUD === "true";
|
|||||||
export const docker = new Docker();
|
export const docker = new Docker();
|
||||||
|
|
||||||
export const paths = (isServer = false) => {
|
export const paths = (isServer = false) => {
|
||||||
if (isServer) {
|
|
||||||
const BASE_PATH = "/etc/dokploy";
|
|
||||||
return {
|
|
||||||
BASE_PATH,
|
|
||||||
MAIN_TRAEFIK_PATH: `${BASE_PATH}/traefik`,
|
|
||||||
DYNAMIC_TRAEFIK_PATH: `${BASE_PATH}/traefik/dynamic`,
|
|
||||||
LOGS_PATH: `${BASE_PATH}/logs`,
|
|
||||||
APPLICATIONS_PATH: `${BASE_PATH}/applications`,
|
|
||||||
COMPOSE_PATH: `${BASE_PATH}/compose`,
|
|
||||||
SSH_PATH: `${BASE_PATH}/ssh`,
|
|
||||||
CERTIFICATES_PATH: `${BASE_PATH}/certificates`,
|
|
||||||
MONITORING_PATH: `${BASE_PATH}/monitoring`,
|
|
||||||
REGISTRY_PATH: `${BASE_PATH}/registry`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const BASE_PATH =
|
const BASE_PATH =
|
||||||
process.env.NODE_ENV === "production"
|
isServer || process.env.NODE_ENV === "production"
|
||||||
? "/etc/dokploy"
|
? "/etc/dokploy"
|
||||||
: path.join(process.cwd(), ".docker");
|
: path.join(process.cwd(), ".docker");
|
||||||
|
const MAIN_TRAEFIK_PATH = `${BASE_PATH}/traefik`;
|
||||||
|
const DYNAMIC_TRAEFIK_PATH = `${MAIN_TRAEFIK_PATH}/dynamic`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
BASE_PATH,
|
BASE_PATH,
|
||||||
MAIN_TRAEFIK_PATH: `${BASE_PATH}/traefik`,
|
MAIN_TRAEFIK_PATH,
|
||||||
DYNAMIC_TRAEFIK_PATH: `${BASE_PATH}/traefik/dynamic`,
|
DYNAMIC_TRAEFIK_PATH,
|
||||||
LOGS_PATH: `${BASE_PATH}/logs`,
|
LOGS_PATH: `${BASE_PATH}/logs`,
|
||||||
APPLICATIONS_PATH: `${BASE_PATH}/applications`,
|
APPLICATIONS_PATH: `${BASE_PATH}/applications`,
|
||||||
COMPOSE_PATH: `${BASE_PATH}/compose`,
|
COMPOSE_PATH: `${BASE_PATH}/compose`,
|
||||||
SSH_PATH: `${BASE_PATH}/ssh`,
|
SSH_PATH: `${BASE_PATH}/ssh`,
|
||||||
CERTIFICATES_PATH: `${BASE_PATH}/certificates`,
|
CERTIFICATES_PATH: `${DYNAMIC_TRAEFIK_PATH}/certificates`,
|
||||||
MONITORING_PATH: `${BASE_PATH}/monitoring`,
|
MONITORING_PATH: `${BASE_PATH}/monitoring`,
|
||||||
REGISTRY_PATH: `${BASE_PATH}/registry`,
|
REGISTRY_PATH: `${BASE_PATH}/registry`,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user