MediaWikiSiteCustomization

From RadiWiki
Jump to: navigation, search

This page contains a log of all the changes that have been done on the MediaWiki configuration, to become the RadiWiki site as it is right now. All changes to the settings of MediaWiki, and installation and modification of extensions, etc.., should be included on this page, to easily reproduce the RadiWiki site on a clean MediaWiki installation. The most recent changes should be on top of the 'Log' section

Be aware that the default skin is 'dare'! This skin is used for not-logged in users. Logged-in users should use the 'monobook' skin. Both skins are the same, except that the 'top-tabs' are not shown for the 'dare' skin.

Information.png
Note: Ensure that changes to the skins, are updated in the 'dare' and the 'monobook' skin

Log

Selected MathML as the default math processor in LocalSettings.php. Also see: https://www.mediawiki.org/wiki/Extension:Math/advancedSettings/en#Server-side_rendering_with_Mathoid

$wgMathValidModes = array( 'mathml' );
$wgDefaultUserOptions['math'] = 'mathml';

Joro (talk) 08:55, 11 April 2019 (CEST)

Added extension 'MagicNoCache'. ( http://www.mediawiki.org/wiki/Extension:MagicNoCache )

Joro 09:27, 6 March 2012 (UTC)

Added extension: 'include'. It can be used to show the content of a text file as part of a wiki page. This will be used to show the latest revision of the drivers.exe file. See:

Used the configuration as suggested in the secure-include.php file.

Joro 09:04, 6 March 2012 (UTC)

Added extension: 'Widgets'. It can be used to add several other general purpose 'widgets' to the Wiki site. See: http://www.mediawiki.org/wiki/Extension:Widget

Joro 19:06, 17 October 2010 (UTC)

Increased the file upload size to 11 MB

Joro 19:06, 17 October 2010 (UTC)

Added XLS as an allowed file extension for file uploads:

LocalSettings.php

# Customized configuration of uploadable files
$wgFileExtensions = array ( 'png', 'gif', 'jpg', 'jpeg', 'pdf', 'doc', 'ppt', 'rtf', 'txt', 'zip', 'xls');

Joro 12:30, 15 January 2009 (UTC)

Installed the blahtex program, to enable the inclusion of formulas in generated PDF files. See the website: http://gva.noekeon.org/blahtexml/

This program requires that the Xerces-C 2.x library is installed:

apt-get -u install libxerces-c2-dev

Then build and install the blahtex and blahtexml programs:

tar -zxvf blahtexml-0.6-src.tar.gz
cd blahtexml-0.6
make linux
make blahtexml-linux
cp blahtex /usr/bin
cp blahtexml /usr/bin

Joro 13:09, 24 November 2008 (UTC)

Added some customizations to the generated PDF file, by creating and changing the file: /usr/lib/python2.5/site-packages/mwlib.rl-0.8.4.dev-py2.5.egg/mwlib/rl/customconfig.pdf

#! /usr/bin/env python
# Overrule some settings for the generated PDF

pagefooter = 'This article originates from RadiWiki (http://wiki.radimation.com/)'

max_img_width = 15              # Maximum image width in centimeters
max_img_height = 18             # Maximum image height in centimeters

# We do not want to show the article authors
showArticleAuthors = False
# We do not want to include the original source in the PDF
showArticleSource = False

Joro 13:09, 24 November 2008 (UTC)

Updated the mwlib and mwlib.rl programs to the latests version able in their source repositories. This adds some new features and several bug fixes.

Joro 13:09, 24 November 2008 (UTC)

Adjusted /var/www/wiki/img_auth.php to allow that images can be downloaded by the PDF generator. Comment the following lines:

if( !$wgUser->getId() && ( !is_array( $wgWhitelistRead ) || !in_array( $title, $wgWhitelistRead ) ) ) {
     wfDebugLog( 'img_auth', "Not logged in and `{$title}` not in whitelist." );
     wfForbidden();
} 

Joro 12:37, 24 November 2008 (UTC)

Clean-up of the old pdf-server that was running, because it is now replaced by the mw-serve deamon. Also disabled (removed) the 'NetworkAuth' extension.

Joro 16:05, 21 November 2008 (UTC)

Updated the version of the Collection extension of www.pediapress.com

cd /var/www/wiki/extensions/
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Collection

Adjusted LocalSettings.php

# Collection tool for the PediaPress extension
require_once("extensions/Collection/Collection.php");
#$wgPDFServer="http://tools.pediapress.com/cgi-bin/pdf-server.py";
$wgCollectionMWServeURL="http://localhost:8899/";
$wgCollectionMWServeCredentials="******:******";
$wgCommunityCollectionNamespace=NS_MEDIAWIKI;
$wgCollectionFormats=array( 'rl' => 'PDF', );

Also updated the installed 'mwlib' library (to version 0.8.3), using instructions on: http://code.pediapress.com/wiki/wiki/mwlib-install

Also updated the installed 'mwlib.rl' library (to version 0.8.1), using instructions on: http://code.pediapress.com/wiki/wiki/mwlib.rl-install

Added a command to /etc/rc.local to start the mw-serve application as a deamon

mw-serve -d -P http -i 127.0.0.1

Netadmin 15:09, 21 November 2008 (UTC)

Updated the version of the Collection extension of www.pediapress.com

cd extensions/
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Collection

Adjusted LocalSettings.php

# Collection tool for the PediaPress extension
require_once("extensions/Collection/Collection.php");
#$wgPDFServer="http://tools.pediapress.com/cgi-bin/pdf-server.py";
$wgCollectionMWServeURL="http://localhost:8899/";
$wgCommunityCollectionNamespace=NS_MEDIAWIKI;
$wgCollectionFormats=array( 'rl' => 'PDF', );

Also updated the installed 'mwlib' library (to version 0.8.3), using instructions on: http://code.pediapress.com/wiki/wiki/mwlib-install

Also updated the installed 'mwlib.rl' library (to version 0.8.1), using instructions on: http://code.pediapress.com/wiki/wiki/mwlib.rl-install

Joro 08:14, 2 September 2008 (UTC)

Added a group 'Customer', so this group can be used for all customers that will be added.

Joro 09:11, 31 July 2008 (UTC)

Allowed other people also to be able to download PDF files of RadiWiki pages. Added the following line to: '.../extensions/Collection/Collection.php'

$wgHooks['DareTemplateToolboxEnd'][] = 'Collection::insertMonoBookToolboxLink';

Also changed the $wgWhitelistRead variable in LocalSettings.php, to allow access to the PDF generation functionality even for not logged-in users.

$wgWhitelistRead = array( "/^:Main Page$/", "/^Special:Userlogin$/", "/^RadiMation Error: [-]?[0-9]*$/", "/^-$/", "/^MediWiki:Monobook.css$/", "/^MediaWiki:dare.css$/", "/^Special:Collection.*/" ); 

Netadmin 09:08, 28 May 2008 (UTC)

Extended the cron job that performs maintenance of the RadiWiki site. Now also the PDF-server cache is cleared.

#! /bin/sh
#
# Little script to run the 'jobQueue' of the RadiWiki site
# Also the cache of the PDF server is cleaned
#
# Modified by joro at 2008, May 28 at 10:56

php /var/www/wiki/maintenance/runJobs.php 

/var/www/wiki/extensions/Collection/pdf-server/clean-cache.py /var/cache/pdf-server

Joro 08:56, 28 May 2008 (UTC)

Removed the PdfExport extension from the RadiWiki site. Did this by disabling the corresponding lines in LocalSettings.php:

### Load the SpecialPdf extension
##require_once("extensions/PdfExport/PdfExport.php");

The files of the extension are not yet removed, so it is possible to enable it again later, or permanently remove the files.

Joro 08:49, 28 May 2008 (UTC)

Changed include/Title.php to allow regular expressions in the 1.12.0 version of MediaWiki again.

                       if ( $wgWhitelistRead ) {
                               if ( is_array($wgWhitelistRead) ) {
                                       for ($i=0; $i<count($wgWhitelistRead); $i++) {
                                               if (preg_match($wgWhitelistRead[$i],$name)) {
                                                       return true;
                                               }
                                       }
                               }
                       }

Also see the instructions below, and the information on: http://meta.wikimedia.org/wiki/Regexp_wgWhitelistRead

Joro 08:45, 28 May 2008 (UTC)

Installed the 'Collection' extension (version 1.0) of PediaPress. (www.pediapress.com)

Added in LocalSettings.php

# Collection tool for the PediaPress extension
require_once("extensions/Collection/Collection.php");
#$wgPDFServer="http://tools.pediapress.com/cgi-bin/pdf-server.py";
$wgPDFServer="http://wiki.radimation.com/cgi-bin/pdf-server.py";
$wgCommunityCollectionNamespace=NS_MEDIAWIKI;

Also installed the mwlib (version 0.6.1) and the mwlib.rl (version 0.6.0) libraries. These libraries are able to generate a PDF from one or more MediaWiki articles. The only problem with these packages is that they expect a public available MediaWiki site. However the RadiWiki site is not public available. The libraries also do not provide a mechanism to log-in on a certain site. Therefor a workaround is implemented that will automatically log-in any request that is coming from the localhost.

Modified the /usr/lib/python2.4/site-packages/mwlib.rl-0.6.0-py2.4.egg/mwlib/rl/pdfstyles.py file, to use a modified footer on the generated PDF files.

pagefooter = 'This article originates from RadiWiki (http://wiki.radimation.com
titlepagefooter = '@WIKITITLE@ book - Generated using the open source mwlib too


Also installed the 'pdf-server.py' script as a CGI-BIN script on the server. This is a local PDF-generation server. See for installation instructions: /var/www/wiki/extensions/Collection/pdf-server/README.txt Made some manual modifications to the /var/www/cgi-bin/pdf-server.py script:

# =============================================================================
# CONFIGURATION
# =============================================================================

# Full URL to this CGI script.
script_url = 'http://wiki.radimation.com/cgi-bin/pdf-server.py'

# If the base url should be overruled
overrule_base_url = 'http://localhost/wiki/'

And everywhere where 'base_url' is checked, and additional check is included that will allow the overruling of 'base_url' by 'overrule_base_url'. This is done to ensure that the pdf-server.py can access the local MediaWiki site through the localhost link

       if len(overrule_base_url) > 0:
            base_url = overrule_base_url


To allow automatic log-in of any request that is coming from the localhost, the 'NetworkAuth' extension (version 1.0) is installed in MediaWiki. Added in LocalSettings.php:

# Automatic network authentication for the PDF Generation
require_once("extensions/NetworkAuth/NetworkAuth.php");
$wgNetworkAuthUsers[] = array(
      'iprange'         => array('127.0.0.1/32'),
      'user'            => 'pdfgenerator'
      );

Also generated a new RadiWiki user account for 'pdfgenerator'.

Joro 08:30, 28 May 2008 (UTC)

Upgraded to version 1.12.0 of MediaWiki

Netadmin 13:19, 26 May 2008 (UTC)

Installed several necessary packages, because it is neededd for LaTeX support.

apt-get install ocaml imagemagick gs cjk-latex tetex-extra php4-imagick binutils gcc

Then compiled the texvc program:

cd /var/www/wiki/math
make

Turned on the usage of 'LaTeX' formula's in MediaWiki. Changed the LocalSettings.php:

## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX           = true; 

Joro 12:01, 26 May 2008 (CEST)

Improved the regular expression for the 'RadiMation Error: <NUMBER>' pages in the white-list. Now also pages with a negative number can be used, even if not logged-in.

# But allow anonymous readers to read the Main Page, login page, and JS/CSS pages
$wgWhitelistRead = array( "/^:Main Page$/", "/^Special:Userlogin$/", "/^RadiMation Error: [-]?[0-9]*$/", "/^-$/",  "/^MediaWiki:Monobook.css$/", "/^MediaWiki:dare.css$/" );

Joro 12:49, 1 February 2008 (CET)

Created an account for 'wote'

Netadmin 11:20, 1 February 2008 (CET)

Optimized the generated PDF output. Changed contents of the PdfExport.php file. Included the name of the page also as the primary header of the PDF file:

$html = "<html><head><title>" . $page . "</title></head><body><H1>" . $page . "</H1>" . $bhtml . "</body></html>"; 

Changed the layout of the PDF document by specifying arguments to the 'htmldoc' program:

passthru("htmldoc -t pdf14 --charset iso-8859-1 --color --quiet --linkstyle plain --jpeg --header ... --footer t./ --webpage '$mytemp'", $returnStatus);

Joro 15:36, 28 January 2008 (CET)

Allowed other people also to create PDF printouts of RadiWiki pages. Added the following line to: '.../extensions/PdfExport/PdfExport.php'

$wgHooks['DareTemplateToolboxEnd'][] = 'wfSpecialPdfToolbox';

Joro 14:29, 28 January 2008 (CET)

Updated the PDFExport extension to the latest version (1.1.11238 (14-September-2007)). See the directions at: http://www.mediawiki.org/wiki/Extension:Pdf_Export Extension is now placed in the '.../extensions/PdfExport/' directory

Also adjusted the LocalSettings.php to include:

# Load the SpecialPdf extension
require_once("extensions/PdfExport/PdfExport.php");

In the extension a small improvement was made, to remove '_' from the page title.

$page = utf8_decode($page);
$page = str_replace('_', ' ', $page);
$html = "<html><head><title>" . $page . "</title></head><body>" . $bhtml . "</body></html>";

Joro 13:53, 28 January 2008 (CET)

Enabled partial keyword searching. Using the directions given at: http://www.mediawiki.org/wiki/Help_talk:Searching Included the file 'SearchMySQL4SubString.php' in the 'includes/' directory. Also adjusted the LocalSettings.php to include:

# Partial searches
require_once("SearchMySQL4SubString.php");
$wgSearchType = 'SearchMySQL4SubString';

Also changed the MySQLSearch.php file to always include an implicit '*' after the specified search query

function searchText( $term ) {
    $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ).'*', true ) ) );
    return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
}

And, to enable partial Title searches:

function searchTitle( $term ) {
    $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ).'*', false ) ) );
    return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
}

Joro 13:25, 28 January 2008 (CET)

Changed the minimum search length to 3 characters. See the 'Short words in searches' page at: http://meta.wikimedia.org/wiki/Help:Short_words_in_searches

Changed the configuration file: /etc/mysql/my.cnf:

[mysqld]
# Enable short word searches for the wiki site
ft_min_word_len=3
[myisamchk]
# Enable short word searches for the wiki site
ft_min_word_len=3

Also updated all the tables by starting the 'maintenance/rebuildtextindex.php' script

Joro 19:03, 25 January 2008 (CET)

Created a correct AdminSettings.php file (based on the AdminSettings.sample') file in the /var/www/wiki/ directory. It is needed to have the correct user account and password for the maintenance scripts

Joro 19:03, 25 January 2008 (CET)

Included the script: wikiRunJobs in /etc/cron.daily

#! /bin/sh
#
# Little script to run the 'jobQueue' of the RadiWiki site
#
# Created by joro at 2008, January 25 at 16:31 

php /var/www/wiki/maintenance/runJobs.php

This will ensure that 'update jobs' are being run daily

Joro 18:35, 25 January 2008 (CET)


Removed the '[edit]' buttons on the right of the section header from the dare-skin (/var/www/wiki/skins/dare/main.css):

h1 .editsection { font-size: 53%; display: none;  }
h2 .editsection { font-size: 67%; display: none; }
h3 .editsection { font-size: 76%; font-weight: normal; display: none; }
h4 .editsection { font-size: 86%; font-weight: normal; display: none; }
h5 .editsection { font-weight: normal; display: none; }
h6 .editsection { font-size: 125%; font-weight: normal; display: none;  }

.editsection {
        float: right;
        margin-left: 5px;
        display: none;
}

Joro 10:46, 14 September 2007 (CEST)

Added an account for 'pady', with rights to change content

Joro 10:46, 14 September 2007 (CEST)

Extended the crontab of the server to include:

0 23 * * * php /var/www/wiki/maintaince/runJobs.php

This will ensure that 'update jobs' are being run every day at 23.00

Joro 09:53, 9 July 2007 (CEST)

# Disable the $wgEnableEmail, to prevent that that 'Email Password'
# button is shown on the log-in screen
$wgEnableEmail      = false;

Joro 09:45, 9 July 2007 (CEST)

Included all the 'RadiMation Error: <NUMBER>' pages in the white-list, so these pages can be seen, even if not logged-in.

# But allow anonymous readers to read the Main Page, login page, and JS/CSS pages
$wgWhitelistRead = array( "/^:Main Page$/", "/^Special:Userlogin$/", "/^RadiMation Error: [0-9]*$/", "/^-$/",  "/^MediaWiki:Monobook.css$/", "/^MediaWiki:dare.css$/" );

Joro 15:43, 22 June 2007 (CEST)

Customized some system messages, so there are some references and clearifications that certain pages are protected, and that someone has to login, to get access to the content of the RadiWiki site.

Joro 14:37, 22 June 2007 (CEST)

Customized the account access settings, so the resellers only have read-access.

# Disable reading and editing by anonymous users
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
# Disallow users to edit pages
$wgGroupPermissions['user']['edit'] = false;
# Allow reading but disable editing for resellers
$wgGroupPermissions['Reseller']['read'] = true;
$wgGroupPermissions['Reseller']['edit'] = false;
# Allow the Groups 'Bots', 'Developer' and 'Sysops' to edit pages
$wgGroupPermissions['Developer']['edit'] = true;

Joro 14:35, 22 June 2007 (CEST)

Created an account for the 'radiwikibot', and the 'reseller's

Joro 14:35, 22 June 2007 (CEST)

Changed permissions so anonymous readers cannot read any page anymore:

#Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
# But allow anonymous readers to read the Main Page, login page, and JS/CSS pages
$wgWhitelistRead = array( "/^:Main Page$/", "/^Special:Userlogin$/", "/^-$/", "/^MediaWiki:Monobook.css$/", "/^MediaWiki:dare.css$/" );


(Instructions taken from: http://www.mediawiki.org/wiki/Manual:Preventing_access)

Joro 13:38, 22 June 2007 (CEST)

Changed the file include/Title.php to include:

                       # Next 3 lines are replaced, to allow regular expressio
                       # the $wgWhiteListRead
                       #  if( $wgWhitelistRead && in_array( $name, $wgWhitelis
                       #       return true;
                       #  }
                       if ( $wgWhitelistRead ) {
                               if ( is_array($wgWhitelistRead) ) {
                                       for ($i=0; $i<count($wgWhitelistRead);
                                               if (preg_match($wgWhitelistRead
                                                       return true;
                                               }
                                       }
                               }
                       }

After instructions on the page: http://meta.wikimedia.org/wiki/Regexp_wgWhitelistRead This makes it possible to use regular expressions on the $wgWhitelistRead variable.

Joro 13:34, 22 June 2007 (CEST)


Installed the StringFunctions extension, using the directions on: http://meta.wikimedia.org/wiki/StringFunctions

# Load the StringFunctions extension
require_once("extensions/StringFunctions/StringFunctions.php");

Joro 15:49, 21 June 2007 (CEST)

Installed the ParserFunctions extension, using the directions on: http://meta.wikimedia.org/wiki/ParserFunctions

# Load the ParserFunctions extension
require_once("extensions/ParserFunctions/ParserFunctions.php");

Joro 16:12, 20 June 2007 (CEST)

Changed lines into a nice detailed red-line (in the monobook and the dare-skin)

h1, h2, h3, h4, h5, h6 {
        color: black;
        background: none;
        font-weight: normal;
        margin: 0;
        padding-top: .5em;
        padding-bottom: .17em;
/*      border-bottom: 1px solid #aaa; */
        border-bottom: 1px solid red;
}

Joro 16:09, 19 June 2007 (CEST)

Removed the top-tabs from the dare-skin (/var/www/wiki/skins/dare/main.css):

#p-cactions li {
    display: none;
}

Joro 15:57, 19 June 2007 (CEST)

Created a dare specific skin, using the adjusted monobook as an example. Procedure that is followed to create a custom skin: http://meta.wikimedia.org/wiki/Skins

Also changed the default skin to 'dare'

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
$wgDefaultSkin = 'dare';

Joro 15:55, 19 June 2007 (CEST)

Changes to the Monobook skin in: /var/www/wiki/skins/monobook/main.css

body {
/*      background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; */
        background: #f9f9f9 url(http://www.dare.nl/gfx/gif/menu.gif) 0 0;
}
#column-one {
    padding-top: 85px;
}
.portlet h5 {
       color: white;
}

Joro 15:38, 19 June 2007 (CEST)

Set to use a slightly modified logo of the www.dare.nl website

# set the logo of the site
$wgLogo             = "/wiki/skins/common/images/logo_DARE.gif";

Joro 15:22, 19 June 2007 (CEST)

All RadiMation related articles are exported from the DKB site, and imported in the RadiWiki site

Netadmin 15:46, 14 June 2007 (CEST)

Added a 'Print as PDF' option in the toolbox, using the Export PDF extension for MediaWiki. Used the directions on: http://www.mediawiki.org/wiki/Extension:Pdf_Export

# Load the SpecialPdf extension
require_once("extensions/SpecialPdf.php");

Netadmin 15:28, 14 June 2007 (CEST)

Implemented upload and image authorisation, using http://www.mediawiki.org/wiki/Manual:Image_Authorisation

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads       = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgUploadPath = "/wiki/img_auth.php";
# Customized configuration of uploadable files
$wgFileExtensions = array ( 'png', 'gif', 'jpg', 'jpeg', 'pdf', 'doc', 'ppt', 'rtf', 'txt');
# Give file size warnings if the to be uploaded file is bigger
$wgUploadSizeWarning = 5 * 1024 * 1024;

/etc/php5/apache2/php.ini

; Maximum allowed size for uploaded files.
upload_max_filesize = 150M


Netadmin 14:20, 14 June 2007 (CEST)

Copied the dare.png file to the server, and adjusted:

# set the logo of the site
$wgLogo             = "/wiki/skins/common/images/dare.png";


Netadmin 12:26, 14 June 2007 (CEST)

Changed the MediaWiki:Sidebar

* navigation
** mainpage|mainpage
** http://www.dare.nl/%7Cdare.nl
** http://www.radimation.com/%7Cradimation.com
** mailto:support@radimation.com%7Cmail support team
* tools
** recentchanges-url|recentchanges
** randompage-url|randompage

Netadmin 12:10, 14 June 2007 (CEST)

Changed the name to RadiWiki

$wgSitename         = "RadiWiki";

Netadmin 12:00, 14 June 2007 (CEST)

Set some restrictions, so it can only be edited/changed by a limited set of users.

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;

Netadmin 11:21, 14 June 2007 (CEST)


Added user accounts for joro and jewe

Netadmin 10:50, 14 June 2007 (CEST)