"sbs.sapian.com.co"); $wgLDAPServerNames = array("SAPIAN.COM.CO"=>"ipa-02-med-host.sapian.com.co"); //Podemos permitir la convivencia de autenticación local del wiki con LDAP. $wgLDAPUseLocal = true; //Encriptación en las solicitudes LDAP. $wgLDAPEncryptionType = array("SAPIAN.COM.CO"=>"ssl"); //Le decimos cual es la base de la consulta $wgLDAPBaseDNs = array("SAPIAN.COM.CO"=>"dc=sapian,dc=com,dc=co"); $wgLDAPSearchAttributes = array("SAPIAN.COM.CO"=>"uid"); //$wgLDAPSearchStrings= array("SAPIAN.COM.CO"=>"uid=USER-NAME,ou=Users,ou=Accounts,dc=sapian,dc=com,dc=co"); //Utilizamos los grupos LDAP para las directivas de grupo: $wgLDAPGroupsPrevail = array("SAPIAN.COM.CO"=>true); $wgLDAPGroupNameAttribute = array("SAPIAN.COM.CO"=>"cn"); //User and password used for proxyagent access. //Please use a user with limited access, NOT your directory manager! $wgLDAPProxyAgent = array( "SAPIAN.COM.CO"=>"uid=mediawiki,cn=sysaccounts,cn=etc,dc=sapian,dc=com,dc=co" ); $wgLDAPProxyAgentPassword = array( "SAPIAN.COM.CO"=>"Ooghia6shoox5ieghaongeequae2ienohpuureiTeiwaetha" ); $wgLDAPDisableAutoCreate = array( 'SAPIAN.COM.CO' => false ); $wgCollectionPODPartners = array( 'pediapress' => array( 'name' => 'PediaPress', 'url' => 'http://pediapress.com/', 'posturl' => 'http://pediapress.com/api/collections/', 'infopagetitle' => 'coll-order_info_article', ), ); */ #$wgDefaultUserOptions['usebetatoolbar'] = 1; #$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1; #$wgDefaultUserOptions['wikieditor-preview'] = 1; require_once "$IP/extensions/ContributionScores/ContributionScores.php"; $wgContribScoreIgnoreBots = true; // Exclude Bots from the reporting - Can be omitted. $wgContribScoreIgnoreBlockedUsers = true; // Exclude Blocked Users from the reporting - Can be omitted. $wgContribScoresUseRealName = true; // Use real user names when available - Can be omitted. Only for MediaWiki 1.19 and later. $wgContribScoreDisableCache = false; // Set to true to disable cache for parser function and inclusion of table. //Each array defines a report - 7,50 is "past 7 days" and "LIMIT 50" - Can be omitted. $wgContribScoreReports = array( array(7,50), array(30,50), array(0,50)); $wgDebugLogFile = "/var/log/mediawiki.log"; // Enable by default for everybody $wgDefaultUserOptions['visualeditor-enable'] = 1; // Don't allow users to disable it $wgHiddenPrefs[] = 'visualeditor-enable'; // OPTIONAL: Enable VisualEditor's experimental code features $wgDefaultUserOptions['visualeditor-enable-experimental'] = 1; $wgVirtualRestConfig['modules']['parsoid'] = array( // URL to the Parsoid instance // Use port 8142 if you use the Debian package 'url' => 'http://localhost:8142', // Parsoid "domain", see below (optional) 'domain' => 'wiki.sapian.com.co', // Parsoid "prefix", see below (optional) 'prefix' => 'wiki' ); //$wfLoadExtension( 'SyntaxHighlight_GeSHi' ); //$wgReadOnly = 'Upgrading to MediaWiki 1.28.2'; $wgShowDBErrorBacktrace = true; wfLoadExtension( 'VisualEditor' ); wfLoadExtension( 'YouTube' ); $wgDefaultUserOptions['visualeditor-enable'] = 1; $wgVirtualRestConfig['modules']['parsoid'] = array( // URL to the Parsoid instance // Use port 8142 if you use the Debian package 'url' => 'http://wiki-01-med-guest.sapian.com.co:8000', // Parsoid "domain", see below (optional) 'domain' => 'sapian', // Parsoid "prefix", see below (optional) 'prefix' => 'sapian' ); $wgSessionsInObjectCache = true; $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true; //When set to true, users can bring in an inline image from an external URL. They do this simply by sticking the full URL into the wiki text (without any other surrounding markup being required) That is the direct URL to an image resource on another website. $wgAllowExternalImages = true; wfLoadExtension( 'SyntaxHighlight_GeSHi' ); // Intergratio to keycloack wfLoadExtension( 'PluggableAuth' ); //$wgPluggableAuth_EnableAutoLogin = true; $wgPluggableAuth_EnableLocalLogin = true; $wgPluggableAuth_EnableLocalProperties = true; $wgPluggableAuth_ButtonLabel = "login accounts.sapian.cloud"; // wfLoadExtension( 'OpenIDConnect' ); // // //$wgOpenIDConnect_UseRealNameAsUserName = true; // //$wgOpenIDConnect_MigrateUsersByUserName = true; // //$wgOpenIDConnect_UseEmailNameAsUserName = true; // //$wgOpenIDConnect_MigrateUsersByEmail = true; // // $wgOpenIDConnect_Config['https://accounts.sapian.cloud/auth/realms/sapian.com.co/'] = [ // 'clientID' => 'mediawiki-sapian-com-co', // 'clientsecret' => 'dced64bf-d7f0-44a2-be44-5c3eff7df304', // 'name' => "Sapian Accounts Server", // 'icon' => "https://www.sapian.com.co/wp-content/uploads/2020/04/SapianMaterialDesign_logo_open_solutions_72dpi.png" // ]; // // //error_reporting( -1 ); // //ini_set( 'display_errors', 1 ); // wfLoadExtension( 'LDAPAuthentication2' ); // Safe IP or not (for bypassing external login via AD) $safeIPs = array('127.0.0.1','localhost'); $ipsVars = array('HTTP_X_FORWARDED_FOR','HTTP_X_REAL_IP','REMOTE_ADDR'); foreach ($ipsVars as $ipsVar) { if (isset($_SERVER[$ipsVar]) && mb_strlen($_SERVER[$ipsVar]) > 3 ) { $wikiRequestIP = $_SERVER[$ipsVar]; break; } } $wikiRequestSafe = (isset($wikiRequestIP) && ( in_array($wikiRequestIP,$safeIPs) )); // Create Wiki-Group 'engineering' from default user group $wgGroupPermissions['engineering'] = $wgGroupPermissions['user']; $wgEmailConfirmToEdit = false; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['read'] = false; $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['sysop']['createaccount'] = false; $wgGroupPermissions['*']['autocreateaccount'] = true; $wgBlockDisablesLogin = true; $ldapJsonFile = "/etc/mediawiki-ldap/ldap.json"; $ldapConfig = false; if (is_file($ldapJsonFile) && is_dir("$IP/extensions/LDAPProvider")) { $testJson = @json_decode(file_get_contents($ldapJsonFile),true); if (is_array($testJson)) { $ldapConfig = true; } else { error_log("Found invalid JSON in file: $IP/ldap.json"); } } // Activate Extension if ( $ldapConfig ) { $wgUserrightsInterwikiDelimiter = "%"; $wgInvalidUsernameCharacters = "%:"; wfLoadExtension( 'PluggableAuth' ); wfLoadExtension( 'LDAPProvider' ); wfLoadExtension( 'LDAPAuthentication2' ); wfLoadExtension( 'LDAPAuthorization' ); wfLoadExtension( 'LDAPUserInfo' ); wfLoadExtension( 'LDAPGroups' ); $LDAPProviderDomainConfigs = $ldapJsonFile; $wgPluggableAuth_ButtonLabel = "Log In via ldap.accounts.sapian.cloud"; if ($wikiRequestSafe) { $LDAPAuthentication2AllowLocalLogin = true; } } $wgSMTP = [ 'host' => 'exim', // could also be an IP address. Where the SMTP server is located 'IDHost' => 'wiki.sapian.com.co', // Generally this will be the domain name of your website (aka mywiki.org) 'port' => 25, // Port to use when connecting to the SMTP server 'auth' => false // Should we use SMTP authentication (true or false) ];