Commit 457deb37 authored by Valian's avatar Valian
Browse files

added and user variable in snippets #32

parent 8f7f54b8
FROM openresty/openresty:alpine-fat FROM openresty/openresty:alpine-fat
# allowed domains should be lua match pattern # allowed domains should be lua match pattern
ENV DIFFIE_HELLMAN='' ALLOWED_DOMAINS='.*' AUTO_SSL_VERSION='0.13.1' FORCE_HTTPS='true' SITES='' LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' ENV DIFFIE_HELLMAN='' \
ALLOWED_DOMAINS='.*' \
AUTO_SSL_VERSION='0.13.1' \
FORCE_HTTPS='true' \
SITES='' \
LETSENCRYPT_URL='https://acme-v02.api.letsencrypt.org/directory' \
RESOLVER_ADDRESS='8.8.8.8'
# Here we install open resty and generate dhparam.pem file. # Here we install open resty and generate dhparam.pem file.
# You can specify DIFFIE_HELLMAN=true to force regeneration of that file on first run # You can specify DIFFIE_HELLMAN=true to force regeneration of that file on first run
......
...@@ -58,8 +58,8 @@ if [ "$FORCE_HTTPS" == "true" ]; then ...@@ -58,8 +58,8 @@ if [ "$FORCE_HTTPS" == "true" ]; then
fi fi
# let's substitute $ALLOWED_DOMAINS and $LETSENCRYPT_URL into OpenResty configuration # let's substitute $ALLOWED_DOMAINS, $LETSENCRYPT_URL and $RESOLVER_ADDRESS into OpenResty configuration
envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL' \ envsubst '$ALLOWED_DOMAINS,$LETSENCRYPT_URL,$RESOLVER_ADDRESS' \
< ${RESTY_CONF_DIR}/resty-http.conf \ < ${RESTY_CONF_DIR}/resty-http.conf \
> ${RESTY_CONF_DIR}/resty-http.conf.copy \ > ${RESTY_CONF_DIR}/resty-http.conf.copy \
&& mv ${RESTY_CONF_DIR}/resty-http.conf.copy ${RESTY_CONF_DIR}/resty-http.conf && mv ${RESTY_CONF_DIR}/resty-http.conf.copy ${RESTY_CONF_DIR}/resty-http.conf
......
...@@ -14,7 +14,7 @@ lua_shared_dict auto_ssl_settings 64k; ...@@ -14,7 +14,7 @@ lua_shared_dict auto_ssl_settings 64k;
# default DNS servers, which can be found in /etc/resolv.conf. If your network # default DNS servers, which can be found in /etc/resolv.conf. If your network
# is not IPv6 compatible, you may wish to disable IPv6 results by using the # is not IPv6 compatible, you may wish to disable IPv6 results by using the
# "ipv6=off" flag (like "resolver 8.8.8.8 ipv6=off"). # "ipv6=off" flag (like "resolver 8.8.8.8 ipv6=off").
resolver 8.8.8.8; resolver $RESOLVER_ADDRESS;
# Initial setup tasks. # Initial setup tasks.
init_by_lua_block { init_by_lua_block {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment