@ -10,6 +10,13 @@
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service
aimport remainder_args
case "${remainder_args[@]:0:2}" in
"crt info"|"crt list")
exit 0
;;
esac
. lib/common || exit 1
. lib/common || exit 1
set -e
set -e
@ -46,26 +53,20 @@ if environment_def="$(printf "%s" "$service_def" | shyaml -y get-value options.e
config+=$(echo -en "\n LEXICON_PROVIDER: $provider")
config+=$(echo -en "\n LEXICON_PROVIDER: $provider")
fi
fi
if ! challenge_type=$(printf "%s" "$service_def" | shyaml get-value "options.challenge-type" 2>/dev/null); then
if ! challenge_type=$(printf "%s" "$service_def" | shyaml get-value "options.challenge-type" 2>/dev/null); then
warn "No ${WHITE}challenge-type${NORMAL} provided, defaulting to 'http'."
warn "No ${WHITE}challenge-type${NORMAL} provided, defaulting to 'http'."
challenge_type=http
challenge_type=http
fi
fi
config+=$(echo -en "\n CHALLENGE_TYPE: $challenge_type")
config+=$(echo -en "\n CHALLENGE_TYPE: $challenge_type")
aimport remainder_args
if [ "$challenge_type" == "http" ] &&
[ "${remainder_args[0]}" == "crt" ] &&
[ "${remainder_args[1]}" == "create" ] &&
! [ -d "$SERVICE_DATASTORE/etc/letsencrypt/live/${remainder_args[2]}" ]; then
if will_need_http_access ;then
while read container_id; do
while read container_id; do
info "Attempting to clear port 80 by stopping $container_id"
docker stop -t 5 "$container_id"
docker stop -t 5 "$container_id"
done < <(docker ps \
done < <(docker ps \
--filter label="compose.project=$PROJECT_NAME" \
--filter publish=80 \
--format "{{.ID}}"
--filter label="compose.project=$PROJECT_NAME" \
--filter publish=80 \
--format "{{.ID}}"
)
)
config+=$(echo -en "\n ports:
config+=$(echo -en "\n ports:
- \"0.0.0.0:80:80\"")
- \"0.0.0.0:80:80\"")