Compare commits

...

12 commits

Author SHA1 Message Date
Pablo Ovelleiro Corral 37f9419aef
Add blackbox-exporter config 2024-08-25 17:17:54 +02:00
teutat3s b6be95d032
Merge pull request 'Maintenance + security updates for element, forgejo, mastodon, matrix-synapse' (#221) from flake-updates into main
Reviewed-on: pub-solar/infra#221
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-08-24 01:11:41 +00:00
teutat3s 99308bfe24
Merge pull request 'secrets: ensure no final newline in editorconfig' (#220) from no-newline-for-secrets into main
Reviewed-on: pub-solar/infra#220
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-08-22 13:13:45 +00:00
teutat3s 50eb1d4f32
flake.lock: Update
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
  → 'github:ryantm/agenix/f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41' (2024-08-10)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06)
  → 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/883180e6550c1723395a3a342f830bfc5c371f6b' (2024-08-05)
  → 'github:nixos/nixpkgs/224042e9a3039291f22f4f2ded12af95a616cca0' (2024-08-21)
• Updated input 'unstable':
    'github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
  → 'github:nixos/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21)
2024-08-22 11:59:47 +02:00
teutat3s c0fcf2352f
secrets: ensure no final newline 2024-08-21 16:39:14 +02:00
teutat3s 3708d77d9b
Merge pull request 'Update docker, forgejo, systemd and others' (#219) from flake-updates into main
Reviewed-on: pub-solar/infra#219
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-07 11:55:29 +00:00
teutat3s 7f2bfd923f
loki: move data dir to /data disk with more room 2024-08-07 10:19:53 +02:00
teutat3s 30d18c725a
revert: overlay for element-web and matrix-synapse
both packages now have the desired version available in nixos-24.05
2024-08-07 10:09:37 +02:00
teutat3s 387d97a2ea
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
  → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
• Updated input 'flake-parts/nixpkgs-lib':
    '5daf051448.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01)
  → 'a5d394176e.tar.gz?narHash=sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q%3D' (2024-08-01)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
  → 'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29)
  → 'github:nixos/nixpkgs/883180e6550c1723395a3a342f830bfc5c371f6b' (2024-08-05)
• Updated input 'unstable':
    'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28)
  → 'github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
2024-08-06 21:17:23 +02:00
teutat3s 6f2eeeb99e
Merge pull request 'Update element-web, matrix-synapse, nextcloud and misc packages' (#218) from flake-input-updates into main
Reviewed-on: pub-solar/infra#218
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-07-31 11:33:33 +00:00
teutat3s 21a28e1212
element-web, matrix-synapse: pull in updates early
element-web 1.11.72 fixes support for Firefox ESR. Also get the latest
matrix-synapse version 1.112.0 while we're at it.
2024-07-31 11:45:58 +02:00
teutat3s c3bf5df1d8
flake.lock: Update
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6' (2024-07-09)
  → 'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/cf297a8d248db6a455b60133f6c0029c04ebe50e' (2024-07-10)
  → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/cab6539d198792f94fbac029e5a63523604fd172' (2024-07-06)
  → 'github:srid/nixos-flake/5734c1d9a5fe0bc8e8beaf389ad6227392ca0108' (2024-07-16)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/a046c1202e11b62cbede5385ba64908feb7bfac4' (2024-07-11)
  → 'github:nixos/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29)
• Updated input 'unstable':
    'github:nixos/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09)
  → 'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28)
2024-07-31 11:43:47 +02:00
5 changed files with 84 additions and 62 deletions

View file

@ -20,41 +20,8 @@ indent_style = unset
indent_size = unset
[{.*,secrets}/**]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.rom]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.py]
indent_size = 4
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
charset = unset
indent_style = unset
indent_size = unset
[{.*,secrets}/**]
end_of_line = unset
insert_final_newline = unset
end_of_line = false
insert_final_newline = false
trim_trailing_whitespace = unset
charset = unset
indent_style = unset

View file

@ -14,11 +14,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1720546205,
"narHash": "sha256-boCXsjYVxDviyzoEyAk624600f3ZBo/DKtUdvMTpbGY=",
"lastModified": 1723293904,
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm",
"repo": "agenix",
"rev": "de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6",
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github"
},
"original": {
@ -165,11 +165,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
@ -299,11 +299,11 @@
]
},
"locked": {
"lastModified": 1720599442,
"narHash": "sha256-jdm+sKVbBXoyrxcHbVaV0htlpq2iFR+eJw3Xe/DPcDo=",
"lastModified": 1724299755,
"narHash": "sha256-P5zMA17kD9tqiqMuNXwupkM7buM3gMNtoZ1VuJTRDE4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "cf297a8d248db6a455b60133f6c0029c04ebe50e",
"rev": "a8968d88e5a537b0491f68ce910749cd870bdbef",
"type": "github"
},
"original": {
@ -315,11 +315,11 @@
},
"nixos-flake": {
"locked": {
"lastModified": 1720281493,
"narHash": "sha256-Lic3N1H2k5RsYDtfbmfO+9K2u7uwyXIj+aCaTj2/zSY=",
"lastModified": 1721140942,
"narHash": "sha256-iEqZGdnkG+Hm0jZhS59NJwEyB6z9caVnudWPGHZ/FAE=",
"owner": "srid",
"repo": "nixos-flake",
"rev": "cab6539d198792f94fbac029e5a63523604fd172",
"rev": "5734c1d9a5fe0bc8e8beaf389ad6227392ca0108",
"type": "github"
},
"original": {
@ -330,11 +330,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1720691131,
"narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=",
"lastModified": 1724242322,
"narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a046c1202e11b62cbede5385ba64908feb7bfac4",
"rev": "224042e9a3039291f22f4f2ded12af95a616cca0",
"type": "github"
},
"original": {
@ -362,14 +362,14 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"lastModified": 1722555339,
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
}
},
"root": {
@ -519,11 +519,11 @@
},
"unstable": {
"locked": {
"lastModified": 1720542800,
"narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=",
"lastModified": 1724224976,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "feb2849fdeb70028c70d73b848214b00d324a497",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
"type": "github"
},
"original": {

View file

@ -25,7 +25,7 @@
};
};
replication_factor = 1;
path_prefix = "/var/lib/loki";
path_prefix = "/data/loki";
storage = {
filesystem = {
chunks_directory = "chunks/";

View file

@ -198,10 +198,10 @@ lib.mapAttrsToList
description = "{{$labels.instance}}: healtcheck {{$labels.job}} fails!";
};
*/
#cert_expiry = {
# condition = "(probe_ssl_earliest_cert_expiry - time())/(3600*24) < 30";
# description = "{{$labels.instance}}: The TLS certificate will expire in less than 30 days: {{$value}}s";
#};
cert_expiry = {
condition = "(probe_ssl_earliest_cert_expiry - time())/(3600*24) < 30";
description = "{{$labels.instance}}: The TLS certificate will expire in less than 30 days: {{$value}}s";
};
# ignore devices that disabled S.M.A.R.T (example if attached via USB)

View file

@ -5,6 +5,10 @@
flake,
...
}:
let
# TODO add hosts here
blackboxTargets = [ "https://pablo.tools" ];
in
{
age.secrets.alertmanager-envfile = {
file = "${flake.self}/secrets/alertmanager-envfile.age";
@ -27,6 +31,33 @@
enable = true;
port = 9001;
exporters = {
blackbox = {
enable = true;
# Default port is 9115
# Listen on 0.0.0.0, bet we only open the firewall for wg0
openFirewall = false;
configFile = pkgs.writeTextFile {
name = "blackbox-exporter-config";
text = ''
modules:
http_2xx:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: [] # Defaults to 2xx
method: GET
no_follow_redirects: false
fail_if_ssl: false
fail_if_not_ssl: false
tls_config:
insecure_skip_verify: false
preferred_ip_protocol: "ip4" # defaults to "ip6"
ip_protocol_fallback: true # fallback to "ip6"
'';
};
};
node = {
enable = true;
enabledCollectors = [ "systemd" ];
@ -38,6 +69,30 @@
scrape_timeout = "9s";
};
scrapeConfigs = [
{
job_name = "blackbox";
scrape_interval = "2m";
metrics_path = "/probe";
params = {
module = [ "http_2xx" ];
};
static_configs = [ { targets = blackboxTargets; } ];
relabel_configs = [
{
source_labels = [ "__address__" ];
target_label = "__param_target";
}
{
source_labels = [ "__param_target" ];
target_label = "instance";
}
{
target_label = "__address__";
replacement = "127.0.0.1:9115"; # The blackbox exporter's real hostname:port.
}
];
}
{
job_name = "node-exporter";
static_configs = [