MediaWiki

From Hidden Wiki
Jump to navigation Jump to search
Unix Assembly language Mathematics Web development I2P
GhostBSD Assembly Programming Tutorial Statistics Django for Beginners MuWire
GUI Artificial intelligence Artificial neural network Machine learning Messenger
Tkinter Artificial intelligence Artificial neural network Machine Learning Mastery with Python Session

MediaWiki is a free and open-source wiki engine. It was developed for use on Wikipedia in 2002, and given the name "MediaWiki" in 2003. It remains in use on Wikipedia and almost all other Wikimedia websites, including Wiktionary, Wikimedia Commons and Wikidata; these sites continue to define a large part of the requirement set for MediaWiki.[1] MediaWiki was originally developed by Magnus Manske and improved by Lee Daniel Crocker.[2][3] Its development has since then been coordinated by the Wikimedia Foundation.


MediaWiki is written in the PHP programming language and stores all text content into a database. The software is optimized to efficiently handle large projects, which can have terabytes of content and hundreds of thousands of hits per second.[1][4] Because Wikipedia is one of the world's largest websites, achieving scalability through multiple layers of caching and database replication has been a major concern for developers. Another major aspect of MediaWiki is its internationalization; its interface is available in more than 300 languages.[5] The software has more than 900 configuration settings[6] and more than 1,900 extensions available for enabling various features to be added or changed.[7]


Besides its use on Wikimedia sites, MediaWiki has been used as a knowledge management and content management system on many thousands of websites, public and private, including the websites Fandom and wikiHow, and major internal installations like Intellipedia and Diplopedia.


If you use Tails, you'd better set up an administration password when you boot your laptop. Because sometimes you need root's permission to install some software. Normally, the administration password is disabled for better security.


See TinyIB, phpBB articles.

See Darknet web development to know how to install it on VPS.


MediaWiki installation

https://www.mediawiki.org/wiki/Download

Darknet web hosting

Name

Administrator account

"Share data about this installation with MediaWiki developers."

Uncheck the above checkbox.

Options

  • User rights profile:
    Open wiki
    Account creation required
    Authorized editors only
    Private wiki

Information

Wikis work best when you let as many people edit them as possible. In MediaWiki, it is easy to review the recent changes, and to revert any damage that is done by naive or malicious users.

However, many have found MediaWiki to be useful in a wide variety of roles, and sometimes it is not easy to convince everyone of the benefits of the wiki way. So you have the choice.

The Open wiki model allows anyone to edit, without even logging in.

A wiki with Account creation required provides extra accountability, but may deter casual contributors.

The Authorized editors only scenario allows approved users to edit, but the public can view the pages, including history.

A Private wiki only allows approved users to view pages, with the same group allowed to edit.

More complex user rights configurations are available after installation, see the relevant manual entry. https://www.mediawiki.org/wiki/Manual:User_rights



Choose one of them. I think Open wiki is the best. If you choose "Open wiki", though you have to handle many vandalism cases, it would be the best choice. Because "Account creation required" wikis usually have no contributions from users. "Open wiki" has more contributions than "Account creation required" wikis.


  • Copyright and license:
    Creative Commons Attribution
    Creative Commons Attribution-ShareAlike
    Creative Commons Attribution-NonCommercial-ShareAlike
    Creative Commons Zero (Public Domain)
    GNU Free Documentation License 1.3 or later
    No license footer
    Select a custom Creative Commons license

In my opinion, "Creative Commons Zero (Public Domain)"is best.


Skins

The MediaWiki tarball download comes pre-bundled with three skins:

  • MonoBook: It's so-so for mobile environment. When you connect to it with smartphones, it will show you mobile version pages so you don't have to install MobileFrontend extension.
  • Timeless: It's best for mobile environment. When you connect to it with smartphones, it will show you mobile version pages so you don't have to install MobileFrontend extension.
  • Vector (the default skin): It's worst for mobile environment. It looks good when you connect it with your laptop. But it doesn't good to read articles on you smartphone. So you have to install MobileFrontend extension.

But if you install MobileFrontend extension, Vector works better than Timeless and MonoBook on the smartphone even with the "Safest" "Security Settings" of Tor Browser.

Extensions

You have to install at least the "Cite" extension. But if you don't know about extensions, just installing all extensions is not bad choice. But some extensions can cause security problems so you have to be cautious.


Special pages
  • CiteThisPage
  • Interwiki
  • Nuke
  • Renameuser
  • ReplaceText
Editors
  • CodeEditor (requires WikiEditor)
  • VisualEditor
  • WikiEditor
Parser hooks


  • InputBox
  • ParserFunctions
  • Poem


  • Scribunto
  • SyntaxHighlight_GeSHi
  • TemplateData
Media handlers
  • PdfHandler
Spam prevention
  • ConfirmEdit: This extension lets you use various different CAPTCHA techniques, to try to prevent spambots and other automated tools from editing your wiki, as well as to foil automated login attempts that try to guess passwords. If your editing contains a new URL, a CAPTCHA (adding or subtracting numbers) shows up. You'd better not install it.
  • SpamBlacklist: You'd better not install this extension. It blocks many normal words and URLs such as pornhub.com.
  • TitleBlacklist: You'd better not install it.
API
  • PageImages
Other
  • Gadgets
  • LocalisationUpdate
  • MultimediaViewer


  • OATHAuth
  • SecureLinkFixer
  • TextExtracts
Extension:MobileFrontend

https://www.mediawiki.org/w/index.php?title=Extension:MobileFrontend

If you use Vector skin, you'd better install MobileFrontend extension or you can't read text properly on your smartphone. Because Vector skin is optimized to a desktop or laptop.


https://www.mediawiki.org/wiki/Special:ExtensionDistributor/MobileFrontend

Download and place the file(s) in a directory called "MobileFrontend" in your "extensions/" folder.

Download MobileFrontend version 1.34, if you use Freedom Hosting Reloaded.


MobileFrontend version 1.35 is not compatible with the MediaWiki core (version 1.33.3), it requires: >= 1.35.0.

https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=MobileFrontend&extdistversion=REL1_34

If you use another hosting such as OnionCommunity Hosting, you can install the latest version of MobileFrontend.


After installation of MediaWiki, you can download LocalSettings.php file. Add the following code at the bottom of your LocalSettings.php:

wfLoadExtension('MobileFrontend');


Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Images and file uploads

  • Enable file uploads: You'd better check this checkbox. You can restrict common users from uploading files and can make only the admin or some users to be able to upload files. You can set this feature at LocalSettings.php file. It will be explained later in this page. Even though you set your wiki as "Open Wiki", geusts cannot upload files. Only users can upload images or videos though your wiki is "open wiki". As the default option, permitted files to be uploaded for users are png, gif, jpg, jpeg, webp and its maximum size is 100 MB.

File uploads potentially expose your server to security risks. For more information, read the security section in the manual. https://www.mediawiki.org/wiki/Manual:Security

To enable file uploads, change the mode on the images subdirectory under MediaWiki's root directory so that the web server can write to it. Then enable this option.

  • Logo URL: You can replace "wiki.png" with another image. But you can do it later manually.


Instant Commons is a feature that allows wikis to use images, sounds and other media found on the Wikimedia Commons site. In order to do this, MediaWiki requires access to the Internet. https://www.mediawiki.org/wiki/InstantCommons https://commons.wikimedia.org/wiki/Main_Page

For more information on this feature, including instructions on how to set it up for wikis other than the Wikimedia Commons, consult the manual. https://www.mediawiki.org/wiki/Manual:$wgForeignFileRepos

Complete installation

Download and upload LocalSettings.php file.

Troubleshooting

If the newest version of MediaWiki doesn't work on the darknet web hosting services, you should use older versions.


There're essential extensions such as the Cite (citation) extension. So if you don't know which extension should be installed, just install all extensions when you install MediaWiki.


Not allow ordinary users to upload files

If a non-registered user tries to upload a file such as an image through the Special:Upload page, he will show the below message.

Login required
Please log in to upload files.


And if you want to prohibit a registered user from uploading files, add the below two lines at the bottom of your LocalSettings.php file.

# Not allow ordinary users to upload files:
$wgGroupPermissions['user']['upload'] = false;


Then ordinary users can't see "Upload file" menu from the left "Tools" menu. And they also can't access Special:Upload or http://********.onion/index.php/Special:Upload link or http://####.onion/index.php?title=Special:Upload link or Special:Upload page. They can see only the below message.

Permission error
You do not have permission to upload this file, for the following reason:
The action you have requested is limited to users in the group: Administrators.

But you can upload files since you're an administrator.

Upload a logo image

Prepare your new logo image. You can adjust its size. It is recommended to 135*135 pixels. If the image is bigger than it, some parts of the image will not be shown.

Upload your new logo image into /www/resources/assets/ directory.

Open LocalSettings.php file.

## The URL path to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";

Edit the above code. Change "wiki.png" to your new logo image file name such as "cute boy.webp" or "sexy child.gif".


A *.jpeg or *.png or *.jpg file works well as a logo file. An "animated gif" file and an "animated webp" file also work well as a logo file. But refreshing needs time so you have to wait and refresh the main page to see the new logo image. Or visit another page, and you will see the new logo file.


wiki.png image is a 135*135 pixels png image, so you can make your new logo image similar to it. You can make it with GIMP or download it from DuckDuckGo. If your logo file is bigger than 135 x 135 pixels, some parts of your image won't show up.


You have to upload your logo file to /www/resources/assets/ directory or you should edit LocalSettings.php file to locate your logo file's location.


If the image's background isn't transparent, you will see white background.

Favicon

Search and download any images form DuckDuckGo or Google. And adjust its size 32*32 pixels or smaller than it. And convert it into an ico file. You can do these image editing with GIMP. Name its name as favicon.ico. You can use png file as a favicon but ico file is better.

And place favicon.ico in the root directory of the web site and to not declare it at all and let the modern browsers pick the icon. And visit http://*********.onion/favicon.ico then the favicon will be shown on the tabs and bookmarks of your Tor Browser.


You'd better the image's background transparent, or you will see white background.


  • Favicon dimensions?

2010-02-15

An ICO file can contain several pictures and Microsoft recommends to put 16x16, 32x32 and 48x48 versions of the icon in favicon.ico. For example, IE will use the 16x16 version for the address bar, and the 32x32 for a task bar shortcut.

https://stackoverflow.com/questions/2268204/favicon-dimensions


putenv error messages

This problem happens when you use Freedom Hosting Reloaded. If you use Daniel's Hosting, you won't see this error message.


Warning: putenv() has been disabled for security reasons in /home/*******/www/includes/Setup.php on line 134
Warning: putenv() has been disabled for security reasons in /home/*******/www/includes/Setup.php on line 134

If you see the above two error messages, you have to edit LocalSettings.php file and Setup.php file.


Open LocalSettings.php file. You can see the below lines on the top of the LocalSettings.php file.

<br />
<b>Warning</b>:  putenv() has been disabled for security reasons in <b>/home/*******/www/includes/Setup.php</b> on line <b>134</b><br />


We will just make the messages not to show up. Write <!-- --> and make the HTML source code as a comment.

<!-- <br />
<b>Warning</b>:  putenv() has been disabled for security reasons in <b>/home/*******/www/includes/Setup.php</b> on line <b>134</b><br /> -->


Upload the edited LocalSettings.php file. Then one error message will disappear.


And download Setup.php file in "includes" folder of "www" directory and open the file. You can see the below line in the Setup.php file.

putenv( "LC_ALL=$wgShellLocale" );


Write # to make the php source code a comment.

# putenv( "LC_ALL=$wgShellLocale" );

Upload Setup.php file and replace the old one. And then the last one error message also will disappear.


Spam filter

Errors:
* The text you wanted to save was blocked by the spam filter.
This is probably caused by a link to a blacklisted external site.
* The following text is what triggered our spam filter: no-ip.


If you see the above message and you don't want to see the message, you can edit the LocalSettings.php file.


wfLoadExtension( 'SpamBlacklist' );

Just put # and make the above line a comment.

# wfLoadExtension( 'SpamBlacklist' );


And upload the file to your web hosting or VPS.


You'd better not install this extension when you install your MediaWiki.


"Edit" doesn't work and only "Edit source" works.

Sky Wiki nameless 2021-06-17 07:57:03 No.19861  
   Sky Wiki
   http://txy7pgu2kdqg3ovmauiyeyrdhqwjdedvmn2rkcmj2vtknvk7zdo4vqqd.onion/

>> nameless 2021-06-18 00:49:37 No.19874

   Editing is broken:
       >Error contacting the Parsoid/RESTBase server: (curl error: 6) Couldn't resolve host name

>> nameless 2021-06-18 15:12:44 No.19876

   >>19874
   now it works

>> nameless 2021-06-18 17:33:01 No.19878

   >>19876
   No, I still get the same error.

>> nameless 2021-06-18 18:09:44 No.19879

   >>19878
   now I edited the main page without login. I can't understand why did you see the error message.

>> nameless 2021-06-18 18:13:12 No.19880

   I just created an account and logged in and edited the Main Page but there was no problem too.

>> nameless 2021-06-18 18:16:52 No.19881

   safest, safer, standard, all of them worked well.
   Did you click "edit" instead of "edit source"? "edit" doesn't work for Tor Browser.

>> nameless 2021-06-18 22:13:08 No.19882

   How download whole wiki? Using wget to do this might take a while...

>> nameless 2021-06-19 01:52:07 No.19885

   >>19882
   Sky Wiki has only a few documents. You'd better download "Hidden Wiki" or "The Hidden Wiki".

>> nameless 2021-06-19 20:27:16 No.19904

   >>19881
   Yes I did that. Why does normal 'edit' not work?

>> nameless 2021-06-20 13:40:03 No.19911

   >>19904
   I don't know the actual reason. "Edit" loads some visual editor like Wikipedia and I maybe need to install something.
   "Edit source" doesn't need any visual editor so it works.

>> nameless 2021-06-20 20:30:36 No.19912

>>19911

Seems like you need to configure the correct hostname in the settings file.

Something like:

…
$wgVirtualRestConfig[‘modules’][‘parsoid’] = array(
‘url’ => ‘http://mydomain.com:8142’,
‘domain’ => ‘mydomain.com’
);


nameless 2021-06-27 15:10:38 No.20059  
   The picture on the front page of Anonymous is embedded from a clearnet site ( https://upload.wikimedia.org/ ).
   Very bad safety practice.


http://plnemlsyla6h5t3nuoz2algzmy635ceuendnjwsmhwn2os5fxahshiad.onion/res/19861.html

Maintenance

Delete old revisions

Connect to your VPS (Virtual private server) with SSH (Secure Shell Protocol).

For more details, see Darknet web development.


Go to "maintenance" directory.

cd var/www/html1/maintenance


This script will only display the number of items that it can delete.

php deleteOldRevisions.php


Actually performs the deletion.

php deleteOldRevisions.php --delete


  • Manual:deleteOldRevisions.php

deleteOldRevisions.php file is a maintenance script to delete all old (non-current) revisions from the revision table in the database.

Manual:deleteOldRevisions.php

https://www.mediawiki.org/wiki/Manual:DeleteOldRevisions.php

Extensions

Template:Main

Resources to developers

MediaWiki can be made more advanced and useful for various purposes through its extensions. These extensions vary greatly in complexity.

The Wikimedia Foundation operates a Git server where many extensions host their repository. Most of them also have a documentation page on the MediaWiki website.

MediaWiki code review was itself historically facilitated through a MediaWiki extension.[8] As of March 2012, it has been done through Gerrit.

Since version 1.16, MediaWiki uses the jQuery library.[9]

Text manipulation

File:Tim Starling June08.jpg
Tim Starling in 2008

Among the most popular extensions is a parser function extension, ParserFunctions, which allows different content to be rendered based on the result of conditional statements.[10] These conditional statements can perform functions such as evaluating whether a parameter is empty, comparing strings, evaluating mathematical expressions, and returning one of two values depending on whether a page exists. It was designed as a replacement for a notoriously inefficient template called {{Qif}}.[11] Schindler recounts the history of the ParserFunctions extension as follows: Template:Cquote

Another parser functions extension, StringFunctions, was developed to allow evaluation of string length, string position, and so on. Wikimedia communities, having created awkward workarounds to accomplish the same functionality,[12] clamored for it to be enabled on their projects.[13] Much of its functionality was eventually integrated into the ParserFunctions extension,[14] albeit disabled by default and accompanied by a warning from Tim Starling that enabling string functions would allow users "to implement their own parsers in the ugliest, most inefficient programming language known to man: MediaWiki wikitext with ParserFunctions."[15]

Since 2012 an extension, Scribunto, has existed that allows for the creation of "modules" - wiki pages written in the scripting language Lua - which can then be run within templates and standard wiki pages. Scribunto has been installed on Wikipedia and other Wikimedia sites since 2013, and is used heavily on those sites. Scribunto code runs significantly faster than corresponding wikitext code using ParserFunctions.[16]

For footnotes and academic-related display

Another very popular extension is a citation extension that enables footnotes to be added to pages using inline references.[17] This extension has, however, been criticized for being difficult to use and requiring the user to memorize complex syntax. A gadget called RefToolbar attempts to make it easier to create citations using common templates. MediaWiki has some extensions that are well-suited for academia, such as mathematics extensions[18] and an extension that allows molecules to be rendered in 3D.[19]

Integration

A generic Widgets extension exists that allows MediaWiki to integrate with virtually anything. Other examples of extensions that could improve a wiki are category suggestion extensions[20] and extensions for inclusion of Flash Videos,[21] YouTube videos,[22] and RSS feeds.[23] Metavid, a site that archives video footage of the U.S. Senate and House floor proceedings, was created using code extending MediaWiki into the domain of collaborative video authoring.[24]

Combating linkspam

There are many spambots that search the web for MediaWiki installations and add linkspam to them, despite the fact that MediaWiki uses the nofollow attribute to discourage such attempts at search engine optimization.[25] Part of the problem is that third party republishers, such as mirrors, may not independently implement the nofollow tag on their websites, so marketers can still get PageRank benefit by inserting links into pages when those entries appear on third party websites.[26] Anti-spam extensions have been developed to combat the problem by introducing CAPTCHAs,[27] blacklisting certain URLs,[28] and allowing bulk deletion of pages recently added by a particular user.[29]

Searches and queries

MediaWiki comes pre-installed with a standard text-based search. Extensions exist to let MediaWiki use more sophisticated third-party search engines, including Elasticsearch (which since 2014 has been in use on Wikipedia), Lucene[30] and Sphinx.[31]

Various MediaWiki extensions have also been created to allow for more complex, faceted search, on both data entered within the wiki and on metadata such as pages' revision history.[32][33] Semantic MediaWiki is one such extension.[34][35]

Database

File:MediaWiki database schema latest.svg
A schematic of the MediaWiki database structure

MediaWiki can use either the MySQL/MariaDB, PostgreSQL or SQLite relational database management system. There is limited support for Oracle Database and Microsoft SQL Server.[36] A MediaWiki database contains several dozen tables, including a page table that contains page titles, page ids, and other metadata;[37] and a revision table to which is added a new row every time an edit is made, containing the page id, a brief textual summary of the change performed, the user name of the article editor (or its IP address the case of an unregistered user) and a timestamp.[38][39]

In a 4½ year period, the MediaWiki database had 170 schema versions.[40] Possibly the largest schema change was done in MediaWiki 1.5, when the storage of metadata was separated from that of content, to improve performance flexibility. When this upgrade was applied to Wikipedia, the site was locked for editing, and the schema was converted to the new version in about 22 hours. Some software enhancement proposals, such as a proposal to allow sections of articles to be watched via watchlist, have been rejected because the necessary schema changes would have required excessive Wikipedia downtime.[41]

Security

MediaWiki developers have enacted security standards, both for core code and extensions.[42] SQL queries and HTML output are usually done through wrapper functions that handle validation, escaping, filtering for prevention of cross-site scripting and SQL injection.[43] Many security issues have had to be patched after a MediaWiki version release,[44] and accordingly MediaWiki.org states, "The most important security step you can take is to keep your software up to date" by subscribing to the announcement listserv and installing security updates that are announced.[45]

See also

References