mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-08-24 02:14:13 -05:00
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:
@@ -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;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user