Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文
M2smart (talkcontribs)

Como posso criar uma pagina de teste antes de publicar, estou aprendendo a editar

AhmadF.Cheema (talkcontribs)
Reply to "Aprendendo a editar paginas"
195.195.217.51 (talkcontribs)

Hi, I've been waiting almost 2 weeks now for the log in team to send me the password so that I can log in but I have yet to receive it. I have already dropped them an email to inform them a week ago but nothing has changed. Does anyone know how else I can go about doing so? Thank you.

AhmadF.Cheema (talkcontribs)

Which website is your query referring to?🤔

Reply to "Log in"

Can I insert large amount of pages directly into database?

4
Parkyh1974 (talkcontribs)

I need to make almost 160 pages of specefic page at my mediawiki. I think it is not intended to normal usage of mediawiki. But If there is no way, I need to make 160 pages and link them by hand. Is there any way to do this? I'm thinking to insert pages into page table. Does this can make problem at mediawiki?

Bawolff (talkcontribs)

So you can use the API - see Bots for more details

Alternatively, with command line access, you can use a shell script combined with the Edit.php maintenance script

Parkyh1974 (talkcontribs)

Thank you. I'll check them.

Osnard (talkcontribs)

Creating custom MediaWiki import XML and using Manual:ImportDump.php is also a very convenient way to do this.

Reply to "Can I insert large amount of pages directly into database?"

How do I configure LDAP Authentication for MediaWiki 1.33?

2
87.123.197.159 (talkcontribs)

I am using LDAP Authentication and it worked fine with MediaWiki 1.32. This is the configuration I have used in MediaWiki 1.32 and which worked there:

$wgGroupPermissions['*']['autocreateaccount'] = true;
require_once "$IP/extensions/LdapAuthentication/LdapAuthentication.php";
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array(
	'ldap.mydomain.org'
);
$wgLDAPServerNames = array(
	'ldap.mydomain.org' => 'ldap.mydomain.org',
);
$wgLDAPUseLocal = false;
$wgLDAPEncryptionType = array(
	'ldap.mydomain.org' => 'ssl'
);
$wgLDAPPort = array(
	'ldap.mydomain.org' => '636',
);
$wgLDAPSearchStrings = array(
	'ldap.mydomain.org' => 'uid=USER-NAME,ou=people,dc=company,dc=org'
);
$wgLDAPWriterDN = array(
	'ldap.mydomain.org' => 'cn=wiki.mydomain.org,ou=services,dc=company,dc=org'
);
$wgLDAPWriterPassword = array(
	'ldap.mydomain.org' => 'VjenWj7Dsd5jN7GftJ7V3'
);

However, after the upgrade to MediaWiki 1.33 authentication stops working. Special:UserLogin tells me: "Incorrect username or password entered".

What is the problem?

I read that $wgAuth was removed in MW 1.33, but Extension:LDAP_Authentication/Configuration still mentions it.

What do I have to change in order to make LDAP Authentication work again?

Osnard (talkcontribs)
Reply to "How do I configure LDAP Authentication for MediaWiki 1.33?"

Login Error with LDAP Authentication Extension

22
Ablum010777 (talkcontribs)

I upgraded from Version 1.32.2 to 1.33.0. Since then I cannot log in to the wiki with the LDAP Authentication. We would still like to use that extension so that our people don't need to remember a new password, and we do it for security reasons. What happened with the LDAP Authentication extension that it totally shot the login procedure? And what alternative is there to that extension?

Sam Madisha (talkcontribs)

Did you manage to fix the error. what is the solution?

Osnard (talkcontribs)
Ablum010777 (talkcontribs)

I read everything that was written there, but it seems very complicated to me, and therefore useless. What I need is a simple extension that authenticates users against our LDAP through contact with the LDAP server. The LDAP Authentication extension provided us with exactly that. I did not see any way to configure Auth_remoteuser or LDAP Authorization in that same way. How about simply retrofitting the LDAP Authentication extension for MediaWiki 1.33.0?

185.20.218.15 (talkcontribs)

Same problem here :`-(

217.114.64.90 (talkcontribs)

Here the same. Would be nice, when it can be fixed.

Ablum010777 (talkcontribs)

Please take a look at these error messages from my Apache Webserver error log:

[Fri Aug 09 10:10:34.102519 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_merge(): Argument #1 is not an array in /srv/www/htdocs/testwiki/extensions/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php on line 36

[Fri Aug 09 10:10:34.102659 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_filter() expects parameter 1 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 308

[Fri Aug 09 10:10:34.102754 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_keys() expects parameter 1 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 308

[Fri Aug 09 10:10:34.102829 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_intersect(): Argument #2 is not an array in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 312

[Fri Aug 09 10:10:34.102924 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  in_array() expects parameter 2 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 329

[Fri Aug 09 10:10:34.103009 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  in_array() expects parameter 2 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 329

[Fri Aug 09 10:10:34.103107 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_merge(): Argument #1 is not an array in /srv/www/htdocs/testwiki/extensions/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php on line 36

[Fri Aug 09 10:10:34.103228 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_merge(): Argument #1 is not an array in /srv/www/htdocs/testwiki/extensions/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php on line 36

[Fri Aug 09 10:10:34.103319 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_filter() expects parameter 1 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 308

[Fri Aug 09 10:10:34.103392 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_keys() expects parameter 1 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 308

[Fri Aug 09 10:10:34.103482 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_intersect(): Argument #2 is not an array in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 312

[Fri Aug 09 10:10:34.103573 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  in_array() expects parameter 2 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 329

[Fri Aug 09 10:10:34.103663 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  in_array() expects parameter 2 to be array, null given in /srv/www/htdocs/testwiki/includes/auth/AuthenticationRequest.php on line 329

[Fri Aug 09 10:10:34.103753 2019] [php7:warn] [pid 21580] [client 10.50.152.24:60371] PHP Warning:  array_merge(): Argument #1 is not an array in /srv/www/htdocs/testwiki/extensions/PluggableAuth/includes/PluggableAuthBeginAuthenticationRequest.php on line 36

Osnard (talkcontribs)
Cindy.cicalese (talkcontribs)

What version of MediaWiki and relevant extensions are you using? In particular, I find it odd that you are getting an exception at "PluggableAuthBeginAuthenticationRequest.php on line 36", since there are not 36 lines in that file, nor have there been in the history of that file as far as I can tell. I'm guessing that you added some debugging statements to that file that changed the line count? If so, I'd be interested in knowing what the values are of $GLOBALS['wgPluggableAuth_ExtraLoginFields'] and parent::getFieldInfo() before the call to array_merge().

Ablum010777 (talkcontribs)

I am working with PHP Version 7.2.5. (Osnard wrote that this would be fine.)

These are the extensions in my LocalSettings.php:

wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'SimpleMathJax' );
require_once( "$IP/extensions/Realnames/Realnames.php" );

This is the configuration for the LDAP Authentication:
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension ( 'Auth_remoteuser' );
wfLoadExtension ( 'LDAPProvider' );
wfLoadExtension ( 'LDAPAuthentication2' );
wfLoadExtension ( 'LDAPAuthorization' );
wfLoadExtension ( 'LDAPUserInfo' );
$wgPluggableAuth_EnableLocalLogin = true;
$LDAPAuthorizationAutoAuthRemoteUserStringParser = 'username-at-domain';
$LDAPAuthentication2UsernameNormalizer = 'strtolower';
$LDAPAuthentication2AllowLocalLogin = true;
$wgAuthRemoteuserAllowUserSwitch = true;
$wgPluggableAuth_ExtraLoginFields = array (
   'Login' => array ( 'type' => 'string', 'label' => 'Benutzername', 'optional' => false, 'sensitive' => true ),
   'Passwort' => array( 'type' => 'password', 'label' => 'Passwort', 'optional' => false, 'sensitive' => true )
);
$wgAuthRemoteuserUserName = function () {
   $user = '';
   if ( isset ($_SERVER[ 'REMOTE_USER' ] ) ) {
        $user = strtolower ( $_SERVER[ 'REMOTE_USER' ] );
   }
   return $user;
};
$LDAPProviderDomainConfigs = "/etc/mediawiki/ldapprovider.json";

I also have the following extensions activated: SphinxSearch Collection (for PDF rendering) Visual Editor

This is the ldapprovider.json file:

{
   'testwiki': {
       'connection': {
           "server": "geo-infra.rlp",
           "options": {
               "LDAP_OPT_DEREF": 1
           },
           "basedn": "ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de",
           "userbasedn": "ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de",
           "groupbasedn": "ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de",
           "searchattribute": "uid",
           "usernameattribute": "uid",
           "realnameattribute": "displayName",
           "emailattribute": "mail",
           "grouprequest": "MediaWiki\\Extension\\LDAPProvider\\UserGroupRequest\\GroupMember::factory"
       },
       'authorization': {
           'rules': {
               'groups': {
                   'required': "cn=wiki_testcontainer,ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de"
               }
           }
       },
       'userinfo': {
           'attributes-map': {
               'email': 'mail',
               'realname': 'displayName'
           }
       }
   }
}

And the PluggableAuthBeginAuthenticationRequest.php:

<?php
use \MediaWiki\Auth\ButtonAuthenticationRequest;
use \MediaWiki\Auth\AuthManager;
class PluggableAuthBeginAuthenticationRequest extends
       ButtonAuthenticationRequest {
       public function __construct() {
               if ( isset( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] ) ) {
                       $label = wfMessage( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] );
               } elseif ( $GLOBALS['wgPluggableAuth_ButtonLabel'] ) {
                       $label = new RawMessage( $GLOBALS['wgPluggableAuth_ButtonLabel'] );
               } else {
                       $label = wfMessage( 'pluggableauth-loginbutton-label' );
               }
               parent::__construct(
                       'pluggableauthlogin',
                       $label,
                       wfMessage( 'pluggableauth-loginbutton-help' ),
                       true );
       }
       /**
        * Returns field information.
        * @return array field information
        */
       public function getFieldInfo() {
               if ( $this->action !== AuthManager::ACTION_LOGIN ) {
                       return [];
               }
               error_log( 'A:' . var_export( $GLOBALS['wgPluggableAuth_ExtraLoginFields'], 1 ) ); // this is what Osnard asked me to add
               error_log( 'B:' . var_export( parent::getFieldInfo(), 1 ) ); // this, too
               error_log( 'C:' . var_export( array_merge( $GLOBALS['wgPluggableAuth_ExtraLoginFields'], parent::getFieldInfo() ), 1 ) ); // this, too.
               return array_merge( $GLOBALS['wgPluggableAuth_ExtraLoginFields'],
                       parent::getFieldInfo() );
       }
}

The result of Osnard's recommendations are:


A:MediaWiki\\Extension\\LDAPAuthentication2\\ExtraLoginFields::__set_state( 
   array(
       'domain' => array (
           'type' => 'select',
           'label' => Message::__set_state( 
               array(
                   'interface' => true,
                   'language' => false,
                   'key' => 'yourdomainname',
                   'keysToTry' => array (
                       0 => 'yourdomainname',
                       ),
                       'parameters' => 
                       array (
                       ),
                       'format' => 'parse',
                       'useDatabase' => true,
                       'title' => NULL,
                       'content' => NULL,
                       'message' => NULL,
                   )
               ),
               'help' => Message::__set_state( 
                   array(
                       'interface' => true,
                       'language' => false,
                       'key' => 'authmanager-domain-help',
                       'keysToTry' => array (
                           0 => 'authmanager-domain-help',
                       ),
                       'parameters' => array (
                       ),
                       'format' => 'parse',
                       'useDatabase' => true,
                       'title' => NULL,
                       'content' => NULL,
                       'message' => NULL,
                   )
               ),
               'options' => array (
                   'testwiki' => RawMessage::__set_state(
                       array(
                           'interface' => true,
                           'language' => false,
                           'key' => 'testwiki',
                           'keysToTry' => array (
                               0 => 'testwiki',
                           ),
                           'parameters' => array (
                           ),
                           'format' => 'parse',
                           'useDatabase' => true,
                           'title' => NULL,
                           'content' => NULL,
                           'message' => 'testwiki',
                       )
                   )
               ),
               'local' => RawMessage::__set_state(
                   array(    
                       'interface' => true,
                       'language' => false,
                       'key' => 'local',
                       'keysToTry' => array (
                           0 => 'local',
                       ),
                       'parameters' => array (
                       ),
                       'format' => 'parse',
                       'useDatabase' => true,
                       'title' => NULL,
                       'content' => NULL,
                       'message' => 'local',
                   )
               ),
           ),
       ),
       'username' => array (
           'type' => 'string',
           'label' => Message::__set_state(
               array(
                   'interface' => true,
                   'language' => false,
                   'key' => 'userlogin-yourname',
                   'keysToTry' => array (
                       0 => 'userlogin-yourname',
                   ),
                   'parameters' => array (
                   ),
                   'format' => 'parse',
                   'useDatabase' => true,
                   'title' => NULL,
                   'content' => NULL,
                   'message' => NULL,
               )
           ),
           'help' => Message::__set_state(
               array(
                   'interface' => true,
                   'language' => false,
                   'key' => 'authmanager-username-help',
                   'keysToTry' => array (
                       0 => 'authmanager-username-help',
                   ),
                   'parameters' => array (
                   ),
                   'format' => 'parse',
                   'useDatabase' => true,
                   'title' => NULL,
                   'content' => NULL,
                   'message' => NULL,
               )
           ),
       ),
       'password' => array (
           'type' => 'password',
           'label' => Message::__set_state( 
               array(
                   'interface' => true,
                   'language' => false,
                   'key' => 'userlogin-yourpassword',
                   'keysToTry' => array (
                       0 => 'userlogin-yourpassword',
                   ),
                   'parameters' => array (
                   ),
                   'format' => 'parse',
                   'useDatabase' => true,
                   'title' => NULL,
                   'content' => NULL,
                   'message' => NULL,
               )
           ),
           'help' => Message::__set_state(
               array(
                   'interface' => true,
                   'language' => false,
                   'key' => 'authmanager-password-help',
                   'keysToTry' => array (
                       0 => 'authmanager-password-help',
                   ),
                   'parameters' => array (
                   ),
                   'format' => 'parse',
                   'useDatabase' => true,
                   'title' => NULL,
                   'content' => NULL,
                   'message' => NULL,
               )
           ),
           'sensitive' => true,
       ),
   )
),
B:array (
   'pluggableauthlogin' => array (
       'type' => 'button',
       'label' => Message::__set_state(
           array(
               'interface' => true,
               'language' => false,
               'key' => 'pluggableauth-loginbutton-label',
               'keysToTry' => array (
                   0 => 'pluggableauth-loginbutton-label',
               ),
               'parameters' => array (
               ),
               'format' => 'parse',
               'useDatabase' => true,
               'title' => NULL,
               'content' => NULL,
               'message' => NULL,
           )
       ),
       'help' => Message::__set_state(
           array(
               'interface' => true,
               'language' => false,
               'key' => 'pluggableauth-loginbutton-help',
               'keysToTry' => array (
                   0 => 'pluggableauth-loginbutton-help',
               ),
               'parameters' => array (
               ),
               'format' => 'parse',
               'useDatabase' => true,
               'title' => NULL,
               'content' => NULL,
               'message' => NULL,
           )
       ),
   ),
),
C: NULL
Osnard (talkcontribs)

Can you try to remove the $wgPluggableAuth_ExtraLoginFields from you configuration? This is set implicitly by Extension:LDAPAuthentication2. Maybe this collides.

Ablum010777 (talkcontribs)

I already did, but it doesn't help. This is always the result:

[89dad82860e957e43a00ac89] /testwiki/ MWException from line 54 of /srv/www/htdocs/testwiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php: Could not parse configuration file '/etc/mediawiki/ldapprovider.json'!

Backtrace:

#0 /srv/www/htdocs/testwiki/extensions/LDAPProvider/src/DomainConfigProvider/LocalJSONFile.php(73): MediaWiki\Extension\LDAPProvider\DomainConfigProvider\LocalJSONFile->__construct(string)

#1 [internal function]: MediaWiki\Extension\LDAPProvider\DomainConfigProvider\LocalJSONFile::newInstance(MediaWiki\Extension\LDAPProvider\Config)

#2 /srv/www/htdocs/testwiki/extensions/LDAPProvider/src/DomainConfigFactory.php(106): call_user_func_array(string, array)

#3 /srv/www/htdocs/testwiki/extensions/LDAPAuthentication2/src/Setup.php(13): MediaWiki\Extension\LDAPProvider\DomainConfigFactory::getInstance()

#4 /srv/www/htdocs/testwiki/includes/Setup.php(903): MediaWiki\Extension\LDAPAuthentication2\Setup::init()

#5 /srv/www/htdocs/testwiki/includes/WebStart.php(77): require_once(string)

#6 /srv/www/htdocs/testwiki/index.php(39): require(string)

#7 {main}

Osnard (talkcontribs)

The error message Could not parse configuration file '/etc/mediawiki/ldapprovider.json'! suggests that there might be a syntax error in that file or the file is nor readable by the webserver. From the example you have posted above I believe the single quotes are the problem. Try using double quotes everywhere in JSON.

Ablum010777 (talkcontribs)

I use double quotes in the JSON file everywhere. Besides I am testing on a console now. It seems to me that the variable containing the text boxes for the login name and the password are not passed to the LocalJSONFile.php file correctly, since I always read NULL. This is my ldapprovider.json now:

{

   "testwiki": {

       "connection": {

           "server": "geo-infra.rlp",

           "options": {

               "LDAP_OPT_DEREF": 1

           },

           "basedn": "ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de",

           "userbasedn": "ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de",

           "groupbasedn": "ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de",

           "searchattribute": "uid",

           "usernameattribute": "uid",

           "realnameattribute": "displayName",

           "emailattribute": "mail",

           "grouprequest": "MediaWiki\\Extension\\LDAPProvider\\UserGroupRequest\\GroupMember::factory"

       },

       "authorization": {

           "rules": {

               "groups": {

                   "required": "cn=wiki_testcontainer,ou=group,ou=VermKV,o=Landesverwaltung Rheinland-Pfalz,c=de"

               }

           }

       },

       "authentication": {

           "emailattribute": 'mail',

           "realnameattribute": "displayName"

           "usernameattribute": "uid"

       }

   }

}


That is also why these two fields (login name and password) are missing when I set the local login variables to false.

Cindy.cicalese (talkcontribs)

From the code you posted, your "C:" printout should be an array containing the merged contents of the two other arrays, but instead it is printing:

C: NULL

which would match the fact that the function appears to be returning NULL. But, how can the result of merging two populated arrays be null?

Ablum010777 (talkcontribs)

The problem has been solved. The variable $GLOBALS['PluggableAuth_ExtraLoginFields'] needs explicit typecasting to array.

Osnard (talkcontribs)
Ablum010777 (talkcontribs)

In PluggableAuthBeginAuthenticationRequest.php (code line printed in bold):

<?php

use \MediaWiki\Auth\ButtonAuthenticationRequest;

use \MediaWiki\Auth\AuthManager;

class PluggableAuthBeginAuthenticationRequest extends

       ButtonAuthenticationRequest {

       public function __construct() {

               if ( isset( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] ) ) {

                       $label = wfMessage( $GLOBALS['wgPluggableAuth_ButtonLabelMessage'] );

               } elseif ( $GLOBALS['wgPluggableAuth_ButtonLabel'] ) {

                       $label = new RawMessage( $GLOBALS['wgPluggableAuth_ButtonLabel'] );

               } else {

                       $label = wfMessage( 'pluggableauth-loginbutton-label' );

               }

               parent::__construct(

                       'pluggableauthlogin',

                       $label,

                       wfMessage( 'pluggableauth-loginbutton-help' ),

                       true );

       }

       /**

        * Returns field information.

        * @return array field information

        */

       public function getFieldInfo() {

               if ( $this->action !== AuthManager::ACTION_LOGIN ) {

                       return [];

               }

               return array_merge( (array) $GLOBALS['wgPluggableAuth_ExtraLoginFields'],

                       parent::getFieldInfo() );

       }

}

Cindy.cicalese (talkcontribs)

Ah, interesting. The printout:


error_log( 'A:' . var_export( $GLOBALS['wgPluggableAuth_ExtraLoginFields'], 1 ) );


is giving:


A:MediaWiki\\Extension\\LDAPAuthentication2\\ExtraLoginFields::__set_state(

   array(

...


rather than


A:array(

...

Osnard (talkcontribs)
Hawaiian717 (talkcontribs)

This feels like overkill. We use LDAP with Auth_remoteuser but don't need any MediaWiki extensions for the LDAP part, since Apache httpd does the authentication to the LDAP server. The relevant bit of our LocalSettings.php file looks like this:


wfLoadExtension('Auth_remoteuser');

#$wgAuth = new Auth_remoteuser();

$wgAuthRemoteuserMailDomain = "spawar.navy.mil";


Then we put a .htaccess file in the root of our wiki with the following (we could also do it in a config file in /etc/httpd/conf.d/):


AuthName "wiki"

AuthType Basic

AuthBasicProvider ldap

AuthLDAPURL <our LDAP url>

Require valid-user

Osnard (talkcontribs)

Yes. This is true, if you don't need features like form-based-authentication, group-based-login-restrictions, groupy-sync or user-info-synchronization.

Reply to "Login Error with LDAP Authentication Extension"
As.kovalev (talkcontribs)

Error loading data: api error-visual editor-doc server-http-error: (curl error: 7) Couldn't connect to server. Try again?

Malyacko (talkcontribs)
Bawolff (talkcontribs)

Some possibilities to try (Some of these may be technical if you aren't familar with linux commandline)

  • Can you use the netstat command to verify that parsoid is listening on the appropriate port
  • Can you manually load the parsoid api via curl from the command line from the machine that mediawiki is on
  • Is there any firewall preventing connections to parsoid
  • Is SELinux enabled and somehow preventing connections to parsoid
  • Is there any other sandboxing (firejail, whatever) enabled that would prevent mediawiki from connecting to parsoid.
Reply to "VisualEditor"

Error loading data from server: apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server.

5
NodokaHanamura (talkcontribs)

Okay, so I'm new to working MediaWiki and I'm trying to get a private wiki that is currently only accessible from my network going with Visual Editor, and I keep getting this error. I've checked LocalSettings and Config.yaml and both seem to be configured right (LocalSettings is pointing to Parsoid and Parsoid is pointing to the MWAPI page), but it seems Parsoid isn't working (Even though the service reports as up when I do service parsoid status. Connecting on port 8142 brings up a Connection Refused error.

Versions:

OS: Turnkey Linux MediaWiki

MediaWiki1.31.1

PHP7.0.33-0+deb9u5 (apache2handler)

MariaDB10.1.37-MariaDB-0+deb9u1

ICU57.1

Bawolff (talkcontribs)

Probably a firewall, SELinux or something of that nature blocking connections to parsoid

NodokaHanamura (talkcontribs)
NodokaHanamura (talkcontribs)

Does anyone have a solution for this?

Bawolff (talkcontribs)

We've received a higher number of reports of this error recently phab:T234049. Its unclear what the cause is so far.

Reply to "Error loading data from server: apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server."
Evolution and evolvability (talkcontribs)

Hello,

What would be the necessary steps to enable this code to embed in a page:

<span class="__dimensions_badge_embed__" data-id="pub.1067741279" data-hide-zero-citations="true" data-style="small_circle"></span><script async src="https://badge.dimensions.ai/badge.js" charset="utf-8"></script>

See https://badge.dimensions.ai/?identifier=pub.1067741279#build for info

It would be highly useful to be able to get them working on WikiJournal articles.

Jonathan3 (talkcontribs)
Evolution and evolvability (talkcontribs)

Thanks - I've also copied a message over at that talkpage for its watchers.

Bawolff (talkcontribs)

Using extension:Widgets is one approach.

Another approach is to put the first part:

<span class="__dimensions_badge_embed__" data-id="pub.1067741279" data-hide-zero-citations="true" data-style="small_circle"></span>

on the page, and add

mw.loader.load( 'https://badge.dimensions.ai/badge.js' );

to the page named MediaWiki:Common.js on your wiki instead of the script tag (This is a special page name in your wiki that contains extra js to load)

Evolution and evolvability (talkcontribs)

Magical Thank you. You can see the results on a test wiki here:

https://wikipediajournal.com/Test_badges

https://wikipediajournal.com/MediaWiki:Common.js

I'm now trying to get the AltMetric badges working via a similar process. Its documentation says to inlcude:

<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>

So I assume the relevant MediaWiki:Common.js addition is:

mw.loader.load( 'https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js' );

Does that look correct?

Bawolff (talkcontribs)

should be. Thag script tag doesnt have the async flag so there is a small possibility it wont like being loaded asynchronously, but it will probably be fine.

Also remember, including external js allows that website to potentially track your users. For many sites this is fine, just wanted to make sure you are aware

Evolution and evolvability (talkcontribs)

Thank you - I'll check up on the details on whether those badges also track.

Altmetric badges seem to work fine.

Implementing crossmark seems to be more complex. My understanding is that the page would just need:

<a data-target="crossmark"><img src="https://crossmark-cdn.crossref.org/widget/v2.0/logos/crossmark-logo-rectangle.svg" width="150" /></a>

and also

<meta name=”dc.identifier” content=”doi:10.5555/12345678” />

Seems to not implement in this case though. I suspect it's something to do with the <meta...> tag. Any ideas?

Jonathan3 (talkcontribs)

You can add meta tags using Extension:WikiSEO but that might be overkill - maybe a Widget would be best after all :-)

Bawolff (talkcontribs)

If you set $wgAllowImageTag to true in LocalSettings.php, you can sort of do the first part as

<img src="https://crossmark-cdn.crossref.org/widget/v2.0/logos/crossmark-logo-rectangle.svg" width="150" />

However, only meta tags using itemprop are allowed, and <a> tags with data attributes are not allowed in wikitext. This would be a good case for the Widgets extension.

Evolution and evolvability (talkcontribs)

I'm not sure how to ask for a widgets extension. Is that something to do with pharbricator?

Bawolff (talkcontribs)

Oh, I didn't realize this was for Wikimedia. Widgets extension is not going to be installed on wikiversity. You could ask on phabricator for a custom extension for this. It might also be possible to do something more complex for this in MediaWiki:Common.js

Please note: Much of what I suggested above regarding adding mw.loader.load() to MediaWiki:Common.js is not allowed under the Wikimedia privacy policy, and is not allowed to be used on Wikimedia Websites.

Evolution and evolvability (talkcontribs)

Ah, I see. Thank you for the clarification! Is the reason for not using mw.loader.load() on any wikimedia platform a fundamental limitation, or something where the privacy issues can be fixed via some extension/gadget/software solution? (sorry for being vague, I'm not very well versed in the technicalities).

Bawolff (talkcontribs)

basically mw.loader.load loads javascript. If its loading something from wikimedia thats fine. If its loading from somewhere else, the other site could use that to track users or do other malicious things

Often you can just copy the external script locally and then its ok if the external site is taken out of the mix

Evolution and evolvability (talkcontribs)

That makes sense. Who would be sensible to contact about helping out with attempting to do that (and do you have any feel for whether it is likely to be 1 hour or one month of work)?

Thanks again for all the help on this!

Bawolff (talkcontribs)

For best success, I'd say come up with a comprehensive list of everything you need (along with explanation of why you need those things & what you are trying to accomplish). Once you have that, I'm not sure who best to reach out to, but first people to try might be m:community tech or a community liason.

Evolution and evolvability (talkcontribs)

Thanks! I'll put together a more comprehensive description to explain the background, aims and expected outcome.

Reply to "Embedding Dimensions badges"
Summary by Bawolff

done

Sunny00217 (talkcontribs)
Bawolff (talkcontribs)

Yes Done

MediaWiki redirecting me to address with additional resource IDs

4
Ivan0890 (talkcontribs)

I can access my wiki via 192.168.1.100/mediawiki, where 192.168.1.100 is an example of my private IP. However, whenever I log in from the main page from my wiki it directs me to "192.168.1.100/mediawiki/index.php/192.168.1.100/mediawik/index.php/Main_Page"


Similarly, when I access my wiki using localhost as server name and then log in, I get redirected to "localhost/mediawiki/index.php/192.168.1.100/mediawiki/index.php/Main_Page"


The workaround now is to manually delete the extraneous resource IDs (/192.168.1.100/mediawiki/index.php/) after logging in, which will take me to the Main Page.


Why am I getting the extraneous /192.168.1.100/mediawiki/index.php/ resource IDs upon redirect, and how to I resolve this?


edit: Seems like this is happening not only when I log in but also when I make edits to pages
edit2: Some more information: When I navigate using internal links, this issue does not come up. It seems like it's only happening when MediaWiki is trying to redirect to another page

Bawolff (talkcontribs)

what rewrite rules do you have set?

What is $wgServer, $wgArticlePath, $wgScriptPath set to

Ivan0890 (talkcontribs)

$wgServer = "192.168.1.100";

$wgScriptPath = "/mediawiki";

$wgArticlePath is not set


edit: while attempting to fix this issue, I've tried setting $wgServer = "WebRequest::detectServer()"; When I did this, MediaWiki no longer redirected me when I clicked "Log in" or "Save Changes"

Ivan0890 (talkcontribs)

I changed the $wgServer = "http://192.168.1.100"; and the issue was resolved.


I believe this was because without the protocol, MediaWiki took that variable to be a relative path instead of the entire server name. Can anyone confirm if this is true?