feat(hosts/merope/calibre-web): expose calibre content server on tailnet

Add a calibre.m7.rs vhost proxying the calibre-server content server,
restricted to localhost and the headscale tailnet prefixes, and enable
calibre-server auth so the endpoint is not anonymous.
This commit is contained in:
Gabriel Fontes
2026-08-20 19:25:54 -03:00
parent 901be0cfe2
commit 052d20c9c7
@@ -1,5 +1,6 @@
{
config,
outputs,
lib,
...
}: {
@@ -12,8 +13,8 @@
calibre-server = {
enable = true;
libraries = ["/srv/media/books"];
# Readarr connects locally and uses the Content Server to update the
# Calibre database without racing direct metadata.db writes.
auth.enable = true;
# Readarr connects locally
extraFlags = ["--enable-local-write"];
};
@@ -22,12 +23,29 @@
options.calibreLibrary = lib.head config.services.calibre-server.libraries;
};
nginx.virtualHosts."books.m7.rs" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.calibre-web.listen.port}";
proxyWebsockets = true;
nginx.virtualHosts = {
"books.m7.rs" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.calibre-web.listen.port}";
proxyWebsockets = true;
};
};
"calibre.m7.rs" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.calibre-server.port}";
proxyWebsockets = true;
extraConfig = ''
allow 127.0.0.1;
allow ::1;
allow ${outputs.nixosConfigurations.alcyone.config.services.headscale.settings.prefixes.v4};
allow ${outputs.nixosConfigurations.alcyone.config.services.headscale.settings.prefixes.v6};
deny all;
'';
};
};
};
};