From 5cd21aa26581553810f06dba9a5038153affe5d2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 31 Dec 2023 22:08:20 +0200 Subject: more on this --- .gitignore | 2 ++ Dockerfile | 7 +++++-- Makefile | 13 +++++++++++++ config | 2 +- htpasswd-test | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 htpasswd-test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df193c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +collections +auth diff --git a/Dockerfile b/Dockerfile index e5e5926..0947b78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,12 @@ RUN apk add --no-cache python3 py3-pip RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade radicale -RUN mkdir /config /collections /etc/radicale -RUN chown radicale /config /collections +RUN mkdir /auth /collections /etc/radicale +RUN chown radicale /collections COPY ./config /etc/radicale/config +COPY ./htpasswd-test /auth/htpasswd +RUN chown 700 /auth +RUN chown 600 /auth/htpasswd EXPOSE 5232 USER radicale diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..08c3b42 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +build: + docker build -t radicale . +run: + if [ ! -d collections ]; then mkdir collections; fi + if [ ! -d auth ]; then mkdir auth; fi + cp -v htpasswd-test auth/htpasswd + sh -c 'docker rm radicale; exit 0' + docker run \ + -v collections:/collections \ + -v auth:/auth \ + -p 5232:5232 \ + --name radicale radicale +br: build run diff --git a/config b/config index 3d1cfdd..af83bd2 100644 --- a/config +++ b/config @@ -4,7 +4,7 @@ hosts = 0.0.0.0:5232, [::]:5232 [auth] type = htpasswd -htpasswd_filename = /config/htpasswd +htpasswd_filename = /auth/htpasswd htpasswd_encryption = md5 [storage] diff --git a/htpasswd-test b/htpasswd-test new file mode 100644 index 0000000..3f9fef2 --- /dev/null +++ b/htpasswd-test @@ -0,0 +1 @@ +test:$apr1$8T5IfpRc$2KqMt1Zl2topMpMhitgYR1 -- cgit v1.2.3