Difference between revisions of "MediaWiki"

From Things and Stuff Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
* https://www.mediawiki.org/wiki/Future/The_big_picture
 
* https://www.mediawiki.org/wiki/Future/The_big_picture
 +
 +
 +
* [https://secluded.site/documenting-with-mediawiki/ Documenting With MediaWiki] - [https://lobste.rs/s/wlqu3t/documenting_with_mediawiki]
  
 
== Setup ==
 
== Setup ==
Line 277: Line 280:
 
== Resources ==
 
== Resources ==
 
* http://www.mediawiki.org/wiki/ResourceLoader
 
* http://www.mediawiki.org/wiki/ResourceLoader
 +
 +
 +
* [https://wikimediafoundation.org/news/2023/12/05/introducing-wikifunctions-first-wikimedia-project-to-launch-in-a-decade-creates-new-forms-of-knowledge/ Introducing Wikifunctions: first Wikimedia project to launch in a decade creates new forms of knowledge – Wikimedia Foundation] [https://news.ycombinator.com/item?id=38548130]
  
 
== Anti-spam ==
 
== Anti-spam ==
Line 308: Line 314:
 
  $wgCaptchaTriggers['createaccount'] = true;
 
  $wgCaptchaTriggers['createaccount'] = true;
 
  $wgCaptchaTriggers['badlogin']      = true;
 
  $wgCaptchaTriggers['badlogin']      = true;
 +
  
 
* http://www.mediawiki.org/wiki/Extension:SpamBlacklist
 
* http://www.mediawiki.org/wiki/Extension:SpamBlacklist
 
** not tried
 
** not tried
 +
  
 
* https://www.mediawiki.org/wiki/Extension:BlockAndNuke
 
* https://www.mediawiki.org/wiki/Extension:BlockAndNuke
 
** https://github.com/wikimedia/mediawiki-extensions-BlockAndNuke
 
** https://github.com/wikimedia/mediawiki-extensions-BlockAndNuke
 +
 +
 +
* https://www.mediawiki.org/wiki/Extension:SmiteSpam - provides a special page "Special:SmiteSpam" helping administrators identify and delete spam pages.
 +
  
 
* https://superuser.com/questions/100452/mass-rollback-on-mediawiki
 
* https://superuser.com/questions/100452/mass-rollback-on-mediawiki
 +
 +
 +
* https://github.com/wikimedia/mediawiki-extensions-DeleteBatch
  
 
== Tools ==
 
== Tools ==
Line 343: Line 358:
 
=== IRC bots ===
 
=== IRC bots ===
 
* https://www.mediawiki.org/wiki/Manual:IRC_RC_Bot
 
* https://www.mediawiki.org/wiki/Manual:IRC_RC_Bot
 +
  
 
== Templates ==
 
== Templates ==
 
* http://en.wikipedia.org/wiki/Template:Col-begin-small
 
* http://en.wikipedia.org/wiki/Template:Col-begin-small
 +
  
 
== URL ==
 
== URL ==
 
* https://www.mediawiki.org/wiki/Extension:ShortUrl
 
* https://www.mediawiki.org/wiki/Extension:ShortUrl
 +
  
 
== API ==
 
== API ==
 
* http://www.mediawiki.org/wiki/API:Data_formats
 
* http://www.mediawiki.org/wiki/API:Data_formats
 +
  
 
== Archive ==
 
== Archive ==
Line 357: Line 376:
  
 
* http://mementoweb.org/depot/
 
* http://mementoweb.org/depot/
 +
  
 
== SEO ==
 
== SEO ==
Line 366: Line 386:
 
   --urlpath http://mydomain.org/sitemap
 
   --urlpath http://mydomain.org/sitemap
  
== Semantic / Data ==
+
 
* http://semantic-mediawiki.org/
+
=== Tags ===
 +
* https://www.mediawiki.org/wiki/Extension:WikiSEO - allows you to replace, append or prepend the html title tag content, and allows you to add common SEO meta keywords and a meta description.
 +
 
 +
* https://www.mediawiki.org/wiki/Extension:GoogleRichCards - Automatically generates Google Rich Cards in JSON+LD format for mediawiki article pages.
 +
 
 +
* https://www.mediawiki.org/wiki/Extension:AdvancedMeta - extension allows setting the robots, keywords and description meta tags for MediaWiki, for SEO purposes
 +
 
 +
 
 +
 
 +
== Data / semantic ==
 +
 
 +
* https://www.mediawiki.org/wiki/Extension:Page_Schemas - a MediaWiki extension that allows for defining all the schema information about a "class", or data type - for naming, display, data input, and browsing - within a single piece of XML contained within a category page. This XML then is used to generate all the necessary additional pages needed to put the schema into effect, such as template pages and, for instance, if Page Forms is installed, form pages. The XML can be created and edited via a helper form, preventing users from having to generate or modify it manually.Page Schemas allows other extensions to define their own fields to add to the XML, using hooks.
 +
 
 +
Currently, the following extensions hook into Page Schemas:
 +
* Cargo
 +
* Page Forms
 +
* Semantic MediaWiki
 +
* Semantic Drilldown
 +
* Semantic Internal Objects
 +
 
 +
 
 +
 
 +
* http://semantic-mediawiki.org
 
** http://semantic-mediawiki.org/wiki/Data_visualization
 
** http://semantic-mediawiki.org/wiki/Data_visualization
 
** http://www.mediawiki.org/wiki/Extension:Semantic_MediaWiki
 
** http://www.mediawiki.org/wiki/Extension:Semantic_MediaWiki
Line 373: Line 415:
  
 
* http://semantic-mediawiki.org/wiki/Help:Inline_queries
 
* http://semantic-mediawiki.org/wiki/Help:Inline_queries
 +
  
 
* http://en.wikipedia.org/wiki/Wikidata
 
* http://en.wikipedia.org/wiki/Wikidata
 +
 
* http://en.wikipedia.org/wiki/DBpedia
 
* http://en.wikipedia.org/wiki/DBpedia
  
 
* http://semanticweb.org/wiki/Semantic_MediaWiki
 
* http://semanticweb.org/wiki/Semantic_MediaWiki
 +
 +
  
 
* http://www.kennel17.co.uk/testwiki/WikiDB/Tutorial
 
* http://www.kennel17.co.uk/testwiki/WikiDB/Tutorial
 +
  
 
* http://discoursedb.org/wiki/Main_Page
 
* http://discoursedb.org/wiki/Main_Page
 +
  
 
* http://aksw.org/Projects/OntoWiki.html
 
* http://aksw.org/Projects/OntoWiki.html
 +
  
 
=== JSON ===
 
=== JSON ===
Line 396: Line 445:
 
== Flow ==
 
== Flow ==
 
* http://www.mediawiki.org/wiki/Flow_Portal
 
* http://www.mediawiki.org/wiki/Flow_Portal
* http://unicorn.wmflabs.org/flow/
+
 
 +
* http://unicorn.wmflabs.org/flow

Latest revision as of 11:44, 5 February 2024

General


Setup

Nginx

Upgrade

Download latest, extract on-top of current. Be careful with overwriting if you have hacked a core theme.

tar xvzf mediawiki-1.19.1.tar.gz -C . --strip-components=1
php maintenance/update.php

Upgrade requires DB user grants for: select, insert, update, delete, alter, index

http://www.mediawiki.org/w/api.php?action=expandtemplates&text=http://download.wikimedia.org/mediawiki/{{MW%20stable%20branch%20number}}/mediawiki-{{MW%20stable%20release%20number}}.tar.gz

Backup

change vars;

nice -n 19 mysqldump -u $USER --password=$PASSWORD $DATABASE -c
nice -n 19 gzip -9 > wiki-$DATABASE-$(date '+%Y%m%d').sql.gz

Script

Compress

Configuration

Caching

$wgMainCacheType = CACHE_ACCEL;
  PHP acceleration, i.e., APC
php purgeList.php --all

Usage

Markup


{| class="wikitable"
|-
! Header 1
! Header 2
! Header 3
|-
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
|-
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3
|}


ToC

__TOC__


Hotkeys

Content


Interwiki

Categories

Theming and frontend




Bootstrap




Print.css


Footer links

MediaWiki:Privacy
MediaWiki:Aboutsite
MediaWiki:Disclaimers


Layout


Social



  • https://www.mediawiki.org/wiki/Extension:OpenGraphMeta - provides OpenGraph protocol metadata for articles on the wiki for 3rd parties like Facebook to extract. The primary use for this extension is for any wiki that provides its users a button to "Like" pages on the wiki, especially if the wiki uses a custom default skin. As sometimes Facebook can extract undesirable parts from the page (known on some custom skins to potentially extract random images irrelevant to the content) providing this data gives Facebook clean data to display in likes, and cleans up the long title into a pair of clean site and page titles.


Content


WYSIWYM


Real-time


Upload

Users

Signup

Login

Permissions

  • Special:UserRights - User rights management

Namespace protection

# Only allow autoconfirmed users to edit Project namespace
$wgNamespaceProtection[NS_PROJECT] = array( 'autoconfirmed' );
 
# Don't allow anyone to edit non-talk pages until they've confirmed their
# e-mail address (assuming we have no custom namespaces and allow edits
# from non-emailconfirmed users to start with)
# Note for 1.13: emailconfirmed group and right were removed from default
# setup, if you want to use it, you'll have to re-enable it manually
$wgNamespaceProtection[NS_MAIN]     = $wgNamespaceProtection[NS_USER]  =
$wgNamespaceProtection[NS_PROJECT]  = $wgNamespaceProtection[NS_IMAGE] =
$wgNamespaceProtection[NS_TEMPLATE] = $wgNamespaceProtection[NS_HELP]  =
 $wgNamespaceProtection[NS_CATEGORY] = array( 'emailconfirmed' );
 
# Only allow sysops to edit "Policy" namespace
$wgGroupPermissions['sysop']['editpolicy'] = true;
$wgNamespaceProtection[NS_POLICY] = array( 'editpolicy' );

Resources


Anti-spam

# Protect shit
require_once("$IP/extensions/ConfirmEdit/ConfirmEdit.php");
require_once("$IP/extensions/ConfirmEdit/QuestyCaptcha.php"); 
$wgCaptchaClass = 'QuestyCaptcha';
$wgCaptchaQuestions[] = array( 'question' => '123 + 1 =', 'answer' => '124' );
$wgCaptchaQuestions[] = array( 'question' => '321 + 2 =', 'answer' => '323' );
etc.
 
$wgGroupPermissions['*'            ]['skipcaptcha'] = false;
$wgGroupPermissions['user'         ]['skipcaptcha'] = false;
$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false;
$wgGroupPermissions['bot'          ]['skipcaptcha'] = true; // registered bots
$wgGroupPermissions['sysop'        ]['skipcaptcha'] = true;

$wgGroupPermissions['emailconfirmed']['skipcaptcha'] = true;
$ceAllowConfirmedEmail = true;

$wgCaptchaTriggers['edit']          = false; 
$wgCaptchaTriggers['create']        = false; 
$wgCaptchaTriggers['addurl']        = true; 
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;






Tools




Visualization


IRC bots


Templates


URL


API


Archive


SEO

php maintenance/generateSitemap.php \
  --fspath sitemap \
  --server http://mydomain.org \
  --urlpath http://mydomain.org/sitemap


Tags


Data / semantic

  • https://www.mediawiki.org/wiki/Extension:Page_Schemas - a MediaWiki extension that allows for defining all the schema information about a "class", or data type - for naming, display, data input, and browsing - within a single piece of XML contained within a category page. This XML then is used to generate all the necessary additional pages needed to put the schema into effect, such as template pages and, for instance, if Page Forms is installed, form pages. The XML can be created and edited via a helper form, preventing users from having to generate or modify it manually.Page Schemas allows other extensions to define their own fields to add to the XML, using hooks.

Currently, the following extensions hook into Page Schemas:

  • Cargo
  • Page Forms
  • Semantic MediaWiki
  • Semantic Drilldown
  • Semantic Internal Objects







JSON

Flow