module: add basic proxy outpost service
This commit is contained in:
parent
618330bee6
commit
794eb56bac
1 changed files with 49 additions and 0 deletions
49
module.nix
49
module.nix
|
|
@ -128,6 +128,29 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Proxy oupost
|
||||||
|
authentik-proxy = {
|
||||||
|
enable = mkEnableOption "authentik Proxy outpost";
|
||||||
|
|
||||||
|
environmentFile = mkOption {
|
||||||
|
type = types.nullOr pathToSecret;
|
||||||
|
default = null;
|
||||||
|
example = "/run/secrets/authentik-proxy/authentik-proxy-env";
|
||||||
|
description = ''
|
||||||
|
Environment file as defined in {manpage}`systemd.exec(5)`.
|
||||||
|
|
||||||
|
Secrets may be passed to the service without adding them to the world-readable
|
||||||
|
/nix/store, by specifying the desied secrets as environment variables according
|
||||||
|
to the authentic documentation.
|
||||||
|
|
||||||
|
```
|
||||||
|
# example content
|
||||||
|
AUTHENTIK_TOKEN=<token from authentik for this outpost>
|
||||||
|
```
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# RADIUS oupost
|
# RADIUS oupost
|
||||||
authentik-radius = {
|
authentik-radius = {
|
||||||
enable = mkEnableOption "authentik RADIUS outpost";
|
enable = mkEnableOption "authentik RADIUS outpost";
|
||||||
|
|
@ -356,6 +379,32 @@ in
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|
||||||
|
# Proxy outpost
|
||||||
|
(mkIf config.services.authentik-proxy.enable (
|
||||||
|
let
|
||||||
|
cfg = config.services.authentik-proxy;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.services.authentik-proxy = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [
|
||||||
|
"network-online.target"
|
||||||
|
"authentik.service"
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
RuntimeDirectory = "authentik-proxy";
|
||||||
|
UMask = "0027";
|
||||||
|
WorkingDirectory = "%t/authentik-proxy";
|
||||||
|
DynamicUser = true;
|
||||||
|
ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/proxy";
|
||||||
|
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
))
|
||||||
|
|
||||||
# RADIUS outpost
|
# RADIUS outpost
|
||||||
(mkIf config.services.authentik-radius.enable (
|
(mkIf config.services.authentik-radius.enable (
|
||||||
let
|
let
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue