feat: Added resolved to mirai
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
./searxng.nix
|
||||
./immich.nix
|
||||
./lldap.nix
|
||||
./resolved.nix
|
||||
|
||||
# ./home-assistant.nix
|
||||
# ./jellyfin.nix
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
ENABLE_LOGIN_FORM = "False";
|
||||
WEBUI_URL = "https://llama.darksailor.dev";
|
||||
OPENAI_BASE_URL = "https://ollama.darksailor.dev/v1";
|
||||
OLLAMA_API_BASE_URL = "https://ollama.ryu.darksailor.dev";
|
||||
};
|
||||
environmentFile = "${config.sops.templates."LLAMA_API_KEY.env".path}";
|
||||
};
|
||||
|
||||
9
nixos/mirai/services/resolved.nix
Normal file
9
nixos/mirai/services/resolved.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{...}: {
|
||||
services.resolved = {
|
||||
enable = true;
|
||||
dnssec = "true";
|
||||
dnsovertls = "true";
|
||||
domains = ["lemur-newton.ts.net"];
|
||||
fallbackDns = ["1.1.1.1"];
|
||||
};
|
||||
}
|
||||
@@ -13,5 +13,6 @@
|
||||
./resolved.nix
|
||||
./minecraft.nix
|
||||
./fwupd.nix
|
||||
./caddy.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
environmentVariables = {
|
||||
OLLAMA_LLM_LIBRARY = "cuda";
|
||||
LD_LIBRARY_PATH = "run/opengl-driver/lib";
|
||||
OLLAMA_ORIGINS = "*";
|
||||
};
|
||||
};
|
||||
open-webui = {
|
||||
@@ -35,20 +36,7 @@
|
||||
'';
|
||||
virtualHosts."ollama.ryu.darksailor.dev".extraConfig = ''
|
||||
import hetzner
|
||||
@apikey {
|
||||
header Authorization "Bearer {env.LLAMA_API_KEY}"
|
||||
}
|
||||
|
||||
handle @apikey {
|
||||
header {
|
||||
# Set response headers or proxy to a different service if API key is valid
|
||||
Access-Control-Allow-Origin *
|
||||
-Authorization "Bearer {env.LLAMA_API_KEY}" # Remove the header after validation
|
||||
}
|
||||
reverse_proxy localhost:${builtins.toString config.services.ollama.port}
|
||||
}
|
||||
|
||||
respond "Unauthorized" 403
|
||||
reverse_proxy localhost:${builtins.toString config.services.ollama.port}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user