-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sebastian Sonne
committed
Aug 7, 2024
1 parent
50a389e
commit 937dd17
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
FROM alpine | ||
|
||
RUN apk add nginx nginx-mod-http-dav-ext shadow tzdata | ||
RUN apk add nginx nginx-mod-http-dav-ext shadow tzdata curl | ||
RUN mkdir /etc/nginx/htpasswd | ||
|
||
COPY ./dav.sh /dav.sh | ||
|
||
VOLUME /dav | ||
EXPOSE 80 | ||
|
||
HEALTHCHECK CMD [ "curl", "-fs", "http://localhost" ] | ||
|
||
CMD /dav.sh && nginx -g "daemon off;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## usage | ||
|
||
The image supports setting your UID and GID (to an extent, system-IDs are protected) and timezone. | ||
|
||
You can create as many webdav shares as you want, the script checks the environment variables for anything beginning with DAV_, if it's empty, creates a share without authorization, if it contains a string, that's used for htpasswd. $-symbols need to be escaped with another $. | ||
|
||
For environment variables beginning with DAV_, the rest of the string is used to: | ||
|
||
* Create /dav/<sharename> | ||
* Create nginx-location /<sharename>, including authentication if chosen | ||
|
||
By default, the container blocks localhost/ and returns a 204. This can be turned into a share by setting `DAV_root_enable`, as well as `DAV_root_name` if you want to name it anything other than `root` (only relevant for storage). If you want to enable authentication, use `DAV_root_auth`. | ||
|
||
## docker-compose | ||
```yaml | ||
services: | ||
webdav: | ||
build: https://github.com/du5tball/docker-webdav.git#main | ||
ports: | ||
- 9000:80 | ||
volumes: | ||
- webdav:/dav | ||
environment: | ||
- PUID=1000 | ||
- PGID=1000 | ||
- TZ=Europe/Berlin | ||
- DAV_public="" | ||
- DAV_private=user:$$apr1$$QP3iuIwL$$jVUes5S3Mf4NHDnOW28Lr1 # user / password | ||
- DAV_root_enable="" | ||
- DAV_root_name=steve | ||
- DAV_root_auth=admin:$$apr1$$5KAARrpl$$TlHIXRceiZjH0LoKD9616. # admin / pass | ||
volumes: | ||
webdav: {} | ||
``` |