From 3389cdb4e14732c21bc6b22336fd29cbb5200060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Tue, 1 Sep 2020 08:01:21 -0400 Subject: webdav setup --- config/minecraft.nix | 2 +- config/web-server.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/minecraft.nix b/config/minecraft.nix index c712503..8e6ad0c 100644 --- a/config/minecraft.nix +++ b/config/minecraft.nix @@ -3,7 +3,7 @@ let minecraft-port = 25565; allowedAddresses = [ "108.30.16.212" - "24.193.7.10" + "24.193.7.0/24" ]; in { diff --git a/config/web-server.nix b/config/web-server.nix index eb957a5..5f1ae53 100644 --- a/config/web-server.nix +++ b/config/web-server.nix @@ -12,6 +12,9 @@ networking.firewall.allowedTCPPorts = [ 80 443 ]; services.nginx = { enable = true; + package = pkgs.nginxStable.override { + modules = with pkgs.nginxModules; [ dav ]; + }; recommendedProxySettings = true; appendHttpConfig = '' # This is a workaround to deal with closed connections on @@ -60,6 +63,19 @@ locations."/mpd" = { proxyPass = "http://${mpd_loc.address}:${toString mpd_loc.port}/"; }; + locations."/dav" = { + root = "/storage/srv/kj.orbekk.com"; + extraConfig = '' + auth_basic webdav; + # htpasswd -c /opt/secret/nginx-webdav.htpasswd + dav_ext_methods PROPFIND OPTIONS; + auth_basic_user_file "/opt/secret/nginx-webdav.htpasswd"; + dav_methods put delete mkcol copy move; + dav_access user:rw group:rw all:rw; + create_full_put_path on; + autoindex on; + ''; + }; #locations."/systemd" = { # proxyPass = "http://10.0.20.15:11105/"; #}; -- cgit v1.2.3