Populate the HTTP_PROXY_AUTH env var. Ticket #6949

This commit is contained in:
jim-p 2016-12-07 13:55:39 -05:00
parent bbe0c513c9
commit 1060378f42
4 changed files with 22 additions and 0 deletions

View File

@ -91,6 +91,10 @@ function pkg_env($extra_env = array()) {
$http_proxy .= ':' . $config['system']['proxyport'];
}
$pkg_env_vars['HTTP_PROXY'] = $http_proxy;
if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) {
$pkg_env_vars['HTTP_PROXY_AUTH'] = "basic:*:{$config['system']['proxyuser']}:{$config['system']['proxypass']}";
}
}
if (isset($config['system']['use_mfs_tmpvar'])) {

View File

@ -2683,6 +2683,10 @@ function configure_cron() {
$http_proxy .= ':' . $config['system']['proxyport'];
}
$crontab_contents .= "HTTP_PROXY={$http_proxy}";
if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) {
$crontab_contents .= "HTTP_PROXY_AUTH=basic:*:{$config['system']['proxyuser']}:{$config['system']['proxypass']}";
}
}
foreach ($config['cron']['item'] as $item) {

View File

@ -25,6 +25,12 @@ if [ "${HTTP_PROXY}" != "" ]; then
fi
export HTTP_PROXY
fi
HTTP_PROXY_AUTH_USER=`/usr/local/sbin/read_xml_tag.sh string system/proxyuser`
HTTP_PROXY_AUTH_PASS=`/usr/local/sbin/read_xml_tag.sh string system/proxypass`
if [ "${HTTP_PROXY_AUTH_USER}" != "" ] && [ "${HTTP_PROXY_AUTH_PASS}" != "" ]; then
HTTP_PROXY_AUTH="basic:*:${HTTP_PROXY_AUTH_USER}:${HTTP_PROXY_AUTH_PASS}"
export HTTP_PROXY_AUTH
fi
# Detect interactive logins and display the shell
unset _interactive

View File

@ -47,3 +47,11 @@ if (${http_proxy} != "") then
endif
setenv HTTP_PROXY ${http_proxy}
endif
set http_proxy_auth_user=`/usr/local/sbin/read_xml_tag.sh string system/proxyuser`
set http_proxy_auth_pass=`/usr/local/sbin/read_xml_tag.sh string system/proxypass`
if ( ${http_proxy_auth_user} != "" && ${http_proxy_auth_pass} != "" ) then
set http_proxy_auth="basic:*:${http_proxy_auth_user}:${http_proxy_auth_pass}"
setenv HTTP_PROXY_AUTH "${http_proxy_auth}"
endif