Skip to content

Commit b74b3f0

Browse files
Victor NawothnigVictor Nawothnig
authored andcommitted
Add RAC outpost
1 parent bfcad34 commit b74b3f0

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

components/gopkgs.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ buildGo123Module {
4141
"cmd/server"
4242
"cmd/proxy"
4343
"cmd/radius"
44+
"cmd/rac"
4445
];
4546
vendorHash = "sha256-aG/VqpmHJeGyF98aS0jgwEAq1R5c8VggeJxLWS9W8HY=";
4647
nativeBuildInputs = [ makeWrapper ];

module.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,29 @@ in
123123
};
124124
};
125125

126+
# RAC oupost
127+
authentik-rac = {
128+
enable = mkEnableOption "authentik RAC outpost";
129+
130+
environmentFile = mkOption {
131+
type = types.nullOr types.path;
132+
default = null;
133+
example = "/run/secrets/authentik-rac/authentik-rac-env";
134+
description = ''
135+
Environment file as defined in {manpage}`systemd.exec(5)`.
136+
137+
Secrets may be passed to the service without adding them to the world-readable
138+
/nix/store, by specifying the desied secrets as environment variables according
139+
to the authentic documentation.
140+
141+
```
142+
# example content
143+
AUTHENTIK_TOKEN=<token from authentik for this outpost>
144+
```
145+
'';
146+
};
147+
};
148+
126149
# RADIUS oupost
127150
authentik-radius = {
128151
enable = mkEnableOption "authentik RADIUS outpost";
@@ -351,6 +374,33 @@ in
351374
}
352375
))
353376

377+
# RAC outpost
378+
(mkIf config.services.authentik-rac.enable (
379+
let
380+
cfg = config.services.authentik-rac;
381+
in
382+
{
383+
systemd.services.authentik-rac = {
384+
wantedBy = [ "multi-user.target" ];
385+
wants = [ "network-online.target" ];
386+
after = [
387+
"network-online.target"
388+
"authentik.service"
389+
];
390+
serviceConfig = {
391+
RuntimeDirectory = "authentik-rac";
392+
UMask = "0027";
393+
WorkingDirectory = "%t/authentik-rac";
394+
DynamicUser = true;
395+
ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/rac";
396+
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
397+
Restart = "on-failure";
398+
BindReadOnlyPaths = "${lib.getExe pkgs.guacamole-server}:/opt/guacamole/sbin/guacd";
399+
};
400+
};
401+
}
402+
))
403+
354404
# RADIUS outpost
355405
(mkIf config.services.authentik-radius.enable (
356406
let

0 commit comments

Comments
 (0)