feat: added auth and crazy more things

This commit is contained in:
didier committed 2026-06-16 12:55:56 -04:00
1 parent 1ecf468140
commit be9d6b610f
10 files changed
+1500 -117

No files matched your search

+34 -9
View File
@@ -14,7 +14,7 @@
pname = "st-pierre";
version = "0.1.0";
src = ./.;
vendorHash = "sha256-6Rahf2Mldeln9EVBr2kMOMCU8fv/DaavVZO7ToyG9mc=";
vendorHash = "sha256-Z8jGsWOTlw47eJ9n7SUJvGfNtXM5HWIe+Aaip0IuOxE=";
};
in
{
@@ -89,16 +89,34 @@
description = "Embedding model name.";
};
tokenFile = lib.mkOption {
adminPasswordFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Path to a file containing the MCP Bearer token.";
description = "Path to a file containing the admin user password for bootstrap.";
};
token = lib.mkOption {
adminPassword = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "MCP Bearer token directly. Prefer tokenFile for secrets.";
description = "Admin user password directly. Prefer adminPasswordFile for secrets.";
};
adminUsername = lib.mkOption {
type = lib.types.str;
default = "admin";
description = "Admin username for bootstrap.";
};
mcpTokenFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Path to a file containing the initial MCP session token.";
};
mcpToken = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Initial MCP session token directly. Prefer mcpTokenFile for secrets.";
};
sqlitePath = lib.mkOption {
@@ -136,9 +154,10 @@
StateDirectory = "st-pierre";
ExecStart = "${st-pierre-pkg}/bin/st-pierre";
}
// lib.optionalAttrs (cfg.openaiApiKeyFile != null || cfg.tokenFile != null || cfg.qdrantApiKeyFile != null) {
// lib.optionalAttrs (cfg.openaiApiKeyFile != null || cfg.adminPasswordFile != null || cfg.mcpTokenFile != null || cfg.qdrantApiKeyFile != null) {
EnvironmentFile = lib.optional (cfg.openaiApiKeyFile != null) cfg.openaiApiKeyFile
++ lib.optional (cfg.tokenFile != null) cfg.tokenFile
++ lib.optional (cfg.adminPasswordFile != null) cfg.adminPasswordFile
++ lib.optional (cfg.mcpTokenFile != null) cfg.mcpTokenFile
++ lib.optional (cfg.qdrantApiKeyFile != null) cfg.qdrantApiKeyFile;
};
@@ -157,8 +176,14 @@
// lib.optionalAttrs (cfg.openaiApiKey != null) {
OPENAI_API_KEY = cfg.openaiApiKey;
}
// lib.optionalAttrs (cfg.token != null) {
MCP_TOKEN = cfg.token;
// lib.optionalAttrs (cfg.adminPassword != null) {
ADMIN_PASSWORD = cfg.adminPassword;
}
// lib.optionalAttrs (true) {
ADMIN_USERNAME = cfg.adminUsername;
}
// lib.optionalAttrs (cfg.mcpToken != null) {
MCP_TOKEN = cfg.mcpToken;
};
};
};