Skip to content

Commit 677cb54

Browse files
Victor NawothnigVictor Nawothnig
authored andcommitted
Add RAC outpost
1 parent 69fac05 commit 677cb54

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 @@ buildGo124Module {
4141
"cmd/server"
4242
"cmd/proxy"
4343
"cmd/radius"
44+
"cmd/rac"
4445
];
4546
vendorHash = "sha256-wTTEDBRYCW1UFaeX49ufLT0c17sacJzcCaW/8cPNYR4=";
4647
nativeBuildInputs = [ makeWrapper ];

module.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,29 @@ in
204204
};
205205
};
206206

207+
# RAC oupost
208+
authentik-rac = {
209+
enable = mkEnableOption "authentik RAC outpost";
210+
211+
environmentFile = mkOption {
212+
type = types.nullOr types.path;
213+
default = null;
214+
example = "/run/secrets/authentik-rac/authentik-rac-env";
215+
description = ''
216+
Environment file as defined in {manpage}`systemd.exec(5)`.
217+
218+
Secrets may be passed to the service without adding them to the world-readable
219+
/nix/store, by specifying the desied secrets as environment variables according
220+
to the authentic documentation.
221+
222+
```
223+
# example content
224+
AUTHENTIK_TOKEN=<token from authentik for this outpost>
225+
```
226+
'';
227+
};
228+
};
229+
207230
# RADIUS oupost
208231
authentik-radius = {
209232
enable = mkEnableOption "authentik RADIUS outpost";
@@ -497,6 +520,33 @@ in
497520
}
498521
))
499522

523+
# RAC outpost
524+
(mkIf config.services.authentik-rac.enable (
525+
let
526+
cfg = config.services.authentik-rac;
527+
in
528+
{
529+
systemd.services.authentik-rac = {
530+
wantedBy = [ "multi-user.target" ];
531+
wants = [ "network-online.target" ];
532+
after = [
533+
"network-online.target"
534+
"authentik.service"
535+
];
536+
serviceConfig = {
537+
RuntimeDirectory = "authentik-rac";
538+
UMask = "0027";
539+
WorkingDirectory = "%t/authentik-rac";
540+
DynamicUser = true;
541+
ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/rac";
542+
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
543+
Restart = "on-failure";
544+
BindReadOnlyPaths = "${lib.getExe pkgs.guacamole-server}:/opt/guacamole/sbin/guacd";
545+
};
546+
};
547+
}
548+
))
549+
500550
# RADIUS outpost
501551
(mkIf config.services.authentik-radius.enable (
502552
let

0 commit comments

Comments
 (0)