feat: refactored reverse proxy to be a normally named module
This commit is contained in:
parent
466926b919
commit
4dd285c122
29 changed files with 352 additions and 426 deletions
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
config = lib.mkIf config.services.paperless.enable {
|
||||
services.paperless = {
|
||||
domain = "${config.services.paperless.subdomain}.${config.host.reverse_proxy.hostname}";
|
||||
configureTika = true;
|
||||
settings = {
|
||||
PAPERLESS_DBENGINE = "postgresql";
|
||||
|
|
|
|||
|
|
@ -4,25 +4,30 @@
|
|||
...
|
||||
}: {
|
||||
options.services.paperless = {
|
||||
subdomain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "subdomain of base domain that paperless will be hosted at";
|
||||
default = "paperless";
|
||||
reverseProxy = {
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "domain that paperless will be hosted at";
|
||||
default = "paperless.arpa";
|
||||
};
|
||||
extraDomains = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "extra domains that should be configured for paperless";
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.services.paperless.enable && config.host.reverse_proxy.enable) {
|
||||
host = {
|
||||
reverse_proxy.subdomains.${config.services.paperless.subdomain} = {
|
||||
target = "http://${config.services.paperless.address}:${toString config.services.paperless.port}";
|
||||
config = lib.mkIf (config.services.paperless.enable && config.services.reverseProxy.enable) {
|
||||
services.reverseProxy.services.paperless = {
|
||||
target = "http://${config.services.paperless.address}:${toString config.services.paperless.port}";
|
||||
domain = config.services.paperless.reverseProxy.domain;
|
||||
extraDomains = config.services.paperless.reverseProxy.extraDomains;
|
||||
|
||||
websockets.enable = true;
|
||||
settings = {
|
||||
proxyWebsockets.enable = true;
|
||||
forwardHeaders.enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
# allow large file uploads
|
||||
client_max_body_size 50000M;
|
||||
'';
|
||||
maxBodySize = 50000;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue