diff --git a/Dockerfile b/Dockerfile index cb323ea..65f718a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,5 +7,6 @@ FROM certbot/certbot:rolling VOLUME /etc/letsencrypt COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/letsencrypt-inwx /usr/bin/ COPY etc/* /usr/lib/letsencrypt-inwx/ +RUN chmod +x /usr/lib/letsencrypt-inwx/* -ENTRYPOINT ["/bin/sh", "/usr/lib/letsencrypt-inwx/docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/usr/lib/letsencrypt-inwx/docker-entrypoint.sh"] diff --git a/etc/certbot-inwx-auth b/etc/certbot-inwx-auth index 11e2bc0..cb401dc 100755 --- a/etc/certbot-inwx-auth +++ b/etc/certbot-inwx-auth @@ -2,7 +2,7 @@ CONFIG_PATH=/etc/letsencrypt-inwx.json -if [ -f ~/.config/letsencrypt-inwx-cred ]; then +if [ -f ~/.config/letsencrypt-inwx.json ]; then CONFIG_PATH=~/.config/letsencrypt-inwx.json fi diff --git a/etc/certbot-inwx-cleanup b/etc/certbot-inwx-cleanup index cb4c280..7ef85a3 100755 --- a/etc/certbot-inwx-cleanup +++ b/etc/certbot-inwx-cleanup @@ -2,7 +2,7 @@ CONFIG_PATH=/etc/letsencrypt-inwx.json -if [ -f ~/.config/letsencrypt-inwx-cred ]; then +if [ -f ~/.config/letsencrypt-inwx.json ]; then CONFIG_PATH=~/.config/letsencrypt-inwx.json fi diff --git a/etc/docker-entrypoint.sh b/etc/docker-entrypoint.sh old mode 100644 new mode 100755 index 5865505..2a0aea4 --- a/etc/docker-entrypoint.sh +++ b/etc/docker-entrypoint.sh @@ -1,3 +1,5 @@ +#!/bin/sh + CONF_CREATED=false if [ ! -z "$INWX_USER" -a ! -z "$INWX_PASSWD" ]; then @@ -7,7 +9,7 @@ if [ ! -z "$INWX_USER" -a ! -z "$INWX_PASSWD" ]; then PASSING INWX_USER AND INWX_PASSWD AS ENV VARIABLES IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE! You should mount a config file into the container instead. See https://github.com/kegato/letsencrypt-inwx for details. " - cat << EOF > /etc/letsencrypt-inwx.conf + cat << EOF > /etc/letsencrypt-inwx.json { "accounts": [{ "username": "$INWX_USER", @@ -15,7 +17,7 @@ You should mount a config file into the container instead. See https://github.co }] } EOF - chmod 600 /etc/letsencrypt-inwx.conf + chmod 600 /etc/letsencrypt-inwx.json fi set -x @@ -23,5 +25,5 @@ certbot -n --agree-tos --server https://acme-v02.api.letsencrypt.org/directory $ set +x if [ $CONF_CREATED = true ]; then - rm /etc/letsencrypt-inwx.conf + rm /etc/letsencrypt-inwx.json fi