File tree Expand file tree Collapse file tree 3 files changed +30
-38
lines changed Expand file tree Collapse file tree 3 files changed +30
-38
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
config ,
3
- lib ,
4
3
pkgs ,
5
4
...
6
5
} :
7
6
8
- let
9
- bannedUserAgentPatterns = [
10
- "Trident/"
11
- "Android\\ s[123456789]\\ ."
12
- "iPod"
13
- "iPad\\ sOS\\ s"
14
- "iPhone\\ sOS\\ s[23456789]"
15
- "Opera/[89]"
16
- # Chrome 134+
17
- "(Chrome|CriOS)/(\\ d\\ d?\\ .|1[012]|13[0123])"
18
- # Firefox ESR 128 and Firefox 137+
19
- "(Firefox|FxiOS)/(\\ d\\ d?\\ .|1[01]|12[012345679]|13[0123456])"
20
- "PPC\\ sMac\\ sOS"
21
- "Windows\\ sCE"
22
- "Windows\\ s95"
23
- "Windows\\ s98"
24
- "Windows\\ sNT\\ s[12345]\\ ."
25
- ] ;
26
- in
27
7
{
28
8
networking . firewall . allowedTCPPorts = [
29
9
80
30
10
443
11
+ 9001
31
12
] ;
32
13
14
+ services . anubis . instances . "hydra-server" = {
15
+ settings = {
16
+ TARGET = "http://127.0.0.1:3000" ;
17
+ BIND = ":3001" ;
18
+ BIND_NETWORK = "tcp" ;
19
+ METRICS_BIND = ":9001" ;
20
+ METRICS_BIND_NETWORK = "tcp" ;
21
+ } ;
22
+ } ;
23
+
33
24
services . nginx = {
34
25
enable = true ;
35
26
enableReload = true ;
51
42
worker_connections 1024;
52
43
'' ;
53
44
54
- appendHttpConfig = ''
55
- map $http_user_agent $badagent {
56
- default 0;
57
- ${ lib . concatMapStringsSep "\n " ( pattern : ''
58
- ~${ pattern } 1;
59
- '' ) bannedUserAgentPatterns }
60
- }
61
- '' ;
62
-
63
45
virtualHosts . "hydra.nixos.org" = {
64
46
forceSSL = true ;
65
47
enableACME = true ;
82
64
'' ;
83
65
84
66
locations . "/" = {
85
- proxyPass = "http://127.0.0.1:3000" ;
86
- extraConfig = ''
87
- if ($badagent) {
88
- access_log /var/log/nginx/abuse.log;
89
- return 403;
90
- }
91
- '' ;
67
+ proxyPass = "http://127.0.0.1:3001" ;
92
68
} ;
93
69
94
70
locations . "/static/" = {
95
71
alias = "${ config . services . hydra-dev . package } /libexec/hydra/root/static/" ;
96
72
} ;
97
73
} ;
98
74
} ;
99
-
100
75
}
Original file line number Diff line number Diff line change 3
3
{
4
4
imports = [
5
5
./alertmanager.nix
6
- ./exporters/up .nix
6
+ ./exporters/anubis .nix
7
7
./exporters/blackbox.nix
8
8
./exporters/channel.nix
9
9
./exporters/domain.nix
17
17
./exporters/owncast.nix
18
18
./exporters/postgresql.nix
19
19
./exporters/rasdaemon.nix
20
+ ./exporters/up.nix
20
21
./exporters/zfs.nix
21
22
] ;
22
23
Original file line number Diff line number Diff line change
1
+ {
2
+ services . prometheus = {
3
+ scrapeConfigs = [
4
+ {
5
+ job_name = "anubis" ;
6
+ static_configs = [
7
+ {
8
+ targets = [
9
+ "hydra.nixos.org:9001"
10
+ ] ;
11
+ }
12
+ ] ;
13
+ }
14
+ ] ;
15
+ } ;
16
+ }
You can’t perform that action at this time.
0 commit comments