extract calibre-web into service
parent
1be66fd2bc
commit
f16972bd81
|
@ -14,14 +14,13 @@ let
|
||||||
};
|
};
|
||||||
vpn = import ../../vpn.nix;
|
vpn = import ../../vpn.nix;
|
||||||
in {
|
in {
|
||||||
disabledModules = [ "services/web-apps/calibre-web.nix" ];
|
|
||||||
imports = [
|
imports = [
|
||||||
./hetznercloud.nix
|
./hetznercloud.nix
|
||||||
../../roles/server.nix
|
../../roles/server.nix
|
||||||
../../roles/datakami.nix
|
../../roles/datakami.nix
|
||||||
../../services/backup.nix
|
../../services/backup.nix
|
||||||
../../services/email.nix
|
../../services/email.nix
|
||||||
../../modules/calibre-web.nix
|
../../services/calibre-web.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
system.stateVersion = "19.03";
|
system.stateVersion = "19.03";
|
||||||
|
@ -44,6 +43,10 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
vhost = "muflax.church";
|
vhost = "muflax.church";
|
||||||
};
|
};
|
||||||
|
calibre-web = {
|
||||||
|
enable = true;
|
||||||
|
vhost = "calibre.yori.cc";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets.muflax.file = ../../../secrets/http.muflax.age;
|
age.secrets.muflax.file = ../../../secrets/http.muflax.age;
|
||||||
|
@ -91,16 +94,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
"media.yori.cc" = sslforward "http://${vpn.ips.frumar}:32001";
|
"media.yori.cc" = sslforward "http://${vpn.ips.frumar}:32001";
|
||||||
"calibre.yori.cc" = lib.mkMerge [ (sslforward "http://[::1]:8083") {
|
|
||||||
locations."/kobo/" = {
|
|
||||||
proxyPass = "http://[::1]:8083/kobo/";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_buffer_size 128k;
|
|
||||||
proxy_buffers 4 256k;
|
|
||||||
proxy_busy_buffers_size 256k;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
} ];
|
|
||||||
};
|
};
|
||||||
networking.firewall.allowedUDPPorts = [ 31790 ]; # wg
|
networking.firewall.allowedUDPPorts = [ 31790 ]; # wg
|
||||||
networking.firewall.allowedTCPPorts = [ 60307 ]; # weechat relay
|
networking.firewall.allowedTCPPorts = [ 60307 ]; # weechat relay
|
||||||
|
@ -124,12 +117,4 @@ in {
|
||||||
];
|
];
|
||||||
nix.settings.allowed-users = [ "@wheel" ];
|
nix.settings.allowed-users = [ "@wheel" ];
|
||||||
|
|
||||||
services.calibre-web = {
|
|
||||||
enable = true;
|
|
||||||
options = {
|
|
||||||
enableBookUploading = true;
|
|
||||||
#enableBookConversion = true;
|
|
||||||
extraConfig.config_kepubifypath = "${pkgs.kepubify}/bin/kepubify";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.yorick.calibre-web;
|
||||||
|
in {
|
||||||
|
disabledModules = [ "services/web-apps/calibre-web.nix" ];
|
||||||
|
imports = [ ../modules/calibre-web.nix ];
|
||||||
|
options.services.yorick.calibre-web = with lib; {
|
||||||
|
enable = mkEnableOption "calibre-web";
|
||||||
|
vhost = mkOption { type = types.str; };
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.calibre-web = {
|
||||||
|
enable = true;
|
||||||
|
options = {
|
||||||
|
enableBookUploading = true;
|
||||||
|
#enableBookConversion = true;
|
||||||
|
extraConfig.config_kepubifypath = "${pkgs.kepubify}/bin/kepubify";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts.${cfg.vhost} = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://[::1]:8083";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
locations."/kobo/" = {
|
||||||
|
proxyPass = "http://[::1]:8083/kobo/";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
proxy_buffers 4 256k;
|
||||||
|
proxy_busy_buffers_size 256k;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue