Lennart J. Kurzweg (Nx2) 960c080f1c fix aggregate source discrepancy
2026-04-24 19:08:36 +02:00
2026-04-24 19:08:36 +02:00
2026-03-21 02:39:09 +01:00
2026-04-23 17:33:35 +02:00
2026-04-22 17:30:07 +02:00
2026-04-23 23:09:24 +02:00
2026-04-24 17:06:18 +02:00
2026-03-31 02:08:39 +02:00
2026-03-31 02:08:39 +02:00
2026-04-24 17:06:18 +02:00
2026-04-24 19:08:36 +02:00
2026-04-22 17:30:07 +02:00

Postgres

  • url
    • Format: postgres://user@host:port/dbname or postgres:///dbname?host=/var/run/postgresql.
    • Default: postgres://nxcaldav@localhost:5432/nxcaldav?sslmode=disable

Users

  • name: required
  • password: cleartext or bcrypt hash
  • password_cmd: shell command

    password_cmd: "echo secretpassword" # Command (output will be hashed in DB)

    password: "$2y$12$LU.8xNK6m98hEJ5oRnBsDuMamfIjXoWTW0eMIJ6yGdLoP3nJAHWH6"

SQL

delte user

DELETE FROM users WHERE name = 'bob';

delete calendar

DELETE FROM calendars WHERE name = 'bob_calendar' AND owner_id = (SELECT id FROM users WHERE name = 'bob');
/* or */
DELETE FROM calendars WHERE path = '/bob/calendars/old/';

rename calendar

UPDATE calendars SET name = 'new', path '/bob/calendars/new/' WHERE path = '/bob/calendars/old/';
UPDATE calendar_objects SET path = regexp_replace(path, '/old/', '/new/')' WHERE your_column ~ '/sport/';

Match Value in calendar objects

select id, path, linecut from calendar_objects, LATERAL regexp_split_to_table(data, E'\r\n') AS linecut where linecut ~ 'CLASS';

Helpers

Prerequisites

The scripts require psycopg2 (or psycopg2-binary) and PyYAML.

pip install psycopg2-binary pyyaml

Exporting Events

The export_events.py script extracts events from the database and saves them as .ics files in a structured directory format: username/calendarID/filename.ics.

Examples:

  • Export everything:
python export_events.py --output ./my_backup
  • Export only one user:
python export_events.py --user alice --output ./alice_backup
  • Export a specific calendar:
python export_events.py --user alice --calendar preservation --output ./preservation_backup

Importing Events

The import_events.py script uploads events back into the database. It can either walk a structured directory (like the one created by the export script) or upload a flat directory of files to a specific target calendar.

Examples:

  • Restore everything from a backup:
python import_events.py --input ./my_backup
  • Upload a directory of .ics files to a specific calendar:
python import_events.py --input ./some_events/ --user alice --calendar work
  • Upload a single file to a specific calendar:
python import_events.py --input ./event.ics --user bob --calendar bob
Description
No description provided
Readme 17 MiB
v0.0.12 Latest
2026-04-30 20:14:46 +02:00
Languages
Go 91.8%
Python 8.2%