summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2021-07-14 21:26:20 -0400
committerKjetil Orbekk <kj@orbekk.com>2021-07-14 21:26:20 -0400
commitaa395f21e4a17b32e0d89a823afa914f1242549c (patch)
tree41e6d7ba048ab96201f28aa7c71c7a2ea0d92418 /modules
parent91324bc602ead478b956b2602d1658ff2830adc7 (diff)
add auth for hledger-web
Diffstat (limited to 'modules')
-rw-r--r--modules/hledger-web.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/hledger-web.nix b/modules/hledger-web.nix
index 57faed6..bfe5e24 100644
--- a/modules/hledger-web.nix
+++ b/modules/hledger-web.nix
@@ -37,5 +37,18 @@ in {
hledger-web -f ${cfg.journalFile} --auto --port ${cfg.port}
'';
};
+
+ services.nginx.virtualHosts."money.orbekk.com" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/" = {
+ proxyPass = "http://127.0.0.1:${toString cfg.port}";
+ proxyWebsockets = true;
+ extraConfig = ''
+ auth_basic money;
+ auth_basic_user_file "/opt/secret/nginx-money.htpasswd";
+ '';
+ };
+ };
};
}