fix(definitions): use HTTPS for subdomain URL template

Subdomain-based URLs (e.g. sonarr.example.com) are typically served
behind a reverse proxy with TLS. Update the template to generate
https:// URLs. Host:port mode remains http:// for local access.
This commit is contained in:
Thomas Camlong committed 2026-05-28 12:16:14 +02:00
1 parent efc48e5097
commit bbb04b084f
2 files changed
+4 -4

No files matched your search

@@ -18,7 +18,7 @@ export const buildIntegrationUrl = (
const slug = getSlugForKind(kind);
const modeBuilders: Record<UrlTemplateMode, () => string> = {
subdomain: () => `http://${slug}.${host}`,
subdomain: () => `https://${slug}.${host}`,
hostPort: () => {
const port = dockerPort ?? getIntegrationDefaultPort(kind);
return port ? `http://${host}:${port}` : `http://${host}`;
@@ -5,7 +5,7 @@ import { buildIntegrationUrl } from "../integration-url-template";
describe("buildIntegrationUrl", () => {
it("builds subdomain URL", () => {
expect(buildIntegrationUrl("sonarr", "homelab.local", "subdomain")).toBe("http://sonarr.homelab.local");
expect(buildIntegrationUrl("sonarr", "homelab.local", "subdomain")).toBe("https://sonarr.homelab.local");
});
it("builds hostPort URL with default port", () => {
@@ -21,7 +21,7 @@ describe("buildIntegrationUrl", () => {
});
it("strips trailing slashes from host", () => {
expect(buildIntegrationUrl("sonarr", "homelab.local/", "subdomain")).toBe("http://sonarr.homelab.local");
expect(buildIntegrationUrl("sonarr", "homelab.local/", "subdomain")).toBe("https://sonarr.homelab.local");
});
it("returns empty string for empty host", () => {
@@ -29,7 +29,7 @@ describe("buildIntegrationUrl", () => {
});
it("uses pi-hole slug for subdomain mode", () => {
expect(buildIntegrationUrl("piHole", "example.com", "subdomain")).toBe("http://pi-hole.example.com");
expect(buildIntegrationUrl("piHole", "example.com", "subdomain")).toBe("https://pi-hole.example.com");
});
it("reads default ports from integration definitions", () => {