Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3323a08134 |
No files matched your search
@@ -2,9 +2,9 @@
|
||||
|
||||
<img src="https://raw.githubusercontent.com/homarr-labs/charts/refs/heads/main/charts/homarr/icon.svg" align="right" width="92" alt="homarr logo">
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
A Helm chart to deploy homarr for Kubernetes
|
||||
|
||||
@@ -437,7 +437,7 @@ All available values are listed on the [artifacthub](https://artifacthub.io/pack
|
||||
| httproute.rules[0].matches[0].path.value | string | `"/"` | Path value to match |
|
||||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
|
||||
| image.repository | string | `"ghcr.io/homarr-labs/homarr"` | Image repository |
|
||||
| image.tag | string | `"v1.76.1"` | Overrides the image tag whose default is the chart appVersion |
|
||||
| image.tag | string | `"v1.76.2"` | Overrides the image tag whose default is the chart appVersion |
|
||||
| imagePullSecrets | list | `[]` | Secrets for Docker registry |
|
||||
| ingress.annotations | object | `{}` | Ingress annotations |
|
||||
| ingress.enabled | bool | `false` | Enable ingress |
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
export const createNextcloudCalendarServerUrl = (integrationUrl: string) => {
|
||||
const calendarServerUrl = new URL(integrationUrl);
|
||||
const integrationPath = calendarServerUrl.pathname.replace(/\/+$/, "");
|
||||
const davPath = "/remote.php/dav";
|
||||
|
||||
calendarServerUrl.pathname = integrationPath.endsWith(davPath)
|
||||
? `${integrationPath}/`
|
||||
: `${integrationPath}${davPath}/`;
|
||||
calendarServerUrl.search = "";
|
||||
calendarServerUrl.hash = "";
|
||||
|
||||
return calendarServerUrl.toString();
|
||||
};
|
||||
@@ -21,7 +21,6 @@ import type { ICalendarIntegration } from "../interfaces/calendar/calendar-integ
|
||||
import type { CalendarEvent } from "../interfaces/calendar/calendar-types";
|
||||
import type { Notification } from "../interfaces/notifications/notification-types";
|
||||
import type { INotificationsIntegration } from "../interfaces/notifications/notifications-integration";
|
||||
import { createNextcloudCalendarServerUrl } from "./nextcloud-url";
|
||||
|
||||
// Register all existing timezones
|
||||
if (ICAL.TimezoneService.count === 0) {
|
||||
@@ -190,7 +189,7 @@ export class NextcloudIntegration extends Integration implements ICalendarIntegr
|
||||
|
||||
private async createCalendarClientAsync(agent?: Agent) {
|
||||
return new DAVClient({
|
||||
serverUrl: createNextcloudCalendarServerUrl(this.integration.url),
|
||||
serverUrl: this.integration.url,
|
||||
credentials: {
|
||||
username: this.getSecretValue("username"),
|
||||
password: this.getSecretValue("password"),
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import type { Agent } from "node:https";
|
||||
import { DAVClient } from "tsdav";
|
||||
import { beforeEach, describe, expect, test, vi } from "vitest";
|
||||
|
||||
import { NextcloudIntegration } from "../nextcloud.integration";
|
||||
|
||||
vi.mock("tsdav", () => ({ DAVClient: vi.fn() }));
|
||||
|
||||
interface NextcloudCalendarClientFactory {
|
||||
createCalendarClientAsync(agent: Agent): Promise<unknown>;
|
||||
}
|
||||
|
||||
describe("NextcloudIntegration", () => {
|
||||
beforeEach(() => {
|
||||
vi.mocked(DAVClient).mockClear();
|
||||
});
|
||||
|
||||
test("uses a calendar server URL that preserves the integration subpath", async () => {
|
||||
const integration = new NextcloudIntegration({
|
||||
id: "integration-id",
|
||||
name: "Nextcloud",
|
||||
url: "https://example.com/nextcloud",
|
||||
externalUrl: null,
|
||||
decryptedSecrets: [
|
||||
{ kind: "username", value: "admin" },
|
||||
{ kind: "password", value: "password" },
|
||||
],
|
||||
});
|
||||
|
||||
await (integration as unknown as NextcloudCalendarClientFactory).createCalendarClientAsync({} as Agent);
|
||||
|
||||
expect(DAVClient).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
serverUrl: "https://example.com/nextcloud/remote.php/dav/",
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,29 +0,0 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import { createNextcloudCalendarServerUrl } from "../nextcloud-url";
|
||||
|
||||
describe("createNextcloudCalendarServerUrl", () => {
|
||||
test("uses the DAV endpoint for a root installation", () => {
|
||||
expect(createNextcloudCalendarServerUrl("https://cloud.example.com")).toBe(
|
||||
"https://cloud.example.com/remote.php/dav/",
|
||||
);
|
||||
});
|
||||
|
||||
test("preserves the base path for a subpath installation", () => {
|
||||
expect(createNextcloudCalendarServerUrl("https://example.com/nextcloud")).toBe(
|
||||
"https://example.com/nextcloud/remote.php/dav/",
|
||||
);
|
||||
});
|
||||
|
||||
test("does not duplicate a trailing slash", () => {
|
||||
expect(createNextcloudCalendarServerUrl("https://example.com/nextcloud/")).toBe(
|
||||
"https://example.com/nextcloud/remote.php/dav/",
|
||||
);
|
||||
});
|
||||
|
||||
test("does not duplicate an existing DAV endpoint", () => {
|
||||
expect(createNextcloudCalendarServerUrl("https://example.com/nextcloud/remote.php/dav")).toBe(
|
||||
"https://example.com/nextcloud/remote.php/dav/",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user