allow proxy env vars (#115)
This commit is contained in:
parent
91bf85a150
commit
745e98161b
|
|
@ -91,13 +91,17 @@ module DockerManager
|
||||||
raise Discourse::NotFound unless repo.present?
|
raise Discourse::NotFound unless repo.present?
|
||||||
script_path = File.expand_path(File.join(__dir__, '../../../scripts/docker_manager_upgrade.rb'))
|
script_path = File.expand_path(File.join(__dir__, '../../../scripts/docker_manager_upgrade.rb'))
|
||||||
|
|
||||||
pid = spawn(
|
env_vars = {
|
||||||
{
|
|
||||||
'UPGRADE_USER_ID' => current_user.id.to_s,
|
'UPGRADE_USER_ID' => current_user.id.to_s,
|
||||||
'UPGRADE_PATH' => params[:path].to_s,
|
'UPGRADE_PATH' => params[:path].to_s,
|
||||||
'UPGRADE_REPO_VERSION' => repo_version(repo).to_s,
|
'UPGRADE_REPO_VERSION' => repo_version(repo).to_s,
|
||||||
'RAILS_ENV' => Rails.env
|
'RAILS_ENV' => Rails.env
|
||||||
},
|
}
|
||||||
|
["http_proxy","https_proxy","no_proxy","HTTP_PROXY","HTTPS_PROXY","NO_PROXY"].each do |p|
|
||||||
|
env_vars[p] = ENV[p] if ! ENV[p].nil?
|
||||||
|
end
|
||||||
|
pid = spawn(
|
||||||
|
env_vars,
|
||||||
"bundle exec rails runner #{script_path}"
|
"bundle exec rails runner #{script_path}"
|
||||||
)
|
)
|
||||||
Process.detach(pid)
|
Process.detach(pid)
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,12 @@ class DockerManager::Upgrader
|
||||||
PATH
|
PATH
|
||||||
COMPRESS_BROTLI
|
COMPRESS_BROTLI
|
||||||
FORCE_S3_UPLOADS
|
FORCE_S3_UPLOADS
|
||||||
|
HTTP_PROXY
|
||||||
|
HTTPS_PROXY
|
||||||
|
NO_PROXY
|
||||||
|
http_proxy
|
||||||
|
https_proxy
|
||||||
|
no_proxy
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_env = Hash[*ENV.map { |k, v| [k, nil] }
|
clear_env = Hash[*ENV.map { |k, v| [k, nil] }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue