From 1ac25c33a90e9029953f234644da4ebd31b45353 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 2 Dec 2018 05:45:33 +0100 Subject: l yellow.r: add retiolum html listing --- lass/1systems/yellow/config.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lass/1systems/yellow') diff --git a/lass/1systems/yellow/config.nix b/lass/1systems/yellow/config.nix index ee14986ac..48d405111 100644 --- a/lass/1systems/yellow/config.nix +++ b/lass/1systems/yellow/config.nix @@ -32,16 +32,24 @@ with import ; }; }; + services.nginx = { + enable = true; + virtualHosts."yellow.r".locations."/dl".extraConfig = '' + autoindex on; + alias /var/download/finished; + ''; + }; + krebs.iptables = { enable = true; tables.filter.INPUT.rules = [ + { predicate = "-p tcp --dport 80"; target = "ACCEPT"; } { predicate = "-p tcp --dport 9091"; target = "ACCEPT"; } { predicate = "-p tcp --dport 51413"; target = "ACCEPT"; } { predicate = "-p udp --dport 51413"; target = "ACCEPT"; } ]; }; - services.nginx.enable = true; services.openvpn.servers.nordvpn.config = '' client dev tun -- cgit v1.2.3 From e4750d38e76db94a0b255fa143408b8cbe38b61b Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 5 Dec 2018 09:02:31 +0100 Subject: l yellow.r: use fancyindex --- lass/1systems/yellow/config.nix | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'lass/1systems/yellow') diff --git a/lass/1systems/yellow/config.nix b/lass/1systems/yellow/config.nix index 48d405111..ff7b23687 100644 --- a/lass/1systems/yellow/config.nix +++ b/lass/1systems/yellow/config.nix @@ -34,10 +34,37 @@ with import ; services.nginx = { enable = true; - virtualHosts."yellow.r".locations."/dl".extraConfig = '' - autoindex on; - alias /var/download/finished; - ''; + package = pkgs.nginx.override { + modules = with pkgs.nginxModules; [ + fancyindex + ]; + }; + virtualHosts."dl" = { + default = true; + locations."/Nginx-Fancyindex-Theme-dark" = { + extraConfig = '' + alias ${pkgs.fetchFromGitHub { + owner = "Naereen"; + repo = "Nginx-Fancyindex-Theme"; + rev = "e84f7d6a32085c2b6238f85f5fdebe9ceb710fc4"; + sha256 = "0wzl4ws2w8f0749vxfd1c8c21p3jw463wishgfcmaljbh4dwplg6"; + }}/Nginx-Fancyindex-Theme-dark; + autoindex on; + ''; + }; + locations."/" = { + root = "/var/download/finished"; + extraConfig = '' + fancyindex on; + fancyindex_header "/Nginx-Fancyindex-Theme-dark/header.html"; + fancyindex_footer "/Nginx-Fancyindex-Theme-dark/footer.html"; + dav_methods PUT DELETE MKCOL COPY MOVE; + + create_full_put_path on; + dav_access all:r; + ''; + }; + }; }; krebs.iptables = { -- cgit v1.2.3