From 4e08eb5dffbfc9707633b6d30e200bb993185db2 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 3 Nov 2020 22:59:13 +0100 Subject: puyak.r,wolf.r: move all services from wolf to puyak --- krebs/1systems/puyak/config.nix | 79 ++++++++++++++++++++++++++++++++++++++++- krebs/1systems/wolf/config.nix | 76 --------------------------------------- 2 files changed, 78 insertions(+), 77 deletions(-) (limited to 'krebs') diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 08a3392bd..fb7d01e70 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -13,13 +13,90 @@ + ### shackspace + # handle the worlddomination map via coap + + + # drivedroid.shack for shackphone + + # + # Say if muell will be collected + + # provide muellshack api + + # provide light control api + + # light.shack web-ui + + # send mail if muell was not handled + + # send mail if muell was not handled + + # powerraw usb serial to mqtt and raw socket + + + { # do not log to /var/spool/log + services.nginx.appendHttpConfig = '' + map $request_method $loggable { + default 1; + GET 0; + } + log_format vhost '$host $remote_addr - $remote_user ' + '[$time_local] "$request" $status ' + '$body_bytes_sent "$http_referer" ' + '"$http_user_agent"'; + error_log stderr; + access_log syslog:server=unix:/dev/log vhost; + ''; + services.journald.rateLimitBurst = 10000; + } + + # create samba share for anonymous usage with the laser and 3d printer pc + + + # mobile.lounge.mpd.shack + + + # hass.shack + + + # connect to git.shackspace.de as group runner for rz + + + # Statistics collection and visualization + # # graphiteApi is broken and unused(hopefully) + ## Collect data from mqtt.shack and store in graphite database + + ## Collect radioactive data and put into graphite + + ## mqtt.shack + + ## influx.shack + + + ## Collect local statistics via collectd and send to collectd + + + + + # prometheus.shack + # + + # + # grafana.shack + + + # shackdns.shack + # replacement for leases.shack and shackles.shack + + + # monitoring: prometheus.shack - ## Collect local statistics via collectd and send to collectd diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index 0160f9ebb..eff09630c 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -14,82 +14,6 @@ in - # handle the worlddomination map via coap - - - - # drivedroid.shack for shackphone - - # - # Say if muell will be collected - - # provide muellshack api - - # provide light control api - - # light.shack web-ui - - # send mail if muell was not handled - - # send mail if muell was not handled - - # powerraw usb serial to mqtt and raw socket - - - { # do not log to /var/spool/log - services.nginx.appendHttpConfig = '' - map $request_method $loggable { - default 1; - GET 0; - } - log_format vhost '$host $remote_addr - $remote_user ' - '[$time_local] "$request" $status ' - '$body_bytes_sent "$http_referer" ' - '"$http_user_agent"'; - error_log stderr; - access_log syslog:server=unix:/dev/log vhost; - ''; - services.journald.rateLimitBurst = 10000; - } - - # create samba share for anonymous usage with the laser and 3d printer pc - - - # mobile.lounge.mpd.shack - - - # hass.shack - - - # connect to git.shackspace.de as group runner for rz - - - # Statistics collection and visualization - # # graphiteApi is broken and unused(hopefully) - ## Collect data from mqtt.shack and store in graphite database - - ## Collect radioactive data and put into graphite - - ## mqtt.shack - - ## influx.shack - - - ## Collect local statistics via collectd and send to collectd - - - - - # prometheus.shack - # - - # - # grafana.shack - - - # shackdns.shack - # replacement for leases.shack and shackles.shack - # misc -- cgit v1.2.3 From fd0a2c3c309fd4d86d0c8b4e4472bf828954fd1f Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 4 Nov 2020 08:51:34 +0100 Subject: wolf.r: re-add shack ssh keys --- krebs/1systems/wolf/config.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'krebs') diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index eff09630c..0c95f4d13 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -14,9 +14,13 @@ in + #### shackspace services + # misc + + ]; # use your own binary cache, fallback use cache.nixos.org (which is used by -- cgit v1.2.3 From 696f6a534a7e193fa726692bcdeb968a68b61612 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 4 Nov 2020 23:01:50 +0100 Subject: puyak.r: cleanup imports --- krebs/1systems/puyak/config.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'krebs') diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index fb7d01e70..827f984d6 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -79,11 +79,9 @@ - - # prometheus.shack - # - - # + ## netbox.shack: Netbox is disabled as nobody seems to be using it anyway + # + # grafana.shack -- cgit v1.2.3 From 9919cb25912dfcc50881239f95494dd2f8e7b858 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 5 Nov 2020 22:14:09 +0100 Subject: puyak.r: initrd bootstrapping via tor --- krebs/1systems/puyak/config.nix | 6 +++++ krebs/2configs/tor/initrd.nix | 50 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 krebs/2configs/tor/initrd.nix (limited to 'krebs') diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 827f984d6..3357964ef 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -7,12 +7,18 @@ + + ## initrd unlocking + # (brain hosts/puyak/luks-ssd;echo) | ssh root@$(brain krebs-secrets/puyak/initrd/hostname) 'cat > /crypt-ramfs/passphrase' + + + ### shackspace # handle the worlddomination map via coap diff --git a/krebs/2configs/tor/initrd.nix b/krebs/2configs/tor/initrd.nix new file mode 100644 index 000000000..cb6008f73 --- /dev/null +++ b/krebs/2configs/tor/initrd.nix @@ -0,0 +1,50 @@ +{config, pkgs, ... }: +## unlock command: +# (brain hosts/puyak/luks-ssd;echo) | ssh root@$(brain krebs-secrets/puyak/initrd/hostname) 'cat > /crypt-ramfs/passphrase' +{ + boot.initrd.network.enable = true; + boot.initrd.network.ssh = { + enable = true; + port = 22; + authorizedKeys = [ + config.krebs.users.jeschli-brauerei.pubkey + config.krebs.users.lass.pubkey + config.krebs.users.lass-mors.pubkey + config.krebs.users.makefu.pubkey + config.krebs.users.tv.pubkey + ]; + hostECDSAKey = ; + }; + boot.initrd.availableKernelModules = [ "e1000e" ]; + + boot.initrd.secrets = { + "/etc/tor/onion/bootup" = ; + }; + + boot.initrd.extraUtilsCommands = '' + copy_bin_and_libs ${pkgs.tor}/bin/tor + ''; + + # start tor during boot process + boot.initrd.network.postCommands = let + torRc = (pkgs.writeText "tor.rc" '' + DataDirectory /etc/tor + SOCKSPort 127.0.0.1:9050 IsolateDestAddr + SOCKSPort 127.0.0.1:9063 + HiddenServiceDir /etc/tor/onion/bootup + HiddenServicePort 22 127.0.0.1:22 + ''); + in '' + echo "tor: preparing onion folder" + # have to do this otherwise tor does not want to start + chmod -R 700 /etc/tor + + echo "make sure localhost is up" + ip a a 127.0.0.1/8 dev lo + ip link set lo up + + echo "tor: starting tor" + tor -f ${torRc} --verify-config + tor -f ${torRc} & + ''; +} -- cgit v1.2.3 From 430dad522cfc6d19329c323e009f47dc0cdc9250 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 5 Nov 2020 22:25:24 +0100 Subject: krebs dummy-secrets: add initrd --- krebs/0tests/data/secrets/initrd/host_ecdsa.pub | 0 krebs/0tests/data/secrets/initrd/host_ecdsa_key | 0 krebs/0tests/data/secrets/initrd/hostname | 0 krebs/0tests/data/secrets/initrd/hs_ed25519_public_key | 0 krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 krebs/0tests/data/secrets/initrd/host_ecdsa.pub create mode 100644 krebs/0tests/data/secrets/initrd/host_ecdsa_key create mode 100644 krebs/0tests/data/secrets/initrd/hostname create mode 100644 krebs/0tests/data/secrets/initrd/hs_ed25519_public_key create mode 100644 krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key (limited to 'krebs') diff --git a/krebs/0tests/data/secrets/initrd/host_ecdsa.pub b/krebs/0tests/data/secrets/initrd/host_ecdsa.pub new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/host_ecdsa_key b/krebs/0tests/data/secrets/initrd/host_ecdsa_key new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/hostname b/krebs/0tests/data/secrets/initrd/hostname new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/hs_ed25519_public_key b/krebs/0tests/data/secrets/initrd/hs_ed25519_public_key new file mode 100644 index 000000000..e69de29bb diff --git a/krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key b/krebs/0tests/data/secrets/initrd/hs_ed25519_secret_key new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.3 From 5e6f56889580d4e2924491a7f471d7994b35212f Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 12 Nov 2020 10:28:14 +0100 Subject: puyak,wolf: add documentation for imports update share --- krebs/1systems/puyak/config.nix | 20 ++++++++++++-------- krebs/1systems/wolf/config.nix | 4 +++- krebs/2configs/shack/share.nix | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'krebs') diff --git a/krebs/1systems/puyak/config.nix b/krebs/1systems/puyak/config.nix index 3357964ef..0cadc3a10 100644 --- a/krebs/1systems/puyak/config.nix +++ b/krebs/1systems/puyak/config.nix @@ -27,20 +27,24 @@ # drivedroid.shack for shackphone # + # Say if muell will be collected - # provide muellshack api + # provide muellshack api: muell.shack - # provide light control api - - # light.shack web-ui - # send mail if muell was not handled - # send mail if muell was not handled - + + # provide light control api + # light.shack lounge.light.shack power.light.shack openhab.shack lightapi.shack + # light.shack web-ui + #light.shack + # powerraw usb serial to mqtt and raw socket - + # powerraw.shack standby.shack + # send power stats to s3 + # powerraw.shack must be available + { # do not log to /var/spool/log services.nginx.appendHttpConfig = '' diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix index 0c95f4d13..25e7c5f06 100644 --- a/krebs/1systems/wolf/config.nix +++ b/krebs/1systems/wolf/config.nix @@ -15,8 +15,10 @@ in #### shackspace services - + # wolf.shack + # gitlab runner + # misc diff --git a/krebs/2configs/shack/share.nix b/krebs/2configs/shack/share.nix index 465d6ef69..d8d65d309 100644 --- a/krebs/2configs/shack/share.nix +++ b/krebs/2configs/shack/share.nix @@ -37,6 +37,9 @@ # for legacy systems client min protocol = NT1 server min protocol = NT1 + workgroup = WORKGROUP + server string = ${config.networking.hostName} + netbios name = ${config.networking.hostName} ''; }; } -- cgit v1.2.3