Initiales Karate-Wiki Setup (Docker, LocalSettings, KarateMedia Video-Extension)
This commit is contained in:
commit
53aec82f7d
17 files changed
+763
No files matched your search
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
/**
|
||||
* Bereinigte & modernisierte LocalSettings.php fuer das Karate-Wiki (Goju-Kai Dojo)
|
||||
* Funktioniert sowohl in der Docker-Umgebung (ueber .env Umgebungsvariablen)
|
||||
* als auch auf dem Strato-Server (ueber LocalSettings.secrets.php).
|
||||
*/
|
||||
|
||||
if ( !defined( 'MEDIAWIKI' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Optional lokale Secrets-Datei laden (fuer Strato-Server ohne Docker, nicht im Git!)
|
||||
if ( file_exists( __DIR__ . '/LocalSettings.secrets.php' ) ) {
|
||||
require_once __DIR__ . '/LocalSettings.secrets.php';
|
||||
} elseif ( file_exists( "$IP/LocalSettings.secrets.php" ) ) {
|
||||
require_once "$IP/LocalSettings.secrets.php";
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 1. Upload-Limits & iOS/Safari Video-Streaming Fix
|
||||
// ----------------------------------------------------------------------------
|
||||
$wgUploadSizeWarning = 2147483647;
|
||||
$wgMaxUploadSize = 2147483647;
|
||||
|
||||
// Wichtig fuer iOS/Safari MP4 Byte-Range Video-Streaming (Phabricator T235554)
|
||||
$wgDisableOutputCompression = true;
|
||||
setlocale( LC_NUMERIC, 'C' );
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 2. Basis-Einstellungen & URLs
|
||||
// ----------------------------------------------------------------------------
|
||||
$wgSitename = getenv( 'MW_SITENAME' ) ?: 'Karate';
|
||||
$wgMetaNamespace = 'Karate';
|
||||
$wgLanguageCode = 'de';
|
||||
|
||||
$wgScriptPath = '';
|
||||
$wgScriptExtension = '.php';
|
||||
$wgServer = getenv( 'MW_SERVER' ) ?: ( $wgServer ?? 'https://www.gojukai-dojo.de' );
|
||||
|
||||
$wgStylePath = "$wgScriptPath/skins";
|
||||
$wgResourceBasePath = $wgScriptPath;
|
||||
$wgLogo = "$wgResourceBasePath/resources/assets/logo_goju-kai_Bleistift.png";
|
||||
$wgLogos = [
|
||||
'1x' => $wgLogo,
|
||||
'icon' => $wgLogo,
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 3. E-Mail-Konfiguration
|
||||
// ----------------------------------------------------------------------------
|
||||
$wgEnableEmail = true;
|
||||
$wgEnableUserEmail = true;
|
||||
$wgEmergencyContact = 'Wiki@gojukai-dojo.de';
|
||||
$wgPasswordSender = 'Wiki@gojukai-dojo.de';
|
||||
$wgEnotifUserTalk = false;
|
||||
$wgEnotifWatchlist = false;
|
||||
$wgEmailAuthentication = true;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 4. Datenbank-Konfiguration (aus Env oder LocalSettings.secrets.php)
|
||||
// ----------------------------------------------------------------------------
|
||||
$wgDBtype = 'mysql';
|
||||
$wgDBserver = getenv( 'MW_DB_HOST' ) ?: ( $wgDBserver ?? 'rdbms.strato.de' );
|
||||
$wgDBname = getenv( 'MW_DB_NAME' ) ?: ( $wgDBname ?? 'dbs1754262' );
|
||||
$wgDBuser = getenv( 'MW_DB_USER' ) ?: ( $wgDBuser ?? 'dbu1061679' );
|
||||
$wgDBpassword = getenv( 'MW_DB_PASSWORD' ) ?: ( $wgDBpassword ?? '' );
|
||||
$wgDBprefix = getenv( 'MW_DB_PREFIX' ) ?: 'Karate_';
|
||||
$wgDBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=binary';
|
||||
|
||||
$wgSecretKey = getenv( 'MW_SECRET_KEY' ) ?: ( $wgSecretKey ?? '' );
|
||||
$wgUpgradeKey = getenv( 'MW_UPGRADE_KEY' ) ?: ( $wgUpgradeKey ?? '' );
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 5. Cache & Uploads / Mediendateien
|
||||
// ----------------------------------------------------------------------------
|
||||
$wgMainCacheType = CACHE_NONE;
|
||||
$wgMemCachedServers = [];
|
||||
|
||||
$wgEnableUploads = true;
|
||||
$wgUseImageMagick = true;
|
||||
$wgImageMagickConvertCommand = '/usr/bin/convert';
|
||||
$wgUseInstantCommons = true;
|
||||
$wgShellLocale = 'en_US.utf8';
|
||||
|
||||
$wgFileExtensions = [
|
||||
'png', 'gif', 'jpg', 'jpeg', 'webp', 'svg',
|
||||
'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp',
|
||||
'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg',
|
||||
'ogg', 'mp3', 'mp4', 'webm', 'mov'
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 6. Berechtigungen & Benutzergruppen (Geschlossenes Vereins-Wiki)
|
||||
// ----------------------------------------------------------------------------
|
||||
$wgGroupPermissions['*']['createaccount'] = false;
|
||||
$wgGroupPermissions['*']['edit'] = false;
|
||||
$wgGroupPermissions['*']['read'] = false;
|
||||
|
||||
// Öffentlich lesbare Seiten (ohne Login)
|
||||
$wgWhitelistRead = [
|
||||
'Spezial:Userlogin',
|
||||
'Spezial:Anmelden',
|
||||
'Karate:Datenschutz',
|
||||
'Karate:Impressum',
|
||||
'Spezial:Benutzerkonto_beantragen',
|
||||
'Karate:Nutzungsbedingungen',
|
||||
];
|
||||
|
||||
$wgBlockDisablesLogin = true;
|
||||
|
||||
// Eigene Vereins-Gruppe "Trustworthy"
|
||||
$wgGroupPermissions['Trustworthy'] = $wgGroupPermissions['user'];
|
||||
$wgGroupPermissions['Trustworthy']['delete'] = true;
|
||||
$wgGroupPermissions['Trustworthy']['protect'] = true;
|
||||
$wgGroupPermissions['Trustworthy']['patrol'] = true;
|
||||
$wgGroupPermissions['Trustworthy']['purge'] = true;
|
||||
$wgGroupPermissions['Trustworthy']['createaccount'] = true;
|
||||
$wgGroupPermissions['Trustworthy']['block'] = true;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 7. Skins
|
||||
// ----------------------------------------------------------------------------
|
||||
wfLoadSkin( 'Vector' );
|
||||
wfLoadSkin( 'MonoBook' );
|
||||
wfLoadSkin( 'Timeless' );
|
||||
if ( is_dir( "$IP/skins/MinervaNeue" ) ) {
|
||||
wfLoadSkin( 'MinervaNeue' );
|
||||
}
|
||||
$wgDefaultSkin = 'vector';
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// 8. Extensions (Absturzsicher geladen)
|
||||
// ----------------------------------------------------------------------------
|
||||
$karateCoreExtensions = [
|
||||
'Cite',
|
||||
'Gadgets',
|
||||
'ImageMap',
|
||||
'InputBox',
|
||||
'Interwiki',
|
||||
'Nuke',
|
||||
'ParserFunctions',
|
||||
'PdfHandler',
|
||||
'SpamBlacklist',
|
||||
'SyntaxHighlight_GeSHi',
|
||||
'TitleBlacklist',
|
||||
'WikiEditor',
|
||||
];
|
||||
|
||||
foreach ( $karateCoreExtensions as $extName ) {
|
||||
if ( file_exists( "$IP/extensions/$extName/extension.json" ) ) {
|
||||
wfLoadExtension( $extName );
|
||||
}
|
||||
}
|
||||
|
||||
// Unsere eigene, wartungsfreie Video-Extension (ersetzt Html5mediator & EmbedVideo!)
|
||||
if ( file_exists( "$IP/extensions/KarateMedia/extension.json" ) ) {
|
||||
wfLoadExtension( 'KarateMedia' );
|
||||
}
|
||||
|
||||
// Optionale Zusatz-Extensions (werden nur geladen, wenn im Image/Ordner installiert)
|
||||
$karateOptionalExtensions = [
|
||||
'UploadWizard',
|
||||
'MobileFrontend',
|
||||
'MsUpload',
|
||||
'LinkTitles',
|
||||
'CookieWarning',
|
||||
'EditUser',
|
||||
'EmailPage',
|
||||
];
|
||||
|
||||
foreach ( $karateOptionalExtensions as $extName ) {
|
||||
if ( file_exists( "$IP/extensions/$extName/extension.json" ) ) {
|
||||
wfLoadExtension( $extName );
|
||||
}
|
||||
}
|
||||
|
||||
// WikiEditor Standard-Optionen
|
||||
$wgDefaultUserOptions['usebetatoolbar'] = 1;
|
||||
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
|
||||
$wgDefaultUserOptions['wikieditor-preview'] = 1;
|
||||
$wgDefaultUserOptions['wikieditor-publish'] = 1;
|
||||
|
||||
// CookieWarning & EditUser Berechtigungen
|
||||
$wgCookieWarningEnabled = true;
|
||||
$wgGroupPermissions['bureaucrat']['edituser'] = true;
|
||||
$wgGroupPermissions['sysop']['edituser-exempt'] = true;
|
||||
@@ -0,0 +1,6 @@
|
||||
; PHP-Konfiguration fuer grosse Karate-Videos (MP4)
|
||||
upload_max_filesize = 500M
|
||||
post_max_size = 500M
|
||||
memory_limit = 512M
|
||||
max_execution_time = 600
|
||||
max_input_time = 600
|
||||
Reference in new issue
Block a user