mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-12 06:55:19 +00:00
feat: add domains in external server
This commit is contained in:
@@ -5,6 +5,7 @@ import type { Domain } from "@/server/api/services/domain";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { templates } from "../templates";
|
||||
import type { TemplatesKeys } from "../types/templates-data.type";
|
||||
import { IS_CLOUD } from "@/server/constants";
|
||||
|
||||
export interface Schema {
|
||||
serverIp: string;
|
||||
@@ -28,7 +29,7 @@ export const generateRandomDomain = ({
|
||||
}: Schema): string => {
|
||||
const hash = randomBytes(3).toString("hex");
|
||||
const slugIp = serverIp.replaceAll(".", "-");
|
||||
return `${projectName}-${hash}${process.env.NODE_ENV === "production" ? `-${slugIp}` : ""}.traefik.me`;
|
||||
return `${projectName}-${hash}${process.env.NODE_ENV === "production" || IS_CLOUD ? `-${slugIp}` : ""}.traefik.me`;
|
||||
};
|
||||
|
||||
export const generateHash = (projectName: string, quantity = 3): string => {
|
||||
|
||||
Reference in New Issue
Block a user