fix auth: config.selfprivacy.modules.auth.enable or false
This commit is contained in:
@@ -14,7 +14,7 @@ let
|
|||||||
"gitea-light"
|
"gitea-light"
|
||||||
"gitea-dark"
|
"gitea-dark"
|
||||||
];
|
];
|
||||||
is-auth-enabled = config.selfprivacy.modules.auth.enable;
|
is-auth-enabled = config.selfprivacy.modules.auth.enable or false;
|
||||||
oauth-client-id = "forgejo";
|
oauth-client-id = "forgejo";
|
||||||
auth-passthru = config.passthru.selfprivacy.auth;
|
auth-passthru = config.passthru.selfprivacy.auth;
|
||||||
oauth2-provider-name = auth-passthru.oauth2-provider-name;
|
oauth2-provider-name = auth-passthru.oauth2-provider-name;
|
||||||
|
@@ -11,7 +11,7 @@ let
|
|||||||
|
|
||||||
hostName = "${cfg.subdomain}.${sp.domain}";
|
hostName = "${cfg.subdomain}.${sp.domain}";
|
||||||
auth-passthru = config.passthru.selfprivacy.auth;
|
auth-passthru = config.passthru.selfprivacy.auth;
|
||||||
is-auth-enabled = config.selfprivacy.modules.auth.enable;
|
is-auth-enabled = config.selfprivacy.modules.auth.enable or false;
|
||||||
cfg = sp.modules.nextcloud;
|
cfg = sp.modules.nextcloud;
|
||||||
ldap_scheme_and_host = "ldaps://${auth-passthru.ldap-host}";
|
ldap_scheme_and_host = "ldaps://${auth-passthru.ldap-host}";
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
let
|
let
|
||||||
domain = config.selfprivacy.domain;
|
domain = config.selfprivacy.domain;
|
||||||
cfg = config.selfprivacy.modules.roundcube;
|
cfg = config.selfprivacy.modules.roundcube;
|
||||||
is-auth-enabled = config.selfprivacy.modules.auth.enable;
|
is-auth-enabled = config.selfprivacy.modules.auth.enable or false;
|
||||||
auth-passthru = config.passthru.selfprivacy.auth;
|
auth-passthru = config.passthru.selfprivacy.auth;
|
||||||
auth-fqdn = auth-passthru.auth-fqdn;
|
auth-fqdn = auth-passthru.auth-fqdn;
|
||||||
oauth-client-id = "roundcube";
|
oauth-client-id = "roundcube";
|
||||||
|
@@ -2,9 +2,10 @@
|
|||||||
let
|
let
|
||||||
inherit (import ./common.nix nixos-args)
|
inherit (import ./common.nix nixos-args)
|
||||||
appendLdapBindPwd
|
appendLdapBindPwd
|
||||||
|
auth-passthru
|
||||||
cfg
|
cfg
|
||||||
domain
|
domain
|
||||||
auth-passthru
|
is-auth-enabled
|
||||||
;
|
;
|
||||||
|
|
||||||
runtime-directory = "dovecot2";
|
runtime-directory = "dovecot2";
|
||||||
@@ -61,7 +62,7 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
lib.mkIf config.selfprivacy.modules.auth.enable {
|
lib.mkIf is-auth-enabled {
|
||||||
mailserver.ldap = {
|
mailserver.ldap = {
|
||||||
# note: in `ldapsearch` first comes filter, then attributes
|
# note: in `ldapsearch` first comes filter, then attributes
|
||||||
dovecot.userAttrs = "+"; # all operational attributes
|
dovecot.userAttrs = "+"; # all operational attributes
|
||||||
|
@@ -3,6 +3,7 @@ let
|
|||||||
inherit (import ./common.nix nixos-args)
|
inherit (import ./common.nix nixos-args)
|
||||||
appendLdapBindPwd
|
appendLdapBindPwd
|
||||||
auth-passthru
|
auth-passthru
|
||||||
|
is-auth-enabled
|
||||||
;
|
;
|
||||||
|
|
||||||
cfg = config.mailserver;
|
cfg = config.mailserver;
|
||||||
@@ -50,7 +51,7 @@ let
|
|||||||
destination = ldapVirtualMailboxMapFile;
|
destination = ldapVirtualMailboxMapFile;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
lib.mkIf config.selfprivacy.modules.auth.enable {
|
lib.mkIf is-auth-enabled {
|
||||||
mailserver.ldap = {
|
mailserver.ldap = {
|
||||||
postfix.mailAttribute = "mail";
|
postfix.mailAttribute = "mail";
|
||||||
postfix.uidAttribute = "uid";
|
postfix.uidAttribute = "uid";
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
rec {
|
rec {
|
||||||
auth-passthru = config.passthru.selfprivacy.auth;
|
auth-passthru = config.passthru.selfprivacy.auth;
|
||||||
domain = config.selfprivacy.domain;
|
domain = config.selfprivacy.domain;
|
||||||
is-auth-enabled = config.selfprivacy.modules.auth.enable;
|
is-auth-enabled = config.selfprivacy.modules.auth.enable or false;
|
||||||
|
|
||||||
appendLdapBindPwd =
|
appendLdapBindPwd =
|
||||||
{ name, file, prefix, suffix ? "", passwordFile, destination }:
|
{ name, file, prefix, suffix ? "", passwordFile, destination }:
|
||||||
|
Reference in New Issue
Block a user