This repository was archived by the owner on Sep 20, 2023. It is now read-only.
File tree 4 files changed +61
-0
lines changed
4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM ubuntu:trusty
2
+
3
+ RUN apt-get update && apt-get install -y nginx nginx-extras apache2-utils
4
+
5
+ ENV USERNAME="" PASSWORD=""
6
+
7
+ VOLUME /media
8
+ COPY webdav.conf /etc/nginx/conf.d/default.conf
9
+ RUN rm /etc/nginx/sites-enabled/*
10
+
11
+ COPY entrypoint.sh /
12
+ RUN chmod +x entrypoint.sh
13
+ CMD /entrypoint.sh && nginx -g "daemon off;"
Original file line number Diff line number Diff line change
1
+ version : ' 2'
2
+ services :
3
+ webdav :
4
+ build : .
5
+ ports :
6
+ - " 80:80"
7
+ volumes :
8
+ - " /mnt:/media"
9
+ environment :
10
+ USERNAME : user
11
+ PASSWORD : passwd
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [[ -n " $USERNAME " ]] && [[ -n " $PASSWORD " ]]
4
+ then
5
+ htpasswd -bc /etc/nginx/htpasswd $USERNAME $PASSWORD
6
+ echo Done.
7
+ else
8
+ echo Using no auth.
9
+ sed -i ' s%auth_basic "Restricted";% %g' /etc/nginx/conf.d/default.conf
10
+ sed -i ' s%auth_basic_user_file htpasswd;% %g' /etc/nginx/conf.d/default.conf
11
+ fi
Original file line number Diff line number Diff line change
1
+
2
+ server {
3
+ listen 80;
4
+
5
+ access_log /dev/stdout;
6
+ error_log /dev/stdout info;
7
+
8
+ client_max_body_size 0;
9
+
10
+ location / {
11
+ create_full_put_path on;
12
+ autoindex on;
13
+ autoindex_exact_size off;
14
+ autoindex_localtime on;
15
+ charset utf-8;
16
+
17
+ dav_methods PUT DELETE MKCOL COPY MOVE;
18
+ dav_ext_methods PROPFIND OPTIONS;
19
+ dav_access user:rw group:rw all:rw;
20
+
21
+ auth_basic "Restricted";
22
+ auth_basic_user_file /etc/nginx/htpasswd;
23
+
24
+ root /media/;
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments