1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(panoptikon): allow secret configuration, telegram reporter, BTC price alert

This commit is contained in:
2024-03-17 21:42:01 +01:00
parent 04bf10a356
commit f69d5c423c
2 changed files with 28 additions and 0 deletions

View File

@@ -13,6 +13,17 @@
retiolumLink = true;
};
telegram-kmein = let
chatId = "-1001796440545";
in
pkgs.writers.writeDash "telegram-fulltext" ''
export TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")"
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot''${TOKEN}/sendMessage" \
-d chat_id=${chatId} \
-d text="$(cat)" \
| ${pkgs.jq}/bin/jq -e .ok
'';
irc-kmein = panoptikon.kpaste-irc {
messagePrefix = "$PANOPTIKON_WATCHER: ";
target = "kmein";
@@ -20,6 +31,8 @@
retiolumLink = false;
};
in {
age.secrets.telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
services.panoptikon = {
enable = true;
watchers = {
@@ -38,6 +51,13 @@ in {
script = panoptikon.url "http://lammla.info/index.php?reihe=30";
reporters = [irc-kmein];
};
btc = {
script = panoptikon.url "https://eur.rate.sx/1BTC";
reporters = [telegram-kmein];
loadCredential = [
"token:${config.age.secrets.telegram-token-kmein.path}"
];
};
kratylos = {
script = panoptikon.url "https://kratylos.reichert-online.org/current_issue/KRATYLOS";
reporters = [irc-kmein];