'; $wgMetaNamespace = '<%= @mediawiki[:metanamespace] %>'; ## 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 = "/w"; $wgArticlePath = '/wiki/$1'; $wgUsePathInfo = true; $wgScriptExtension = ".php"; ## The protocol and server name to use in fully-qualified URLs $wgServer = "//<%= @name %>"; $wgInternalServer = 'https://<%= @name %>'; $wgCanonicalServer = 'https://<%= @name %>'; $wgSecureLogin = true; $wgDefaultUserOptions['prefershttps'] = 1; $wgCookieSecure = true; ## The relative URL path to the skins directory $wgStylePath = "$wgScriptPath/skins"; ## The relative URL path to the logo. Make sure you change this from the default, ## or else you'll overwrite your logo when you upgrade! $wgLogo = "<%= @mediawiki[:logo] %>"; ## UPO means: this is also a user preference option $wgEnableEmail = true; $wgEnableUserEmail = true; # UPO $wgEmergencyContact = "<%= @mediawiki[:email_contact] %>"; $wgPasswordSender = "<%= @mediawiki[:email_sender] %>"; $wgPasswordSenderName = "<%= @mediawiki[:email_sender_name] %>"; //Replaced by MediaWiki:Emailsender in v1.23.0 $wgNoReplyAddress = "<%= @mediawiki[:email_sender] %>"; $wgEnotifUserTalk = true; # UPO $wgEnotifWatchlist = true; # UPO $wgEmailAuthentication = true; $wgEnotifUseJobQ = true; ## Database settings $wgDBtype = "mysql"; $wgDBserver = "<%= @database_params[:host] %>"; $wgDBname = "<%= @database_params[:name] %>"; $wgDBuser = "<%= @database_params[:username] %>"; $wgDBpassword = "<%= @database_params[:password] %>"; # MySQL specific settings $wgDBprefix = ""; # MySQL table options to use during installation or update $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary"; # Experimental charset support for MySQL 5.0. $wgDBmysql5 = false; ## Shared memory settings $wgMainCacheType = CACHE_MEMCACHED; $wgMemCachedServers = array('127.0.0.1:11211'); $wgSessionsInObjectCache = TRUE; ## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: $wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert"; $wgGenerateThumbnailOnParse = false; $wgMaxImageArea = 125000000; $wgMaxShellMemory = 5524000; $wgMaxShellFileSize = 819200; $wgMaxShellTime = 360; $wgMaxShellWallClockTime = 360; # Allow some more upload extensions $wgFileExtensions[] = 'doc'; $wgFileExtensions[] = 'pdf'; $wgFileExtensions[] = 'odt'; $wgFileExtensions[] = 'odp'; $wgFileExtensions[] = 'ods'; $wgFileExtensions[] = 'svg'; $wgFileExtensions[] = 'osm'; <% @mediawiki[:extra_file_extensions].each do |mw_extra_file_extension| -%> $wgFileExtensions[] = '<%= mw_extra_file_extension %>'; <% end -%> # Add OSM XML file format per http://www.iana.org/assignments/media-types/media-types.xhtml # Shout out to Paul Norman for reserving this. # Helps MimeMagic determine XML-based formats and chooses the correct MimeType # for .osm files. $wgXMLMimeTypes[] = array('osm' => 'application/vnd.openstreetmap.data+xml'); $wgTrustedMediaFormats[] = 'application/vnd.openstreetmap.data+xml'; $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input'); $wgSVGConverter = 'rsvg'; $wgSVGMaxSize = 2000; # InstantCommons allows wiki to use images from https://commons.wikimedia.org <% if @mediawiki[:commons] -%> $wgUseInstantCommons = true; <% else -%> $wgUseInstantCommons = false; <% end -%> ## 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 $wgShellLocale = "en_US.utf8"; ## If you want to use image uploads under safe mode, ## create the directories images/archive, images/thumb and ## images/temp, and make them all writable. Then uncomment ## this, if it's not already uncommented: #$wgHashedUploadDirectory = false; ## Set $wgCacheDirectory to a writable directory on the web server ## to make your wiki go slightly faster. The directory should not ## be publically accessible from the web. #$wgCacheDirectory = "$IP/cache"; # Site language code, should be one of the list in ./languages/Names.php $wgLanguageCode = "en"; ## Enable setting the page content language by users $wgPageLanguageUseDB = true; $wgGroupPermissions['user']['pagelang'] = true; $wgSecretKey = '<%= @secret_key %>'; # Site upgrade key. Must be set to a string (default provided) to turn on the # web installer while LocalSettings.php is in place #$wgUpgradeKey = "6ad907e74fc65836"; ## Default skin: you can change the default skin. Use the internal symbolic ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector': $wgDefaultSkin = "<%= @mediawiki[:skin] %>"; ## 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 = "Wiki_content_license"; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/2.0/"; $wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license"; $wgRightsIcon = "/cc-wiki.png"; # Path to the GNU diff3 utility. Used for conflict resolution. $wgDiff3 = "/usr/bin/diff3"; $wgExternalDiffEngine = 'wikidiff2'; # Query string length limit for ResourceLoader. You should only set this if # your web server has a query string length limit (then set it to that limit), # or if you have suhosin.get.max_value_length set in php.ini (then set it to # that value) $wgResourceLoaderMaxQueryLength = -1; # End of automatically generated settings. # Add more configuration options below. # Only Allow Signed-in users to edit $wgGroupPermissions['*']['edit'] = false; # Only allow autoconfirmed for a few actions $wgGroupPermissions['user']['move'] = false; $wgGroupPermissions['user']['movefile'] = false; $wgGroupPermissions['user']['move-categorypages'] = false; $wgGroupPermissions['user']['upload'] = false; $wgGroupPermissions['autoconfirmed']['move'] = true; $wgGroupPermissions['autoconfirmed']['movefile'] = true; $wgGroupPermissions['autoconfirmed']['move-categorypages'] = true; $wgGroupPermissions['autoconfirmed']['upload'] = true; # Allow bureaucrat group access to oversight options $wgGroupPermissions['bureaucrat']['hideuser'] = true; $wgGroupPermissions['bureaucrat']['deletelogentry'] = true; $wgGroupPermissions['bureaucrat']['deleterevision'] = true; $wgGroupPermissions['bureaucrat']['suppressrevision'] = true; $wgGroupPermissions['bureaucrat']['suppressionlog'] = true; # Since 1.32 MW introduced interface-admin group to separate all UI-related rights. This makes sense for bigger sites, # but for OSM it makes more sense to keep group structure simple. Give all interface-admin rights to sysops. # Also remove the interface-admin group to avoid confusion. $wgGroupPermissions['sysop'] = array_merge( $wgGroupPermissions['sysop'], $wgGroupPermissions['interface-admin'] ); unset( $wgGroupPermissions['interface-admin'] ); unset( $wgRevokePermissions['interface-admin'] ); unset( $wgAddGroups['interface-admin'] ); unset( $wgRemoveGroups['interface-admin'] ); unset( $wgGroupsAddToSelf['interface-admin'] ); unset( $wgGroupsRemoveFromSelf['interface-admin'] ); # The v1.32+ gadget system also requires two additional rights # See https://www.mediawiki.org/wiki/Extension:Gadgets $wgGroupPermissions['sysop']['gadgets-edit'] = true; $wgGroupPermissions['sysop']['gadgets-definition-edit'] = true; <% if @mediawiki[:private_accounts] -%> # Prevent new user registrations except by existing users $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['user']['createaccount'] = true; <% end -%> <% if @mediawiki[:private_site] -%> # Disable reading by anonymous users $wgGroupPermissions['*']['read'] = false; # Allow anonymous users to access the login page $wgWhitelistRead = array ("Special:Userlogin"); # Prevent new user registrations except by sysops $wgGroupPermissions['*']['createaccount'] = false; # Restrict access to the upload directory $wgUploadPath = "$wgScriptPath/img_auth.php"; <% end -%> <% if not(@mediawiki[:private_accounts]) and not(@mediawiki[:private_site]) -%> # user group "confirmed" with identical rights as "autoconfirmed", but assigned manually by sysops $wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed']; $wgAddGroups['sysop'][] = 'confirmed'; $wgRemoveGroups['sysop'][] = 'confirmed'; <% end -%> # Allow Subpages on Main Namespace $wgNamespacesWithSubpages[NS_MAIN] = true; # DNS Blacklists to use $wgEnableDnsBlacklist = true; $wgDnsBlacklistUrls = array( 'proxies.dnsbl.sorbs.net.', 'opm.tornevall.org.', 'xbl.spamhaus.org.', 'dnsbl-2.uceprotect.net.' ); # Require validated email to edit $wgEmailConfirmToEdit = true; # Extend autoblock period $wgAutoblockExpiry = 7776000; // 90 days # Spam filter regex $wgSpamRegex = '/\b(gmail|dell|asus|eps(o|0)n|br(o|0)ther|can(o|0)n|hp|k(o|0)dak|lexmark|mcafee|bitdefender|n(o|0)rt(o|0)n( 360)?|avira|kaspersky|avg|avast|micr(o|0)s(o|0)ft|(o|0)utl(o|0)(o|0)k|printer|netgear( r(o|0)uter)?|quickb(o|0)(o|0)ks( payr(o|0)ll)?)( antivirus)?( helpline| cust(o|0)mer|( technical| tech)| cust(o|0)mer service)? (supp(o|0)rt number|ph(o|0)ne number|supp(o|0)rt ph(o|0)ne number|care number|helpdesk number)\b/i'; # Autopromote users to autoconfirmed $wgAutoConfirmAge = 345600; // 4 days $wgAutoConfirmCount = 10; # Disable Hit Counter for Performance $wgDisableCounters = TRUE; # Disable IP in Header to avoid cache issue $wgShowIPinHeader = FALSE; # Job Runs mostly by cron $wgJobRunRate = 0.01; # dissolves double redirects automatically $wgFixDoubleRedirects = TRUE; # Allow external images from a few sites $wgAllowExternalImagesFrom = array( 'http://tile.openstreetmap.org/', 'https://tile.openstreetmap.org', 'http://josm.openstreetmap.de/', 'http://trac.openstreetmap.org/', 'http://rweait.dev.openstreetmap.org/' ); $wgNoFollowDomainExceptions = array( 'www.openstreetmap.org', 'josm.openstreetmap.de', 'taginfo.openstreetmap.org', 'blog.openstreetmap.org', 'wiki.osmfoundation.org' ); # FIXME - move to specific # defines which links of the sidebar are translatable $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'mapfeatures-url', 'contributors-url', 'helppage', 'blogs-url', 'shop-url', 'sitesupport-url' ); # FIXME - move to specific $wgAllowUserJs = TRUE; $wgAllowUserCss = TRUE; # Raise expensive lua (and other function) call limits to match WP # Docs: https://www.mediawiki.org/wiki/Manual:$wgExpensiveParserFunctionLimit # Wikipedia's Config: https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php $wgExpensiveParserFunctionLimit = 500; <% if @mediawiki[:site_notice] -%> $wgSiteNotice = "<%= @mediawiki[:site_notice] %>"; <% end -%> <% if @mediawiki[:site_readonly] -%> $wgReadOnly = "<%= @mediawiki[:site_readonly] %>"; <% end -%> <% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%> <%= "require_once('#{file}');" %> <% end -%>