summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-12-31 22:08:20 +0200
committerPaul Buetow <paul@buetow.org>2023-12-31 22:08:20 +0200
commit5cd21aa26581553810f06dba9a5038153affe5d2 (patch)
treec992027f266015d59be53d3acbd94ed97f5e87cb
parent889194103729edf60f0ef45f176b1a4a8aeeb2ed (diff)
more on this
-rw-r--r--.gitignore2
-rw-r--r--Dockerfile7
-rw-r--r--Makefile13
-rw-r--r--config2
-rw-r--r--htpasswd-test1
5 files changed, 22 insertions, 3 deletions
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