Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMF 2.1 | Mediawiki 1.35.1 #15

Closed
sandfam opened this issue Feb 16, 2021 · 5 comments · Fixed by #18
Closed

SMF 2.1 | Mediawiki 1.35.1 #15

sandfam opened this issue Feb 16, 2021 · 5 comments · Fixed by #18

Comments

@sandfam
Copy link

sandfam commented Feb 16, 2021

Hello,

I'm unable to get this bridge to work, and was wondering if you could assist me. The only SMF account is the main Administrator account you setup during installation. When I edit the LocalSettings.php file with any of the Optional LocalSettings.php such as: $wgFSPAllowGroups = array(5);, or any other one, then I just get a blank, white page giving me a generic 500 Internal Error.

However, when I add just the Required LocalSettings.php portion:

wfLoadExtension('ForumSsoProvider');
$wgSMFPath = '/var/www/html';
$wgFSPSoftware = 'smf2.1';

Then the wiki no longer gives me the 500 Internal Error, but when I attempt to login - a Fatal Error occurs. So, I added the following code at the very end of LocalSettings.php in order to see a more detailed Internal Error:

error_reporting( -1 );v
ini_set( 'display_errors', 1 );

$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;

Therefore, the Internal Error when attempting to login with my main Administrator account is:

[aa99e6c5e8d12031f9174bd1] /mediawiki/index.php?title=Special:UserLogin&returnto=Main+Page Error from line 136 of /var/lib/mediawiki/extensions/ForumSsoProvider/ForumSsoProvider.php: Call to a member function doRedirect() on null

Backtrace:

#0 /var/lib/mediawiki/includes/HookContainer/HookContainer.php(320): ForumSsoProvider::onSpecialPageBeforeExecute(SpecialUserLogin, NULL)
#1 /var/lib/mediawiki/includes/HookContainer/HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#2 /var/lib/mediawiki/includes/HookContainer/HookRunner.php(3757): MediaWiki\HookContainer\HookContainer->run(string, array)
#3 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(593): MediaWiki\HookContainer\HookRunner->onSpecialPageBeforeExecute(SpecialUserLogin, NULL)
#4 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#5 /var/lib/mediawiki/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#6 /var/lib/mediawiki/includes/MediaWiki.php(940): MediaWiki->performRequest()
#7 /var/lib/mediawiki/includes/MediaWiki.php(543): MediaWiki->main()
#8 /var/lib/mediawiki/index.php(53): MediaWiki->run()
#9 /var/lib/mediawiki/index.php(46): wfIndexMain()
#10 {main}

Here's how my LocalSettings.php file looks. I used "XXXXX" in some spots to keep private, but don't mind sharing if need be:

<?php
# This file was automatically generated by the MediaWiki 1.35.1
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# https://www.mediawiki.org/wiki/Manual:Configuration_settings

# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
	exit;
}


## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename = "XXXXX";
$wgMetaNamespace = "XXXXXX";

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "/mediawiki";

## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://XXXX.com";

## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;

## The URL paths to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/framed4.png" ];

## UPO means: this is also a user preference option

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "XXXXX";
$wgPasswordSender = "XXXXX";

$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "mediawiki";
$wgDBuser = "mediawiki";
$wgDBpassword = "XXXXXXX";

# MySQL specific settings
$wgDBprefix = "wiki";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

# Shared database table
# This has no effect unless $wgSharedDB is also set.
$wgSharedTables[] = "actor";

## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = false;

# Periodically send a pingback to https://www.mediawiki.org/ with basic data
# about this MediaWiki instance. The Wikimedia Foundation shares this data
# with MediaWiki developers to help guide future development efforts.
$wgPingback = true;

## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale. This should ideally be set to an English
## language locale so that the behaviour of C library functions will
## be consistent with typical installations. Use $wgLanguageCode to
## localise the wiki.
$wgShellLocale = "C.UTF-8";

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publicly accessible from the web.
#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "en";

$wgSecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";

# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "XXXXXXXXXXXXXXXXXXXXXX";

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";

# The following permissions were set based on your choice in the installer
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = 'smfcurve2';

# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
wfLoadSkin( 'smfcurve2' );


# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );

# End of automatically generated settings.
# Add more configuration options below.

$wgSessionCacheType = CACHE_DB;

wfLoadExtension('ForumSsoProvider');
$wgSMFPath = '/var/www/html';
$wgFSPSoftware = 'smf2.1';

error_reporting( -1 );
ini_set( 'display_errors', 1 );

$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;

All in all, I have no idea what I'm doing wrong to get this working. I'm hoping you can get me in the right direction.

I am running:
SMF 2.1 RC3
Mediawiki 1.35.1
PHP 7.3.19
Apache 2.4.38
MariaDB 10.3.27

Thank you,
Mike

@jdarwood007
Copy link
Member

Make sure you call wfLoadExtension after you defined the settings. The SSO process happens very early in the MediaWiki startup and if the settings are missing, it can cause this.

@sandfam
Copy link
Author

sandfam commented Jun 19, 2021

Hi again,

First off, thank you very much for your response. I apologize for not getting back to you in a timely fashion as I need additional help. I had COVID-19, and it really did me in. Anyway, I decided to downgrade SMF 2.1 RC3 to SMF 2.0.18. Everything else (Mediawiki, PHP, etc) is the same version as stated above.

So, now my LocalSettings.php is:

# This file was automatically generated by the MediaWiki 1.35.1
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# https://www.mediawiki.org/wiki/Manual:Configuration_settings

# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
	exit;
}

wfLoadExtension('ForumSsoProvider');
$wgSMFPath = '/var/www/html';
$wgFSPSoftware = 'smf2.0';
$wgFSPAdminGroups = array(1, 3);


## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename = "XXXXX";
$wgMetaNamespace = "XXXXX";

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "/mediawiki";

## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://XXXXXXXXX";

## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;

## The URL paths to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/framed4.png" ];

## UPO means: this is also a user preference option

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "XXXXXXX";
$wgPasswordSender = "XXXXXXX";

$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "XXXXXX";
$wgDBuser = "XXXXXX";
$wgDBpassword = "XXXXXXX";

# MySQL specific settings
$wgDBprefix = "wiki";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

# Shared database table
# This has no effect unless $wgSharedDB is also set.
$wgSharedTables[] = "actor";

## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = true;

# Periodically send a pingback to https://www.mediawiki.org/ with basic data
# about this MediaWiki instance. The Wikimedia Foundation shares this data
# with MediaWiki developers to help guide future development efforts.
$wgPingback = false;

## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale. This should ideally be set to an English
## language locale so that the behaviour of C library functions will
## be consistent with typical installations. Use $wgLanguageCode to
## localise the wiki.
$wgShellLocale = "C.UTF-8";

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publicly accessible from the web.
#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "en";

$wgSecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";

# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "XXXXXXXXXXXXXXXX";

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";

# The following permissions were set based on your choice in the installer
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = 'smfcurve2';

# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'smfcurve2' );


# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );


# End of automatically generated settings.
# Add more configuration options below.

$wgSessionCacheType = CACHE_DB;

As you can see, I changed:

$wgFSPSoftware = 'smf2.1'; to $wgFSPSoftware = 'smf2.0;

And I think I followed your previous instructions by placing this earlier in the file:

wfLoadExtension('ForumSsoProvider'); $wgSMFPath = '/var/www/html'; $wgFSPSoftware = 'smf2.0'; $wgFSPAdminGroups = array(1, 3);

Now the Main page of the wiki is displaying a "Log in" link at the top, and even if I attempt to log in manually, then I get an error message saying:

Incorrect username or password entered. Please try again.

Thank you very much for your time & assistance,
Mike

@jdarwood007
Copy link
Member

Move the wfLoadExtension to after you define the settings

$wgSMFPath = '/var/www/html';
$wgFSPSoftware = 'smf2.0';
$wgFSPAdminGroups = array(1, 3);
wfLoadExtension('ForumSsoProvider');

Mediawiki will setup the extension as soon as you call the wfLoadExtension, so the settings need to be in place first.

@ThermoMan
Copy link

If the above suggestions don't do it, you might also need
$wgFSPPath = $wgSMFPath
before you load the extension.

This ended up being the fix I needed.

jdarwood007 added a commit that referenced this issue Aug 27, 2021
@jdarwood007
Copy link
Member

Looks like the documentation is wrong. All paths should be using $wgFS prefix as its generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants