biotite: move all services to biotite except kanidm

This commit is contained in:
xinyangli 2024-12-05 13:28:22 +08:00
parent 7bc5db676d
commit 756357552a
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
13 changed files with 78 additions and 52 deletions

View file

@ -3,6 +3,7 @@
./hardware-configurations.nix
./monitoring.nix
./restic.nix
./ntfy.nix
];
config = {

View file

@ -10,7 +10,8 @@ let
minifluxUrl
gotosocialUrl
hedgedocDomain
forgejoDomain
grafanaUrl
ntfyUrl
;
removeHttps = s: lib.removePrefix "https://" s;
in
@ -44,7 +45,7 @@ in
promtail.enable = true;
};
services.caddy.virtualHosts."https://grafana.xinyang.life".extraConfig =
services.caddy.virtualHosts.${grafanaUrl}.extraConfig =
with config.services.grafana.settings.server; ''
reverse_proxy http://${http_addr}:${toString http_port}
'';
@ -98,17 +99,13 @@ in
name = "hedgedoc";
address = hedgedocDomain;
}
{
name = "forgejo";
address = forgejoDomain;
}
{
name = "ntfy";
address = "ntfy.xinyang.life";
address = removeHttps ntfyUrl;
}
{
name = "grafana-eu";
address = "grafana.xinyang.life";
address = removeHttps grafanaUrl;
}
{
name = "loki";

29
machines/thorite/ntfy.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, ... }:
let
inherit (config.my-lib.settings) ntfyUrl;
in
{
services.ntfy-sh = {
enable = true;
group = "caddy";
settings = {
listen-unix = "/var/run/ntfy-sh/ntfy.sock";
listen-unix-mode = 432; # octal 0660
base-url = ntfyUrl;
};
};
systemd.services.ntfy-sh.serviceConfig.RuntimeDirectory = "ntfy-sh";
services.caddy.virtualHosts.${ntfyUrl}.extraConfig = ''
reverse_proxy unix/${config.services.ntfy-sh.settings.listen-unix}
@httpget {
protocol http
method GET
path_regexp ^/([-_a-z0-9]{0,64}$|docs/|static/)
}
redir @httpget https://{host}{uri}
'';
}