mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Populate the HTTP_PROXY_AUTH env var. Ticket #6949
This commit is contained in:
parent
bbe0c513c9
commit
1060378f42
@ -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'])) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user