Localsettings
| tbd @ |
|---|
Background
This page contains part of the LocalSettings of Wiki Aventurica.
For clarity, many of these settings are stored on the server in distinct files, which are included into the localsettings via require_once "<path>/<file name>.php";.
Omitted on this page are settings found on these pages:
All of the setting variables should be documented in the MediaWiki wiki, for example $wgLanguageCode.
Usually, setting variables have a default value, which means that even if they are not set in the localsettings, they will have an effect on the wiki. For example: We do not set $wgRateLimits, but the default limits still apply to everything happening in the wiki.
Not in use at WA
- Performance
- Private wiki
Individual Settings
These settings differ for each wiki in our wiki farm.
Keys and Rights
# Site language code, should be one of the list in ./includes/languages/data/Names.php
$wgLanguageCode = "de";
$wgSecretKey = "<key>";
# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "<key>";
## 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 Aventurica:Lizenzbestimmungen"; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "https://creativecommons.org/licenses/by-sa/3.0/";
$wgRightsText = "''Creative Commons'' „Namensnennung – Weitergabe unter gleichen Bedingungen“";
Namespaces
###############
# Namensräume #
###############
define("NS_DSK", 218);
define("NS_DSK_TALK", 219);
define("NS_ELF", 220);
define("NS_ELF_TALK", 221);
define("NS_UNOFFICIAL", 222);
define("NS_UNOFFICIAL_TALK", 223);
define("NS_ILARIS", 444);
define("NS_ILARIS_TALK", 445);
define("NS_CHRON", 666);
define("NS_CHRON_TALK", 667);
define("NS_ARCHIVE", 998);
define("NS_ARCHIVE_TALK", 999);
$wgExtraNamespaces[NS_DSK] = "DSK";
$wgExtraNamespaces[NS_DSK_TALK] = "DSK_Diskussion";
$wgExtraNamespaces[NS_ELF] = "Elf";
$wgExtraNamespaces[NS_ELF_TALK] = "Elf_Diskussion";
$wgExtraNamespaces[NS_UNOFFICIAL] = "Inoffiziell";
$wgExtraNamespaces[NS_UNOFFICIAL_TALK] = "Inoffiziell_Diskussion";
$wgExtraNamespaces[NS_ILARIS] = "Ilaris";
$wgExtraNamespaces[NS_ILARIS_TALK] = "Ilaris_Diskussion";
$wgExtraNamespaces[NS_CHRON] = "Chronik";
$wgExtraNamespaces[NS_CHRON_TALK] = "Chronik_Diskussion";
$wgExtraNamespaces[NS_ARCHIVE] = "Archiv";
$wgExtraNamespaces[NS_ARCHIVE_TALK] = "Archiv_Diskussion";
$wgContentNamespaces = [ NS_MAIN, NS_DSK, NS_ELF, NS_UNOFFICIAL, NS_ILARIS ];
$wgNamespacesWithSubpages[NS_DSK] = true;
$wgNamespacesWithSubpages[NS_ELF] = true;
$wgNamespacesWithSubpages[NS_UNOFFICIAL] = true;
$wgNamespacesWithSubpages[NS_CHRON] = true;
$wgNamespacesWithSubpages[NS_ARCHIVE] = true;
$wgNamespaceAliases['Benutzerkonto'] = NS_USER;
$wgNamespaceAliases['Benutzerkonto_Diskussion'] = NS_USER_TALK;
$wgNamespaceAliases['Benutzende'] = NS_USER;
$wgNamespaceAliases['Benutzende_Diskussion'] = NS_USER_TALK;
$wgNamespaceAliases['Spielerwelten'] = NS_UNOFFICIAL;
$wgNamespaceAliases['Spielerwelten_Diskussion'] = NS_UNOFFICIAL_TALK;
$wgNamespaceAliases['Hausregel'] = NS_UNOFFICIAL;
$wgNamespaceAliases['Hausregel_Diskussion'] = NS_UNOFFICIAL_TALK;
$wgNamespaceAliases['Spielerheld'] = NS_UNOFFICIAL;
$wgNamespaceAliases['Spielerheld_Diskussion'] = NS_UNOFFICIAL_TALK;
$wgNamespacesToBeSearchedDefault = [
NS_MAIN => true,
NS_TALK => false,
NS_USER => false,
NS_USER_TALK => false,
NS_PROJECT => false,
NS_PROJECT_TALK => false,
NS_FILE => true,
NS_FILE_TALK => false,
NS_MEDIAWIKI => false,
NS_MEDIAWIKI_TALK => false,
NS_TEMPLATE => false,
NS_TEMPLATE_TALK => false,
NS_HELP => false,
NS_HELP_TALK => false,
NS_CATEGORY => true,
NS_CATEGORY_TALK => false,
NS_DSK => true,
NS_ELF => true,
NS_UNOFFICIAL => true,
NS_CHRON => true
];
Extensions for de
This uses a path variable defined later on this page, but in the localsettings on the server the path variable is defined before this, so it works as intended. For uploads, see Manual:Configuring file uploads.
################################
# Extension-Anpassungen für de #
################################
$wgEnableUploads = true; #nur im de-Wiki
wfLoadExtension( 'UploadWizard' );
require_once( "$wgCustomIncludes/UploadWizardCustom.php" );
$wgAbuseFilterIsCentral = true;
Common Settings
The following settings are used by every wiki in our wiki farm.
Paths
#########
# paths #
#########
## 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 = "/$wgLanguageCode";
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://$wgLanguageCode.wiki-aventurica.de";
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = "/shared";
# pretty URLs
$wgArticlePath = '/wiki/$1';
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
# WA-specific paths
$wgBasePath = "/var/www/vhosts/wiki-aventurica.de/";
$wgSecretPath = "$wgBasePath/httpdocs";
$wgWaPath = "$wgSecretPath/wa";
$wgCustomPath = "$wgWaPath/custom";
$wgCustomIncludes = "$wgCustomPath/includes";
$wgCustomResources = "/custom/resources";
$wgCommonPath = "$wgWaPath/shared";
# load skins only one time for all languages
$wgStylePath = "$wgResourceBasePath/skins";
#$wgStyleDirectory = $wgStylePath;
# logging - files should not be publicly accessible
$wgDebugLogFile = "$wgBasePath/debug/$wgDBname/log_debug_$wgDBname";
$wgDBerrorLog = "$wgBasePath/debug/dberror.log";
$wgDebugLogGroups = [
'exception' => "$wgBasePath/debug/exception.log",
'error' => "$wgBasePath/debug/error.log",
'fatal' => "$wgBasePath/debug/fatal.log",
'deprecated' => "$wgBasePath/debug/deprecated.log",
];
Main configuration
Setting $wgLocaltimezone together with date_default_timezone_set() fixed the following error: "date(): It is not safe to rely on the system's timezone settings..."
###############
# main config #
###############
# Periodically send a pingback to https://www.mediawiki.org/ with basic data
# about this MediaWiki instance. The Wikimedia Foundation shares this data
# with MediaWiki developers to help guide future development efforts.
$wgPingback = false;
$wgSitename = "Wiki Aventurica";
$wgMetaNamespace = "Wiki_Aventurica";
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = $wgLanguageCode . "wa";
# user and pw
require_once "$wgSecretPath/confincludes/data.php";
# MySQL specific settings
$wgDBprefix = "";
$wgDBssl = false;
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
# Einfach alles zählen, was im Inhaltsnamensraum liegt
$wgArticleCountMethod = 'any';
# time zone
$wgLocaltimezone = "Europe/Berlin";
date_default_timezone_set( $wgLocaltimezone );
# language links inline
$wgInterwikiMagic = false;
# Signatur in Edit-Toolbox
$wgExtraSignatureNamespaces = [ NS_MAIN, NS_HELP, NS_PROJECT ];
# Enable subpages
$wgNamespacesWithSubpages[NS_MAIN] = true;
$wgNamespacesWithSubpages[NS_PROJECT] = true;
$wgNamespacesWithSubpages[NS_HELP] = true;
$wgNamespacesWithSubpages[NS_TEMPLATE] = true;
# footer
$wgFooterIcons['monitoredby']['wikiapiary'] = [
"src" => "$wgCustomResources/Monitored_by_WikiApiary.png",
"url" => "https://wikiapiary.com/wiki/Wiki_Aventurica?pk_campaign=FooterIcon",
"alt" => "Monitored by WikiApiary"
];
Logo and Favicon
####################
# logo and favicon #
####################
$wgFavicon = "$wgCustomResources/favicon.ico";
$wgLogos = [
'1x' => "$wgCustomResources/WALogoAlt.png", // path to 1x version
'icon' => "$wgCustomResources/Wiki-Aventurica-Logo-50x50.svg", // Limited support, either 50x50 svg or 100x100 png WALogo.png
'wordmark' => [
'src' => "$wgCustomResources/WASchriftzug.png", // 135px wide image of sitename text, limited support
'1x' => "$wgCustomResources/WASchriftzug_124x32.svg", // optional if you want to support browsers with SVG
'width' => 124,
'height' => 32,
],
];
$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png";
#########
# email #
#########
$wgEnableSpecialMute = true;
## UPO means: this is also a user preference option
$wgEnableEmail = true; # true ist Standard
$wgEnableUserEmail = true; # UPO - true ist Standard
$wgEnableUserEmailMuteList = true; # es sollte die Möglichkeit geben, bestimmte Nutzer zu blocken
# this needs $wgSMTP to be defined, which was included earlier with the database user information
$wgEmergencyContact = "admin@wiki-aventurica.de";
$wgPasswordSender = "admin@wiki-aventurica.de";
$wgUserEmailConfirmationTokenExpiry = 24 * 60 * 60;
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;
Performance
see Manual:Cache, Manual:File cache and Manual:Job queue
###############
# Performance #
###############
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];
$wgMessageCacheType = CACHE_ACCEL; #if not set, inherited from MainCacheType
$wgParserCacheType = CACHE_ACCEL; #if not set, inherited from MainCacheType
$wgUseFileCache = true;
$wgCacheDirectory = "$wgWaPath/cache/$wgDBname"; #The directory should not be publicly accessible from the web.
$wgFileCacheDirectory = "$wgCacheDirectory/html";
$wgParserCacheExpireTime = 14*24*3600;
#$wgEnableSidebarCache = false; #auf false, da sonst unsere Seitenleiste nicht richtig funktioniert
#$wgSidebarCacheExpiry = 14*24*3600;
$wgSessionCacheType = CACHE_DB;
$wgJobRunRate = 0;
$wgMaxCredits = 0;
$wgExpensiveParserFunctionLimit = 200; #Vielschreiber funktioniert sonst nicht
File conversions
see Manual:Image_administration
###########
# Dateien #
###########
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgImageMagickTempDir = "$wgCacheDirectory/temp";
$wgSVGConverter = 'inkscape';
$wgSVGConverterPath = "/usr/bin";
$wgSVGConverters = [
'ImageMagick' => '$path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape $input -w $width -o $output',
'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input',
'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt', ],
];
# $wgThumbnailEpoch = 20240824161252; #anpassen, um alte thumbnails erneut zu erstellen
// Add several file types to the default array
$wgFileExtensions = array_merge(
$wgFileExtensions, [
'svg', 'pdf', 'txt', 'mid', 'mp3', 'kml', 'kmz', 'dic', 'ods'
]
);
Privacy and Security
########################
# privacy and security #
########################
$wgForceHTTPS = true;
$wgCookieSameSite = "None"; #für Centralauth-Feature?
$wgPutIPinRC = false; #IP-Adresse von Angemeldeten wird nicht benötigt
$wgPasswordPolicy['policies']['default']['MinimumPasswordLengthToLogin'] = 4;
$wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = 128;
#Benutzernamensraum sollte nicht indiziert werden
$wgNamespaceRobotPolicies = [
NS_USER => 'noindex',
NS_USER_TALK => 'noindex',
];
$wgAutoCreateTempUser = [
'known' => false,
'enabled' => true,
'actions' => [
'edit',
],
'genPattern' => '~$1',
'matchPattern' => null,
'reservedPattern' => '~$1',
'serialProvider' => [
'type' => 'centralauth',
'useYear' => true,
],
'serialMapping' => [
'type' => 'plain-numeric',
],
'expireAfterDays' => 30,
'notifyBeforeExpirationDays' => 10,
];
Spam and Vandalism
######################
# spam and vandalism #
######################
$wgAutoConfirmCount = 1; #Benutzergruppe autoconfirmed erst nach einer Bearbeitung
$wgAccountCreationThrottle = [ [
'count' => 1,
'seconds' => 86400,
] ]; #jede IP max 1 account innerhalb von 24 Stunden
$wgInvalidUsernameCharacters = '@:>=#€,!?.1234567890'; #Benutzernamen müssen weder Aussagen sein noch Zahlen enthalten.
$wgMaxNameChars = 50; #reicht um einen sinnvollen Benutzernamen anzulegen
#Spam wird durch Filter abgefangen, pageranks guter Links sollten nicht beeinträchtigt werden
$wgNoFollowLinks = false; #interne redlinks werden in hooks behandelt
#Aus dem "Sperren" ein richtiges Sperren machen
$wgBlockDisablesLogin = true;
Default User Preferences
##################################
# Standard-Benutzereinstellungen #
##################################
#$wgDefaultUserOptions['forceeditsummary'] = 1; #jetzt besser durch Abuse-Filter gelöst
$wgHiddenPrefs[] = 'forceeditsummary'; #Zusammenfassungskommentar erzwingen
$wgHiddenPrefs[] = 'gender'; #Wiki ist kein Datingportal
$wgDefaultUserOptions['useeditwarning'] = 0; #Nervfaktorminimierung, aber Möglichkeit für Einstellung belassen
$wgDefaultUserOptions['enotifwatchlistpages'] = 0; #Wiki sollte nicht standardmäßig mails verschicken
$wgDefaultUserOptions['enotifusertalkpages'] = 0; #Wiki sollte nicht standardmäßig mails verschicken
$wgDefaultUserOptions['uselivepreview'] = 1; #vielleicht etwas Bandbreite einsparen?
$wgDefaultUserOptions['ccmeonemails'] = 1; #man sollte immer eine Bestätigung bekommen, dass etwas verschickt wurde
$wgDefaultUserOptions['watchlistunwatchlinks'] = 1; #praktische Funktion
$wgDefaultUserOptions['requireemail'] = 1; #email-Spam verhindern
User Rights
##################
# Benutzerrechte #
##################
#Benutzer css und js
$wgAllowUserJs = true;
$wgAllowUserCss = true;
$wgAllowSiteCSSOnRestrictedPages = true; #CSS wird sonst auf Spezial:Einstellungen und Spezial:Login nicht geladen.
#Benutzernamensraum nur angemeldet bearbeiten
$wgNamespaceProtection[NS_USER] = [ 'edit-user' ];
Skins
see Manual:Skins
#########
# Skins #
#########
$wgEnableProtectionIndicators = true;
## Default skin: you can change the default skin. Use the internal symbolic
## names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = "timeless";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MinervaNeue' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
