mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(domain): add internalPath and stripPath properties to domain configuration
- Updated test files to include new properties `internalPath` and `stripPath` in domain configurations. - Removed deprecated `createMultiPathDomain` function from the domain service to streamline the codebase.
This commit is contained in:
@@ -19,6 +19,8 @@ describe("createDomainLabels", () => {
|
||||
path: "/",
|
||||
createdAt: "",
|
||||
previewDeploymentId: "",
|
||||
internalPath: "/",
|
||||
stripPath: false,
|
||||
};
|
||||
|
||||
it("should create basic labels for web entrypoint", async () => {
|
||||
|
||||
@@ -119,6 +119,8 @@ const baseDomain: Domain = {
|
||||
domainType: "application",
|
||||
uniqueConfigKey: 1,
|
||||
previewDeploymentId: "",
|
||||
internalPath: "/",
|
||||
stripPath: false,
|
||||
};
|
||||
|
||||
const baseRedirect: Redirect = {
|
||||
|
||||
@@ -201,44 +201,3 @@ export const validateDomain = async (
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const createMultiPathDomain = async (
|
||||
applicationId: string,
|
||||
domains: Array<{
|
||||
host: string;
|
||||
externalPath?: string;
|
||||
internalPath: string;
|
||||
port?: number;
|
||||
https?: boolean;
|
||||
stripPath?: boolean;
|
||||
}>
|
||||
) => {
|
||||
const app = await findApplicationById(applicationId);
|
||||
if (!app) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
message: "Application not found",
|
||||
});
|
||||
}
|
||||
|
||||
const createdDomains = [];
|
||||
|
||||
for (const domainConfig of domains) {
|
||||
const domain = await createDomain({
|
||||
applicationId,
|
||||
host: domainConfig.host,
|
||||
path: domainConfig.externalPath || "/",
|
||||
internalPath: domainConfig.internalPath,
|
||||
port: domainConfig.port || 3000,
|
||||
https: domainConfig.https || false,
|
||||
stripPath: domainConfig.stripPath || false,
|
||||
serviceName: app.appName,
|
||||
domainType: "application",
|
||||
certificateType: domainConfig.https ? "letsencrypt" : "none",
|
||||
});
|
||||
|
||||
createdDomains.push(domain);
|
||||
}
|
||||
|
||||
return createdDomains;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user