From 23d2950ed7d60aaa066a437b4aaffbf55a76c036 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Aug 2018 20:58:23 +0200 Subject: cgit-clear-cache: init --- krebs/3modules/git.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix index 5ae24b40..89726fd7 100644 --- a/krebs/3modules/git.nix +++ b/krebs/3modules/git.nix @@ -403,9 +403,7 @@ let )); environment.systemPackages = [ - (pkgs.writeDashBin "cgit-clear-cache" '' - ${pkgs.coreutils}/bin/rm -f ${cfg.cgit.settings.cache-root}/* - '') + (pkgs.cgit-clear-cache.override { inherit (cfg.cgit.settings) cache-root; }) ]; system.activationScripts.cgit = '' -- cgit v1.2.3 From 7da08cb47fd07d4220f459475bb8bce405512397 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Aug 2018 22:05:45 +0200 Subject: krebs git: allow git user to rwx cgit cache-root --- krebs/3modules/git.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix index 89726fd7..8a923efd 100644 --- a/krebs/3modules/git.nix +++ b/krebs/3modules/git.nix @@ -348,6 +348,10 @@ let users.users.${cfg.user.name} = { inherit (cfg.user) home name uid; description = "Git repository hosting user"; + extraGroups = [ + # To allow running cgit-clear-cache via hooks. + cfg.cgit.fcgiwrap.group.name + ]; shell = "/bin/sh"; openssh.authorizedKeys.keys = unique @@ -407,7 +411,8 @@ let ]; system.activationScripts.cgit = '' - mkdir -m 0700 -p ${cfg.cgit.settings.cache-root} + mkdir -m 0770 -p ${cfg.cgit.settings.cache-root} + chmod 0770 ${cfg.cgit.settings.cache-root} chown ${toString cfg.cgit.fcgiwrap.user.uid}:${toString cfg.cgit.fcgiwrap.group.gid} ${cfg.cgit.settings.cache-root} ''; -- cgit v1.2.3 From 61e6552da3c48256bf4d17ae691721b3a7d000f2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 29 Aug 2018 11:39:03 +0200 Subject: l: rip dishfire.r --- krebs/3modules/lass/default.nix | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index c4a5bbb0..44b56c4d 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -11,39 +11,6 @@ with import ; ci = true; monitoring = true; }) { - dishfire = { - cores = 4; - nets = rec { - internet = { - ip4.addr = "144.76.172.188"; - aliases = [ - "dishfire.i" - ]; - ssh.port = 45621; - }; - retiolum = { - via = internet; - ip4.addr = "10.243.133.99"; - ip6.addr = "42:0000:0000:0000:0000:0000:d15f:1233"; - aliases = [ - "dishfire.r" - ]; - tinc.pubkey = '' - -----BEGIN RSA PUBLIC KEY----- - MIIBCgKCAQEAwKi49fN+0s5Cze6JThM7f7lj4da27PSJ/3w3tDFPvtQco11ksNLs - Xd3qPaQIgmcNVCR06aexae3bBeTx9y3qHvKqZVE1nCtRlRyqy1LVKSj15J1D7yz7 - uS6u/BSZiCzmdZwu3Fq5qqoK0nfzWe/NKEDWNa5l4Mz/BZQyI/hbOpn6UfFD0LpK - R4jzc9Dbk/IFNAvwb5yrgEYtwBzlXzeDvHW2JcPq3qQjK2byQYNiIyV3g0GHppEd - vDbIPDFhTn3Hv5zz/lX+/We8izzRge7MEd+Vn9Jwb5NAzwDsOHl6ExpqASv9H49U - HwgPw5pstabyrsDWXybSYUb+8LcZf+unGwIDAQAB - -----END RSA PUBLIC KEY----- - ''; - tinc.port = 993; - }; - }; - ssh.privkey.path = ; - ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGv0JMp0y+E5433GRSFKVK3cQmP0AAlS9aH9fk49yFxy"; - }; prism = rec { cores = 4; extraZones = { -- cgit v1.2.3 From af2753507d65e01d088161122ce5663c181a46aa Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 25 Aug 2018 16:54:13 +0200 Subject: add konsens module --- krebs/3modules/default.nix | 1 + krebs/3modules/konsens.nix | 80 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 krebs/3modules/konsens.nix (limited to 'krebs/3modules') diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index afc96e9e..83334976 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -26,6 +26,7 @@ let ./iana-etc.nix ./iptables.nix ./kapacitor.nix + ./konsens.nix ./monit.nix ./newsbot-js.nix ./nixpkgs.nix diff --git a/krebs/3modules/konsens.nix b/krebs/3modules/konsens.nix new file mode 100644 index 00000000..47316d5d --- /dev/null +++ b/krebs/3modules/konsens.nix @@ -0,0 +1,80 @@ +{ config, lib, pkgs, ... }: + +with import ; + +let + cfg = config.krebs.konsens; + + out = { + options.krebs.konsens = api; + config = lib.mkIf cfg.enable imp; + }; + + api = { + enable = mkEnableOption "git konsens finder"; + repos = mkOption { + type = types.attrsOf (types.submodule ({ config, ...}: { + options = { + url = mkOption { + type = types.str; + default = "git@localhost:${config._module.args.name}"; + }; + branchesToCheck = mkOption { + type = types.listOf types.str; + default = [ "lassulus" "makefu" "tv" ]; + }; + target = mkOption { + type = types.str; + default = "master"; + }; + timerConfig = mkOption { + type = types.attrsOf types.str; + default = { + OnCalendar = "*:00,15,30,45"; + }; + }; + }; + })); + }; + }; + + imp = { + users.users.konsens = rec { + name = "konsens"; + uid = genid name; + home = "/var/lib/konsens"; + createHome = true; + }; + + systemd.timers = mapAttrs' (name: repo: + nameValuePair "konsens-${name}" { + description = "konsens timer"; + wantedBy = [ "timers.target" ]; + timerConfig = repo.timerConfig; + } + ) cfg.repos; + + systemd.services = mapAttrs' (name: repo: + nameValuePair "konsens-${name}" { + after = [ "network.target" "secret.service" ]; + path = [ pkgs.git ]; + restartIfChanged = false; + serviceConfig = { + Type = "simple"; + PermissionsStartOnly = true; + ExecStart = pkgs.writeDash "konsens-${name}" '' + if ! test -e ${name}; then + git clone ${repo.url} ${name} + fi + cd ${name} + git fetch origin + git push origin $(git merge-base ${concatMapStringsSep " " (branch: "origin/${branch}") repo.branchesToCheck}):refs/heads/master + ''; + WorkingDirectory = /var/lib/konsens; + User = "konsens"; + }; + } + ) cfg.repos; + }; + +in out -- cgit v1.2.3 From c1e692217834de86416b04c04958c791113b11cc Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 2 Sep 2018 08:56:12 +0200 Subject: l: rekey, rename borg.r -> rock.r (Mic92) --- krebs/3modules/lass/default.nix | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'krebs/3modules') diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index 44b56c4d..7d9ef507 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -408,7 +408,7 @@ with import ; }; }; }; - borg = { + rock = { monitoring = false; ci = false; external = true; @@ -416,22 +416,21 @@ with import ; retiolum = { ip4.addr = "10.243.29.171"; ip6.addr = "42:4992:6a6d:700::2"; - aliases = [ "borg.r" ]; + aliases = [ "rock.r" ]; tinc.pubkey = '' - -----BEGIN PUBLIC KEY----- - MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0bHZApTM7Hl4qqNakSwq - bt7zJoTVK9ePoC3Mue1VmJ1mCKMaxKdzlO31kPeHtkilAzgyIJdgikyKFlApGsQL - aIuU9h55X7TbikoDD6ghbSrAe3Pgc+sJ3OZ7wO7Qb8CKgJvEbkk/u68YiJgyTjYD - HNjIQzlsGdpoSke9vwC8qWanfgN7c2MMGtakqfXDjYjCgp7O43i+SMupkMSXIXMA - 5XUFh/vVp6xgPxBofcw0uQIyZ5v4PPFjnGPm4rnMbFzbhubntHjDadwGd5Niyw4O - zNNKNchTLfNiuNGqTZeYd0kJ5fNMKykhpSs+ou34MvexvpuyPlFuotnPXN/nOMml - 3nwiqzthzPuBZRLswxT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/18LcfX730f8CAwEAAQ== + -----END RSA PUBLIC KEY----- ''; }; }; -- cgit v1.2.3 From 071cc0f5b109b4e17b3d6616fcc20c419ae1f7c8 Mon Sep 17 00:00:00 2001 From: jeschli Date: Tue, 4 Sep 2018 19:54:22 +0200 Subject: j enklave: +cgit --- krebs/3modules/jeschli/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs/3modules') diff --git a/krebs/3modules/jeschli/default.nix b/krebs/3modules/jeschli/default.nix index ed9bfad2..ab8fe097 100644 --- a/krebs/3modules/jeschli/default.nix +++ b/krebs/3modules/jeschli/default.nix @@ -132,6 +132,7 @@ with import ; ip6.addr = "42::30"; aliases = [ "enklave.r" + "cgit.enklave.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3