From 7568bb31689d6f9b3122fb242584d22464b59077 Mon Sep 17 00:00:00 2001 From: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:38:26 +0300 Subject: [PATCH 1/2] Fixed listing xslt template and removed auto_envsubst_on_include --- standalone_ubuntu_oss_install.sh | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/standalone_ubuntu_oss_install.sh b/standalone_ubuntu_oss_install.sh index 29f16ca8..eed6725a 100644 --- a/standalone_ubuntu_oss_install.sh +++ b/standalone_ubuntu_oss_install.sh @@ -256,31 +256,12 @@ auto_envsubst() { done } -auto_envsubst_on_include() { - local include_dir="/etc/nginx/include" - local suffix="${NGINX_ENVSUBST_TEMPLATE_SUFFIX:-.template}" - local filter="${NGINX_ENVSUBST_FILTER:-}" - - local template defined_envs relative_path output_path subdir - defined_envs=$(printf '${%s} ' $(env | cut -d= -f1)) - if [ ! -w "$include_dir" ]; then - echo "$ME: ERROR: $include_dir is not writable" - return 0 - fi - find "$include_dir" -follow -type f -name "*$suffix" -print | while read -r template; do - output_path="${template%$suffix}" - echo "$ME: Running envsubst on $template to $output_path" - envsubst "$defined_envs" < "$template" > "$output_path" - done -} - # Attempt to read DNS Resolvers from /etc/resolv.conf if [ -z ${DNS_RESOLVERS+x} ]; then export DNS_RESOLVERS="$(cat /etc/resolv.conf | grep nameserver | cut -d' ' -f2 | xargs)" fi auto_envsubst -auto_envsubst_on_include EOF chmod +x /usr/local/bin/template_nginx_config.sh @@ -375,7 +356,7 @@ http { } EOF -download "common/etc/nginx/include/listing.xsl.template" "/etc/nginx/include/listing.xsl.template" +download "common/etc/nginx/include/listing.xsl" "/etc/nginx/include/listing.xsl" download "common/etc/nginx/include/awscredentials.js" "/etc/nginx/include/awscredentials.js" download "common/etc/nginx/include/awssig2.js" "/etc/nginx/include/awssig2.js" download "common/etc/nginx/include/awssig4.js" "/etc/nginx/include/awssig4.js" From a1c7174046b4a01470cebbea1160a66f320a9c8d Mon Sep 17 00:00:00 2001 From: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:57:19 +0300 Subject: [PATCH 2/2] Added installation script running example --- docs/getting_started.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index b2ff0948..0c0239ee 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -106,7 +106,7 @@ extension. ## Running as a Systemd Service -A [install script](/standalone_ubuntu_oss_install.sh) for the gateway shows +An [install script](/standalone_ubuntu_oss_install.sh) for the gateway shows how to install NGINX from a package repository, checkout the gateway source, and configure it using the supplied environment variables. @@ -115,6 +115,11 @@ variables mentioned in the [configuration section](#configuration) into memory, and then execute the script. The script takes one optional parameter that specifies the name of the branch to download files from. +For example: +```shell-session +sudo env $(cat settings.example) ./standalone_ubuntu_oss_install.sh +``` + ## Running in Containers ### Running the Public Open Source NGINX Container Image