-
Notifications
You must be signed in to change notification settings - Fork 824
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
HTML volume required when using DNS challenge only #1159
Labels
kind/bug
Issue reporting a bug
Comments
@shawb5 good catch, thank you. Those check are in the entrypoint, and we have no easy way to know at the time when they're being made if the diff --git a/app/entrypoint.sh b/app/entrypoint.sh
index 00f1ef2..5d9bab7 100755
--- a/app/entrypoint.sh
+++ b/app/entrypoint.sh
@@ -27,7 +27,7 @@ function check_docker_socket {
fi
}
-function check_writable_directory {
+function check_dir_is_mounted_volume {
local dir="$1"
if [[ $(get_self_cid) ]]; then
if ! docker_api "/containers/$(get_self_cid)/json" | jq ".Mounts[].Destination" | grep -q "^\"$dir\"$"; then
@@ -36,6 +36,13 @@ function check_writable_directory {
else
echo "Warning: can't check if '$dir' is a mounted volume without self container ID."
fi
+}
+
+function check_writable_directory {
+ local dir="$1"
+
+ check_dir_is_mounted_volume "$dir"
+
if [[ ! -d "$dir" ]]; then
echo "Error: can't access to '$dir' directory !" >&2
echo "Check that '$dir' directory is declared as a writable volume." >&2
@@ -49,6 +56,18 @@ function check_writable_directory {
rm -f "$dir/.check_writable"
}
+function warn_html_directory {
+ local dir='/usr/share/nginx/html'
+
+ check_dir_is_mounted_volume "$dir"
+
+ if [[ ! -d "$dir" ]] || ! touch "$dir/.check_writable" 2>/dev/null; then
+ echo "Warning: can't access or write to '$dir' directory. This will prevent HTML-01 challenges from working correctly."
+ echo "If you are only using DNS-01 challenges, you can ignore this warning, otherwise check that '$dir' is declared as a writable volume."
+ fi
+ rm -f "$dir/.check_writable"
+}
+
function check_dh_group {
# DH params will be supplied for acme-companion here:
local DHPARAM_FILE='/etc/nginx/certs/dhparam.pem'
@@ -176,7 +195,7 @@ if [[ "$*" == "/bin/bash /app/start.sh" ]]; then
check_writable_directory '/etc/nginx/certs'
parse_true "${ACME_HTTP_CHALLENGE_LOCATION:=false}" && check_writable_directory '/etc/nginx/vhost.d'
check_writable_directory '/etc/acme.sh'
- check_writable_directory '/usr/share/nginx/html'
+ warn_html_directory
if [[ -f /app/letsencrypt_user_data ]]; then
check_writable_directory '/etc/nginx/vhost.d'
check_writable_directory '/etc/nginx/conf.d'
Could you give the |
@buchdag Thanks, this appears to be working now without the html volume |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
In contrevention to the documentation, acme-companion requires html volume to be mounted even if only DNS-01 challenge is used. Creating the html volume and mount resolves the issue.
acme-companion image version
nginx-proxy's Docker configuration
rendered nginx configuration
Containers logs
acme-companion
nginx-proxy
Docker host
The text was updated successfully, but these errors were encountered: