diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d741e40..0000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2d58a4e..fd214ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,19 @@ variables: - IMAGE_NAME: thallian/dovecot-ldap + CONTAINER_NAME: thallian/dovecot build: - stage: build - script: - - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY - - docker build -t $IMAGE_NAME:$CI_COMMIT_SHA . - - docker build -t $IMAGE_NAME:$CI_COMMIT_REF_NAME . - - docker build -t $IMAGE_NAME:latest . - - docker push $IMAGE_NAME:$CI_COMMIT_SHA - - docker push $IMAGE_NAME:$CI_COMMIT_REF_NAME - - docker push $IMAGE_NAME:latest + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --cache=false + --context "$CI_PROJECT_DIR" + --dockerfile "$CI_PROJECT_DIR/Dockerfile" + --destination "$CONTAINER_NAME:$CI_COMMIT_SHA" + --destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME" + --destination "$CONTAINER_NAME:latest" diff --git a/Dockerfile b/Dockerfile index 17e2cfb..bc2508d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,15 +16,15 @@ RUN apk --no-cache add \ icu-dev \ inotify-tools-dev -ENV SHA256_SUM_DOVECOT=1c67ccccdc81a75007c01dedc02ad608c4d856c60a6b89b9cd246e79f72aa2b8 -ENV DOVECOT_FILENAME=dovecot-2.3.17.1.tar.gz +ENV SHA256_SUM_DOVECOT=06e73f668c6c093c45bdeeeb7c20398ab8dc49317234f4b5781ac5e2cc5d6c33 +ENV DOVECOT_FILENAME=dovecot-2.3.18.tar.gz RUN wget https://www.dovecot.org/releases/2.3/$DOVECOT_FILENAME RUN echo "$SHA256_SUM_DOVECOT $DOVECOT_FILENAME" | sha256sum -c - || exit 1 RUN mkdir /tmp/dovecot RUN tar xzf $DOVECOT_FILENAME -C /tmp/dovecot --strip 1 -ENV SHA256_SUM_PIGEONHOLE=3cc4a3de6d7e27bd99ac59b99faa161287f78167272699a22591798ffcf84512 -ENV PIGEONHOLE_FILENAME=dovecot-2.3-pigeonhole-0.5.17.1.tar.gz +ENV SHA256_SUM_PIGEONHOLE=a6d828f8d6f2decba5105343ece5c7a65245bd94e46a8ae4432a6d97543108a5 +ENV PIGEONHOLE_FILENAME=dovecot-2.3-pigeonhole-0.5.18.tar.gz RUN wget https://pigeonhole.dovecot.org/releases/2.3/$PIGEONHOLE_FILENAME RUN echo "$SHA256_SUM_PIGEONHOLE $PIGEONHOLE_FILENAME" | sha256sum -c - || exit 1 RUN mkdir /tmp/pigeonhole diff --git a/rootfs/etc/cont-init.d/02-sieve-rules b/rootfs/bin/sieve-rules similarity index 70% rename from rootfs/etc/cont-init.d/02-sieve-rules rename to rootfs/bin/sieve-rules index df0c4ad..d4d5a5f 100755 --- a/rootfs/etc/cont-init.d/02-sieve-rules +++ b/rootfs/bin/sieve-rules @@ -1,3 +1,3 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh s6-setuidgid vmail sievec /var/lib/vmail/sieve-after/spam.sieve diff --git a/rootfs/etc/fix-attrs.d/00-mails b/rootfs/etc/fix-attrs.d/00-mails deleted file mode 100644 index 777bfac..0000000 --- a/rootfs/etc/fix-attrs.d/00-mails +++ /dev/null @@ -1 +0,0 @@ -/var/lib/vmail/mail true vmail 0640 0750 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/dovecot/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/dovecot/dependencies new file mode 100644 index 0000000..226a375 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/dovecot/dependencies @@ -0,0 +1,2 @@ +confd +sieve-rules diff --git a/rootfs/etc/s6-overlay/s6-rc.d/dovecot/run b/rootfs/etc/s6-overlay/s6-rc.d/dovecot/run new file mode 100644 index 0000000..8aa95b4 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/dovecot/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec dovecot -F diff --git a/rootfs/etc/s6-overlay/s6-rc.d/dovecot/type b/rootfs/etc/s6-overlay/s6-rc.d/dovecot/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/dovecot/type @@ -0,0 +1 @@ +longrun diff --git a/rootfs/etc/s6-overlay/s6-rc.d/sieve-rules/type b/rootfs/etc/s6-overlay/s6-rc.d/sieve-rules/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/sieve-rules/type @@ -0,0 +1 @@ +oneshot diff --git a/rootfs/etc/s6-overlay/s6-rc.d/sieve-rules/up b/rootfs/etc/s6-overlay/s6-rc.d/sieve-rules/up new file mode 100644 index 0000000..b26ce36 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/sieve-rules/up @@ -0,0 +1 @@ +sieve-rules diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/dovecot b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/dovecot new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/services.d/dovecot/run b/rootfs/etc/services.d/dovecot/run deleted file mode 100644 index 15d56da..0000000 --- a/rootfs/etc/services.d/dovecot/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv sh - -exec dovecot -F