mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-01 16:56:34 +01:00
add radical server
This commit is contained in:
parent
f438090290
commit
0523784b9c
2 changed files with 41 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
./mail.nix
|
||||
./matrix.nix
|
||||
./nginx.nix
|
||||
./radicale.nix
|
||||
];
|
||||
|
||||
jopejoe1 = {
|
||||
|
|
40
systems/hetzner/radicale.nix
Normal file
40
systems/hetzner/radicale.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
mailAccounts = config.mailserver.loginAccounts;
|
||||
htpasswd = pkgs.writeText "radicale.users" (concatStrings
|
||||
(flip mapAttrsToList mailAccounts (mail: user:
|
||||
mail + ":" + user.hashedPassword + "\n"
|
||||
))
|
||||
);
|
||||
|
||||
in {
|
||||
services.radicale = {
|
||||
enable = true;
|
||||
config = ''
|
||||
[auth]
|
||||
type = htpasswd
|
||||
htpasswd_filename = ${htpasswd}
|
||||
htpasswd_encryption = bcrypt
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
virtualHosts = {
|
||||
"cal.missing.ninja" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:5232/";
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Script-Name /;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Authorization;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue