Difference between revisions of "Mediawiki Plugin"

From FusionForge Wiki
Jump to: navigation, search
(Data Export)
(Data Export: more precisions)
Line 29: Line 29:
== Data Export ==
== Data Export ==
For a public project: see https://web_host/plugins/mediawiki/dumps/ (last version of each page only), performed by <tt>forge_run_plugin_job mediawiki dump-wikis.php</tt>. Individual pages can also be exported using https://web_host/plugins/mediawiki/wiki/PROJECT/index.php/Special:Export .
* A list of individual pages can be exported by the user using https://web_host/plugins/mediawiki/wiki/PROJECT/index.php/Special:Export .
* For a complete pages export:
For a private project:
** For a public project: see https://web_host/plugins/mediawiki/dumps/ (last version of each page only), performed by <tt>forge_run_plugin_job mediawiki dump-wikis.php</tt>.
* Pages export : use XML export (with complete history)
** For a private project or for complete history: use [https://www.mediawiki.org/wiki/Manual:DumpBackup.php XML export]:
  /usr/share/gforge/plugins/mediawiki/bin/mw-wrapper.php $PROJECT dumpBackup.php --full | gzip > $PROJECT.xml.gz
  /usr/share/gforge/plugins/mediawiki/bin/mw-wrapper.php $PROJECT dumpBackup.php --full | gzip > $PROJECT.xml.gz
* Attachments export:
* Attachments export:

Revision as of 16:21, 23 May 2014

Mediawiki Plugin
Plugin to use the "Mediawiki" (mediawiki) wiki. Plugin available since FusionForge 4.7.x .
Plugin Changelog
Plugin Changelog for mediawiki
actively maintained
Matrix by Fusionforge Version and by Linux Distribution
distribution\version 4.8.x 5.0.x 5.1.x 5.2.x 5.3.x 6.0.x master
Debian undefined undefined undefined undefined undefined undefined undefined
CentOS undefined undefined undefined undefined undefined undefined undefined

See the plugin's README on the master/trunk for some details about the plugin.

The authentication for MediaWiki is adapted to use the FusionForge user credentials. See http://lists.fusionforge.org/pipermail/fusionforge-general/2011-October/001589.html for more details.

Using the API

The API is available to interact with the wikis programmatically. It can be accessed through the api.php, instead of the regular index.php.

In the case when ACLs of a project restrict permissions to read the contents of the wiki to authenticated users and/or members of the project, most calls to the API may fail with a read permission error. This can be solved by first authenticating the client to fusionforge, and reusing the session cookies for access to the API. See https://lists.fusionforge.org/pipermail/fusionforge-general/2014-March/002641.html for an example in Python.

To be able to use the methods requiring logging-in to the API, the login action will need to be invoked with a username/password pair, where the username will be the capitalized version of the fusionforge username (as displayed in the user's page link in top/right corner of wiki pages, when authenticated), and where the password will have to be set by a forge system administrator.

Defining mediawiki user's password for API login

Currently, the authentication system for the mediawiki embedded through the fusionforge plugin doesn't provide its users will real passwords (or, more precisely, a random password is generated at user's first login), so a password needs to be set explicitely by a system administrator in the mediawiki database, using the following invocation inside the plugin's directory :

# cd .../plugins/mediawiki
# bin/mw-wrapper.php projname changePassword.php --user=Theuser --password=NEWPASSWORD

Data Export

/usr/share/gforge/plugins/mediawiki/bin/mw-wrapper.php $PROJECT dumpBackup.php --full | gzip > $PROJECT.xml.gz
  • Attachments export:
tar czf $PROJECT-attachments.tar.gz -C /var/lib/gforge/plugins/mediawiki/projects/ $PROJECT

Note: if needed, one may export using SQL format - but if that's for a project admin, it may be needed to anonymize data stored by MediaWiki (IP addresses...), so prefer an XML dump, but for reference : pg_dump -n plugin_mediawiki_$PROJECT gforge | gzip > plugin_mediawiki_$PROJET.sql.gz.