Projekt:Software features

CamNet - das Wiki

Structure

Structure is as follows:

-rw-r-----  1 www-data www-data   58 Oct 11 09:48 _admin_login.php   // located in this file are the credentials for the local admin login
drwxr-x---  2 www-data www-data 4096 Dec  6 15:43 bin                // contains helper scripts
drwxr-x---  3 www-data www-data 4096 Oct 11 09:48 bot                // <deprecated> first bot iteration for mediawiki script operations
drwxr-x---  2 www-data www-data 4096 Oct 21 09:25 common             // some php files / classes used across multiple auxiliary files (e.g. imtbot)
drwxr-x---  5 www-data www-data 4096 Oct 11 09:48 crons              // here you can place cron jobs in subdirectories. put a script for each job in one of the 
                                                                     // subdirs minutely, hourly, daily, or weekly. They will called automatically from the system.
drwxr-x---  3 www-data www-data 4096 Oct 11 09:48 imtbot             // place your bot scripts here. contains a construction kit to easily generate custom bot scripts
drwxr-x---  7 www-data www-data 4096 Oct 11 09:48 init               // contains files and dumps for initial content (both base and project specific)

IMTBot

Init dumps

Helper scripts

The scripts located in the _opt/bin directory can help you in your wiki related tasks. Most of them have a help page. Just call the script with parameter --help.

Files in the directory are

-rw-r--r-- 1 www-data www-data     8 Jan 20 17:09 .branch                        // config file, holds current wiki core branch
-rw-r--r-- 1 www-data www-data   110 Jan 20 18:07 .extensions.manual             // list of extensions, updated manually
-rw-r--r-- 1 www-data www-data   509 Jan 20 08:35 .extensions.on.REL             // list of extensions on release branch (they "track" mw core branches)
-rw-r--r-- 1 www-data www-data    39 Jan 20 21:31 .extensions.on.master          // list of extensions on master branch (no release branch tracking
-rw-r--r-- 1 www-data www-data    45 Jan 20 08:40 .gitignore                     // the .gitignore for this directory
-rw-r----- 1 www-data www-data 19414 Nov 14 08:58 _scriptInit                    // a helper file that contains many useful functions and settings for your scripts
-rwxr-x--- 1 www-data www-data  4500 Oct 21 08:27 cargo_recreateData             // recreates your cargo tables
-rwxr-x--- 1 www-data www-data  5975 Oct 21 08:27 create_dumps                   // takes all *.list files in the current dir (except protection.list) and creates an xlm file each
-rwxr-xr-x 1 www-data www-data  5753 Jan 20 08:40 cronctrl                       // allows you to display cron jobs and temporarily disable/enable them
-rwxr-x--- 1 www-data www-data  6990 Feb  3 17:50 extension_updater              // allows you to batch-pull all your extenions on master or release branch
-rwxr-x--- 1 www-data www-data   840 Oct 21 08:27 fetch_sources                  // call this with subversion number as parameter to get new sources.
                                                                                 // NOTE: This has no --help option.
-rwxr-x--- 1 www-data www-data   923 Oct 21 08:27 get_new_version_going          // a small script to initialize a new version (update, not upgrade) of the mediawiki software
-rwxr-x--- 1 www-data www-data  6719 Oct 21 08:27 helper.createScriptHusk        // METASCRIPT that can help you create new scripts
-rw-r----- 1 www-data www-data    45 Oct 20 09:18 .gitignore                     // a list of files to ignore in the repo
-rwxr-x--- 1 www-data www-data  5483 Nov 11 14:35 import_dumps                   // imports all .xml files in the current directory or the supplies xml file.
-rwxr-xr-x 1 www-data www-data  5172 Jan 20 08:40 import_images                  // imports all images, supplied with your project (base and project related)
-rwxr-x--- 1 www-data www-data  6140 Oct 21 08:27 import_liveData                // for use on staging systems to import data, exported from a live systems
-rwxr-x--- 1 www-data www-data 33716 Nov 11 14:46 init                           // helps you to get your installation going
-rw-r----- 1 www-data www-data   572 Oct 21 08:27 init.config                    // holds configuration for your initialization
-rw-r----- 1 www-data www-data    11 Oct 11 09:48 init.lock                      // after you initialized your system, this file will be present
                                                                                 // to warn you, if you accidently execute init a second time
-rwxr-x--- 1 www-data www-data  5187 Feb 10 13:58 merge_updates                  // this helps you to clean up, after you integrated a new core or did a merge.
-rwxr-x--- 1 www-data www-data  5799 Oct 21 08:27 protect_pages                  // looks for a list of pages to protect in a specified file and protects them
-rwxr-x--- 1 www-data www-data  7505 Nov 14 09:01 reset_secrets                  // helper scripts that resets your projects secrets (db and session hash).
                                                                                 // modifies your db credentials and your config files.
-rwxr-x--- 1 www-data www-data  4050 Oct 21 08:27 runMaintenance                 // runs a bunch of useful maintenance scripts. Should be called after updates/upgrades
-rwxr-x--- 1 www-data www-data  7135 Oct 25 09:01 runwikijobs                    // runs jobs in your project's job queue (and logs it)
-rwxr-x--- 1 www-data www-data  4607 Oct 21 08:27 setMode                        // can be used to switch your project between maintenance and normal mode
-rw-r----- 1 www-data www-data    12 Oct 17 09:11 setMode.status                 // holds current status (maintenance or normal)
-rwxr-x--- 1 www-data www-data  1194 Oct 11 09:48 tweak_timestamp                // a crude helper scripts that simply updates all timestamps in a
                                                                                 // mediawiki dump xml file. so that, after an import, the imported article will show
-rwxr-x--- 1 www-data www-data  5176 Oct 21 08:27 update_dumps                   // creates up-to-date versions of your project's dump files, as long as there
                                                                                 // are *.list files present in _opt/init/local_content. Can also be used to update base dumps
-rw-r--r-- 1 www-data www-data   182 Dec  8 13:11 url.config                     // present after running init for the first time.
                                                                                 // here you can customize your project's url

Following are some detailed information about certain scripts:

create_dumps

Usage:

  • Switch to a dir that contains at least one file ending with .list
  • or call with the name of a file as argument

The script then produces an xml dump (for all list files or the supplied file only). As default, only the current revision will be dumped, use argumment --full to geht the file's full history. The script processes the list file(s) and

  • ignores empty lines or lines beginning with a #
  • dumps all contents of a given category, if the line starts either with "Category:" or the equivalent of your locale. Inludes the category page itself but excludes subcategories (no recursion).
  • dumps only the category page, if page name starts with a :Category:
  • in every other case, dumps the pagename.

Example:

# this is a comment.
# btw: the following line will also be ignored

# normal page, will be dumped:
Normal Page
# will also be dumped normally:
Namespace4:Funnypage
# and again: dumped directly, no special treatment:
:Category:Funny pages
# now the interesting part
# this category will be dumped. also: all pages, contained in this category, except subcategories
Category:Interesting facts

Note: This script uses the url, supplied in your LocalSettings_host.php. To be more specific, it uses the url stored in url.config by init.

More help is available via parameter --help.

extension_updater

Maintainer can use this scipt to update (pull) all extensions in the project. Should only ever be used on dev platform. Changes can then be commited to feature branch and pushed to staging and live systems.

fetch_sources

NOTE: You should have no need of this script, if you update your repo regularly.

Supply a subversion of 1.27 (for example 42) and the script will download and extract this subversion in your base dir. After execution, you will find a new dir, e.g. named mediawiki-1.27.42 in your basedir containing the downloaded sources. Call get_new_version_going next.

get_new_version_going

NOTE: You should have no need of this script, if you update your repo regularly.

A small script to initialize a new version (update, not upgrade) of the mediawiki software. You need to be in the new versions directory and a symlink named "mediawiki" to your current version should exist in your basedir.

import_dumps

Usage:

  • Switch to a dir that contains at least one medaiwiki dump file ending with .xml
  • or call with the name of a mediawiki dump file as argument

This imports all .xml files in the current directory or the supplies xml file in your mediawiki. Useful to call in your ./_opt/init/local_content dir if you want to update your project's content/engine files or even in the ./_opt/init/base_content/default dir if you want to update the package's base files

Logging will be done to central log file. More help is available via parameter --help.

import_liveData

This scripts helps you import live data in your staging or dev system it expects an mysql dump file named <your_project>.sql.gz in the directory /var/www/_livedata/current and imports it. Then it imports all images found in /var/www/_livedata/current/images. Logging will be done to central log file.

If you want to test new templtes/modules, import your local project xml dumps afterwards vis import_dumps.

init

This is an installation wizard for a mediawiki installation. See your installation guide for more information.

Files belonging to this script are:

  • init.config: holds configuration for your initialization
  • init.lock: after you initialized your system, this file will be present to warn you, if you accidently execute init a second time
  • init.log: if you did not specify a custom log location, the init log will be put in here.

More help is available via parameter --help.

protect_pages

Looks for a file named protection.list in the current dir and protects all pages or all pages in categories listed in it.

Note: This script uses the url, supplied in your LocalSettings_host.php. To be more specific, it uses the url set up by your init script. See there for more information.

More help is available via parameter --help.

reset_secrets

If you ever feel the need to reset all your project's secrets, use this script. It generates a new db password and sets it in the db and writes it to your config together with a new session hash token and token version.

runMaintenance

Runs a bunch of mediawiki maintenance scripts: update.php, rebuildall.php, and initSiteStats.php. Pauses runwikijobs during execution.

runwikijobs

Checks mediawiki job queue and - if not emtpy - runs the job runner maintenance script runJobs.php. Number of jobs run will be logged to your central log file.

setMode

With this you can switch your project from operation to maintenance mode and back.

tweak_timestamp

A crude helper scripts that simply updates all timestamps in a mediawiki dump xml file. This fakes the dump file's last revision dates to be NOW so that each page contained in the dump file will automatically have a new revision showing in its page histories.

update_dumps

Creates up-to-date versions of your project's dump files, as long as there are *.list files present in _opt/init/local_content. When called with parameter --base it updates the base installation files instead.

This script uses the create_dumps and should be used to generated updated xmls for your project. It is probably used only on dev systems.

More help is available via parameter --help.