This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/sh | ||
|
||
CRED_PATH=/etc/letsencrypt-inwx-cred | ||
CONFIG_PATH=/etc/letsencrypt-inwx.json | ||
|
||
if [ -f ~/.config/letsencrypt-inwx-cred ]; then | ||
CRED_PATH=~/.config/letsencrypt-inwx-cred | ||
CONFIG_PATH=~/.config/letsencrypt-inwx.json | ||
fi | ||
|
||
/usr/bin/letsencrypt-inwx create -c $CRED_PATH -d "_acme-challenge.$CERTBOT_DOMAIN" -v "$CERTBOT_VALIDATION" | ||
/usr/bin/letsencrypt-inwx create -c $CONFIG_PATH -d "_acme-challenge.$CERTBOT_DOMAIN" -v "$CERTBOT_VALIDATION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/sh | ||
|
||
CRED_PATH=/etc/letsencrypt-inwx-cred | ||
CONFIG_PATH=/etc/letsencrypt-inwx.json | ||
|
||
if [ -f ~/.config/letsencrypt-inwx-cred ]; then | ||
CRED_PATH=~/.config/letsencrypt-inwx-cred | ||
CONFIG_PATH=~/.config/letsencrypt-inwx.json | ||
fi | ||
|
||
/usr/bin/letsencrypt-inwx delete -c $CRED_PATH -d "_acme-challenge.$CERTBOT_DOMAIN" | ||
/usr/bin/letsencrypt-inwx delete -c $CONFIG_PATH -d "_acme-challenge.$CERTBOT_DOMAIN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
hasErrors=false | ||
CONF_CREATED=false | ||
|
||
if [ -z "$INWX_USER" ]; then | ||
echo "ERROR: Missing env-argument INWX_USER" | ||
hasErrors=true | ||
fi | ||
|
||
if [ -z "$INWX_PASSWD" ]; then | ||
echo "ERROR: Missing env-argument INWX_PASSWD" | ||
hasErrors=true | ||
fi | ||
|
||
if [ $hasErrors = true ]; then | ||
exit 1; | ||
fi | ||
|
||
cat << EOF > /etc/letsencrypt-inwx-cred | ||
$INWX_USER | ||
$INWX_PASSWD | ||
if [ ! -z "$INWX_USER" -a ! -z "$INWX_PASSWD" ]; then | ||
CONF_CREATED=true | ||
>&2 echo "\ | ||
!!! WARNING !!! | ||
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 | ||
{ | ||
"accounts": [{ | ||
"username": "$INWX_USER", | ||
"password": "$INWX_PASSWD" | ||
}] | ||
} | ||
EOF | ||
|
||
chmod 600 /etc/letsencrypt-inwx-cred | ||
chmod 600 /etc/letsencrypt-inwx.conf | ||
fi | ||
|
||
set -x | ||
certbot -n --agree-tos --server https://acme-v02.api.letsencrypt.org/directory $@ | ||
set +x | ||
|
||
rm /etc/letsencrypt-inwx-cred | ||
if [ $CONF_CREATED = true ]; then | ||
rm /etc/letsencrypt-inwx.conf | ||
fi |