This commit is contained in:
parent
5086aba848
commit
e183e8310c
2 changed files with 44 additions and 38 deletions
|
|
@ -34,8 +34,8 @@
|
||||||
users = {
|
users = {
|
||||||
rodant = {
|
rodant = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "llm user";
|
description = "llm user";
|
||||||
packages = with pkgs; [git python3 nodejs cargo ripgrep curl wget ffmpeg imagemagick texliveFull ];
|
packages = with pkgs; [git python3 nodejs cargo ripgrep curl wget ffmpeg imagemagick texliveFull];
|
||||||
};
|
};
|
||||||
k = {
|
k = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
|
|
||||||
|
|
@ -102,34 +102,40 @@
|
||||||
secretKeyFile = "/var/cache-priv-key.pem";
|
secretKeyFile = "/var/cache-priv-key.pem";
|
||||||
};
|
};
|
||||||
|
|
||||||
prometheus = {
|
prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
scrapeConfigs = [{
|
scrapeConfigs = [
|
||||||
job_name = "ratchat-server";
|
{
|
||||||
static_configs = [{
|
job_name = "ratchat-server";
|
||||||
targets = [ "127.0.0.1:9011" ];
|
static_configs = [
|
||||||
}];
|
{
|
||||||
}];
|
targets = ["127.0.0.1:9011"];
|
||||||
};
|
}
|
||||||
|
];
|
||||||
grafana = {
|
}
|
||||||
enable = true;
|
];
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
http_addr = "127.0.0.1";
|
|
||||||
http_port = 3000;
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
provision = {
|
grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
datasources.settings.datasources = [{
|
settings = {
|
||||||
name = "Prometheus";
|
server = {
|
||||||
type = "prometheus";
|
http_addr = "127.0.0.1";
|
||||||
url = "http://localhost:9090";
|
http_port = 3000;
|
||||||
}];
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
provision = {
|
||||||
|
enable = true;
|
||||||
|
datasources.settings.datasources = [
|
||||||
|
{
|
||||||
|
name = "Prometheus";
|
||||||
|
type = "prometheus";
|
||||||
|
url = "http://localhost:9090";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
ollama = {
|
ollama = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -224,13 +230,13 @@ grafana = {
|
||||||
|
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
commonHttpConfig = ''
|
commonHttpConfig = ''
|
||||||
map $http_authorization $is_allowed_user {
|
map $http_authorization $is_allowed_user {
|
||||||
default 0;
|
default 0;
|
||||||
"Bearer ratToken" 1;
|
"Bearer ratToken" 1;
|
||||||
"Bearer notRatToken" 1;
|
"Bearer notRatToken" 1;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
clientMaxBodySize = "4g";
|
clientMaxBodySize = "4g";
|
||||||
|
|
@ -265,9 +271,9 @@ commonHttpConfig = ''
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:9011";
|
proxyPass = "http://127.0.0.1:9011";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
if ($is_allowed_user = 0) { return 401; }
|
if ($is_allowed_user = 0) { return 401; }
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue