start authentik on boot

This commit is contained in:
2024-11-10 14:15:17 -06:00
parent 445cf1d2bd
commit f96f769b2b
4 changed files with 64 additions and 19 deletions

View File

@@ -1,13 +1,10 @@
{ pkgs, config, lib, inputs, ... }: {
{ pkgs, config, lib, ... }: {
options.sysconfig.opts.virtualization.authentik.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
imports = [
inputs.arion.nixosModules.arion
];
config = lib.mkIf config.sysconfig.opts.virtualization.authentik.enable {
@@ -22,14 +19,16 @@
path = "/ssd1/Authentik/.env";
};
/*systemd.services.launchAuthentik = {
systemd.services.launchAuthentik = {
enable = true;
wantedBy = [ "multi-user.target" ];
script = ''
cd /home/nathan/Projects/System/system-config/services/containers/authentik
${pkgs.docker-compose}/bin/docker-compose up -d
cd /ssd1/Authentik
${pkgs.docker-compose}/bin/docker-compose up
'';
};*/
};
};
}

View File

@@ -123,6 +123,9 @@
entryPoints = [ "localsecure" "websecure" ];
rule = "Host(`blunkall.us`)";
service = "homepage";
middlewares = [
"authentik"
];
tls = {
certResolver = "cloudflare";
domains = {
@@ -137,6 +140,22 @@
entryPoints = [ "localsecure" "websecure" ];
rule = "Host(`www.blunkall.us`)";
service = "homepage";
middlewares = [
"authentik"
];
tls = {
certResolver = "cloudflare";
domains = {
main = "blunkall.us";
sans = [ "*.blunkall.us" "*.local.blunkall.us" ];
};
};
};
auth = {
entryPoints = [ "localsecure" "websecure" ];
rule = "Host(`auth.blunkall.us`)";
service = "authentik";
tls = {
certResolver = "cloudflare";
domains = {
@@ -159,7 +178,7 @@
};
};*/
local = {
/*local = {
entryPoints = [ "localsecure" ];
rule = "Host(`traefik.local.blunkall.us`)";
service = "dashboard@internal";
@@ -170,6 +189,26 @@
sans = [ "*.blunkall.us" "*.local.blunkall.us" ];
};
};
};*/
};
middlewares = {
authentik.forwardAuth = {
address = "http://192.168.100.10:9000/outpost.goauthentik.io/auth/traefik";
trustForwardHeader = true;
authResponseHeaders = [
"X-authentik-username"
"X-authentik-groups"
"X-authentik-email"
"X-authentik-name"
"X-authentik-uid"
"X-authentik-jwt"
"X-authentik-meta-jwks"
"X-authentik-meta-outpost"
"X-authentik-meta-provider"
"X-authentik-meta-app"
"X-authentik-meta-version"
];
};
};
@@ -177,6 +216,8 @@
#gitlab.loadBalancer.servers = [ { url = "http://192.168.100.12:80"; } ];
homepage.loadBalancer.servers = [ { url = "http://192.168.100.13:80"; } ];
authentik.loadBalancer.servers = [ { url = "http://192.168.100.10:9000"; } ];
};
};
};