Merge pull request #46 from GeoffreyFrogeye/push-xklzwvrxluln
module: add basic proxy outpost service
This commit is contained in:
commit
2ef24fac99
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
|
||||
authentik-radius = {
|
||||
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
|
||||
(mkIf config.services.authentik-radius.enable (
|
||||
let
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue