From ffc5f9b59635de8d584bc3a1b24aead2997127fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Fri, 31 Mar 2023 10:59:52 +0200 Subject: [PATCH] fix(panoptikon): add watcher name to commit message, random delay 1h, ignore html errors, #xxx notification --- lib/panoptikon.nix | 2 +- modules/panoptikon.nix | 4 ++-- systems/ful/panoptikon.nix | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/panoptikon.nix b/lib/panoptikon.nix index a343f7b..6a23a24 100644 --- a/lib/panoptikon.nix +++ b/lib/panoptikon.nix @@ -9,7 +9,7 @@ url = address: pkgs.writers.writeDash "watch-url" '' ${pkgs.curl}/bin/curl -sSL ${lib.escapeShellArg address} \ - | ${pkgs.python3Packages.html2text}/bin/html2text + | ${pkgs.python3Packages.html2text}/bin/html2text --decode-errors=ignore ''; urlSelector = selector: address: pkgs.writers.writeDash "watch-url-selector" '' diff --git a/modules/panoptikon.nix b/modules/panoptikon.nix index 735d195..1befa39 100644 --- a/modules/panoptikon.nix +++ b/modules/panoptikon.nix @@ -67,7 +67,7 @@ systemd.timers = lib.attrsets.mapAttrs' (watcherName: _: lib.nameValuePair "panoptikon-${watcherName}" { - timerConfig.RandomizedDelaySec = "60"; + timerConfig.RandomizedDelaySec = toString (60 * 60); }) cfg.watchers; @@ -114,7 +114,7 @@ ${watcherOptions.script} > ${watcherName} ${pkgs.git}/bin/git add ${watcherName} - ${pkgs.git}/bin/git commit --message "$(${pkgs.coreutils}/bin/date -Is)" || : + ${pkgs.git}/bin/git commit --message "${watcherName} / $(${pkgs.coreutils}/bin/date -Is)" || : if [ -n "$(${pkgs.git}/bin/git diff HEAD^ -- ${watcherName})" ]; then ${lib.strings.concatMapStringsSep "\n" (reporter: '' diff --git a/systems/ful/panoptikon.nix b/systems/ful/panoptikon.nix index e95c8c0..02f3d83 100644 --- a/systems/ful/panoptikon.nix +++ b/systems/ful/panoptikon.nix @@ -9,7 +9,7 @@ panoptikon = niveumLib.panoptikon {inherit pkgs lib niveumPackages config;}; irc-xxx = panoptikon.kpaste-irc { - target = "#xxx"; + target = lib.escapeShellArg "#xxx"; retiolumLink = true; };