Daap config files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
5.1 KiB

<?php
/**
* ----------------------------------------------------------------------------------------
* This file is provided by the wikibase/wikibase docker image.
* This file will be passed through envsubst which will replace "$" with "$".
* If you want to change MediaWiki or Wikibase settings then either mount a file over this
* template and or run a different entrypoint.
* ----------------------------------------------------------------------------------------
*/
## Database settings
## Environment variables will be substituted in here.
$wgDBserver = "mysql.svc:3306";
$wgDBname = "my_wiki";
$wgDBuser = "wikiuser";
$wgDBpassword = "3bKNXRFfUGwpNG9z";
$wgServer = "https://daap.bannerrepeater.org";
## Logs
## Save these logs inside the container
$wgDebugLogGroups = array(
'resourceloader' => '/var/log/mediawiki/resourceloader.log',
'exception' => '/var/log/mediawiki/exception.log',
'error' => '/var/log/mediawiki/error.log',
);
## Site Settings
# TODO pass in the rest of this with env vars?
$wgShellLocale = "en_US.utf8";
$wgLanguageCode = "en";
$wgSitename = "DAAP";
$wgMetaNamespace = "Project";
# Configured web paths & short URLs
# This allows use of the /wiki/* path
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "/w"; // this should already have been configured this way
$wgArticlePath = "/wiki/$1";
#Set Secret
$wgSecretKey = "37xvDQZhrQuxYqzM";
## RC Age
# https://www.mediawiki.org/wiki/Manual:
# Items in the recentchanges table are periodically purged; entries older than this many seconds will go.
# The query service (by default) loads data from recent changes
# Set this to 1 year to avoid any changes being removed from the RC table over a shorter period of time.
$wgRCMaxAge = 365 * 24 * 3600;
wfLoadSkin( 'Vector' );
## Wikibase
# Load Wikibase repo, client & lib with the example / default settings.
require_once "$IP/extensions/Wikibase/vendor/autoload.php";
require_once "$IP/extensions/Wikibase/lib/WikibaseLib.php";
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
# OAuth
wfLoadExtension( 'OAuth' );
$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;
# WikibaseImport
require_once "$IP/extensions/WikibaseImport/WikibaseImport.php";
# CirrusSearch
wfLoadExtension( 'Elastica' );
require_once "$IP/extensions/CirrusSearch/CirrusSearch.php";
$wgCirrusSearchServers = [ 'elasticsearch.svc' ];
$wgSearchType = 'CirrusSearch';
$wgCirrusSearchExtraIndexSettings['index.mapping.total_fields.limit'] = 5000;
# UniversalLanguageSelector
wfLoadExtension( 'UniversalLanguageSelector' );
# cldr
wfLoadExtension( 'cldr' );
# CustomCaptchaThingy
wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/QuestyCaptcha' ]);
$wgCaptchaQuestions = [
'<br /> Please email daap dot signup at disroot dot org to receive the registration code and enter it here:' => '2020',
];
$wgCaptchaTriggers['createaccount'] = true;
# Custom namespaces
define("BIOGRAPHY", 3000);
define("BIOGRAPHY_TALK", 3001);
define("DESCRIPTION", 3002);
define("DESCRIPTION_TALK", 3003);
define("HISTORY", 3004);
define("HISTORY_TALK", 3005);
$wgExtraNamespaces[BIOGRAPHY] = "Biography";
$wgExtraNamespaces[BIOGRAPHY_TALK] = "Biography_talk";
$wgExtraNamespaces[DESCRIPTION] = "Description";
$wgExtraNamespaces[DESCRIPTION_TALK] = "Description_talk";
$wgExtraNamespaces[HISTORY] = "History";
$wgExtraNamespaces[HISTORY_TALK] = "History_talk";
# Files upload
$wgEnableUploads = true;
# allow uploading zip files and other extensions
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc',
'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx',
'pptx', 'ps', 'odt', 'ods', 'odp', 'odg', 'zip'
);
$wgTrustedMediaFormats[] = 'application/zip';
# incaseof problems with uploading files you could try to disable following checks:
#$wgVerifyMimeType = false;
#$wgStrictFileExtensions = false;
#$wgCheckFileExtensions = false;
#restrict anonymous edits
$wgGroupPermissions['*']['edit'] = false;
#elastic search issues
$wgDebugLogGroups['CirrusSearch'] = "$IP/extensions/CirrusSearch/error.log";
#import properties
wfLoadExtension( 'WikibaseImport' );
#circumvent users url additions restrictions
$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = true;
#commons mediawiki
$wgUseInstantCommons = true;
#users deletion and merging
wfLoadExtension( 'UserMerge' );
#By def nobody can use this other than bureaucrat
$wgGroupPermissions['bureaucrat']['usermerge'] = true;
#optional: def array
$wgUserMergeProtectedGroups = array( 'groupname' );
#force language to be english
# disable language selection
#$wgHiddenPrefs[] = 'language';
# if you want to disable variants as well
#$wgHiddenPrefs[] = 'variant';
#$wgHiddenPrefs[] = 'noconvertlink';
#$wgLanguageCode = 'en';
#wikibaselocalmedia
#wfLoadExtension( 'WikibaseLocalMedia' );