summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-12-06 15:34:06 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-12-06 15:34:06 +0100
commitd1b8c94b7cb2e598643c742c222ac50d5917b562 (patch)
tree873a432b7447556110aefc8821b9e258975ec4fe
parentf27fdaaa6b5e57ae763b76a8ac6e55fed3bcb2a4 (diff)
downloadnixos-d1b8c94b7cb2e598643c742c222ac50d5917b562.tar
nixos-d1b8c94b7cb2e598643c742c222ac50d5917b562.tar.gz
nixos-d1b8c94b7cb2e598643c742c222ac50d5917b562.tar.bz2
nixos-d1b8c94b7cb2e598643c742c222ac50d5917b562.tar.xz
nixos-d1b8c94b7cb2e598643c742c222ac50d5917b562.zip
FTP over WebDAV
-rw-r--r--custom/ymir-nginx.nix35
-rw-r--r--ymir.nix16
2 files changed, 41 insertions, 10 deletions
diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix
index a1de81c3..dcee84fa 100644
--- a/custom/ymir-nginx.nix
+++ b/custom/ymir-nginx.nix
@@ -175,8 +175,6 @@ in {
175 listen [::]:443 ssl; 175 listen [::]:443 ssl;
176 server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$; 176 server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$;
177 177
178 include ${acme};
179
180 location / { 178 location / {
181 auth_basic "Reverse proxy to bragi"; 179 auth_basic "Reverse proxy to bragi";
182 auth_basic_user_file /srv/www/bragi/htpasswd; 180 auth_basic_user_file /srv/www/bragi/htpasswd;
@@ -184,6 +182,39 @@ in {
184 proxy_pass http://bragi.asgard.yggdrasil/; 182 proxy_pass http://bragi.asgard.yggdrasil/;
185 } 183 }
186 } 184 }
185
186 server {
187 listen *:80;
188 listen [::]:80;
189 server_name ~^ftp\.(yggdrasil\.li|141\.li|praseodym\.org)$;
190
191 include ${acme};
192
193 location / {
194 return 301 https://$host$request_uri;
195 }
196 }
197
198 server {
199 listen *:443 ssl;
200 listen [::]:443 ssl;
201
202 server_name ~^ftp\.(yggdrasil\.li|141\.li|praseodym\.org)$;
203
204 client_body_temp_path /tmp/webdav;
205
206 location / {
207 root /srv/ftp/$remote_user;
208 autoindex on;
209
210 auth_basic "FTP over WebDAV";
211 auth_basic_user_file /srv/ftp.htpasswd;
212
213 dav_methods PUT DELETE MKCOL COPY MOVE;
214 create_full_put_path on;
215 dav_access user:rw group:r all:r;
216 }
217 }
187 ''; 218 '';
188 }; 219 };
189} 220}
diff --git a/ymir.nix b/ymir.nix
index 3eb10d10..e73ae546 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 "ftp.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 "ftp.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 "ftp.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"
@@ -979,17 +979,17 @@ in rec {
979 979
980 services.vsftpd = { 980 services.vsftpd = {
981 enable = true; 981 enable = true;
982 # forceLocalLoginsSSL = true; 982 forceLocalLoginsSSL = true;
983 # forceLocalDataSSL = true; 983 forceLocalDataSSL = true;
984 localUsers = true; 984 localUsers = true;
985 writeEnable = true; 985 writeEnable = true;
986 chrootlocalUser = true; 986 chrootlocalUser = true;
987 # rsaKeyFile = "/var/lib/acme/yggdrasil.li/key.pem"; 987 rsaKeyFile = "/var/lib/acme/yggdrasil.li/key.pem";
988 # rsaCertFile = "/var/lib/acme/yggdrasil.li/fullchain.pem"; 988 rsaCertFile = "/var/lib/acme/yggdrasil.li/fullchain.pem";
989 extraConfig = '' 989 extraConfig = ''
990 local_umask=022 990 local_umask=022
991 991
992 log_ftp_protocol=YES 992 log_ftp_protocol=NO
993 xferlog_enable=YES 993 xferlog_enable=YES
994 994
995 pam_service_name=vsftpd 995 pam_service_name=vsftpd