diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2021-07-14 21:26:20 -0400 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2021-07-14 21:26:20 -0400 |
commit | aa395f21e4a17b32e0d89a823afa914f1242549c (patch) | |
tree | 41e6d7ba048ab96201f28aa7c71c7a2ea0d92418 | |
parent | 91324bc602ead478b956b2602d1658ff2830adc7 (diff) |
add auth for hledger-web
-rw-r--r-- | modules/hledger-web.nix | 13 |
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"; + ''; + }; + }; }; } |