Skip to content

Commit

Permalink
work in progress for idaholab#331, improvements to extracted_files_ht…
Browse files Browse the repository at this point in the history
…tp_server.py and the setting/creation of ACL rules on hedgehog
  • Loading branch information
mmguero committed Apr 1, 2024
1 parent 9a51ee4 commit 4a21efc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ http {
# extracted file download hedgehog redirect
location ~* ^/hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {
include /etc/nginx/nginx_auth_rt.conf;
include /etc/nginx/nginx_system_resolver.conf;
set $upstream $1:8006;
rewrite ^/hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $2 break;
proxy_pass https://$upstream;
Expand Down
1 change: 1 addition & 0 deletions nginx/nginx_readonly.conf
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ http {

# extracted file download hedgehog redirect
location ~* ^/hh-extracted-files/([a-zA-Z0-9-\.]+)\b(.*) {
include /etc/nginx/nginx_system_resolver.conf;
set $upstream $1:8006;
rewrite ^/hh-extracted-files/([a-zA-Z0-9-\.]+)(.*)$ $2 break;
proxy_pass https://$upstream;
Expand Down
9 changes: 9 additions & 0 deletions nginx/scripts/docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ NGINX_SSL_CONF=/etc/nginx/nginx_ssl_config.conf
# a blank file just to use as an "include" placeholder for the nginx's LDAP config when LDAP is not used
NGINX_BLANK_CONF=/etc/nginx/nginx_blank.conf

# "include" file for resolver directive
NGINX_RESOLVER_CONF=/etc/nginx/nginx_system_resolver.conf

# "include" file for auth_basic, prompt, and htpasswd location
NGINX_BASIC_AUTH_CONF=/etc/nginx/nginx_auth_basic.conf

Expand Down Expand Up @@ -287,6 +290,12 @@ for TEMPLATE in "$NGINX_TEMPLATES_DIR"/*.conf.template; do
DOLLAR=$ envsubst < "$TEMPLATE" > "$NGINX_CONFD_DIR/$(basename "$TEMPLATE"| sed 's/\.template$//')"
done

# put the DNS resolver (nameserver from /etc/resolv.conf) into NGINX_RESOLVER_CONF
DNS_SERVER="$(grep -i '^nameserver' /etc/resolv.conf | head -n1 | cut -d ' ' -f2)"
[[ -z "${DNS_SERVER:-}" ]] && DNS_SERVER="127.0.0.11"
export DNS_SERVER
echo "resolver ${DNS_SERVER};" > "${NGINX_RESOLVER_CONF}"

set -e

# insert some build and runtime information into the landing page
Expand Down

0 comments on commit 4a21efc

Please sign in to comment.