Code: Select all | 複製程式碼
<?php
/**
* This file was automatically generated by the MediaWiki 1.48.0-alpha
* installer. If you make manual changes, please keep track in case you
* need to recreate them later.
*
* See includes/MainConfigSchema.php for all configurable settings
* and their default values, but don't forget to make changes in _this_
* file, not there.
*
* Further documentation for configuration settings may be found at:
* https://www.mediawiki.org/wiki/Manual:C ... n_settings
*/
// Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
// Uncomment this to disable output compression
// $wgDisableOutputCompression = true;
$wgSitename = "zine-tw.com";
$wgMetaNamespace = "Zine-tw.com";
// 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 = "/mediawiki";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
// The protocol and server name to use in fully-qualified URLs
$wgServer = "https://zine-tw.com";
// The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
// The URL paths to the logo. Make sure you change this from the default,
// or else you'll overwrite your logo when you upgrade!
$wgLogos = [
'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
'icon' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
];
// UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "";
$wgPasswordSender = "";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
// Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "my_wiki";
$wgDBuser = "db_user";
$wgDBpassword = "db_password";
# MySQL specific settings
$wgDBprefix = "";
$wgDBssl = false;
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
// Shared database table
// This has no effect unless $wgSharedDB is also set.
$wgSharedTables[] = "actor";
// Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];
// To enable image uploads, make sure the 'images' directory
// is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
// InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = true;
// 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 = true;
// Site language code, should be one of the list in ./includes/Languages/Data/Names.php
$wgLanguageCode = "zh-tw";
// Time zone
$wgLocaltimezone = "Asia/Taipei";
// Set $wgCacheDirectory to a writable directory on the web server
// to make your wiki go slightly faster. The directory should not
// be publicly accessible from the web.
$wgCacheDirectory = "$IP/cache";
$wgSecretKey = "568565c98bc86c02cfd783a46456e953b618ee9aabd969e629ed34430ec2ccb7";
// 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 = "8d063da59bc3ddc4";
// 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 = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
// Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
## Default skin: you can change the default skin. Use the internal symbolic
// names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = 'vector-2022';
// Enabled skins.
// The following skins were automatically enabled:
wfLoadSkin( 'Vector' );
$wgVectorNightMode['beta'] = true;
$wgVectorNightMode['logged_out'] = true;
$wgVectorNightMode['logged_in'] = true;
$wgDefaultUserOptions['vector-theme'] = 'night';
// End of automatically generated settings.
// Add more configuration options below.
wfLoadExtension( 'MobileFrontend' );
# 核心郵件功能啟用
$wgEnableEmail = true;
$wgEnableUserEmail = true;
$wgEmailAuthentication = true;
$wgPasswordSender = 'yourname@gmail.com';
#
Port 465 (TLS/STARTTLS) 專屬配置
$wgSMTP = [
'host' => 'ssl://smtp.gmail.com', //
前綴請維持 ssl://
'port' => 465, //
埠號改為 465
'auth' => true,
'username' => 'yourname@gmail.com',
'password' => 'qbblfqpuukctgmhd', //
依然必須使用 Google 的應用程式密碼
'IDHost' => 'zine-tw.com',
'localhost'=> 'zine-tw.com'
];
# =========================================================================
#
12核心/15G RAM 多服務環境:MediaWiki 核心與效能微調
# =========================================================================
## 1. 關閉動態縮圖生成 (重要:防止記憶體溢出)
# 預設訪客看大圖時,MediaWiki 會呼叫 PHP 現場消耗數百 MB 記憶體去縮放圖片,容易觸發 OOM。
# 改為由背景任務 (Cron/JobQueue) 生成,或在使用者需要時才允許,上限設為 12 核可容納的極限。
$wgMaxImageArea = 1.25e7; // 限制最大可縮放的圖片像素,防止有人上傳超大相片卡死伺服器
$wgMemoryLimit = 512 * 1024 * 1024; // 強制限制 MediaWiki 單一進程最多使用 512M,配合我們 www.conf 的調整
## 2. 優化背景作業 (Job Queue) 分流
# 預設情況下,MediaWiki 在訪客瀏覽網頁時,會在後台偷偷執行待辦工作(例如更新分類、寄送通知)。
# 這在多服務環境下會拖慢網頁回應時間。我們將其調低,讓前端反應更敏捷。
$wgJobRunRate = 0.05; // 降低網頁觸發機率,改由背景排程處理
## 3. 開啟局部文字快取與語系快取
# 配合您系統已裝的 APCu,把 MediaWiki 本地翻譯和常用條目字串死鎖在記憶體中
$wgMessageCacheType = CACHE_ACCEL;
$wgLanguageConverterCacheType = CACHE_ACCEL;
## 4. 關閉偵錯模式(上線正式環境安全優化)
# 您目前開啟了除錯資訊,這會讓 PHP 產生大量額外日誌,拖慢高並發時的系統效能。
# 網站功能確認正常後,建議將以下三行改為常規生產環境模式:
#$wgShowExceptionDetails = false;
#$wgDevelopmentWarnings = false;
#error_reporting( 0 );
# =========================================================================
#
驗證碼防護設定 (ConfirmEdit - Google reCAPTCHA v2)
# =========================================================================
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'ConfirmEdit/ReCaptchaNoCaptcha' ); //
改成這樣才對
$wgCaptchaClass = 'ReCaptchaNoCaptcha';
// Google reCAPTCHA 驗證金鑰
$wgReCaptchaSiteKey = '6LfHL8gtAAAAAARi_CeOxtv3mBUSQsutt2EFG7Sh';
$wgReCaptchaSecretKey = '6LfHL8gtAAAAAOHxLxIhCdBeOKTl_6Ow37yy_Xp6';
// 驗證碼觸發時機
$wgCaptchaTriggers['edit'] = false;
$wgCaptchaTriggers['create'] = false;
$wgCaptchaTriggers['addurl'] = true; // 內文加入外部連結時
$wgCaptchaTriggers['createaccount'] = true; // 新帳號註冊時
$wgCaptchaTriggers['badlogin'] = true; // 密碼猜錯多次時
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'CodeMirror' );
wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';
wfLoadExtension( 'CheckUser' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'TemplateStyles' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'Echo' );
#暫時關閉
wfLoadExtension( 'LoginNotify' );
wfLoadExtension( 'AbuseFilter' );
wfLoadExtension( 'DiscussionTools' );
wfLoadExtension( 'CodeEditor' );
$wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
wfLoadExtension( 'Linter' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'Math' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'Thanks' );
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Babel' );
wfLoadExtension( 'cldr' );
$wgDefaultUserOptions['usenewrc'] = 1;
wfLoadExtension( 'Translate' );
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages
wfLoadExtension( 'UniversalLanguageSelector' );
/**
* This file was automatically generated by the MediaWiki 1.48.0-alpha
* installer. If you make manual changes, please keep track in case you
* need to recreate them later.
*
* See includes/MainConfigSchema.php for all configurable settings
* and their default values, but don't forget to make changes in _this_
* file, not there.
*
* Further documentation for configuration settings may be found at:
* https://www.mediawiki.org/wiki/Manual:C ... n_settings
*/
// Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
// Uncomment this to disable output compression
// $wgDisableOutputCompression = true;
$wgSitename = "zine-tw.com";
$wgMetaNamespace = "Zine-tw.com";
// 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 = "/mediawiki";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
// The protocol and server name to use in fully-qualified URLs
$wgServer = "https://zine-tw.com";
// The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
// The URL paths to the logo. Make sure you change this from the default,
// or else you'll overwrite your logo when you upgrade!
$wgLogos = [
'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
'icon' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
];
// UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "";
$wgPasswordSender = "";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
// Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "my_wiki";
$wgDBuser = "db_user";
$wgDBpassword = "db_password";
# MySQL specific settings
$wgDBprefix = "";
$wgDBssl = false;
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
// Shared database table
// This has no effect unless $wgSharedDB is also set.
$wgSharedTables[] = "actor";
// Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];
// To enable image uploads, make sure the 'images' directory
// is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
// InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = true;
// 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 = true;
// Site language code, should be one of the list in ./includes/Languages/Data/Names.php
$wgLanguageCode = "zh-tw";
// Time zone
$wgLocaltimezone = "Asia/Taipei";
// Set $wgCacheDirectory to a writable directory on the web server
// to make your wiki go slightly faster. The directory should not
// be publicly accessible from the web.
$wgCacheDirectory = "$IP/cache";
$wgSecretKey = "568565c98bc86c02cfd783a46456e953b618ee9aabd969e629ed34430ec2ccb7";
// 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 = "8d063da59bc3ddc4";
// 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 = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
// Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
## Default skin: you can change the default skin. Use the internal symbolic
// names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = 'vector-2022';
// Enabled skins.
// The following skins were automatically enabled:
wfLoadSkin( 'Vector' );
$wgVectorNightMode['beta'] = true;
$wgVectorNightMode['logged_out'] = true;
$wgVectorNightMode['logged_in'] = true;
$wgDefaultUserOptions['vector-theme'] = 'night';
// End of automatically generated settings.
// Add more configuration options below.
wfLoadExtension( 'MobileFrontend' );
# 核心郵件功能啟用
$wgEnableEmail = true;
$wgEnableUserEmail = true;
$wgEmailAuthentication = true;
$wgPasswordSender = 'yourname@gmail.com';
#
$wgSMTP = [
'host' => 'ssl://smtp.gmail.com', //
'port' => 465, //
'auth' => true,
'username' => 'yourname@gmail.com',
'password' => 'qbblfqpuukctgmhd', //
'IDHost' => 'zine-tw.com',
'localhost'=> 'zine-tw.com'
];
# =========================================================================
#
# =========================================================================
## 1. 關閉動態縮圖生成 (重要:防止記憶體溢出)
# 預設訪客看大圖時,MediaWiki 會呼叫 PHP 現場消耗數百 MB 記憶體去縮放圖片,容易觸發 OOM。
# 改為由背景任務 (Cron/JobQueue) 生成,或在使用者需要時才允許,上限設為 12 核可容納的極限。
$wgMaxImageArea = 1.25e7; // 限制最大可縮放的圖片像素,防止有人上傳超大相片卡死伺服器
$wgMemoryLimit = 512 * 1024 * 1024; // 強制限制 MediaWiki 單一進程最多使用 512M,配合我們 www.conf 的調整
## 2. 優化背景作業 (Job Queue) 分流
# 預設情況下,MediaWiki 在訪客瀏覽網頁時,會在後台偷偷執行待辦工作(例如更新分類、寄送通知)。
# 這在多服務環境下會拖慢網頁回應時間。我們將其調低,讓前端反應更敏捷。
$wgJobRunRate = 0.05; // 降低網頁觸發機率,改由背景排程處理
## 3. 開啟局部文字快取與語系快取
# 配合您系統已裝的 APCu,把 MediaWiki 本地翻譯和常用條目字串死鎖在記憶體中
$wgMessageCacheType = CACHE_ACCEL;
$wgLanguageConverterCacheType = CACHE_ACCEL;
## 4. 關閉偵錯模式(上線正式環境安全優化)
# 您目前開啟了除錯資訊,這會讓 PHP 產生大量額外日誌,拖慢高並發時的系統效能。
# 網站功能確認正常後,建議將以下三行改為常規生產環境模式:
#$wgShowExceptionDetails = false;
#$wgDevelopmentWarnings = false;
#error_reporting( 0 );
# =========================================================================
#
# =========================================================================
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'ConfirmEdit/ReCaptchaNoCaptcha' ); //
$wgCaptchaClass = 'ReCaptchaNoCaptcha';
// Google reCAPTCHA 驗證金鑰
$wgReCaptchaSiteKey = '6LfHL8gtAAAAAARi_CeOxtv3mBUSQsutt2EFG7Sh';
$wgReCaptchaSecretKey = '6LfHL8gtAAAAAOHxLxIhCdBeOKTl_6Ow37yy_Xp6';
// 驗證碼觸發時機
$wgCaptchaTriggers['edit'] = false;
$wgCaptchaTriggers['create'] = false;
$wgCaptchaTriggers['addurl'] = true; // 內文加入外部連結時
$wgCaptchaTriggers['createaccount'] = true; // 新帳號註冊時
$wgCaptchaTriggers['badlogin'] = true; // 密碼猜錯多次時
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'CodeMirror' );
wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';
wfLoadExtension( 'CheckUser' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'TemplateStyles' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'Echo' );
#暫時關閉
wfLoadExtension( 'LoginNotify' );
wfLoadExtension( 'AbuseFilter' );
wfLoadExtension( 'DiscussionTools' );
wfLoadExtension( 'CodeEditor' );
$wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
wfLoadExtension( 'Linter' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'Math' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'Thanks' );
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Babel' );
wfLoadExtension( 'cldr' );
$wgDefaultUserOptions['usenewrc'] = 1;
wfLoadExtension( 'Translate' );
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages
wfLoadExtension( 'UniversalLanguageSelector' );