Compare commits
3 commits
4fd0b16db0
...
2bbbe03444
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bbbe03444 | ||
|
|
478f26a9b8 | ||
| 18ebde767e |
6 changed files with 45 additions and 32 deletions
14
flake.lock
generated
14
flake.lock
generated
|
|
@ -83,11 +83,11 @@
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774210137,
|
"lastModified": 1774258552,
|
||||||
"narHash": "sha256-QaPn/8NlrXd6jd8S9+KV2pYsGNZ8KWU5+jv2/QtRlUw=",
|
"narHash": "sha256-wTJJxhLPr3OHXQ23H9+Ch1YjdlaoMf3605ezfRYLaC4=",
|
||||||
"rev": "1862f2641e54a51755b0b9acb907d01f6b324b2a",
|
"rev": "28bb98f5aec0ea70b623ab4953eb8186acdb7bba",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/1862f2641e54a51755b0b9acb907d01f6b324b2a.tar.gz"
|
"url": "https://git.clan.lol/api/v1/repos/clan/clan-core/archive/28bb98f5aec0ea70b623ab4953eb8186acdb7bba.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
|
|
@ -980,11 +980,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774253681,
|
"lastModified": 1774259547,
|
||||||
"narHash": "sha256-U3LMRHov4wQ4olZq/zvf94Qf7oL6W11fjvZGvWg3gZc=",
|
"narHash": "sha256-5EQ1TL+R/tcsoGas1oALp5Tj2ACfSul+pfrrxP72xC0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "16b430b0e3a5233df0444f14928af915555308ac",
|
"rev": "b3f8d82c4c685fb6f3080745dab8f07606ae50d3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -543,12 +543,12 @@ in
|
||||||
networking.caddy = {
|
networking.caddy = {
|
||||||
hosts = {
|
hosts = {
|
||||||
"auth.kruining.eu" = ''
|
"auth.kruining.eu" = ''
|
||||||
reverse_proxy h2c://::1:9092
|
reverse_proxy h2c://[::1]:9092
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
(auth) {
|
(auth) {
|
||||||
forward_auth h2c://::1:9092 {
|
forward_auth h2c://[::1]:9092 {
|
||||||
uri /api/authz/forward-auth
|
uri /api/authz/forward-auth
|
||||||
copy_headers Remote-User Remote-Groups Remote-Email Remote-Name
|
copy_headers Remote-User Remote-Groups Remote-Email Remote-Name
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ in {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
"${fqn}" = ''
|
"${fqn}" = ''
|
||||||
reverse_proxy /_matrix/* http://::1:${toString port}
|
reverse_proxy /_matrix/* http://[::1]:${toString port}
|
||||||
reverse_proxy /_synapse/client/* http://::1:${toString port}
|
reverse_proxy /_synapse/client/* http://[::1]:${toString port}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,15 @@
|
||||||
|
|
||||||
cfg = config.${namespace}.services.networking.caddy;
|
cfg = config.${namespace}.services.networking.caddy;
|
||||||
hasHosts = (cfg.hosts |> attrNames |> length) > 0;
|
hasHosts = (cfg.hosts |> attrNames |> length) > 0;
|
||||||
|
caddyBase = pkgs.callPackage "${pkgs.path}/pkgs/by-name/ca/caddy/package.nix" {
|
||||||
|
buildGo125Module = pkgs.buildGo126Module;
|
||||||
|
caddy = caddyBase;
|
||||||
|
};
|
||||||
|
caddyPackage =
|
||||||
|
caddyBase.withPlugins {
|
||||||
|
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
|
||||||
|
hash = "sha256-pSXjLaZoRtKV3eFl2ySRSjl3yxi514G1Cb7pfrpxxtE=";
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
options.${namespace}.services.networking.caddy = {
|
options.${namespace}.services.networking.caddy = {
|
||||||
enable = mkEnableOption "enable caddy" // {default = true;};
|
enable = mkEnableOption "enable caddy" // {default = true;};
|
||||||
|
|
@ -27,10 +36,7 @@ in {
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = cfg.enable;
|
enable = cfg.enable;
|
||||||
|
|
||||||
package = pkgs.caddy.withPlugins {
|
package = caddyPackage;
|
||||||
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
|
|
||||||
hash = "sha256-rsDnTunR8C7hVOX5aKcba+iFYHbpWek65DZgbMxOdTs=";
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts =
|
virtualHosts =
|
||||||
cfg.hosts
|
cfg.hosts
|
||||||
|
|
|
||||||
|
|
@ -33,15 +33,15 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf hasPeers {
|
config = mkIf hasPeers {
|
||||||
networking.firewall.allowedUDPPorts = cfg.peer |> lib.attrValues |> lib.map (p: p.port);
|
# networking.firewall.allowedUDPPorts = cfg.peer |> lib.attrValues |> lib.map (p: p.port);
|
||||||
networking.wq-quick = {
|
# networking.wq-quick = {
|
||||||
# enable = cfg.enable;
|
# # enable = cfg.enable;
|
||||||
|
|
||||||
interfaces =
|
# interfaces =
|
||||||
cfg.peer
|
# cfg.peer
|
||||||
|> attrsToList
|
# |> attrsToList
|
||||||
|> imap0 (i: { name, value }: (namevaluepair "wg${i}" (value // { }));
|
# |> imap0 (i: { name, value }: (namevaluepair "wg${i}" (value // {})))
|
||||||
|> listToAttrs
|
# |> listToAttrs;
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
{ pkgs, config, lib, namespace, ... }:
|
{
|
||||||
let
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
namespace,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
|
|
||||||
cfg = config.${namespace}.services.observability.promtail;
|
cfg = config.${namespace}.services.observability.promtail;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.${namespace}.services.observability.promtail = {
|
options.${namespace}.services.observability.promtail = {
|
||||||
enable = mkEnableOption "enable Grafana Promtail";
|
enable = mkEnableOption "enable Grafana Promtail";
|
||||||
};
|
};
|
||||||
|
|
@ -31,7 +35,7 @@ in
|
||||||
|
|
||||||
clients = [
|
clients = [
|
||||||
{
|
{
|
||||||
url = "http://::1:9003/loki/api/v1/push";
|
url = "http://[::1]:9003/loki/api/v1/push";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -46,7 +50,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
relabel_configs = [
|
relabel_configs = [
|
||||||
{ source_labels = [ "__journal__systemd_unit" ]; target_label = "unit"; }
|
{
|
||||||
|
source_labels = ["__journal__systemd_unit"];
|
||||||
|
target_label = "unit";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue