mirror of
https://github.com/itme-brain/nixos.git
synced 2026-05-08 06:50:11 -04:00
api key
This commit is contained in:
parent
573f5ec95d
commit
d8be05169c
2 changed files with 11 additions and 0 deletions
|
|
@ -163,6 +163,7 @@ in
|
|||
proxyPass = "http://192.168.0.23:8002/";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
include ${config.sops.templates."nginx-mcp-auth.conf".path};
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -26,6 +26,16 @@
|
|||
owner = "nginx";
|
||||
};
|
||||
|
||||
# MCP endpoint auth — validates X-API-Key header
|
||||
sops.templates."nginx-mcp-auth.conf" = {
|
||||
content = ''
|
||||
if ($http_x_api_key != "${config.sops.placeholder."LLAMA_API_KEY"}") {
|
||||
return 401 '{"error": "Unauthorized"}';
|
||||
}
|
||||
'';
|
||||
owner = "nginx";
|
||||
};
|
||||
|
||||
modules.system = {
|
||||
nginx = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue