summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/ymir-nginx.nix22
-rw-r--r--ymir.nix41
2 files changed, 26 insertions, 37 deletions
diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix
index a1de81c3..96633f00 100644
--- a/custom/ymir-nginx.nix
+++ b/custom/ymir-nginx.nix
@@ -184,6 +184,28 @@ in {
184 proxy_pass http://bragi.asgard.yggdrasil/; 184 proxy_pass http://bragi.asgard.yggdrasil/;
185 } 185 }
186 } 186 }
187
188 server {
189 listen *:443 ssl;
190 listen [::]:443 ssl;
191
192 server_name ~^webdav\.(yggdrasil\.li|141\.li|praseodym\.org)$;
193
194 include ${acme};
195
196 location ~ ^/(.+?)(/.*)?$ {
197 alias /home/$1/webdav$2;
198 autoindex on;
199
200 auth_basic "WebDAV user directory of $1";
201 auth_basic_user_file /home/$1/webdav.htpasswd;
202
203 client_body_temp_path /tmp/webdav.$1;
204 dav_methods PUT DELETE MKCOL COPY MOVE;
205 create_full_put_path on;
206 dav_access user:rw group:r all:r;
207 }
208 }
187 ''; 209 '';
188 }; 210 };
189} 211}
diff --git a/ymir.nix b/ymir.nix
index 0d7de78d..e940f8b6 100644
--- a/ymir.nix
+++ b/ymir.nix
@@ -14,10 +14,10 @@ let
14 }; 14 };
15 }; 15 };
16 myDomains = [ "dirty-haskell.org" "www.dirty-haskell.org" "lists.dirty-haskell.org" "l.dirty-haskell.org" 16 myDomains = [ "dirty-haskell.org" "www.dirty-haskell.org" "lists.dirty-haskell.org" "l.dirty-haskell.org"
17 "files.141.li" "f.141.li" "ymir.141.li" "141.li" "www.141.li" "lists.141.li" "l.141.li" "bragi.141.li" 17 "webdav.141.li" "files.141.li" "f.141.li" "ymir.141.li" "141.li" "www.141.li" "lists.141.li" "l.141.li" "bragi.141.li"
18 "ymir.xmpp.li" "xmpp.li" "www.xmpp.li" "lists.xmpp.li" "l.xmpp.li" "muc.xmpp.li" "proxy.xmpp.li" 18 "ymir.xmpp.li" "xmpp.li" "www.xmpp.li" "lists.xmpp.li" "l.xmpp.li" "muc.xmpp.li" "proxy.xmpp.li"
19 "files.yggdrasil.li" "f.yggdrasil.li" "ymir.yggdrasil.li" "git.yggdrasil.li" "www.yggdrasil.li" "yggdrasil.li" "lists.yggdrasil.li" "l.yggdrasil.li" "bragi.yggdrasil.li" 19 "webdav.yggdrasil.li" "files.yggdrasil.li" "f.yggdrasil.li" "ymir.yggdrasil.li" "git.yggdrasil.li" "www.yggdrasil.li" "yggdrasil.li" "lists.yggdrasil.li" "l.yggdrasil.li" "bragi.yggdrasil.li"
20 "files.praseodym.org" "f.praseodym.org" "ymir.praseodym.org" "praseodym.org" "www.praseodym.org" "lists.praseodym.org" "l.praseodym.org" 20 "webdav.praseodym.org" "files.praseodym.org" "f.praseodym.org" "ymir.praseodym.org" "praseodym.org" "www.praseodym.org" "lists.praseodym.org" "l.praseodym.org"
21 "git.rheperire.org" "api.rheperire.org" "www.rheperire.org" "rheperire.org" 21 "git.rheperire.org" "api.rheperire.org" "www.rheperire.org" "rheperire.org"
22 "ymir.kleen.li" "kleen.li" "www.kleen.li" 22 "ymir.kleen.li" "kleen.li" "www.kleen.li"
23 "ymir.nights.email" "nights.email" "www.nights.email" 23 "ymir.nights.email" "nights.email" "www.nights.email"
@@ -140,8 +140,7 @@ in rec {
140 firewall = { 140 firewall = {
141 enable = true; 141 enable = true;
142 allowPing = true; 142 allowPing = true;
143 allowedTCPPorts = [ 21 # ftp 143 allowedTCPPorts = [ 22 # ssh
144 22 # ssh
145 25 # smtp 144 25 # smtp
146 143 # imap 145 143 # imap
147 993 # imaps 146 993 # imaps
@@ -160,8 +159,6 @@ in rec {
160 allowedUDPPorts = [ 64738 # murmur 159 allowedUDPPorts = [ 64738 # murmur
161 53 # DNS 160 53 # DNS
162 ]; 161 ];
163 allowedTCPPortRanges = [ { from = 20000; to = 21000; } # ftp
164 ];
165 allowedUDPPortRanges = [ { from = 60000; to = 61000; } # mosh 162 allowedUDPPortRanges = [ { from = 60000; to = 61000; } # mosh
166 ]; 163 ];
167 }; 164 };
@@ -963,34 +960,4 @@ in rec {
963 systemd.status-mail = { 960 systemd.status-mail = {
964 onFailure = [ "nixos-upgrade" "postfix" "dovecot2" "prosody" "opendkim" "nsd" "unbound" "tinc.yggdrasil" "postsrsd" ]; 961 onFailure = [ "nixos-upgrade" "postfix" "dovecot2" "prosody" "opendkim" "nsd" "unbound" "tinc.yggdrasil" "postsrsd" ];
965 }; 962 };
966
967 services.vsftpd = {
968 enable = true;
969 forceLocalLoginsSSL = true;
970 forceLocalDataSSL = true;
971 localUsers = true;
972 writeEnable = true;
973 chrootlocalUser = true;
974 rsaKeyFile = "/var/lib/acme/yggdrasil.li/key.pem";
975 rsaCertFile = "/var/lib/acme/yggdrasil.li/fullchain.pem";
976 extraConfig = ''
977 pam_service_name=vsftpd
978
979 port_enable=no
980
981 pasv_enable=yes
982 pasv_max_port=21000
983 pasv_min_port=20000
984
985 allow_writeable_chroot=yes
986 '';
987 };
988
989 security.pam.services."vsftpd".text = ''
990 auth requisite pam_succeed_if.so user ingroup ftp
991
992 auth include ftp
993 account include ftp
994 session include ftp
995 '';
996} 963}