Have lego get certs for my external domain as well
This commit is contained in:
parent
3a90b097c8
commit
46fac59c3d
@ -51,8 +51,10 @@ cd ${NOMAD_TASK_DIR}
|
|||||||
echo "Read certs from nomad vars"
|
echo "Read certs from nomad vars"
|
||||||
${NOMAD_TASK_DIR}/nomad-var-dirsync-linux-{{ env "attr.cpu.arch" }} -root-var=secrets/certs read .
|
${NOMAD_TASK_DIR}/nomad-var-dirsync-linux-{{ env "attr.cpu.arch" }} -root-var=secrets/certs read .
|
||||||
|
|
||||||
|
function getcert() {
|
||||||
|
local domain=$1
|
||||||
action=run
|
action=run
|
||||||
if [ -f /.lego/certificates/_.thefij.rocks.crt ]; then
|
if [ -f "/.lego/certificates/_.$domain.crt" ]; then
|
||||||
action=renew
|
action=renew
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -60,10 +62,15 @@ echo "Attempt to $action certificates"
|
|||||||
${NOMAD_TASK_DIR}/lego \
|
${NOMAD_TASK_DIR}/lego \
|
||||||
--accept-tos --pem \
|
--accept-tos --pem \
|
||||||
--email=iamthefij@gmail.com \
|
--email=iamthefij@gmail.com \
|
||||||
--domains="*.thefij.rocks" \
|
--domains="*.$domain" \
|
||||||
--dns="cloudflare" \
|
--dns="cloudflare" \
|
||||||
$action \
|
$action \
|
||||||
--$action-hook="${NOMAD_TASK_DIR}/nomad-var-dirsync-linux-{{ env "attr.cpu.arch" }} -root-var=secrets/certs write .lego" \
|
--$action-hook="${NOMAD_TASK_DIR}/nomad-var-dirsync-linux-{{ env "attr.cpu.arch" }} -root-var=secrets/certs write .lego" \
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getcert "thefij.rocks"
|
||||||
|
getcert "iamthefij.com"
|
||||||
EOH
|
EOH
|
||||||
destination = "${NOMAD_TASK_DIR}/start.sh"
|
destination = "${NOMAD_TASK_DIR}/start.sh"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user