1 配置文件LocalSettings.php

网站信息,用户,权限,邮件,插件等都可以在此配置

2.1 配置邮件系统

配置SMTP

  1. <?php
  2. // ...
  3. $wgEnableEmail = true;
  4. $wgEnableUserEmail = true; # UPO
  5. $wgEmergencyContact = "humaninfo@novogene.com"; # 和username保持一致
  6. $wgPasswordSender = "humaninfo@novogene.com";
  7. $wgSMTP = array(
  8. 'host' => 'smtp.exmail.qq.com', # 腾讯企业邮箱
  9. 'port' => 587, # For阿里云服务器
  10. 'auth' => true,
  11. 'username' => 'humaninfo@novogene.com',
  12. 'password' => 'your_password'
  13. );
  14. $wgEnotifUserTalk = false; # UPO
  15. $wgEnotifWatchlist = false; # UPO
  16. $wgEmailAuthentication = true;

2.2 加载插件

插件目录为extensions, 默认包含一些插件,想增加插件只需把新的插件解压到该目录下
开启指定插件

  1. <?php
  2. wfLoadExtension( 'WikiEditor' ); # 可视化编辑器
  3. wfLoadExtension( 'CodeEditor' );
  4. wfLoadExtension( 'SyntaxHighlight_GeSHi' ); # 语法高亮
  5. wfLoadExtension( 'ImageMap' );
  6. wfLoadExtension( 'PdfHandler' );
  7. wfLoadExtension( 'PageImages' );
  8. wfLoadExtension( 'ParserFunctions' );

2.3 匿名用户权限

配置匿名用户是否可以创建账号,读权限,编辑权限

  1. <?php
  2. $wgGroupPermissions['*']['createaccount'] = true;
  3. $wgGroupPermissions['*']['read'] = true;
  4. $wgGroupPermissions['*']['edit'] = false;

2.4 其他

  1. <?php
  2. // 网站图标
  3. $wgLogo = "$wgResourceBasePath/resources/assets/logo.png";
  4. // 默认皮肤
  5. $wgDefaultSkin = "vector";