Skip to content

Commit

Permalink
bugfix in mod_ood_proxy and keep clean_nginx_env idempotent (#2570)
Browse files Browse the repository at this point in the history
bugfix in mod_ood_proxy and keep clean_nginx_env idempotent
  • Loading branch information
johrstrom authored Feb 16, 2023
1 parent b6cedd0 commit d9292c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod_ood_proxy/lib/ood/nginx_stage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function pun(r, bin, user, app_init_url, exports, pre_hook_root_cmd, allowed_hos
if pre_hook_root_cmd then
local env_table = exports_to_table(r, exports)
if allowed_hosts then
env_table["OOD_ALLOWED_HOSTS"] = allowed_hosts
-- capture2e_with_env will prefix OOD_
env_table["ALLOWED_HOSTS"] = allowed_hosts
end
cmd = cmd .. " -P '" .. r:escape(pre_hook_root_cmd) .. "'"
err = capture2e_with_env(cmd, env_table)
Expand Down
2 changes: 2 additions & 0 deletions nginx_stage/lib/nginx_stage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def self.clean_nginx_env(user:)
"RAILS_LOG_TO_STDOUT" => "true",
# name change here because only OOD_* from apache is allowed through sudo rules
"ALLOWED_HOSTS" => ENV['OOD_ALLOWED_HOSTS'],
# set the duplicate to keep clean_nginx_env impepodent
"OOD_ALLOWED_HOSTS" => ENV['OOD_ALLOWED_HOSTS'],
}.merge(pun_custom_env).merge(preserve_env_declarations.map { |k| [ k, ENV[k] ] }.to_h))
end

Expand Down

0 comments on commit d9292c1

Please sign in to comment.