From d5af942e3a62e99412c8b7a17b6d43a78c7f828d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 30 Jul 2023 15:36:29 +0200 Subject: reaktor2: rename to reaktor --- krebs/2configs/reaktor2.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index 61b44fc27..95ef2f8ae 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -597,7 +597,7 @@ in { krebs.reaktor2 = { hackint = { hostname = "irc.hackint.org"; - nick = "reaktor2|krebs"; + nick = "reaktor"; plugins = [ { plugin = "register"; @@ -617,7 +617,7 @@ in { port = "6697"; }; r = { - nick = "reaktor2|krebs"; + nick = "reaktor"; sendDelaySec = null; plugins = [ { -- cgit v1.2.3 From 8534fe4290f9c79d6b19f649964940c1408ece71 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 30 Jul 2023 17:17:06 +0200 Subject: reaktor2: quote state_file in hledger --- krebs/2configs/reaktor2.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs/2configs') diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index 95ef2f8ae..8837f0aa5 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -28,7 +28,7 @@ let amt=$2 unit=$3 printf '%s\n %s %d %s\n %s %d %s\n' "$(date -Id)" "$tonick" "$amt" "$unit" "$_from" "$(expr 0 - "''${amt#+}")" "$unit" >> $state_file - ${pkgs.hledger}/bin/hledger -f $state_file bal -N -O csv \ + ${pkgs.hledger}/bin/hledger -f "$state_file" bal -N -O csv \ | ${pkgs.coreutils}/bin/tail +2 \ | ${pkgs.miller}/bin/mlr --icsv --opprint cat \ | ${pkgs.gnugrep}/bin/grep "$_from" -- cgit v1.2.3 From 6043552115f1629b72fc40564eba4fd34f9a5cb6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 30 Jul 2023 17:21:20 +0200 Subject: reaktor2: extract agenda.html into separate file --- krebs/2configs/agenda.html | 91 +++++++++++++++++++++++++++++++++ krebs/2configs/reaktor2.nix | 120 +++++--------------------------------------- 2 files changed, 104 insertions(+), 107 deletions(-) create mode 100644 krebs/2configs/agenda.html (limited to 'krebs/2configs') diff --git a/krebs/2configs/agenda.html b/krebs/2configs/agenda.html new file mode 100644 index 000000000..9ccfc241c --- /dev/null +++ b/krebs/2configs/agenda.html @@ -0,0 +1,91 @@ + + + + Agenda + + + + + +
+ + + diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index 8837f0aa5..c357da1d7 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -483,113 +483,19 @@ in { ''}''; }; - services.nginx = { - virtualHosts."agenda.r" = { - serverAliases = [ "kri.r" ]; - locations."= /index.html".extraConfig = '' - alias ${pkgs.writeText "agenda.html" '' - - - - Agenda - - - - - -
- - - - ''}; - ''; - locations."/agenda.json".extraConfig = '' - proxy_set_header Host $host; - proxy_pass http://localhost:8009; - ''; - extraConfig = '' - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - ''; - }; + services.nginx.virtualHosts."agenda.r" = { + serverAliases = [ "kri.r" ]; + locations."= /index.html".extraConfig = '' + alias ./agenda.html; + ''; + locations."/agenda.json".extraConfig = '' + proxy_set_header Host $host; + proxy_pass http://localhost:8009; + ''; + extraConfig = '' + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + ''; }; systemd.services.reaktor2-r.serviceConfig.DynamicUser = mkForce false; -- cgit v1.2.3 From d8cdda91e3c8027ed8a057649b32e2a00d4abaf9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 30 Jul 2023 17:22:00 +0200 Subject: reaktor2: add hotdog.r/bedger.json endpoint --- krebs/2configs/reaktor2.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'krebs/2configs') diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index c357da1d7..0f7ab0adf 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -498,6 +498,36 @@ in { ''; }; + krebs.htgen.bedger = { + port = 8011; + user = { + name = "reaktor2"; + home = stateDir; + }; + script = ''. ${pkgs.writers.writeDash "bedger" '' + case "$Method" in + "GET") + printf 'HTTP/1.1 200 OK\r\n' + printf 'Connection: close\r\n' + printf '\r\n' + ${pkgs.hledger}/bin/hledger -f ${stateDir}/ledger bal -N -O json + exit + ;; + esac + ''}''; + }; + + services.nginx.virtualHosts."hotdog.r" = { + locations."/bedger.json".extraConfig = '' + proxy_set_header Host $host; + proxy_pass http://localhost:8011; + ''; + extraConfig = '' + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + ''; + }; + systemd.services.reaktor2-r.serviceConfig.DynamicUser = mkForce false; systemd.services.reaktor2-hackint.serviceConfig.DynamicUser = mkForce false; krebs.reaktor2 = { -- cgit v1.2.3