diff --git a/.github/sponsors/mandarin.png b/.github/sponsors/mandarin.png new file mode 100644 index 000000000..f76512920 Binary files /dev/null and b/.github/sponsors/mandarin.png differ diff --git a/README.md b/README.md index 2e784812c..1c8ef8365 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,15 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com). ### Hero Sponsors 🎖
### Premium Supporters 🥇 diff --git a/apps/dokploy/__test__/compose/domain/labels.test.ts b/apps/dokploy/__test__/compose/domain/labels.test.ts index 5076a2042..4123b2877 100644 --- a/apps/dokploy/__test__/compose/domain/labels.test.ts +++ b/apps/dokploy/__test__/compose/domain/labels.test.ts @@ -26,11 +26,30 @@ describe("createDomainLabels", () => { "traefik.http.routers.test-app-1-web.entrypoints=web", "traefik.http.services.test-app-1-web.loadbalancer.server.port=8080", "traefik.http.routers.test-app-1-web.service=test-app-1-web", + "traefik.http.routers.test-app-1-web.rule=PathPrefix(`/`)", ]); }); it("should create labels for websecure entrypoint", async () => { const labels = await createDomainLabels(appName, baseDomain, "websecure"); + expect(labels).toEqual([ + "traefik.http.routers.test-app-1-websecure.rule=Host(`example.com`)", + "traefik.http.routers.test-app-1-websecure.entrypoints=websecure", + "traefik.http.services.test-app-1-websecure.loadbalancer.server.port=8080", + "traefik.http.routers.test-app-1-websecure.service=test-app-1-websecure", + "traefik.http.routers.test-app-1-websecure.rule=PathPrefix(`/`)", + ]); + }); + + it("shouldn't add the path prefix if is empty", async () => { + const labels = await createDomainLabels( + appName, + { + ...baseDomain, + path: "", + }, + "websecure", + ); expect(labels).toEqual([ "traefik.http.routers.test-app-1-websecure.rule=Host(`example.com`)", "traefik.http.routers.test-app-1-websecure.entrypoints=websecure", diff --git a/packages/server/src/utils/docker/domain.ts b/packages/server/src/utils/docker/domain.ts index 090bf02ed..a065f31c0 100644 --- a/packages/server/src/utils/docker/domain.ts +++ b/packages/server/src/utils/docker/domain.ts @@ -268,7 +268,7 @@ export const createDomainLabels = async ( `traefik.http.routers.${routerName}.service=${routerName}`, ]; - if (domain.path && domain.path.length > 0 && domain.path !== "/") { + if (domain.path) { labels.push( `traefik.http.routers.${routerName}.rule=PathPrefix(\`${domain.path}\`)`, );