feat(librechat): add option for email login and registration

This commit is contained in:
Mohammad Rafiq 2025-05-31 14:21:13 +08:00
parent c113b5d3ef
commit 9f6f870d6c
No known key found for this signature in database
2 changed files with 15 additions and 0 deletions

View file

@ -176,6 +176,15 @@ in
};
};
auth = {
allowEmailLogin = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable or disable ONLY email login.";
};
allowEmailRegistration = lib.mkEnableOption "Enable or disable Email registration of new users.";
};
};
config = lib.mkIf cfg.enable {
@ -247,6 +256,8 @@ in
export HOST=${cfg.host}
export PORT=${builtins.toString cfg.port}
export MONGO_URI="${cfg.mongodbURI}"
export ALLOW_EMAIL_LOGIN=${if cfg.auth.allowEmailLogin then "true" else "false"}
export ALLOW_REGISTRATION=${if cfg.auth.allowEmailRegistration then "true" else "false"}
cd ${cfg.path}
${pkgs.librechat}/bin/librechat-server

View file

@ -30,6 +30,10 @@
openFirewall = true;
host = "0.0.0.0";
mongodbURI = "mongodb://apollo:27017";
auth = {
allowEmailLogin = true;
allowEmailRegistration = true;
};
credentials = {
creds_key_file = config.sops.secrets."librechat/creds_key".path;
creds_iv_file = config.sops.secrets."librechat/creds_iv".path;