mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: panoptikon urlwatcher
This commit is contained in:
@@ -10,6 +10,7 @@ in {
|
||||
./hardware-configuration.nix
|
||||
./matomo.nix
|
||||
./radio.nix
|
||||
./panoptikon.nix
|
||||
../../configs/monitoring.nix
|
||||
../../configs/tor.nix
|
||||
../../configs/save-space.nix
|
||||
|
||||
41
systems/ful/panoptikon.nix
Normal file
41
systems/ful/panoptikon.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
kpaste = pkgs.writers.writeDash "kpaste" ''
|
||||
${pkgs.curl}/bin/curl -sS -sS http://p.r --data-binary @"''${1:--}" | ${pkgs.gnused}/bin/sed '$ {p;s|http://p.r|https://p.krebsco.de|}'
|
||||
'';
|
||||
|
||||
url = address:
|
||||
pkgs.writers.writeDash "watch-url" ''
|
||||
${pkgs.w3m}/bin/w3m -dump ${lib.escapeShellArg address}
|
||||
'';
|
||||
|
||||
urlJSON = address:
|
||||
pkgs.writers.writeDash "watch-url-json" ''
|
||||
${pkgs.curl}/bin/curl -sSL ${lib.escapeShellArg address} | ${pkgs.jq}/bin/jq
|
||||
'';
|
||||
|
||||
reporters.irc-xxx = pkgs.writers.writeDash "irc-xxx" ''
|
||||
${kpaste} \
|
||||
| ${pkgs.gnused}/bin/sed -n '2s/^/change detected: /p' \
|
||||
| ${config.nur.repos.mic92.ircsink}/bin/ircsink \
|
||||
--nick "$PANOPTIKON_WATCHER"-watcher \
|
||||
--server irc.r \
|
||||
--target '#xxx'
|
||||
'';
|
||||
in {
|
||||
services.panoptikon = {
|
||||
enable = true;
|
||||
watchers."github-meta" = {
|
||||
script = urlJSON "https://api.github.com/meta";
|
||||
reporters = [reporters.irc-xxx];
|
||||
};
|
||||
watchers.spiegel = {
|
||||
script = url "https://www.spiegel.de/";
|
||||
reporters = [];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user