Sign inSign up

srisner/nxtcld-calendar-server

By srisner

•Updated 2 months ago

Simple relay server for calendar integration in self hosted Nextcloud

Image
Networking
Web servers
0

146

srisner/nxtcld-calendar-server repository overview

⁠Nextcloud calendar server

Simple relay server for calendar integration in self hosted Nextcloud

Nextcloud allows users to add calendars via links (called "New subscription from link" in Nextcloud) but limits redirect following by 5 hops. This can break calendar integration if the calendars require more than 5 hops.

This server acts as a relay between Nextcloud and the calendar servers by separately fetching the calendars and allowing Nextcloud to access them directly without requiring redirects.

Docker Hub⁠

GitHub⁠

⁠Note on security

The server runs on Python and uses Flask, no security features are implemented.

This should be sufficient for personal use (self hosted in home network), but is not suitable for production environments.

⁠Setting up the server

The server can be set up as a independent server (e.g. calendar.arpa) or as a custom location on the Nextcloud server when using a reverse proxy like Nginx Proxy Manager (nextcloud.arpa/calendar-server)

⁠Environment variables
SchemeBASE_URL example
nextcloud.arpa/calendar-server/nxtcld-calendar-server/
calendar.arpa/
⁠Volumes

The container contains two folders that can be kept, the data and the log folder. But only the data folder is essential for the app to function.

FolderPath in container
dataapp/data
logsapp/logs
⁠Example deployment

This example uses the yml file to write the data to data/config.json.

See below⁠ for an explanation of the file contents.

configs:
  calendar_config:
    content: |
      [
        {
          "NAME": "Calendar",
          "URL": "https://calend.ar",
          "PATH": "calendar",
          "FILENAME": "calendar.ics"
        }
      ]

services:
  nextcloud-calendar-server:
    image: srisner/nxtcld-calendar-server:v1.0
    container_name: nextcloud-calendar-server
    restart: always

    configs:
      - source: calendar_config
        target: /app/data/config.json

    ports:
      - 0.0.0.0:5000:5000/tcp

    environment:
      - BASE_URL=/nxtcld-calendar-server/

    volumes:
      - nextcloud-calendar-server-data:/app/data

volumes:
  nextcloud-calendar-server-data:
    name: nextcloud-calendar-server-data

⁠Adding calendars

Calendars are added in the config file data/config.json

Example:

[
    {
        "NAME": "Cal 1",
        "URL": "https://...",
        "PATH": "cal_1",
        "FILENAME": "cal_1.ics"
    },
    {
        "NAME": "Cal 2",
        "URL": "https://...",
        "PATH": "cal_2",
        "FILENAME": "cal_2.ics"
    }
]
KeyValue
NAMEused for debugging and readability, should be unique but no errors will occur if it is not unique
URLthe calendars subscription link
PATHon which path the calendar will be accessible to Nextcloud (calendar.arpa/PATH or nextcloud.arpa/calendar-server/PATH) Should not contain any / since this will break path matching
FILENAMEthe filename that will be used when downloading the calendar, should end with .ics

Tag summary

Content type

Image

Digest

sha256:05548552e…

Size

392.2 MB

Last updated

2 months ago

docker pull srisner/nxtcld-calendar-server:v1.0