gerd.authelia: adds smtp support w/ stalwart
This commit is contained in:
parent
eab1162cfd
commit
6f261c6b78
4 changed files with 29 additions and 10 deletions
|
@ -3,13 +3,16 @@
|
||||||
let
|
let
|
||||||
svc_domain = "auth.${config.mine.shared.settings.domain}";
|
svc_domain = "auth.${config.mine.shared.settings.domain}";
|
||||||
|
|
||||||
|
authelia_user = "authelia-main";
|
||||||
autheliaStateDir = "/var/lib/authelia-main";
|
autheliaStateDir = "/var/lib/authelia-main";
|
||||||
|
smtp_username = "authelia";
|
||||||
port = 9091;
|
port = 9091;
|
||||||
in {
|
in {
|
||||||
services.authelia.instances.main = {
|
services.authelia.instances.main = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
environmentVariables.AUTHELIA_AUTHENTICATION_BACKEND_LDAP_PASSWORD_FILE = config.age.secrets.lldap-bind-user-pass.path;
|
environmentVariables.AUTHELIA_AUTHENTICATION_BACKEND_LDAP_PASSWORD_FILE = config.age.secrets.lldap-bind-user-pass.path;
|
||||||
|
environmentVariables.AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE = config.age.secrets.authelia-smtp-password.path;
|
||||||
secrets = {
|
secrets = {
|
||||||
jwtSecretFile = config.age.secrets.authelia-jwt.path;
|
jwtSecretFile = config.age.secrets.authelia-jwt.path;
|
||||||
storageEncryptionKeyFile = config.age.secrets.authelia-storage.path;
|
storageEncryptionKeyFile = config.age.secrets.authelia-storage.path;
|
||||||
|
@ -26,14 +29,18 @@ in {
|
||||||
server.address = "tcp://127.0.0.1:${builtins.toString port}";
|
server.address = "tcp://127.0.0.1:${builtins.toString port}";
|
||||||
|
|
||||||
# totp - disable for now, as it requires email server
|
# totp - disable for now, as it requires email server
|
||||||
access_control.default_policy = "one_factor";
|
access_control.default_policy = "two_factor";
|
||||||
# totp.disable = true;
|
totp.issuer = svc_domain;
|
||||||
# webauthn.disable = true;
|
|
||||||
# default_2fa_method = "totp";
|
|
||||||
# totp.issuer = "auth.fricloud.dk";
|
|
||||||
|
|
||||||
storage.local.path = "${autheliaStateDir}/authelia.sqlite3";
|
storage.local.path = "${autheliaStateDir}/authelia.sqlite3";
|
||||||
notifier.filesystem.filename = "${autheliaStateDir}/authelia_notifier.txt";
|
|
||||||
|
notifier.smtp = rec {
|
||||||
|
address = "submissions://${config.mine.shared.settings.mail.domain_smtp}:${builtins.toString config.mine.shared.settings.mail.ports.submissions}";
|
||||||
|
username = smtp_username;
|
||||||
|
sender = "Authelia <${username}@${config.mine.shared.settings.domain}>";
|
||||||
|
identifier = config.networking.hostName;
|
||||||
|
tls.server_name = config.mine.shared.settings.mail.domain_smtp;
|
||||||
|
};
|
||||||
|
|
||||||
authentication_backend = {
|
authentication_backend = {
|
||||||
password_reset.disable = false;
|
password_reset.disable = false;
|
||||||
|
@ -87,10 +94,11 @@ in {
|
||||||
|
|
||||||
# setup secrets for authelia
|
# setup secrets for authelia
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
authelia-jwt.owner = "authelia-main";
|
authelia-jwt.owner = authelia_user;
|
||||||
authelia-storage.owner = "authelia-main";
|
authelia-storage.owner = authelia_user;
|
||||||
authelia-session.owner = "authelia-main";
|
authelia-session.owner = authelia_user;
|
||||||
authelia-oidc-issuer-privatekey-pem.owner = "authelia-main";
|
authelia-oidc-issuer-privatekey-pem.owner = authelia_user;
|
||||||
|
authelia-smtp-password.owner = authelia_user;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups."${config.age.secrets.lldap-bind-user-pass.group}".members = [ config.users.users.authelia-main.name ];
|
users.groups."${config.age.secrets.lldap-bind-user-pass.group}".members = [ config.users.users.authelia-main.name ];
|
||||||
|
|
9
secrets/authelia/smtp-password.age
Normal file
9
secrets/authelia/smtp-password.age
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 QSDXqg ukkpdyQwjxQ5ZSDRNp3scWW/UaL9KkvYjgOohagME2E
|
||||||
|
TBz/F6ki/WRQ36dwWGya/+jk6d/CVit0uk6ftUGwkM0
|
||||||
|
-> ssh-ed25519 n8n9DQ 4tAfBISscjJkXdT2ze7qwjSgXsKVORQdJ6BU2FWziBI
|
||||||
|
KsgjA34+cX5JP5zQDJu2S42T07L1bUH6rFNLnGpGsCk
|
||||||
|
-> ssh-ed25519 BTp6UA MN57AovukP5h7xP0TtdZJnbGUVGem9Ag4yrXeQPLOmc
|
||||||
|
XvlsXC6kI6gbzrujxfGQII2bwPoXd7pAQfP3oXGqe4U
|
||||||
|
--- qWkj5My+16z9Qjge9GR0ezFkzi4zONiEny+I/5j9qpQ
|
||||||
|
*ヲ{|<7C>o訒<6F>i_k}oセ暉<EFBDBE>ー乕z)ァ讐ネQウオク、ニc弥戻ヲH「、<]約・g\{W<><57>7:
|
|
@ -8,6 +8,7 @@
|
||||||
authelia-session.file = ./authelia/session.age;
|
authelia-session.file = ./authelia/session.age;
|
||||||
authelia-oidc-issuer-privatekey-pem.file = ./authelia/oidc-issuer-privatekey-pem.age;
|
authelia-oidc-issuer-privatekey-pem.file = ./authelia/oidc-issuer-privatekey-pem.age;
|
||||||
authelia-oidc-issuer-privatekey-crt.file = ./authelia/oidc-issuer-privatekey-crt.age;
|
authelia-oidc-issuer-privatekey-crt.file = ./authelia/oidc-issuer-privatekey-crt.age;
|
||||||
|
authelia-smtp-password.file = ./authelia/smtp-password.age;
|
||||||
|
|
||||||
# lldap
|
# lldap
|
||||||
lldap-admin-user-pass.file = ./lldap/admin-user-pass.age;
|
lldap-admin-user-pass.file = ./lldap/admin-user-pass.age;
|
||||||
|
|
|
@ -16,6 +16,7 @@ in
|
||||||
"authelia/session.age".publicKeys = defaultAccess;
|
"authelia/session.age".publicKeys = defaultAccess;
|
||||||
"authelia/oidc-issuer-privatekey-pem.age".publicKeys = defaultAccess;
|
"authelia/oidc-issuer-privatekey-pem.age".publicKeys = defaultAccess;
|
||||||
"authelia/oidc-issuer-privatekey-crt.age".publicKeys = defaultAccess;
|
"authelia/oidc-issuer-privatekey-crt.age".publicKeys = defaultAccess;
|
||||||
|
"authelia/smtp-password.age".publicKeys = defaultAccess;
|
||||||
|
|
||||||
# lldap
|
# lldap
|
||||||
"lldap/admin-user-pass.age".publicKeys = defaultAccess;
|
"lldap/admin-user-pass.age".publicKeys = defaultAccess;
|
||||||
|
|
Loading…
Reference in a new issue