Skip to content

Commit

Permalink
Merge pull request #624 from nextcloud/enh/add-webdav
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jan 31, 2024
2 parents bd5dd12 + 3dd2fe1 commit 7169f70
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webdav-apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM httpd:alpine

# Create webdav directory
RUN mkdir -p /usr/local/apache2/webdav; chown www-data /usr/local/apache2/webdav
# Copy config
COPY ./webdav.conf /usr/local/apache2/conf/webdav.conf
# Add password file
RUN /usr/local/apache2/bin/htpasswd -cb /usr/local/apache2/webdav.password test pass
RUN chown root:www-data /usr/local/apache2/webdav.password
RUN chmod 640 /usr/local/apache2/webdav.password
# Enable config
RUN echo "Include conf/webdav.conf" >> /usr/local/apache2/conf/httpd.conf
19 changes: 19 additions & 0 deletions webdav-apache/webdav.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so

Alias /webdav /usr/local/apache2/webdav

<Location /webdav/>
DAV on
Options +Indexes
AuthType Basic
AuthName "webdav"
AuthUserFile /usr/local/apache2/webdav.password
Require valid-user
</Location>

<Directory /usr/local/apache2/webdav>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

0 comments on commit 7169f70

Please sign in to comment.