diff --git a/.env.dist b/.env.dist index 1b70cacc..c29bbbac 100644 --- a/.env.dist +++ b/.env.dist @@ -48,6 +48,9 @@ EXPOSE_ADMIN=no # Use Letsencrypt to generate a TLS certificate (uncomment to enable) # ENABLE_CERTBOT=True +# Dav server implementation (value: radicale, none) +WEBDAV=none + ################################### # Mail settings ################################### diff --git a/docker-compose.yml.dist b/docker-compose.yml.dist index cd10b362..8b6ae76d 100644 --- a/docker-compose.yml.dist +++ b/docker-compose.yml.dist @@ -76,6 +76,14 @@ services: volumes: - "$ROOT/filter:/data" + webdav: + # build: $WEBDAV + image: mailu/$WEBDAV:$VERSION + restart: always + env_file: .env + volumes: + - "$ROOT/dav:/data" + admin: # build: admin image: mailu/admin:$VERSION diff --git a/nginx/nginx.conf b/nginx/nginx.conf index ec4db23f..0d57ca50 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -10,6 +10,7 @@ events { # Environment variables used in the configuration env WEBMAIL; +env WEBDAV; env EXPOSE_ADMIN; http { @@ -43,6 +44,7 @@ http { # Load Lua variables set_by_lua $webmail 'return os.getenv("WEBMAIL")'; + set_by_lua $webdav 'return os.getenv("WEBDAV")'; set_by_lua $expose_admin 'return os.getenv("EXPOSE_ADMIN")'; # Actual logic @@ -77,6 +79,16 @@ http { } } + location /webdav { + if ($webdav != none) { + proxy_pass http://webdav:5232; + } + + if ($webdav = none) { + return 403; + } + } + location /.well-known/acme-challenge { proxy_pass http://admin:8081; } diff --git a/radicale/Dockerfile b/radicale/Dockerfile new file mode 100644 index 00000000..6c666374 --- /dev/null +++ b/radicale/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:edge + +RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ + && apk add --update \ + radicale@testing \ + && rm -rf /var/cache/apk/* + +COPY radicale.conf /radicale.conf + +CMD radicale -f -S -C /radicale.conf diff --git a/radicale/radicale.conf b/radicale/radicale.conf new file mode 100644 index 00000000..0818c8f0 --- /dev/null +++ b/radicale/radicale.conf @@ -0,0 +1,32 @@ +[server] +hosts = 0.0.0.0:5232, [::]:5232 +daemon = False +ssl = False +dns_lookup = False +realm = Radicale - Password Required +base_prefix = /webdav/ + +[encoding] +request = utf-8 +stock = utf-8 + +[well-known] + +[auth] +type = IMAP +imap_hostname = imap +imap_port = 993 +imap_ssl = True + +[git] + +[rights] +type = owner_only + +[storage] +type = filesystem +filesystem_folder = /data + +[logging] + +[headers]