yep, more dotfiles

server: add authelia

wiro.world 40e896fb 819b7973

verified
+76
nixos/profiles/server.nix
···
lldap-port = 3006;
lldap-hostname = "ldap.wiro.world";
+
authelia-port = 3007;
+
authelia-hostname = "auth.wiro.world";
+
grafana-port = 9000;
grafana-hostname = "console.wiro.world";
prometheus-port = 9001;
···
virtualHosts.${lldap-hostname}.extraConfig = ''
reverse_proxy http://localhost:${toString lldap-port}
'';
+
+
virtualHosts.${authelia-hostname}.extraConfig = ''
+
reverse_proxy http://localhost:${toString authelia-port}
+
'';
};
security.sudo.wheelNeedsPassword = false;
···
ldap_base_dn = "dc=wiro,dc=world";
};
environmentFile = config.age.secrets.lldap-env.path;
+
};
+
+
age.secrets.authelia-jwt-secret.file = ../../secrets/authelia-jwt-secret.age;
+
age.secrets.authelia-jwt-secret.owner = config.services.authelia.instances.main.user;
+
age.secrets.authelia-storage-enc-key.file = ../../secrets/authelia-storage-enc-key.age;
+
age.secrets.authelia-storage-enc-key.owner = config.services.authelia.instances.main.user;
+
age.secrets.authelia-ldap-password.file = ../../secrets/authelia-ldap-password.age;
+
age.secrets.authelia-ldap-password.owner = config.services.authelia.instances.main.user;
+
age.secrets.authelia-smtp-password.file = ../../secrets/authelia-smtp-password.age;
+
age.secrets.authelia-smtp-password.owner = config.services.authelia.instances.main.user;
+
services.authelia.instances.main = {
+
enable = true;
+
+
secrets = {
+
jwtSecretFile = config.age.secrets.authelia-jwt-secret.path;
+
# oidcHmacSecretFile = config.age.secrets.authelia-oidc-hmac-secret.path;
+
# oidcIssuerPrivateKeyFile = config.age.secrets.authelia-oidc-issuer-pkey.path;
+
# sessionSecretFile = config.age.secrets.authelia-session-secret.path;
+
storageEncryptionKeyFile = config.age.secrets.authelia-storage-enc-key.path;
+
};
+
environmentVariables = {
+
AUTHELIA_AUTHENTICATION_BACKEND_LDAP_PASSWORD_FILE = config.age.secrets.authelia-ldap-password.path;
+
AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE = config.age.secrets.authelia-smtp-password.path;
+
};
+
settings = {
+
server.address = "localhost:${toString authelia-port}";
+
+
storage.local.path = "/var/lib/authelia-main/db.sqlite3";
+
+
session = {
+
cookies = [{
+
domain = "wiro.world";
+
authelia_url = "https://${authelia-hostname}";
+
default_redirection_url = "https://wiro.world";
+
}];
+
};
+
+
authentication_backend = {
+
ldap = {
+
address = "ldap://localhost:3890";
+
timeout = "5m"; # replace with systemd dependency
+
+
base_dn = "dc=wiro,dc=world";
+
users_filter = "(&({username_attribute}={input})(objectClass=person))";
+
groups_filter = "(&(member={dn})(objectClass=groupOfNames))";
+
+
user = "uid=authelia,ou=people,dc=wiro,dc=world";
+
# Set in `AUTHELIA_AUTHENTICATION_BACKEND_LDAP_PASSWORD_FILE`.
+
# password = "";
+
};
+
};
+
access_control = {
+
default_policy = "deny";
+
rules = [
+
{
+
domain = "*.wiro.world";
+
policy = "one_factor";
+
}
+
];
+
};
+
+
notifier.smtp = {
+
address = "smtp://smtp.resend.com:2587";
+
username = "resend";
+
# Set in `AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE`.
+
# password = "";
+
sender = "authelia@wiro.world";
+
};
+
};
};
# port used is 6567
secrets/authelia-jwt-secret.age

This is a binary file and will not be displayed.

secrets/authelia-ldap-password.age

This is a binary file and will not be displayed.

+9
secrets/authelia-smtp-password.age
···
+
age-encryption.org/v1
+
-> ssh-ed25519 sMF1bg 0duJYaUlZd2G3tYi7CuV+c7KNaqWusLoMpoILvaajgc
+
AnAlDVzRdeoXGXvyllhSNCoDQjZ+nucLGHCfPWR8IBQ
+
-> ssh-ed25519 SmMcWg oX82fe4sQmKyjJqv9AFRY6Bww43V/8myNRsN9/M8Sho
+
Et6ycO8hm2XV36X5q7iO+nJCtjkYoq6mDBEssrjt/70
+
-> ssh-ed25519 Q8rMFA /gU1tIVjqExV8NXB1gSDsWIXpVfxm3zPJX7xOAqeqWM
+
szrd67kHWslLO+jMCuDmzYR0LPVVzd7idgl3AKt+USU
+
--- ojxyQVhx4rX+x5gzEEx8KFiorwywqEEyTNWUJY39jIk
+
�������ş* l��1����= n�Ŏ��(� �Iamz~B����������� 鰦�.�.Z>�',p��
+11
secrets/authelia-storage-enc-key.age
···
+
age-encryption.org/v1
+
-> ssh-ed25519 sMF1bg PYC6LaFo/DTQlRMewqbVtS4lzVtKyuFZQSqCrQwwEyg
+
kj0sHy8IpnBsMBQy/XYtj2pLXlk6wprF3MxjFTOiZ6E
+
-> ssh-ed25519 SmMcWg rvlLGzf6D96Dh1lL8as2vjc3PB7G/86U8AR7/lAELT0
+
qcdOqVV6o+5OfJYj5pfZ62hOnrBQwY0DAeIJkLoyYss
+
-> ssh-ed25519 Q8rMFA eALgQVN5OA0EuYYEyEbFnju/Yii71e+xcs98LkXnyyo
+
Rbxu60qvXKdFaJ7lfs7LeYx37TIKYK2Gxw2QcxF3soA
+
--- ryt5q5lXn1Cyn4T6RSU1IR7dHZOTbyanaG6ZqeYYGBQ
+
�G���* \�ʕ�|���
+
�S�T���z�! �FIG͍��,��2Q��+�s�76Z�D`��Q�hM�],��E7�2<Q�
+
?ׯ�t��u\���xpe/rrR��L}��S��g�%�:�Oj����{T%h��D�~�+DЫ��W%� �ŗ�r�v$%m$
+4
secrets/secrets.nix
···
"pds-env.age".publicKeys = deploy;
# Defines `LLDAP_JWT_SECRET`, `LLDAP_KEY_SEED`.
"lldap-env.age".publicKeys = deploy;
+
"authelia-jwt-secret.age".publicKeys = deploy;
+
"authelia-storage-enc-key.age".publicKeys = deploy;
+
"authelia-ldap-password.age".publicKeys = deploy;
+
"authelia-smtp-password.age".publicKeys = deploy;
# Not used in config but useful
"pgp-ca5e.age".publicKeys = users;