From 463a8e01d4ad1fd4e09c7d3b1ef1904ea73327fc Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 4 Oct 2015 22:28:41 +0200 Subject: m 1 p: add get system pkg --- makefu/1systems/pornocauster.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/1systems/pornocauster.nix b/makefu/1systems/pornocauster.nix index d43f89a03..d208e5112 100644 --- a/makefu/1systems/pornocauster.nix +++ b/makefu/1systems/pornocauster.nix @@ -42,7 +42,7 @@ krebs.build.user = config.krebs.users.makefu; krebs.build.target = "root@pornocauster"; - + environment.systemPackages = with pkgs;[ get]; networking.firewall.allowedTCPPorts = [ 25 ]; -- cgit v1.2.3 From ab48fbd9720508520c5c3f951ed3b10bef139212 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 4 Oct 2015 22:29:30 +0200 Subject: m {3,5} tinc_graphs: make everyting work, final --- makefu/1systems/wry.nix | 4 ++-- makefu/3modules/tinc_graphs.nix | 25 +++++++++++++++++++------ makefu/5pkgs/tinc_graphs/default.nix | 4 ++-- 3 files changed, 23 insertions(+), 10 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/wry.nix b/makefu/1systems/wry.nix index 9368f1ae5..819a208ac 100644 --- a/makefu/1systems/wry.nix +++ b/makefu/1systems/wry.nix @@ -32,8 +32,8 @@ in { makefu.tinc_graphs.enable = true; makefu.tinc_graphs.krebsNginx = { enable = true; - hostnames_complete = [ "graphs.wry" "graphs.wry.retiolum" ]; - # TODO: remove hard-coded path + # TODO: remove hard-coded hostname + hostnames_complete = [ "graphs.wry" ]; hostnames_anonymous = [ "graphs.krebsco.de" ]; }; networking.firewall.allowedTCPPorts = [80]; diff --git a/makefu/3modules/tinc_graphs.nix b/makefu/3modules/tinc_graphs.nix index 10f1b23a0..06b3f6263 100644 --- a/makefu/3modules/tinc_graphs.nix +++ b/makefu/3modules/tinc_graphs.nix @@ -24,21 +24,22 @@ let # configure krebs nginx to serve the new graphs enable = mkEnableOption "tinc_graphs nginx"; - hostnames_complete = { + hostnames_complete = mkOption { #TODO: this is not a secure way to serve these graphs,better listen to # the correct interface, krebs.nginx does not support this yet type = with types; listOf str; description = "hostname which serves complete graphs"; - default = config.krebs.build.host.name; + default = [ "graphs.${config.krebs.build.host.name}" ]; }; - hostnames_anonymous = { + hostnames_anonymous = mkOption { type = with types; listOf str; description = '' hostname which serves anonymous graphs must be different from hostname_complete ''; + default = [ "anongraphs.${config.krebs.build.host.name}" ]; }; }; @@ -74,18 +75,29 @@ let EXTERNAL_FOLDER = external_dir; INTERNAL_FOLDER = internal_dir; GEODB = cfg.geodbPath; + TINC_HOSTPATH=config.krebs.retiolum.hosts; }; restartIfChanged = true; serviceConfig = { Type = "simple"; + ExecStartPre = pkgs.writeScript "tinc_graphs-init" '' #!/bin/sh mkdir -p "${external_dir}" "${internal_dir}" ''; + ExecStart = "${pkgs.tinc_graphs}/bin/all-the-graphs"; - User = "root"; # tinc cannot be queried as user, + + ExecStartPost = pkgs.writeScript "tinc_graphs-post" '' + #!/bin/sh + # TODO: this may break if workingDir is set to something stupid + # this is needed because homedir is created with 700 + chmod 755 "${cfg.workingDir}" + ''; + + User = "root"; # tinc cannot be queried as user, # seems to be a tinc-pre issue privateTmp = true; }; @@ -93,7 +105,7 @@ let users.extraUsers.tinc_graphs = { uid = 3925439960; #genid tinc_graphs - home = "/var/cache/tinc_graphs"; + home = "/var/spool/tinc_graphs"; createHome = true; }; @@ -102,15 +114,16 @@ let server-names = cfg.krebsNginx.hostnames_complete; locations = [ (nameValuePair "/" '' + autoindex on; root ${internal_dir}; '') ]; }; tinc_graphs_anonymous = { server-names = cfg.krebsNginx.hostnames_anonymous; - #server-names = [ "dick" ]; locations = [ (nameValuePair "/" '' + autoindex on; root ${external_dir}; '') ]; diff --git a/makefu/5pkgs/tinc_graphs/default.nix b/makefu/5pkgs/tinc_graphs/default.nix index 95f096a30..5bc974157 100644 --- a/makefu/5pkgs/tinc_graphs/default.nix +++ b/makefu/5pkgs/tinc_graphs/default.nix @@ -2,14 +2,14 @@ python3Packages.buildPythonPackage rec { name = "tinc_graphs-${version}"; - version = "0.2.9"; + version = "0.2.12"; propagatedBuildInputs = with pkgs;[ python3Packages.pygeoip ## ${geolite-legacy}/share/GeoIP/GeoIPCity.dat ]; src = fetchurl { url = "https://pypi.python.org/packages/source/t/tinc_graphs/tinc_graphs-${version}.tar.gz"; - sha256 = "0fm063qhjlb8g1xahwcqqrd2dxgd38wwi55rhl1k5chr7zajsqfz"; + sha256 = "03jxvxahpcbpnz4668x32b629dwaaz5jcjkyaijm0zzpgcn4cbgp"; }; preFixup = with pkgs;'' wrapProgram $out/bin/build-graphs --prefix PATH : "$out/bin" -- cgit v1.2.3 From e7779d8016cc06c5b7383e25a2e0608666495ca2 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 5 Oct 2015 17:51:14 +0200 Subject: makefu {1,2} Reaktor: add random-emoji plugin to Reaktor to pnp" --- makefu/1systems/pnp.nix | 1 + makefu/2configs/Reaktor/random-emoji.nix | 25 +++++++++++++++++++++++++ makefu/2configs/Reaktor/random-emoji.sh | 5 +++++ 3 files changed, 31 insertions(+) create mode 100644 makefu/2configs/Reaktor/random-emoji.nix create mode 100644 makefu/2configs/Reaktor/random-emoji.sh (limited to 'makefu') diff --git a/makefu/1systems/pnp.nix b/makefu/1systems/pnp.nix index 7698ea14d..fdc2f0135 100644 --- a/makefu/1systems/pnp.nix +++ b/makefu/1systems/pnp.nix @@ -23,6 +23,7 @@ ## \/ are only plugins, must enable Reaktor explicitly ../2configs/Reaktor/stockholmLentil.nix ../2configs/Reaktor/simpleExtend.nix + ../2configs/Reaktor/random-emoji.nix ../2configs/Reaktor/titlebot.nix ../2configs/exim-retiolum.nix diff --git a/makefu/2configs/Reaktor/random-emoji.nix b/makefu/2configs/Reaktor/random-emoji.nix new file mode 100644 index 000000000..b2d99b36b --- /dev/null +++ b/makefu/2configs/Reaktor/random-emoji.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with pkgs; +let + rpkg = pkgs.substituteAll( { + name="random-emoji"; + dir= "bin"; + isExecutable=true; + src= ./random-emoji.sh; + }); + rpkg-path = lib.makeSearchPath "bin" (with pkgs; [ + coreutils + gnused + gnugrep + curl]); +in { + # TODO: make origin a variable, <- module is generic enough to handle different origins, not only stockholm + krebs.Reaktor.extraConfig = '' + public_commands.insert(0,{ + 'capname' : "emoji", + 'pattern' : indirect_pattern.format("emoji"), + 'argv' : ["${rpkg}/bin/random-emoji"], + 'env' : { 'PATH':'${rpkg-path}' } }) + ''; +} diff --git a/makefu/2configs/Reaktor/random-emoji.sh b/makefu/2configs/Reaktor/random-emoji.sh new file mode 100644 index 000000000..913d615be --- /dev/null +++ b/makefu/2configs/Reaktor/random-emoji.sh @@ -0,0 +1,5 @@ +#!/bin/sh +curl http://emojicons.com/random -s | \ + grep data-text | \ + sed -n 's/.*>\(.*\)<\/textarea>/\1/p' | \ + head -n 1 -- cgit v1.2.3 From a986b13d633c872e1586799ea1337f362c562c94 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 5 Oct 2015 17:57:00 +0200 Subject: makefu 2 cgit: primary git server is pnp --- makefu/2configs/git/cgit-retiolum.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 40b51e601..1277a014e 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -29,6 +29,7 @@ let hooks = { post-receive = git.irc-announce { nick = config.networking.hostName; + verbose = config.krebs.build.host.name == "pnp"; channel = "#retiolum"; # TODO remove the hardcoded hostname server = "cd.retiolum"; -- cgit v1.2.3 From 36d43bf73f498228ff540e86e6dd6596a353a0da Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 7 Oct 2015 15:21:24 +0200 Subject: makefu 3 tinc_graphs: actually start the timer --- makefu/3modules/tinc_graphs.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/3modules/tinc_graphs.nix b/makefu/3modules/tinc_graphs.nix index 06b3f6263..62d607527 100644 --- a/makefu/3modules/tinc_graphs.nix +++ b/makefu/3modules/tinc_graphs.nix @@ -64,13 +64,11 @@ let environment.systemPackages = [ pkgs.tinc_graphs]; systemd.timers.tinc_graphs = { description = "Build Tinc Graphs via via timer"; - + wantedBy = [ "timers.target"]; timerConfig = cfg.timerConfig; }; systemd.services.tinc_graphs = { description = "Build Tinc Graphs"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; environment = { EXTERNAL_FOLDER = external_dir; INTERNAL_FOLDER = internal_dir; -- cgit v1.2.3 From 5f5c1f5f661a2c4236fb62bc4c0ec7d43ae7a5b1 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 8 Oct 2015 16:51:57 +0200 Subject: m 2 Reaktor: add shack-correct, update pnp Reaktor Channels --- makefu/1systems/pnp.nix | 3 ++- makefu/2configs/Reaktor/shack-correct.nix | 20 ++++++++++++++++++++ makefu/2configs/Reaktor/shack-correct.sh | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/Reaktor/shack-correct.nix create mode 100644 makefu/2configs/Reaktor/shack-correct.sh (limited to 'makefu') diff --git a/makefu/1systems/pnp.nix b/makefu/1systems/pnp.nix index fdc2f0135..e7ceca60d 100644 --- a/makefu/1systems/pnp.nix +++ b/makefu/1systems/pnp.nix @@ -25,6 +25,7 @@ ../2configs/Reaktor/simpleExtend.nix ../2configs/Reaktor/random-emoji.nix ../2configs/Reaktor/titlebot.nix + ../2configs/Reaktor/shack-correct.nix ../2configs/exim-retiolum.nix ../2configs/urlwatch.nix @@ -35,7 +36,7 @@ krebs.Reaktor.debug = true; krebs.Reaktor.nickname = "Reaktor|bot"; krebs.Reaktor.extraEnviron = { - REAKTOR_CHANNELS = "#krebs,#binaergewitter"; + REAKTOR_CHANNELS = "#krebs,#binaergewitter,#shackspace"; }; krebs.build.host = config.krebs.hosts.pnp; diff --git a/makefu/2configs/Reaktor/shack-correct.nix b/makefu/2configs/Reaktor/shack-correct.nix new file mode 100644 index 000000000..8f30807f1 --- /dev/null +++ b/makefu/2configs/Reaktor/shack-correct.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +with pkgs; +let + script = pkgs.substituteAll ( { + name="shack-correct"; + isExecutable=true; + dir = ""; + src = ./shack-correct.sh; + }); +in { + krebs.Reaktor.extraConfig = '' + public_commands.insert(0,{ + 'capname' : "shack-correct", + 'pattern' : '^(?P.*Shack.*)$$', + 'argv' : ["${script}"], + 'env' : { }}) + ''; +} + diff --git a/makefu/2configs/Reaktor/shack-correct.sh b/makefu/2configs/Reaktor/shack-correct.sh new file mode 100644 index 000000000..3b4d04f80 --- /dev/null +++ b/makefu/2configs/Reaktor/shack-correct.sh @@ -0,0 +1,6 @@ +#! /bin/sh +set -eu +printf "Sie meinten wohl \"" +echo -n $@ | sed 's/Shack/shack/g' +echo "\"" +echo "${_from}--" -- cgit v1.2.3