From 8574f0f177c004031a4282d121931caab62158ad Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 3 Nov 2017 13:29:14 +0100 Subject: ma lancache-dns: add storage server names --- makefu/2configs/lanparty/lancache-dns.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/lancache-dns.nix b/makefu/2configs/lanparty/lancache-dns.nix index 4b4ebf0a0..f03fe8773 100644 --- a/makefu/2configs/lanparty/lancache-dns.nix +++ b/makefu/2configs/lanparty/lancache-dns.nix @@ -21,6 +21,13 @@ let stateDir = "/var/lib/unbound"; user = "unbound"; upstream-server = "8.8.8.8"; + local_ip = "192.168.1.10"; + extra-config = pkgs.writeText "local.conf" '' + server: + local-data: "piratebox. A ${local-ip}" + local-data: "store. A ${local-ip}" + local-data: "share. A ${local-ip}" + ''; in { services.unbound = { enable = true; @@ -29,6 +36,7 @@ in { forwardAddresses = [ upstream-server ]; extraConfig = '' include: "${stateDir}/lancache/*.conf" + include: "${extra-config}" ''; }; services.dnscrypt-proxy.enable = lib.mkForce false; @@ -42,7 +50,8 @@ in { path = [ pkgs.gawk pkgs.iproute pkgs.gnused ]; script = '' set -xeu - current_ip=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') + # current_ip=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') + current_ip=${local_ip} old_ip=10.1.1.250 mkdir -p ${stateDir} rm -rvf ${stateDir}/lancache -- cgit v1.2.3 From a98010b11c68863feaa6ff30943ef21d39a59980 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 3 Nov 2017 14:46:31 +0100 Subject: ma lancache-dns: fix local-ip variable --- makefu/2configs/lanparty/lancache-dns.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/lancache-dns.nix b/makefu/2configs/lanparty/lancache-dns.nix index f03fe8773..5d90d1a99 100644 --- a/makefu/2configs/lanparty/lancache-dns.nix +++ b/makefu/2configs/lanparty/lancache-dns.nix @@ -24,9 +24,9 @@ let local_ip = "192.168.1.10"; extra-config = pkgs.writeText "local.conf" '' server: - local-data: "piratebox. A ${local-ip}" - local-data: "store. A ${local-ip}" - local-data: "share. A ${local-ip}" + local-data: "piratebox. A ${local_ip}" + local-data: "store. A ${local_ip}" + local-data: "share. A ${local_ip}" ''; in { services.unbound = { -- cgit v1.2.3 From 328f9ffdac31e164ca34cadb5db3065ba0456686 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 3 Nov 2017 14:46:54 +0100 Subject: ma lanparty/samba: add new writeable share --- makefu/2configs/lanparty/samba.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/samba.nix b/makefu/2configs/lanparty/samba.nix index de834ab16..32a656ad7 100644 --- a/makefu/2configs/lanparty/samba.nix +++ b/makefu/2configs/lanparty/samba.nix @@ -10,9 +10,16 @@ }; services.samba = { enable = true; + enableNmbd = true; shares = { - share-home = { + lanparty = { path = "/data/lanparty/"; + "read only" = "yes"; + browseable = "yes"; + "guest ok" = "yes"; + }; + share = { + path = "/data/lanparty/share"; "read only" = "no"; browseable = "yes"; "guest ok" = "yes"; -- cgit v1.2.3 From 9f8aa6abaedf8cbf3ce40548b1e52ac45c469c38 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Nov 2017 10:48:14 +0100 Subject: ma lancache-dns: refactor --- makefu/2configs/lanparty/lancache-dns.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/lancache-dns.nix b/makefu/2configs/lanparty/lancache-dns.nix index 5d90d1a99..498162d13 100644 --- a/makefu/2configs/lanparty/lancache-dns.nix +++ b/makefu/2configs/lanparty/lancache-dns.nix @@ -1,6 +1,17 @@ { pkgs, lib, config, ... }: with import ; let + upstream-server = "8.8.8.8"; + local_ip = "192.168.10.10"; + + extra-config = pkgs.writeText "local.conf" '' + server: + local-data: "piratebox. A ${local_ip}" + local-data: "store. A ${local_ip}" + local-data: "share. A ${local_ip}" + ''; + + # see https://github.com/zeropingheroes/lancache for full docs lancache-dns = pkgs.stdenv.mkDerivation rec { name = "lancache-dns-2017-06-28"; @@ -11,8 +22,9 @@ let rev = "420aa62"; sha256 = "0ik7by7ripdv2avyy5kk9jp1i7rz9ksc8xmg7n9iik365q9pv94m"; }; + phases = [ "unpackPhase" "installPhase" ]; - # here we can chance to edit `includes/proxy-cache-paths.conf` + # here we have the chance to edit `includes/proxy-cache-paths.conf` installPhase = '' mkdir -p $out cp -r * $out/ @@ -20,14 +32,6 @@ let }; stateDir = "/var/lib/unbound"; user = "unbound"; - upstream-server = "8.8.8.8"; - local_ip = "192.168.1.10"; - extra-config = pkgs.writeText "local.conf" '' - server: - local-data: "piratebox. A ${local_ip}" - local-data: "store. A ${local_ip}" - local-data: "share. A ${local_ip}" - ''; in { services.unbound = { enable = true; -- cgit v1.2.3 From 7184c979931af91187617d5b7d7c513e892b17a4 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Nov 2017 10:48:31 +0100 Subject: ma lancache: make statedir a variable --- makefu/2configs/lanparty/lancache.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/lancache.nix b/makefu/2configs/lanparty/lancache.nix index 3df2e3f59..bcacf2e15 100644 --- a/makefu/2configs/lanparty/lancache.nix +++ b/makefu/2configs/lanparty/lancache.nix @@ -17,15 +17,21 @@ let installPhase = '' mkdir -p $out cp -r * $out/ + rm $out/caches-enabled/* sed -i -e 's/^\(user\).*/\1 ${cfg.user} ${cfg.group};/' \ -e '1 idaemon off;' \ + -e 's#/var/lancache#${cfg.statedir}#g' \ $out/nginx.conf + sed -i -e 's#/var/lancache#${cfg.statedir}#g' \ + $out/*/*.conf + ln -s $out/caches-available/* $out/caches-enabled/ ''; }; cfg = { + statedir = "/data/cache"; + group = "nginx-lancache"; user = "nginx-lancache"; - statedir = "/var/lancache"; package = pkgs.stdenv.lib.overrideDerivation pkgs.nginx (old:{ configureFlags = old.configureFlags ++ [ "--with-http_slice_module" @@ -43,6 +49,7 @@ in { preStart = '' mkdir -p ${cfg.statedir} && cd ${cfg.statedir} + chmod 700 ${cfg.statedir} PATH_CACHE=$PATH_BASE/cache PATH_LOGS=$PATH_BASE/logs -- cgit v1.2.3 From c8ab30951e9780a2bfd10bcb987c46e95d6b93a0 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Nov 2017 10:49:11 +0100 Subject: ma lanparty/samba: update path --- makefu/2configs/lanparty/samba.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/samba.nix b/makefu/2configs/lanparty/samba.nix index 32a656ad7..4176d7b35 100644 --- a/makefu/2configs/lanparty/samba.nix +++ b/makefu/2configs/lanparty/samba.nix @@ -19,7 +19,7 @@ "guest ok" = "yes"; }; share = { - path = "/data/lanparty/share"; + path = "/data/incoming"; "read only" = "no"; browseable = "yes"; "guest ok" = "yes"; -- cgit v1.2.3 From 4fa4ee36ee5b9d3d15aa826007dd648e7cd5860e Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Nov 2017 10:49:47 +0100 Subject: ma lanparty: add mumble-server --- makefu/2configs/lanparty/mumble-server.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 makefu/2configs/lanparty/mumble-server.nix (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/mumble-server.nix b/makefu/2configs/lanparty/mumble-server.nix new file mode 100644 index 000000000..5b9631cd1 --- /dev/null +++ b/makefu/2configs/lanparty/mumble-server.nix @@ -0,0 +1,12 @@ +{ config, ... }: +{ + networking.firewall.allowedTCPPorts = [ 64738 ]; + networking.firewall.allowedUDPPorts = [ 64738 ]; + services.murmur = { + enable = true; + welcometext = "Welcome to the LANest Party mumble server"; + bonjour = true; + hostName = "0.0.0.0"; + sendVersion = true; + }; +} -- cgit v1.2.3 From f45a5057aa6584177064622ba13f53e59238dae8 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 8 Nov 2017 10:52:06 +0100 Subject: ma lanparty/lancache-dns: add documentation --- makefu/2configs/lanparty/lancache-dns.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'makefu/2configs/lanparty') diff --git a/makefu/2configs/lanparty/lancache-dns.nix b/makefu/2configs/lanparty/lancache-dns.nix index 498162d13..c9da7c4c4 100644 --- a/makefu/2configs/lanparty/lancache-dns.nix +++ b/makefu/2configs/lanparty/lancache-dns.nix @@ -2,6 +2,8 @@ with import ; let upstream-server = "8.8.8.8"; + # make sure the router pins the ip address to the deployed host + # and set it as dns server ( dhcp option 6,192.168.10.10 ) local_ip = "192.168.10.10"; extra-config = pkgs.writeText "local.conf" '' -- cgit v1.2.3