From 637b665b50803e94df9f5287838033dd5fa4b267 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 26 Jul 2022 16:47:45 +0200 Subject: [PATCH] new: [radicale] add new charm. Signed-off-by: Valentin Lab --- radicale/build/Dockerfile | 22 +++------------------- radicale/build/README | 7 ------- radicale/build/default.nix | 28 ---------------------------- radicale/hooks/init | 8 +++++--- 4 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 radicale/build/README delete mode 100644 radicale/build/default.nix diff --git a/radicale/build/Dockerfile b/radicale/build/Dockerfile index 4ebd74c..d1dfa17 100644 --- a/radicale/build/Dockerfile +++ b/radicale/build/Dockerfile @@ -1,21 +1,5 @@ -FROM debian:jessie +FROM alpine:3.15 -RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip --no-install-recommends && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* +RUN apk add radicale -RUN pip3 install --upgrade radicale - -## XXXvlab: TO REMOVE, Ugh, git is needed only to install radicale_auth_ldap -## XXXvlab: This should be installed only if we link to ldap -RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y git --no-install-recommends && \ - cd /tmp && git clone https://github.com/marcoh00/radicale-auth-ldap && \ - cd radicale-auth-ldap && python3 setup.py install && \ - cd .. && rm -rf radicale-auth-ldap && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - - -ENTRYPOINT [ "radicale" ] +ENTRYPOINT [ "radicale", "--storage-filesystem-folder=/var/lib/radicale/collections" ] diff --git a/radicale/build/README b/radicale/build/README deleted file mode 100644 index c687132..0000000 --- a/radicale/build/README +++ /dev/null @@ -1,7 +0,0 @@ -To use nix for building this image: - -nix-build . - -it'll give a file "result" that you can load in docker: - -docker load < result \ No newline at end of file diff --git a/radicale/build/default.nix b/radicale/build/default.nix deleted file mode 100644 index 320f219..0000000 --- a/radicale/build/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs ? import {} }: - -with pkgs; -let - # entrypoint = writeScript "entrypoint.sh" '' - # #!${stdenv.shell} - # set -e - # exec "$@" - # ''; -in -dockerTools.buildImage { - name = "radicale"; - runAsRoot = '' - #!${stdenv.shell} - ${dockerTools.shadowSetup} - ''; - - contents = [ radicale ]; - - config = { - # Cmd = [ "radicale" ]; - Entrypoint = [ "radicale" ]; - ExposedPorts = { - "6379/tcp" = {}; - }; - WorkingDir = "/data"; - }; -} \ No newline at end of file diff --git a/radicale/hooks/init b/radicale/hooks/init index d024dee..52c33f1 100755 --- a/radicale/hooks/init +++ b/radicale/hooks/init @@ -15,13 +15,15 @@ set -u service_def=$(get_compose_service_def "$SERVICE_NAME") -CONF="$SERVICE_CONFIGSTORE/etc/radicale/config" +CONFIG_PATH="/etc/radicale/config" +HOST_CONFIG_PATH="$SERVICE_CONFIGSTORE$CONFIG_PATH" config=$(echo "$service_def" | shyaml get-value options.config 2>/dev/null) || { die "Missing ${WHITE}config${NORMAL} option." } -file_put "$CONF" <