Page MenuHomePhabricator

Secure login notice on new vagrant install
Closed, ResolvedPublic


After creating new Vagrant install, I get this on each wiki:

Notice: Secure login was enabled on a server that only supports HTTP or
HTTPS. Disabling secure login. [Called from require_once in
/vagrant/mediawiki/includes/Setup.php at line 680] in
/vagrant/mediawiki/includes/debug/MWDebug.php on line 309

when going to e.g.
Roles enabled:


Event Timeline

Smalyshev triaged this task as Medium priority.Dec 19 2017, 10:31 PM
Smalyshev created this task.

$wgSecureLogin is set by the https role which also tries to override $wgServer to be protocol-relative (apparently unsuccessfully). The code block to debug is the one with the $mwvSupportsHttps condition in puppet/modules/mediawiki/templates/multiwiki/CommonSettings.php.erb / /vagrant/settings.d/wikis/CommonSettings.php.

If I dump $wgServer at includes/Setup.php:610 it is It turns out that the block in settings.d/wikis/CommonSettings.php which is trying to mutate $wgServer based on the state of $mwvSupportsHttps is before the block where settings.d/puppet-managed/01-Vagrant-HTTPS-support-flag.php actually sets the flag.

Sort of strangely, things look to be correct with eval.php:

$ mwscript eval.php --wiki=wiki
> echo $wgServer;
> var_dump($wgSecureLogin);
/vagrant/mediawiki/maintenance/eval.php(78) : eval()'d code:1:


The part that makes this strange is that the block in question from settings.d/wikis/CommonSettings.php is guarded by "if ( PHP_SAPI !== 'cli' ) {" which means that it does not apply to the eval.php path. If I remove the whole block that was introduced for T68399 then $wgServer ends up being "//" as hoped in the web path as well.

Change 400204 had a related patch set uploaded (by BryanDavis; owner: BryanDavis):
[mediawiki/vagrant@stretch-migration] Mutate $wgServer after applying local settings

Change 400204 merged by jenkins-bot:
[mediawiki/vagrant@stretch-migration] Mutate $wgServer after applying local settings