Skip to content

Commit

Permalink
feat: add prometheus auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarsel committed Oct 18, 2024
1 parent c291133 commit 731e58a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions SwarselSystems.org
Original file line number Diff line number Diff line change
Expand Up @@ -6592,15 +6592,16 @@ Also, the system state version is set here. No need to touch it.
http_addr = "127.0.0.1";
protocol = "https";
domain = "status.swarsel.win";
root_url = "%(protocol)s://%(domain)s:%(http_port)s/grafana/";
};
};
};

services.prometheus = {
enable = true;
webExternalUrl = "https://status.swarsel.win/prometheus";
port = 9090;
listenAddress = "127.0.0.1";
webConfigFile = /../../programs/server/prometheus/web.config;
exporters = {
zfs = {
enable = true;
Expand All @@ -6620,13 +6621,13 @@ Also, the system state version is set here. No need to touch it.
acmeRoot = null;
locations = {
"/grafana" = {
proxyPass = "http://localhost:3000/grafana/";
proxyPass = "http://localhost:3000";
extraConfig = ''
client_max_body_size 0;
'';
};
"/prometheus" = {
proxyPass = "http://localhost:9090/prometheus/";
proxyPass = "http://localhost:9090";
extraConfig = ''
client_max_body_size 0;
'';
Expand Down
7 changes: 4 additions & 3 deletions profiles/server/common/monitoring.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
http_addr = "127.0.0.1";
protocol = "https";
domain = "status.swarsel.win";
root_url = "%(protocol)s://%(domain)s:%(http_port)s/grafana/";
};
};
};

services.prometheus = {
enable = true;
webExternalUrl = "https://status.swarsel.win/prometheus";
port = 9090;
listenAddress = "127.0.0.1";
webConfigFile = /../../programs/server/prometheus/web.config;
exporters = {
zfs = {
enable = true;
Expand All @@ -49,13 +50,13 @@
acmeRoot = null;
locations = {
"/grafana" = {
proxyPass = "http://localhost:3000/grafana/";
proxyPass = "http://localhost:3000";
extraConfig = ''
client_max_body_size 0;
'';
};
"/prometheus" = {
proxyPass = "http://localhost:9090/prometheus/";
proxyPass = "http://localhost:9090";
extraConfig = ''
client_max_body_size 0;
'';
Expand Down
2 changes: 2 additions & 0 deletions programs/server/prometheus/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
basic_auth_users:
admin: $2a$12$UFCdK2B67OM.p51ON8eKLOxQ4Ek9jruJPtaLE4Owc4Ukf7jGx//LC

0 comments on commit 731e58a

Please sign in to comment.