Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use full ca chain + register an email address. #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN echo "**** install OpenSSL ****" && \
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
\
echo "**** install pip ****" && \
rm /usr/lib/python*/EXTERNALLY-MANAGED && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --no-cache --upgrade pip setuptools wheel && \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ When this Docker image is updated and you want to start using it, or if you want
## Required Variables

* DOMAIN_NAME
* EMAIL_ADDRESS
* LINODE_CLI_TOKEN
* NODEBALANCER_ID
* CONFIG_ID
Expand Down
19 changes: 17 additions & 2 deletions serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ then
exit 1
fi;

# If we don't have an EMAIL_ADDRESS set, complain and exit
if [ -z "$EMAIL_ADDRESS" ];
then
echo "Error: EMAIL_ADDRESS variable not set."
exit 1
fi;

# If we don't have a LINODE_CLI_TOKEN set, complain and exit
if [ -z "$LINODE_CLI_TOKEN" ];
then
Expand All @@ -35,7 +42,7 @@ fi;

export NODEBALANCER_LABEL=`linode-cli nodebalancers view $NODEBALANCER_ID --text --no-headers --format label`

if [-z "$NODEBALANCER_LABEL" ];
if [ -z "$NODEBALANCER_LABEL" ];
then
echo Bad NODEBALANCER_ID $NODEBALANCER_ID
exit 1
Expand Down Expand Up @@ -100,14 +107,22 @@ fi;
# Start the web server in the background
nginx

# register email address
$ACME --config-home /data \
--register-account -m $EMAIL_ADDRESS --server zerossl

# use zerossl by default
$ACME --config-home /data \
--set-default-ca --server zerossl

# Run the cert for the given domain using nginx
$ACME --config-home /data \
--issue -d $DOMAIN_NAME \
-w /usr/share/nginx/html \
--reloadcmd "/install_cert.sh" \
--pre-hook "rm $OK_FILE || true" \
$NOTIFY_HOOK \
--cert-file /data/cert.pem \
--fullchain-file /data/cert.pem \
--key-file /data/key.pem \
--force

Expand Down