Fix for Evolution CardDav/CalDav

They seem to make `GET` requests with `body`, which isn't allowed by the spec and causes Deno to fail. This prevents/ignores that.

It also makes the default `docker-compose.yml` "safer" by not exposing the database and container.

Finally, it removes a couple of unmaintained "one-click-deploy" buttons and simplifies documentation.
This commit is contained in:
Bruno Bernardino
2025-08-28 14:57:51 +01:00
parent 02d1d3e6fa
commit 47f443c300
6 changed files with 35 additions and 105 deletions

View File

@@ -31,11 +31,16 @@ export const handler: Handler<Data, FreshContextState> = async (request, context
const requestBodyText = await request.clone().text();
// Remove the `/caldav/` prefix from the hrefs in the request
const parsedRequestBodyText = requestBodyText.replaceAll('<href>/caldav/', `<href>/`).replaceAll(
let parsedRequestBodyText = requestBodyText.replaceAll('<href>/caldav/', `<href>/`).replaceAll(
':href>/caldav/',
`:href>/`,
);
// The spec doesn't allow a body for GET or HEAD requests (and Deno fails if you try)
if (request.method === 'GET' || request.method === 'HEAD') {
parsedRequestBodyText = '';
}
const response = await fetch(`${calendarConfig.calDavUrl}/${path}`, {
headers: {
...Object.fromEntries(request.headers.entries()),

View File

@@ -31,11 +31,16 @@ export const handler: Handler<Data, FreshContextState> = async (request, context
const requestBodyText = await request.clone().text();
// Remove the `/carddav/` prefix from the hrefs in the request
const parsedRequestBodyText = requestBodyText.replaceAll('<href>/carddav/', `<href>/`).replaceAll(
let parsedRequestBodyText = requestBodyText.replaceAll('<href>/carddav/', `<href>/`).replaceAll(
':href>/carddav/',
`:href>/`,
);
// The spec doesn't allow a body for GET or HEAD requests (and Deno fails if you try)
if (request.method === 'GET' || request.method === 'HEAD') {
parsedRequestBodyText = '';
}
const response = await fetch(`${contactsConfig.cardDavUrl}/${path}`, {
headers: {
...Object.fromEntries(request.headers.entries()),