I'm running a Drupal training course at work. For the exercises I've set up an Ubuntu Server VM (with Unity GUI) using VirtualBox. This allows me to port the VM around between my home workstation (with no proxy) and two work locations (each behind different proxies).
Since we work in French, the exercises make extensive use of translations for the various modules installed.
Drupal accesses the Internet from the server in the following different ways:
- drush downloads of modules
- drush pm-updates
- UI verification of module updates
- UI verification of translation updates (using l10n_update module)
- drush verification of translation updates (also using l10n, but with commands)
Every time I make a change to the VM in one location I have to update the proxy settings in the others, and I'm having great difficulty in working out how to do this. Proxy settings seem to be in three places:
- /etc/wgetrc - this changes the wget proxy settings, and it seems to work fine for drush dl and drush pm-update, but does not get taken into account by the UI or drush translation updates
in settings.php: here it seems to be possible to set them in either Drupal-7 format, like so:
$conf['proxy_server'] = '10.154.61.3'; $conf['proxy_port'] = 3128;
or in Drupal-8 format, like so:
$settings['http_client_config']['proxy']['http'] = '10.154.61.3:3128'; $settings['http_client_config']['proxy']['https'] = '10.154.61.3:3128'; $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost'];
You can also install a module called http_proxy, and this puts the settings directly into Drupal variables in the database (in the 'variable' table).
What's been bugging me is getting the proxy configuration changes to work. I get into situations where drush works for downloads and module updates but not for translation updates, and the UI doesn't work at all.
Of course, some of this is due to the imponderables of proxy settings (impossible to know what the settings are, and they change unpredictably - at one point for example I had to use the user agent settings).
But I have some questions I'm hoping someone might be able to answer:
- What operations exactly do drush dl, pm-update, l10n-update, and the UI equivalents use? Are there differences that might cause one to work and others not?
- Do both the D7 and the D8 formats in settings.php work?
- What is the difference between using settings.php and the variables in the database?
- How do the database variables get updated? Does the fact of changing them in settings.php also update the database?