diff --git a/.dockerignore b/.dockerignore index db103f00..fe9d137f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,5 +2,8 @@ /configs/secret.php /configs/env +# Composer +/vendor + # Git /.git/ diff --git a/.editorconfig b/.editorconfig index c3cebb46..a03d5131 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,9 @@ indent_size = 2 [*.{php,php.example}] indent_style = tab indent_size = 4 + +[*.xml] +indent_style = tab + +[composer.lock] +indent_size = 4 diff --git a/.gitignore b/.gitignore index ef061ed3..9c068f9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # secret /configs/secret.php /configs/env + +# Composer +/vendor diff --git a/.phpcs.xml b/.phpcs.xml new file mode 100644 index 00000000..9e23142a --- /dev/null +++ b/.phpcs.xml @@ -0,0 +1,10 @@ + + + + + + + . + + + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..f198c9d3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,97 @@ +os: linux +dist: xenial +git: + quiet: true + depth: 3 + +# PHP +language: php +php: '7.2' +cache: + directories: + - vendor + +env: + global: + # Maximum iteration limit for loop + - LOOP_LIMIT=300 + +services: + - docker + +jobs: + include: + # + # LocalSettings.php 코드 lint + # + - name: lint + before_script: + - composer install --prefer-source --quiet --no-interaction + script: + - composer test + + + # + # 미디어위키 도커 이미지가 정상적으로 실행되는지 확인 + # + - name: docker + before_script: + # Setup files for database and memcached + - git clone https://github.com/femiwiki/database.git ~/swarm --depth=1 + - sudo mkdir -p /srv/mysql/ + # Initialize docker swarm and start memcached and MySQL + - docker swarm init + - docker stack deploy -c ~/swarm/memcached.yml memcached + - docker stack deploy -c ~/swarm/database.yml database + # Wait until root account's password of MySQL is generated + - | + printf 'Waiting for database_mysql service...'; + # Set counter to check endless loop + COUNTER=0; + while [ -z $(docker service logs database_mysql 2>&1 | grep -oP 'GENERATED ROOT PASSWORD: \K.+') ]; do + # retry every 1 second. + sleep 1; + # Append dots to the previous message if process is delayed. + printf '.'; + # Terminate Travis-ci if loop exceeds limit + (( COUNTER++ )); + if [ $COUNTER -gt $LOOP_LIMIT ]; then + printf '\n'; + echo 'Falied to start database_mysql service'; + # Print logs for debugging + docker service logs database_mysql; + travis_terminate 1; + fi + done; + printf '\n'; + # Edit configuration + - | + HOST_IP="$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')"; + MYSQL_PW="$(docker service logs database_mysql 2>&1 | grep -Po 'GENERATED ROOT PASSWORD: \K.+')"; + - mv configs/env.example configs/env + - sed -ri "s/mysqlhostname/${HOST_IP}/; s/mysqlusername/root/; s/mysqlpassword/${MYSQL_PW}/" configs/env + - mv configs/secret.php.example configs/secret.php + - sed -ri "s/DB_HOSTNAME/${HOST_IP}/; s/DB_USERNAME/root/; s/DB_PASSWORD/${MYSQL_PW}/; s/MEMCACHED_HOSTNAME/${HOST_IP}/" configs/secret.php + # Tweak LocalSettings.php for debugging + - printf 'wfRunDebugMode("localhost");\nrequire_once "$IP/includes/DevelopmentSettings.php";\n' >> configs/LocalSettings.php + script: + - docker build --tag femiwiki/mediawiki . + - docker stack deploy -c docker-compose.yml mediawiki + # Check if status of container is shutdown + - test -z "$(docker service ps -qf 'desired-state=Shutdown' mediawiki_fastcgi)" + # Access localhost until success + - | + printf 'Waiting for http...' + COUNTER=0; + until [ "$(curl -Lfs localhost)" ]; do + sleep 1; + printf '.'; + (( COUNTER++ )); + if [ $COUNTER -gt $LOOP_LIMIT ]; then + printf '\n'; + echo 'Failed to connect to localhost'; + travis_terminate 1; + fi + done; printf '\n' + - docker service logs mediawiki_fastcgi + - curl -Lf localhost | head diff --git a/README.md b/README.md index 9f9d3d9f..ed9f2b29 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,41 @@ -페미위키 미디어위키 서버 [![Docker Hub Status]][Docker Hub Link] +페미위키 미디어위키 서버 [![Docker Hub Status]][Docker Hub Link] [![Travis CI Status]][Travis CI Link] ======== 한국의 페미니즘 위키인 [femiwiki.com]에 사용되는 미디어위키 서버입니다. Dockerfile, 도커 컴포즈 파일 등 다양한 코드를 담고있습니다. -|| 내용 -:---|---- -기능 | 미디어위키 서버 -Base AMI | [Femiwiki Base AMI](https://github.com/femiwiki/ami) - -```sh -git clone https://github.com/femiwiki/mediawiki ~/mediawiki --depth=1 -cp ~/mediawiki/configs/env.example ~/mediawiki/configs/env -cp ~/mediawiki/configs/secret.php.example ~/mediawiki/configs/secret.php -vim configs/{env,secret.php} -# 각 설정 파일을 필요한 내용으로 고쳐주세요. - -sudo docker swarm init -sudo docker stack deploy -c ~/mediawiki/docker-compose.yml mediawiki -``` - -### 개발 ```bash -# 도커 이미지 업데이트 +# 도커이미지 빌드 docker build -t femiwiki/mediawiki . -docker push femiwiki/mediawiki -``` - -로컬에서 테스트하는 방법 -```bash +# 환경설정 파일인 secret.php와 env 를 적절히 수정해주세요 cp configs/secret.php.example configs/secret.php cp configs/env.example configs/env vim configs/{env,secret.php} -# secret.php와 env 를 적절히 수정해주세요 -# DB를 별도의 방법으로 적절히 띄운 뒤 도커 컴포즈 실행 +# (Optional) configs/LocalSettings.php 검사 +composer install +composer test +# (Optional) configs/LocalSettings.php 자동 교정 +composer fix + +# MySQL와 memcached를 별도의 방법으로 띄운 뒤 도커 컴포즈를 실행해주면 됩니다. +# 자세한 내용은 https://github.com/femiwiki/database 참고 docker-compose up ```   +### Production +페미위키 프로덕션 배포는 [Docker Swarm]으로 이뤄집니다. 페미위키에서 사용하는 +AWS EC2 AMI는 [femiwiki/ami]를 참고해주세요. + +```sh +sudo docker swarm init +sudo docker stack deploy -c ~/mediawiki/docker-compose.yml mediawiki +``` + +  + -------- The source code of *femiwiki/mediawiki* is primarily distributed under the terms @@ -48,6 +44,10 @@ of the [GNU Affero General Public License v3.0] or any later version. See [Docker Hub Status]: https://badgen.net/docker/pulls/femiwiki/mediawiki/?icon=docker&label=pulls [Docker Hub Link]: https://hub.docker.com/r/femiwiki/mediawiki/ +[Travis CI Status]: https://badgen.net/travis/femiwiki/mediawiki/master?label=build +[Travis CI Link]: https://travis-ci.org/femiwiki/mediawiki [femiwiki.com]: https://femiwiki.com +[Docker Swarm]: https://docs.docker.com/engine/swarm/ +[femiwiki/ami]: https://github.com/femiwiki/ami [GNU Affero General Public License v3.0]: LICENSE [COPYRIGHT]: COPYRIGHT diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..5c2414c1 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "require-dev": { + "mediawiki/mediawiki-codesniffer": "23.0.0", + "jakub-onderka/php-parallel-lint": "0.9.2" + }, + "scripts": { + "fix": "phpcbf", + "test": [ + "php -l configs/LocalSettings.php", + "parallel-lint --exclude vendor .", + "phpcs -p -s ." + ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..7e21a3be --- /dev/null +++ b/composer.lock @@ -0,0 +1,283 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "44e403c1152e43f7b017cc2be0d5dbfb", + "packages": [], + "packages-dev": [ + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-08-30T16:08:34+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/cb17687e9f936acd7e7245ad3890f953770dec1b", + "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2018-04-30T10:33:04+00:00" + }, + { + "name": "jakub-onderka/php-parallel-lint", + "version": "v0.9.2", + "source": { + "type": "git", + "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", + "reference": "2ead2e4043ab125bee9554f356e0a86742c2d4fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/2ead2e4043ab125bee9554f356e0a86742c2d4fa", + "reference": "2ead2e4043ab125bee9554f356e0a86742c2d4fa", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "~0.3", + "nette/tester": "~1.3" + }, + "suggest": { + "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", + "time": "2015-12-15T10:42:16+00:00" + }, + { + "name": "mediawiki/mediawiki-codesniffer", + "version": "v23.0.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/mediawiki-tools-codesniffer.git", + "reference": "c271e2b0388d2eaf7f2b15afc4d0f1dcfc30d937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/mediawiki-tools-codesniffer/zipball/c271e2b0388d2eaf7f2b15afc4d0f1dcfc30d937", + "reference": "c271e2b0388d2eaf7f2b15afc4d0f1dcfc30d937", + "shasum": "" + }, + "require": { + "composer/semver": "1.4.2", + "composer/spdx-licenses": "1.4.0", + "php": ">= 5.6.99", + "squizlabs/php_codesniffer": "3.3.2" + }, + "require-dev": { + "jakub-onderka/php-console-highlighter": "0.3.2", + "jakub-onderka/php-parallel-lint": "1.0.0", + "mediawiki/minus-x": "0.3.1", + "phpunit/phpunit": "4.8.36 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "MediaWiki\\": "MediaWiki" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "MediaWiki CodeSniffer Standards", + "homepage": "https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP", + "keywords": [ + "codesniffer", + "mediawiki" + ], + "time": "2018-11-14T01:45:17+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-09-23T23:08:17+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/configs/LocalSettings.php b/configs/LocalSettings.php index 7a3814be..ac3d9a13 100644 --- a/configs/LocalSettings.php +++ b/configs/LocalSettings.php @@ -14,52 +14,57 @@ exit; } -## Uncomment this to disable output compression -# $wgDisableOutputCompression = true; - $wgSitename = '페미위키'; -## 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 +# 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 = ''; $wgArticlePath = "/w/$1"; -## The protocol and server name to use in fully-qualified URLs +# The protocol and server name to use in fully-qualified URLs $wgServer = 'https://femiwiki.com'; $wgCanonicalServer = 'https://femiwiki.com'; $wgEnableCanonicalServerLink = true; -## The URL path to static resources (images, scripts, etc.) +# The URL path to static resources (images, scripts, etc.) $wgResourceBasePath = $wgScriptPath; $wgStyleVersion = '20181013_0'; $wgResourceLoaderMaxage = [ 'versioned' => [ - // Squid/Varnish but also any other public proxy cache between the client and MediaWiki - 'server' => 90 * 24 * 60 * 60, // 90 days - // On the client side (e.g. in the browser cache). - 'client' => 90 * 24 * 60 * 60, // 90 days + # Squid/Varnish but also any other public proxy cache between the client and MediaWiki + 'server' => 90 * 24 * 60 * 60, # 90 days + # On the client side (e.g. in the browser cache). + 'client' => 90 * 24 * 60 * 60, # 90 days ], 'unversioned' => [ - 'server' => 3 * 60, // 3 mins - 'client' => 3 * 60, // 3 mins + # 3 minutes + 'server' => 3 * 60, + # 3 minutes + 'client' => 3 * 60, ], ]; -## Trust an X-Forwarded-For (XFF) header specifying a private IP in requests -## from a trusted forwarding proxy +# Trust an X-Forwarded-For (XFF) header specifying a private IP in requests +# from a trusted forwarding proxy $wgUsePrivateIPs = true; $wgSquidServersNoPurge = [ '172.31.0.0/16', '10.0.0.0/8' ]; -## The URL path to the logo. Make sure you change this from the default, -## or else you'll overwrite your logo when you upgrade! +# The URL path to the logo. Make sure you change this from the default, +# or else you'll overwrite your logo when you upgrade! +# +# References: +# https://www.mediawiki.org/wiki/Manual:$wgLogo +# https://www.mediawiki.org/wiki/Manual:$wgLogoHD $wgLogo = "$wgResourceBasePath/skins/Femiwiki/images/logo-1200-630.png"; -# @todo Add $wgLogoHD -## UPO means: this is also a user preference option +# UPO means: this is also a user preference option +# +# Reference: +# https://www.mediawiki.org/wiki/Help:User_preference_option $wgEnableEmail = true; $wgEnableUserEmail = true; # UPO $wgAllowHTMLEmail = true; @@ -79,7 +84,7 @@ $wgEnotifWatchlist = false; # UPO $wgEmailAuthentication = true; -## $wgStructuredChangeFiltersShowPreference do exists untli Mediawiki 1.32. +# $wgStructuredChangeFiltersShowPreference do exists untli Mediawiki 1.32. if ( version_compare( $wgVersion, '1.32', '<' ) ) { $wgStructuredChangeFiltersShowPreference = true; # UPO } @@ -94,14 +99,14 @@ # MySQL table options to use during installation or update $wgDBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=binary'; -## Shared memory settings +# Shared memory settings $wgMainCacheType = CACHE_MEMCACHED; $wgSessionCacheType = CACHE_MEMCACHED; $wgParserCacheType = CACHE_MEMCACHED; $wgMessageCacheType = CACHE_MEMCACHED; -## To enable image uploads, make sure the 'images' directory -## is writable, then set this to true: +# To enable image uploads, make sure the 'images' directory +# is writable, then set this to true: $wgEnableUploads = true; $wgFileExtensions[] = 'svg'; $wgAllowTitlesInSVG = true; @@ -112,14 +117,14 @@ # InstantCommons allows wiki to use images from https://commons.wikimedia.org $wgUseInstantCommons = true; -## If you use ImageMagick (or any other shell command) on a -## Linux server, this will need to be set to the name of an -## available UTF-8 locale +# If you use ImageMagick (or any other shell command) on a +# Linux server, this will need to be set to the name of an +# available UTF-8 locale $wgShellLocale = 'C.UTF-8'; -## Set $wgCacheDirectory to a writable directory on the web server -## to make your wiki go slightly faster. The directory should not -## be publically accessible from the web. +# Set $wgCacheDirectory to a writable directory on the web server +# to make your wiki go slightly faster. The directory should not +# be publically accessible from the web. $wgCacheDirectory = '/tmp/cache'; $wgUseFileCache = true; @@ -135,8 +140,8 @@ # 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, ie 'vector', 'monobook': +# Default skin: you can change the default skin. Use the internal symbolic +# names, ie 'vector', 'monobook': $wgDefaultSkin = 'femiwiki'; # Enabled skins. @@ -145,17 +150,16 @@ wfLoadSkin( 'Femiwiki' ); $wgFacebookAppId = '1937597133150935'; -# End of automatically generated settings. -# Add more configuration options below. - +# # Namespace settings -## BBS +# +# BBS define( 'NS_BBS', 3906 ); define( 'NS_BBS_TALK', 3907 ); $wgExtraNamespaces[NS_BBS] = '게시판'; $wgExtraNamespaces[NS_BBS_TALK] = '게시판토론'; -## BBS (Legacy) +# BBS (Legacy) define( 'NS_BBSFREE', 3902 ); define( 'NS_BBSFREE_TALK', 3903 ); $wgExtraNamespaces[NS_BBSFREE] = '자유게시판'; @@ -174,10 +178,10 @@ $wgGroupPermissions['oversight']['deleterevision'] = true; $wgGroupPermissions['bot']['patrolmarks'] = true; -## Prevent anonymous users from edit pages +# Prevent anonymous users from edit pages $wgGroupPermissions['*']['edit'] = false; -## Set when users become autoconfirmed users +# Set when users become autoconfirmed users $wgAutoConfirmCount = 0; $wgAutoConfirmAge = 3600; @@ -188,11 +192,11 @@ ], ]; -## Allow autoconfirmed users to edit pages +# Allow autoconfirmed users to edit pages $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['autoconfirmed']['edit'] = true; -## Early adopt interface-admin that introduced in Mediawiki 1.32 +# Early adopt interface-admin that introduced in Mediawiki 1.32 if ( version_compare( $wgVersion, '1.32', '<' ) ) { $wgGroupPermissions['interface-admin']['editusercss'] = true; $wgGroupPermissions['interface-admin']['edituserjson'] = true; @@ -206,7 +210,7 @@ $wgGroupPermissions['sysop']['edituserjs'] = false; } -## Add restricted-sysop group +# Add restricted-sysop group $wgGroupPermissions['restricted-sysop'] = $wgGroupPermissions['sysop']; $wgGroupPermissions['restricted-sysop']['apihighlimits'] = false; $wgGroupPermissions['restricted-sysop']['editinterface'] = false; @@ -216,10 +220,10 @@ $wgGroupPermissions['restricted-sysop']['move-rootuserpages'] = false; $wgGroupPermissions['restricted-sysop']['unblockself'] = false; -## FemiwikiTeam is just a list of all Femiwiki team member +# FemiwikiTeam is just a list of all Femiwiki team member $wgGroupPermissions['femiwiki-team']['editprotected'] = true; -## Remain commemorative Seeder group +# Remain commemorative Seeder group $wgGroupPermissions['seeder']['read'] = true; # Show numbers on headings @@ -231,11 +235,11 @@ # Hide some Preferences $wgHiddenPrefs[] = 'gender'; $wgHiddenPrefs[] = 'realname'; -## @See https://github.com/femiwiki/mediawiki/issues/210 +# See https://github.com/femiwiki/mediawiki/issues/210 if ( version_compare( $wgVersion, '1.32', '<' ) ) { $wgHiddenPrefs[] = 'showtoolbar'; } -## @See https://github.com/femiwiki/mediawiki/issues/211 +# See https://github.com/femiwiki/mediawiki/issues/211 $wgHiddenPrefs[] = 'numberheadings'; # Allow display titles not only to titles that normalize to the same canonical @@ -262,7 +266,7 @@ # all pages (that are not redirects) are considered as valid articles $wgArticleCountMethod = 'any'; -## Prevent Search for some namespaces +# Prevent Search for some namespaces $wgNamespaceRobotPolicies = [ NS_TALK => 'noindex,nofollow', NS_USER => 'noindex,nofollow', @@ -288,18 +292,18 @@ # # Extensions # -## ParserFunction +# ParserFunction wfLoadExtension( 'ParserFunctions' ); $wgPFEnableStringFunctions = true; -## AWS +# AWS wfLoadExtension( 'AWS' ); $wgAWSRegion = 'ap-northeast-1'; $wgAWSBucketPrefix = 'femiwiki-uploaded-files'; $wgAWSRepoHashLevels = 2; $wgAWSRepoDeletedHashLevels = 2; -## VisualEditor +# VisualEditor wfLoadExtension( 'VisualEditor' ); $wgVisualEditorAvailableNamespaces = [ NS_SPECIAL => true, @@ -341,30 +345,30 @@ # Enable twocolconflict to opt-out $wgDefaultUserOptions['twocolconflict'] = true; -## TemplateData +# TemplateData wfLoadExtension( 'TemplateData' ); -## RevisionSlider +# RevisionSlider wfLoadExtension( 'RevisionSlider' ); -## Echo +# Echo wfLoadExtension( 'Echo' ); -## TwoColConflict +# TwoColConflict wfLoadExtension( 'TwoColConflict' ); $wgDefaultUserOptions['twocolconft'] = true; -## Interwiki +# Interwiki wfLoadExtension( 'Interwiki' ); -## Thanks +# Thanks wfLoadExtension( 'Thanks' ); -## Scribunto +# Scribunto wfLoadExtension( 'Scribunto' ); $wgScribuntoDefaultEngine = 'luastandalone'; -## Flow +# Flow wfLoadExtension( 'Flow' ); $wgFlowEditorList = [ 'visualeditor', 'none' ]; $wgNamespaceContentModels[NS_TALK] = 'flow-board'; @@ -375,35 +379,35 @@ $wgNamespaceContentModels[NS_TEMPLATE_TALK] = 'flow-board'; $wgNamespaceContentModels[NS_HELP_TALK] = 'flow-board'; $wgNamespaceContentModels[NS_CATEGORY_TALK] = 'flow-board'; -$wgNamespaceContentModels[275] = 'flow-board'; /* Widget talk */ -$wgNamespaceContentModels[829] = 'flow-board'; /* Module talk */ -$wgNamespaceContentModels[2301] = 'flow-board'; /* Gadget talk */ -$wgNamespaceContentModels[2303] = 'flow-board'; /* Gadget definition talk */ +$wgNamespaceContentModels[275] = 'flow-board'; # Widget talk +$wgNamespaceContentModels[829] = 'flow-board'; # Module talk +$wgNamespaceContentModels[2301] = 'flow-board'; # Gadget talk +$wgNamespaceContentModels[2303] = 'flow-board'; # Gadget definition talk $wgNamespaceContentModels[NS_BBS] = 'flow-board'; $wgNamespaceContentModels[NS_BBS_TALK] = 'flow-board'; -## TemplateStyles +# TemplateStyles wfLoadExtension( 'TemplateStyles' ); -## CategoryTree +# CategoryTree wfLoadExtension( 'CategoryTree' ); -## Disambiguator +# Disambiguator wfLoadExtension( 'Disambiguator' ); -## CreateUserPage +# CreateUserPage wfLoadExtension( 'CreateUserPage' ); -## Cite +# Cite wfLoadExtension( 'Cite' ); -## CiteThisPage +# CiteThisPage wfLoadExtension( 'CiteThisPage' ); -## CodeEditor +# CodeEditor wfLoadExtension( 'CodeEditor' ); -## WikiEditor +# WikiEditor wfLoadExtension( 'WikiEditor' ); $wgDefaultUserOptions['usebetatoolbar'] = 1; $wgDefaultUserOptions['usebetatoolbar-cgd'] = 1; @@ -411,7 +415,7 @@ $wgDefaultUserOptions['wikieditor-publish'] = 1; $wgHiddenPrefs[] = 'usebetatoolbar'; -## AbuseFilter +# AbuseFilter wfLoadExtension( 'AbuseFilter' ); $wgGroupPermissions['sysop']['abusefilter-modify'] = true; $wgGroupPermissions['*']['abusefilter-log-detail'] = true; @@ -421,7 +425,7 @@ $wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true; $wgGroupPermissions['sysop']['abusefilter-revert'] = true; -## ConfirmEdit +# ConfirmEdit wfLoadExtensions( [ 'ConfirmEdit', 'ConfirmEdit/QuestyCaptcha' ] ); $wgCaptchaQuestions = [ '나는 페미니스트입니다.' => [ @@ -441,79 +445,79 @@ $wgCaptchaTriggers['createaccount'] = true; $wgCaptchaTriggers['badlogin'] = false; -## Gadgets +# Gadgets wfLoadExtension( 'Gadgets' ); $wgGadgetsRepoClass = 'GadgetDefinitionNamespaceRepo'; -## Widgets +# Widgets require_once "$IP/extensions/Widgets/Widgets.php"; $wgNamespaceContentModels[274] = CONTENT_MODEL_TEXT; -## CheckUser +# CheckUser wfLoadExtension( 'CheckUser' ); -## UserMerge +# UserMerge wfLoadExtension( 'UserMerge' ); -## Renameuser +# Renameuser wfLoadExtension( 'Renameuser' ); -## Poem +# Poem wfLoadExtension( 'Poem' ); -## SyntaxHighlight +# SyntaxHighlight wfLoadExtension( 'SyntaxHighlight_GeSHi' ); -## CharInsert +# CharInsert wfLoadExtension( 'CharInsert' ); -## CodeMirror +# CodeMirror wfLoadExtension( 'CodeMirror' ); -## EmbedVideo +# EmbedVideo wfLoadExtension( 'EmbedVideo' ); -## InputBox +# InputBox wfLoadExtension( 'InputBox' ); -## Description2 +# Description2 wfLoadExtension( 'Description2' ); -## OpenGraphMeta +# OpenGraphMeta wfLoadExtension( 'OpenGraphMeta' ); -## PageImages +# PageImages wfLoadExtension( 'PageImages' ); -## FacetedCategory +# FacetedCategory wfLoadExtension( 'FacetedCategory' ); -## UnifiedExtensionForFemiwiki --it requires the CategoryTree extension +# UnifiedExtensionForFemiwiki --it requires the CategoryTree extension wfLoadExtension( 'UnifiedExtensionForFemiwiki' ); $wgSpecialPages['Uncategorizedcategories'] = [ SpecialUncategorizedCategoryTree::class ]; $wgSpecialPages['Whatlinkshere'] = [ SpecialOrderedWhatlinkshere::class ]; $wgGoogleAnalyticsTrackingID = 'UA-82072330-1'; -## IntersectionSearch +# IntersectionSearch wfLoadExtension( 'CategoryIntersectionSearch' ); -## SimpleMathJax +# SimpleMathJax wfLoadExtension( 'SimpleMathJax' ); -## HTMLTags +# HTMLTags require_once "$IP/extensions/HTMLTags/HTMLTags.php"; $wgHTMLTagsAttributes['a'] = [ 'href', 'class', 'itemprop' ]; $wgHTMLTagsAttributes['link'] = [ 'href', 'itemprop' ]; $wgHTMLTagsAttributes['meta'] = [ 'content', 'itemprop' ]; $wgHTMLTagsAttributes['iframe'] = [ 'src', 'class', 'style' ]; -## Josa +# Josa wfLoadExtension( 'Josa' ); -## Sanction +# Sanction wfLoadExtension( 'Sanctions' ); -## BetaFeatures +# BetaFeatures wfLoadExtension( 'BetaFeatures' ); #