fix calibre-web write issue

This commit is contained in:
Noah Masur
2026-07-28 22:04:29 +00:00
parent 373beb6daf
commit 5929b3201d
@@ -32,15 +32,11 @@ in
reverseProxyAuth.enable = false; reverseProxyAuth.enable = false;
enableBookConversion = true; enableBookConversion = true;
enableBookUploading = true; enableBookUploading = true;
# Point this directly to the folder containing your 'metadata.db' file
calibreLibrary = libraryPath; calibreLibrary = libraryPath;
}; };
}; };
# metadata.db lives in /var/lib/calibre-web-db and is symlinked into the
# library dir; ProtectSystem=strict in the upstream module blocks writes
# through symlinks unless the real target path is also listed.
systemd.services.calibre-web.serviceConfig.ReadWritePaths = [ "/var/lib/calibre-web-db" ];
# Allow web traffic to Caddy # Allow web traffic to Caddy
nmasur.presets.services.caddy.routes = [ nmasur.presets.services.caddy.routes = [
{ {
@@ -65,6 +61,13 @@ in
# Grant user access to Calibre directories # Grant user access to Calibre directories
users.users.${username}.extraGroups = [ "calibre-web" ]; users.users.${username}.extraGroups = [ "calibre-web" ];
# Ensure the service has explicit filesystem read/write access to the library path
# This fixes the "sqlite3.OperationalError: unable to open database file" bug
systemd.services.calibre-web.serviceConfig.ReadWritePaths = [
libraryPath
"/var/lib/calibre-web-db"
];
# Run a backup on a schedule # Run a backup on a schedule
systemd.timers.calibre-backup = lib.mkIf config.nmasur.presets.services.litestream.enable { systemd.timers.calibre-backup = lib.mkIf config.nmasur.presets.services.litestream.enable {
timerConfig = { timerConfig = {