Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Nov 18, 2024
1 parent 3bc15ac commit 0400e96
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 5 deletions.
63 changes: 60 additions & 3 deletions nix/modules/nixos/containers/authelia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ in {
uid = 999;
restartUnits = ["[email protected]"];
};
authelia-jwt_secret = {
sopsFile = lib.snowfall.fs.get-file "${cfg.secret_file}";
uid = 999;
restartUnits = ["[email protected]"];
};
authelia-session_secret = {
sopsFile = lib.snowfall.fs.get-file "${cfg.secret_file}";
uid = 999;
restartUnits = ["[email protected]"];
};
# "authelia-jwt_rsa_key.pem" = {
# # format = "binary";
# sopsFile = lib.snowfall.fs.get-file "${cfg.secret_file}";
# uid = 999;
# restartUnits = ["[email protected]"];
# };
};
containers.authelia = {
ephemeral = true;
Expand All @@ -64,6 +80,15 @@ in {
"${config.sops.secrets.authelia-storage-encryption-key.path}" = {
isReadOnly = true;
};
"${config.sops.secrets.authelia-session_secret.path}" = {
isReadOnly = true;
};
"${config.sops.secrets.authelia-jwt_secret.path}" = {
isReadOnly = true;
};
# "${config.sops.secrets."authelia-jwt_rsa_key.pem".path}" = {
# isReadOnly = true;
# };

"/var/lib/authelia-main/users/" = {
hostPath = "${cfg.dataPath}/users/";
Expand All @@ -85,9 +110,9 @@ in {
enable = true;
secrets = {
storageEncryptionKeyFile = config.sops.secrets.authelia-storage-encryption-key.path;
# jwtSecretFile = config.sops.secrets.authelia_jwt_secret_file.path;
# sessionSecretFile = config.sops.secrets.authelia_session_secret_file.path;
manual = true;
jwtSecretFile = config.sops.secrets.authelia-jwt_secret.path;
sessionSecretFile = config.sops.secrets.authelia-session_secret.path;
# manual = true;
};

settings = {
Expand Down Expand Up @@ -141,6 +166,38 @@ in {
}
];
};

identity_providers = {
oidc = {
# jwks = [
# {
# key_id = "main";
# key = config.sops.secrets.authelia-storage-encryption-key;
# }
# ];
clients = [
# {
# client_id = "jellyfin";
# client_name = "Jellyfin";
# client_secret = "$pbkdf2-sha512$310000$w8/7AXV6ljEACFLwkc.neQ$bMnyFnhUjuFjhKGw.awXKfK1EK6n9XS5P6RcywAbBxLhI6hcJqJ8jDCt3oOBp9YpaPCbNh3Sm23NCwJaUIci5w";
# require_pkce = true;
# pkce_challenge_method = "S256";
# authorization_policy = "one_factor";
# redirect_uris = [ "https://jellyfin.${config.domain.base}/sso/OID/redirect/authelia" ];
# token_endpoint_auth_method = "client_secret_post";
# }
{
client_id = "nextcloud";
client_name = "Nextcloud";
client_secret = "$pbkdf2-sha512$310000$UO0xTTiZTXcj6cUL1R7P/A$4SQ.Zzv//x02/sZ5WM8EBPYd/Tps07K8.Zq19sjVVV6vIMCb.e5giDgHeZokgD3lBv4MOVlxttCjRU0dhFO15w";
require_pkce = true;
pkce_challenge_method = "S256";
authorization_policy = "one_factor";
redirect_uris = ["https://nextcloud2.${cfg.domain}/apps/oidc_login/oidc"];
}
];
};
};
};
};
};
Expand Down
14 changes: 14 additions & 0 deletions nix/modules/nixos/containers/nextcloud/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ in {
"OC\\Preview\\Movie"
"OC\\Preview\\MP4"
];
user_oidc = {
single_logout = false;
auto_provision = true;
soft_auto_provision = true;
};

oidc_login_client_id = "nextcloud";
oidc_login_provider_url = "https://authelia.sbulav.ru";
oidc_login_attributes = {
id = "preferred_username";
};
oidc_login_scope = "openid profile";
oidc_login_button_text = "Log in with OpenID";
oidc_login_code_challenge_method = "S256";
};
};
};
Expand Down
7 changes: 5 additions & 2 deletions nix/secrets/serverz/default.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
traefik-cf-env: ENC[AES256_GCM,data:g7Xw9UM1FeOFh+R0jGmPl9Gipix2WNilkCw30iDutxduhYCRmh3cye4D43Zy5x31kvdHej0pwlaSgEVbDOfBMoeENezrcDnLd3xqZHks75QleXv8Ujqoag==,iv:w/byUzrl/9+qcMnUERmO7RYpk991WbhRtcBJkIQIF1o=,tag:CxFiyegx/ZhzU+CU0Bkabg==,type:str]
authelia-env: ENC[AES256_GCM,data:6fFB2jhyMiGKY/Y/cbel3p9wkEX72OPYHjoEereC7vj6kVH6fne7ctCKFgzZF0bGyET6iS7sh01Xgj+BNCejdSAoqjouoUHBcFc3VE7Vrecg/0LLDjLZ4sc1Fd1ZGLvcPNDTVL0j7UQTBX0MirB1yy4t2s1gNLUvjunwxtglLaAxjDIi541pZb4d9FL/BJ1g76dvGLIlyF4tKssSPSujLls/JrlG3/jbdrmS4sbA+ZI=,iv:eqeV4P1Rw0RxQqs//oYTzEQLyavLfbvKkz2JXs9fkmc=,tag:1rsGSeGVn3c3IYAsfghTXw==,type:str]
authelia-jwt_secret: ENC[AES256_GCM,data:Y+B6kS6Zoo9Z2h5VPbn0mwFiP9sdWAPP/ztCNbtGRa+6Slt9HP9ccbWcno7kdi6LdHq+ocEJJTOHnztmLBMxZQ==,iv:CyCga7SDtpYVl2GDOcA4eFCqx4bDmEhkM2kFD74laJU=,tag:nKLzB8+vrOPnwf0x+F/G4g==,type:str]
authelia-session_secret: ENC[AES256_GCM,data:h5ypDJtUSkF+dtD1edMlXATx6tkTejTG93n3enZz8VwUuMdxjYhIiA7R4KpRpXbgdDbRRbgjb+naunTAZZjQpw==,iv:5wUFCQfOxkSZ9RnMG7fU3U5neAM4jkE5+mP33JyNjSo=,tag:uK5682nzik96MTy6xtrCmw==,type:str]
authelia-storage-encryption-key: ENC[AES256_GCM,data:ub+rSg3lNyxVJapVhMJBu+9kfG6ToSJSXmgie3qOvlkRZy4oLYdEIvgcie9yZ6CnSAASMLVBX8GSt2XKee8Lbg==,iv:vHNERwAxZ8ndFKANC40GUqt1JF1ivBOPWt70MWgSMso=,tag:yQN8dDoXl6Uqg3VSG3hhUw==,type:str]
authelia-jwt_rsa_key.pem: ENC[AES256_GCM,data:milUMHhao5r3wbwHRtsshdNYF0VOw/LjHkg4blXDH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gtwjv1z4p3TplQ8nYVNuOQNRSKL4MdnwlgU5QBrqYUtzE,iv:QuJpw9N81fGOlx9D+r+HT5mzQHA0mQ4twAZKiGXQwJM=,tag:0eAeZ8p6GulohKG6915PeQ==,type:str]
nextcloud-admin-pass: ENC[AES256_GCM,data:yJFfJ7K/gyM71omo//qURGs=,iv:5JmRGdHHtJtiZeuF4kjok2nUrWQArRRTr5XbwJtDXxI=,tag:SY9Lz7QMCNoixUesA3Q9WQ==,type:str]
sops:
kms: []
Expand All @@ -26,8 +29,8 @@ sops:
SVdkN2htWTBaLy9jdGJ6S0RocE9JMFUK8yejh6yKp+OLsNFXWHUJzvHnwaGI1yXA
Y4F7JY6bhXcu8KJGvjgy08ox+n82V6xY9ov1hwhUlfyIZf4H0/bjuA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-11-13T07:50:57Z"
mac: ENC[AES256_GCM,data:3ww7LvMEg/qa8JJ6C4OlEvf4eqlQgvPtWDEkuY9QewnjSs7pAGNxQrOPpNCO4zLrO7Kx2u73Rcg8bzQXbBsPypR5LmlOC8hqi+OqW8k0YPmG8Ep0WVMX7v9IQsjM34JSyQFIKC7iD55diTi5B7W+a/MOpqJ0wvNPqPUwrbRA1/M=,iv:IgbubkYWcOrxXLRvHCknUNNkt1rQ+JDgcRTAaAgKZwU=,tag:WGVSgNnybAqfEgLl1kZx+w==,type:str]
lastmodified: "2024-11-18T11:04:07Z"
mac: ENC[AES256_GCM,data:xyoVGkZcl/HK7TaYAew5HMrFJuBW3fj7pnriWvl885/aJPd27o3MvVnZnW2MCjC9CFKdlXrVamfm6W8q4p7Y2ZVCoMK3o9n5qm9Lynjro3vKn2qPYKjSF/5OocFathAow2L+UOacTCiNl9CFdevKRjWAgybpOzjjCdjBdjz9Hsw=,iv:SQo0nKgbnAXCn8B6yvr9msAiv3PlhkoyszR6KP7fWIQ=,tag:1r7IdPnuaEm+mgLC40+NoQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.1

0 comments on commit 0400e96

Please sign in to comment.