Browse Source

radicale from alpine/edge/testing + bcrypt dependencies; sample config & htpasswd; docker-compose.yml

Fabian Peter Hammerle 4 years ago
commit
657f2fd17b
5 changed files with 108 additions and 0 deletions
  1. 26 0
      Dockerfile
  2. 52 0
      README.md
  3. 11 0
      config
  4. 17 0
      docker-compose.yml
  5. 2 0
      htpasswd

+ 26 - 0
Dockerfile

@@ -0,0 +1,26 @@
+FROM alpine:3.10
+
+# storage hooks
+RUN apk add --no-cache git
+
+# py3-passlib & py3-bcrypt required for htpasswd_encryption=bcrypt
+# https://github.com/pyca/bcrypt/
+# > from bcrypt import _bcrypt
+# > ModuleNotFoundError: No module named '_cffi_backend'
+RUN apk add --no-cache py3-bcrypt py3-cffi
+
+ARG REPOSITORY=http://dl-cdn.alpinelinux.org/alpine/edge/testing
+RUN apk add --repository=$REPOSITORY --no-cache radicale py3-passlib
+
+ENV COLLECTIONS_PATH=/var/lib/radicale/collections
+RUN mkdir "$COLLECTIONS_PATH" && chown radicale "$COLLECTIONS_PATH"
+VOLUME $COLLECTIONS_PATH
+
+ENV CONFIG_PATH=/etc/radicale/config
+
+USER radicale
+EXPOSE 5232/tcp
+CMD radicale --server-hosts=0.0.0.0:5232 \
+    --config="$CONFIG_PATH" \
+    --storage-filesystem-folder="$COLLECTIONS_PATH" \
+    --debug --logging-mask-passwords

+ 52 - 0
README.md

@@ -0,0 +1,52 @@
+# Radicale 🐳
+
+CalDAV (calendars, todo-lists) and CardDAV (contacts) server
+
+https://radicale.org/
+
+## Setup
+
+1. Create config ( https://radicale.org/configuration/ )
+
+   Example:
+   ```
+   [auth]
+   type = htpasswd
+   htpasswd_filename = /etc/radicale/htpasswd
+   htpasswd_encryption = bcrypt
+
+   [rights]
+   type = authenticated
+   ```
+
+2. Store credentials
+   ```sh
+   htpasswd -cB htpasswd alice
+   htpasswd -B htpasswd bob
+   ```
+
+3. Test config
+   ```sh
+   docker run --rm \
+       -v $PWD/config:/etc/radicale/config \
+       -v $PWD/htpasswd:/etc/radicale/htpasswd \
+       -p 5232:5232 fphammerle/radicale
+   ```
+
+4. Start daemon
+   ```sh
+   docker run --name radicale \
+       -v $PWD/config:/etc/radicale/config:ro \
+       -v $PWD/htpasswd:/etc/radicale/htpasswd:ro \
+       -v radicale-collections:/var/lib/radicale/collections:rw \
+       --detach --restart unless-stopped \
+       -p 5232:5232 \
+       fphammerle/radicale
+   ```
+
+## Docker Compose 🐙
+
+1. `git clone https://github.com/fphammerle/docker-radicale`
+2. `cd docker-radicale`
+3. Adapt mount points in [docker-compose.yml](docker-compose.yml)
+4. `docker-compose up`

+ 11 - 0
config

@@ -0,0 +1,11 @@
+[auth]
+type = htpasswd
+htpasswd_filename = /etc/radicale/htpasswd
+htpasswd_encryption = bcrypt
+
+[rights]
+type = authenticated
+
+[logging]
+# debug = true
+debug = false

+ 17 - 0
docker-compose.yml

@@ -0,0 +1,17 @@
+version: '2'
+
+volumes:
+  config:
+  collections:
+
+services:
+  radicale:
+    build: .
+    image: fphammerle/radicale
+    volumes:
+    - config:/etc/radicale:ro
+    - collections:/var/lib/radicale/collections:rw
+    ports: ['0.0.0.0:5232:5232']
+    restart: unless-stopped
+
+# https://docs.docker.com/compose/compose-file/compose-file-v2/

+ 2 - 0
htpasswd

@@ -0,0 +1,2 @@
+alice:$2y$05$tVh.YaZakbjuKZX1U2dCL.pLGEmVEaEN0eoQwsIGh/MvhLLA88LLi
+bob:$2y$05$xJO9xjaFqTd4VvuYgYCkZuX3GS9Ql2o57kno0D/lA6e4eksrKKTIC