Add a dav server, related to #68

master
Pierre Jaury 8 years ago
parent ab06365f09
commit fa912e7889

@ -48,6 +48,9 @@ EXPOSE_ADMIN=no
# Use Letsencrypt to generate a TLS certificate (uncomment to enable) # Use Letsencrypt to generate a TLS certificate (uncomment to enable)
# ENABLE_CERTBOT=True # ENABLE_CERTBOT=True
# Dav server implementation (value: radicale, none)
WEBDAV=none
################################### ###################################
# Mail settings # Mail settings
################################### ###################################

@ -76,6 +76,14 @@ services:
volumes: volumes:
- "$ROOT/filter:/data" - "$ROOT/filter:/data"
webdav:
# build: $WEBDAV
image: mailu/$WEBDAV:$VERSION
restart: always
env_file: .env
volumes:
- "$ROOT/dav:/data"
admin: admin:
# build: admin # build: admin
image: mailu/admin:$VERSION image: mailu/admin:$VERSION

@ -10,6 +10,7 @@ events {
# Environment variables used in the configuration # Environment variables used in the configuration
env WEBMAIL; env WEBMAIL;
env WEBDAV;
env EXPOSE_ADMIN; env EXPOSE_ADMIN;
http { http {
@ -43,6 +44,7 @@ http {
# Load Lua variables # Load Lua variables
set_by_lua $webmail 'return os.getenv("WEBMAIL")'; 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")'; set_by_lua $expose_admin 'return os.getenv("EXPOSE_ADMIN")';
# Actual logic # 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 { location /.well-known/acme-challenge {
proxy_pass http://admin:8081; proxy_pass http://admin:8081;
} }

@ -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

@ -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]
Loading…
Cancel
Save