feat: add redis for authelia session storage
This commit is contained in:
parent
c589a47353
commit
307e8f2307
1 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,21 @@ let
|
||||||
system = pkgs.system;
|
system = pkgs.system;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
# Redis for Authelia session persistence
|
||||||
|
services.redis.servers.authelia = {
|
||||||
|
enable = true;
|
||||||
|
user = "authelia-main";
|
||||||
|
unixSocket = "/run/redis-authelia/redis.sock";
|
||||||
|
unixSocketPerm = 660;
|
||||||
|
settings = {
|
||||||
|
appendonly = "yes"; # Enable AOF persistence
|
||||||
|
appendfsync = "everysec"; # Sync every second
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Add authelia user to redis group for socket access
|
||||||
|
users.users.authelia-main.extraGroups = [ "redis-authelia" ];
|
||||||
|
|
||||||
sops.secrets.authelia-jwt-secret = {
|
sops.secrets.authelia-jwt-secret = {
|
||||||
owner = "authelia-main";
|
owner = "authelia-main";
|
||||||
};
|
};
|
||||||
|
|
@ -106,6 +121,9 @@ in {
|
||||||
inactivity = "45m";
|
inactivity = "45m";
|
||||||
remember_me_duration = "1M";
|
remember_me_duration = "1M";
|
||||||
domain = "cloonar.com";
|
domain = "cloonar.com";
|
||||||
|
redis = {
|
||||||
|
host = "/run/redis-authelia/redis.sock";
|
||||||
|
};
|
||||||
# todo: enable with 4.38
|
# todo: enable with 4.38
|
||||||
# cookies = [
|
# cookies = [
|
||||||
# {
|
# {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue