Skip to content

Commit c66ceda

Browse files
committed
feat: disable location configuration by default
1 parent dba1f82 commit c66ceda

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ if [[ "$*" == "/bin/bash /app/start.sh" ]]; then
167167
exit 1
168168
fi
169169
check_writable_directory '/etc/nginx/certs'
170-
check_writable_directory '/etc/nginx/vhost.d'
170+
parse_true "${ACME_HTTP_CHALLENGE_LOCATION:=false}" && check_writable_directory '/etc/nginx/vhost.d'
171171
check_writable_directory '/etc/acme.sh'
172172
check_writable_directory '/usr/share/nginx/html'
173-
[[ -f /app/letsencrypt_user_data ]] && check_writable_directory '/etc/nginx/conf.d'
173+
if [[ -f /app/letsencrypt_user_data ]]; then
174+
check_writable_directory '/etc/nginx/vhost.d'
175+
check_writable_directory '/etc/nginx/conf.d'
176+
fi
174177
check_default_cert_key
175178
check_dh_group
176179
reload_nginx

app/letsencrypt_service

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,10 @@ function update_cert {
348348
for domain in "${hosts_array[@]}"; do
349349
# Add all the domains to certificate
350350
params_issue_arr+=(--domain "$domain")
351-
# Add location configuration for the domain
352-
add_location_configuration "$domain" || reload_nginx
351+
# If enabled, add location configuration for the domain
352+
if parse_true "${ACME_HTTP_CHALLENGE_LOCATION:=false}"; then
353+
add_location_configuration "$domain" || reload_nginx
354+
fi
353355
done
354356

355357
params_issue_arr=("${params_base_arr[@]}" "${params_issue_arr[@]}")

0 commit comments

Comments
 (0)