|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * ---------------------------------------------------------------------------------------- |
| 4 | + * This file is provided by the wikibase/wikibase docker image. |
| 5 | + * This file will be passed through envsubst which will replace "$" with "$". |
| 6 | + * If you want to change MediaWiki or Wikibase settings then either mount a file over this |
| 7 | + * template and or run a different entrypoint. |
| 8 | + * ---------------------------------------------------------------------------------------- |
| 9 | + */ |
| 10 | + |
| 11 | +## Database settings |
| 12 | +## Environment variables will be substituted in here. |
| 13 | +$wgDBserver = "mysql.svc:3306"; |
| 14 | +$wgDBname = "scisrc_wiki"; |
| 15 | +$wgDBuser = "wikiuser"; |
| 16 | +$wgDBpassword = "qsV5Hj9D$<b;)6w3"; |
| 17 | + |
| 18 | +## Logs |
| 19 | +## Save these logs inside the container |
| 20 | +$wgDebugLogGroups = array( |
| 21 | + 'resourceloader' => '/var/log/mediawiki/resourceloader.log', |
| 22 | + 'exception' => '/var/log/mediawiki/exception.log', |
| 23 | + 'error' => '/var/log/mediawiki/error.log', |
| 24 | +); |
| 25 | + |
| 26 | +## Site Settings |
| 27 | +# TODO pass in the rest of this with env vars? |
| 28 | +$wgShellLocale = "en_US.utf8"; |
| 29 | +$wgLanguageCode = "en"; |
| 30 | +$wgSitename = "ScienceSource"; |
| 31 | +$wgMetaNamespace = "Project"; |
| 32 | +# Configured web paths & short URLs |
| 33 | +# This allows use of the /wiki/* path |
| 34 | +## https://www.mediawiki.org/wiki/Manual:Short_URL |
| 35 | +$wgScriptPath = "/w"; // this should already have been configured this way |
| 36 | +$wgArticlePath = "/wiki/$1"; |
| 37 | + |
| 38 | +#Set Secret |
| 39 | +$wgSecretKey = "secretkey"; |
| 40 | + |
| 41 | +## RC Age |
| 42 | +# https://www.mediawiki.org/wiki/Manual: |
| 43 | +# Items in the recentchanges table are periodically purged; entries older than this many seconds will go. |
| 44 | +# The query service (by default) loads data from recent changes |
| 45 | +# Set this to 1 year to avoid any changes being removed from the RC table over a shorter period of time. |
| 46 | +$wgRCMaxAge = 365 * 24 * 3600; |
| 47 | + |
| 48 | +wfLoadSkin( 'Vector' ); |
| 49 | + |
| 50 | +## Wikibase |
| 51 | +# Load Wikibase repo, client & lib with the example / default settings. |
| 52 | +require_once "$IP/extensions/Wikibase/vendor/autoload.php"; |
| 53 | +require_once "$IP/extensions/Wikibase/lib/WikibaseLib.php"; |
| 54 | +require_once "$IP/extensions/Wikibase/repo/Wikibase.php"; |
| 55 | +require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php"; |
| 56 | +require_once "$IP/extensions/Wikibase/client/WikibaseClient.php"; |
| 57 | +require_once "$IP/extensions/Wikibase/client/ExampleSettings.php"; |
| 58 | +# OAuth |
| 59 | +wfLoadExtension( 'OAuth' ); |
| 60 | +$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true; |
| 61 | +$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true; |
| 62 | +$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true; |
| 63 | +$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true; |
| 64 | + |
| 65 | +# WikibaseImport |
| 66 | +require_once "$IP/extensions/WikibaseImport/WikibaseImport.php"; |
| 67 | + |
| 68 | +# CirrusSearch |
| 69 | +wfLoadExtension( 'Elastica' ); |
| 70 | +require_once "$IP/extensions/CirrusSearch/CirrusSearch.php"; |
| 71 | +$wgCirrusSearchServers = [ 'elasticsearch.svc' ]; |
| 72 | +$wgSearchType = 'CirrusSearch'; |
| 73 | +$wgCirrusSearchExtraIndexSettings['index.mapping.total_fields.limit'] = 5000; |
| 74 | + |
| 75 | +$wgLogo = '/scisrclogo.svg'; |
| 76 | + |
| 77 | +# Define constants for additional namespaces. |
| 78 | +define("NS_ARTICLE", 3100); // This MUST be even. |
| 79 | +define("NS_ARTICLE_TALK", 3101); // This MUST be the following odd integer. |
| 80 | + |
| 81 | +# Add namespaces. |
| 82 | +$wgExtraNamespaces[NS_ARTICLE] = "Article"; |
| 83 | +$wgExtraNamespaces[NS_ARTICLE_TALK] = "Article_talk"; // Note underscores in the namespace name. |
| 84 | + |
| 85 | +$wgScriptPath = "/w"; // this should already have been configured this way |
| 86 | +$wgArticlePath = "/wiki/$1"; |
| 87 | + |
| 88 | +## Shared memory settings |
| 89 | +$wgMainCacheType = CACHE_ANYTHING; |
| 90 | +$wgSessionsInObjectCache = true; |
| 91 | + |
| 92 | +# Initially prevent unknown users from creating accounts or editing |
| 93 | +#$wgGroupPermissions['*']['edit'] = false; |
| 94 | +#$wgGroupPermissions['*']['createaccount'] = false; |
| 95 | + |
| 96 | +require_once "$IP/extensions/NamespaceHTML/NamespaceHTML.php"; |
| 97 | + |
| 98 | +$wgRawHtmlNamespaces = array( NS_ARTICLE ); # allow raw HTML but only in the Article namespace |
| 99 | + |
| 100 | +session_save_path("tmp"); |
0 commit comments