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:
@@ -28,6 +28,13 @@
|
|||||||
example = "*:0/3";
|
example = "*:0/3";
|
||||||
default = "daily";
|
default = "daily";
|
||||||
};
|
};
|
||||||
|
loadCredential = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.string;
|
||||||
|
description = ''
|
||||||
|
This can be used to pass secrets to the systemd service without adding them to the nix store.
|
||||||
|
'';
|
||||||
|
default = [];
|
||||||
|
};
|
||||||
reporters = lib.mkOption {
|
reporters = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.path;
|
type = lib.types.listOf lib.types.path;
|
||||||
description = ''
|
description = ''
|
||||||
@@ -104,6 +111,7 @@
|
|||||||
WorkingDirectory = "/var/lib/panoptikon";
|
WorkingDirectory = "/var/lib/panoptikon";
|
||||||
RestartSec = "60";
|
RestartSec = "60";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
LoadCredential = watcherOptions.loadCredential;
|
||||||
};
|
};
|
||||||
unitConfig = {
|
unitConfig = {
|
||||||
StartLimitIntervalSec = "300";
|
StartLimitIntervalSec = "300";
|
||||||
|
|||||||
@@ -13,6 +13,17 @@
|
|||||||
retiolumLink = true;
|
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 {
|
irc-kmein = panoptikon.kpaste-irc {
|
||||||
messagePrefix = "$PANOPTIKON_WATCHER: ";
|
messagePrefix = "$PANOPTIKON_WATCHER: ";
|
||||||
target = "kmein";
|
target = "kmein";
|
||||||
@@ -20,6 +31,8 @@
|
|||||||
retiolumLink = false;
|
retiolumLink = false;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
age.secrets.telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
|
||||||
|
|
||||||
services.panoptikon = {
|
services.panoptikon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
watchers = {
|
watchers = {
|
||||||
@@ -38,6 +51,13 @@ in {
|
|||||||
script = panoptikon.url "http://lammla.info/index.php?reihe=30";
|
script = panoptikon.url "http://lammla.info/index.php?reihe=30";
|
||||||
reporters = [irc-kmein];
|
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 = {
|
kratylos = {
|
||||||
script = panoptikon.url "https://kratylos.reichert-online.org/current_issue/KRATYLOS";
|
script = panoptikon.url "https://kratylos.reichert-online.org/current_issue/KRATYLOS";
|
||||||
reporters = [irc-kmein];
|
reporters = [irc-kmein];
|
||||||
|
|||||||
Reference in New Issue
Block a user