MWStake MediaWiki Manager

From mwstake
Jump to: navigation, search
GitHub Repo Tag "CreateCampEMWCon2021"
Code Base at    
Development Discussion at

Project Reasoning and Potential Goals[edit]

Facilitate managing all aspects and use cases regarding the operation of MediaWiki instance(s)
  1. Across set up modes and operating systems
  2. Targeting all user groups accordingly
  3. Conveying best practices
  4. Component monitoring and certification services
  5. Not integrated, but besides MediaWiki instance(s)
  6. Install/configure/upgrade system(s)
  7. Install/enable/disable/upgrade/configure extensions
    • MediaWiki Stakeholders Group Certified Extensions Service
  8. Backup/restore/clone/compare/consolidate system(s) (snapshots)
  9. Inject/extract/facet/edit/consolidate/import/export/remove apps/structures/ontologies
    • MediaWiki Stakeholders Group Certified Apps Service
  10. Script/automate/schedule tasks
  11. Package/move/archive/migrate system(s)


  • Permissions (owner, group, rwx, executing user, etc.)
  • Apache (SSL, configuration)
  • Certified extensions and apps catalog (selection, fields, mechanisms, policies, stewardship)
  • SSO
  • Search

MWM Implementation Aspects[edit]

How and Why?

  • Dissect system…
  • …into as few as possible but into as many as necessary interfacing components…
  • …in order to fulfill all intended use cases…
  • …in accordance with corresponding users' capabilities and needs.

Abstraction Layers[edit]

CLI <-- API <-- UI
  1. UI is GUI for API
  2. API wraps CLI
  3. CLI means bash scripts covering all use cases

Podman-managed MWM Kubernetes deploy manifest ("Containers")[edit]

  1. Pod "mwm"
  2. Container "mediawiki" + user volumes and config envs
  3. Container "mariadb" + config envs

Config envs[edit]

Pending: podman secret

# my-new-system.env
export WG_DB_PASSWORD=8n65f%6n5
⇒ envsubst ⇒
# mediawiki-manager.yml
  - image:
    name: mediawiki
      - name: WG_DB_PASSWORD
        value: 8n65f%6n5
      - ...
# Localsettings.php
$wgDBpassword = getenv("WG_DB_PASSWORD");

Config database[edit]

# addToMWMSQLite.php

$name  = $argv[1];
$localsettingsdirectives = $argv[2];
$db = new SQLite3('mwmconfigdb.sqlite');

$stmt = $db->prepare('INSERT INTO extensions (name, localsettingsdirectives) VALUES ( :name, :localsettingsdirectives)');
$stmt->bindValue(':name', $name, SQLITE3_TEXT);
$stmt->bindValue(':localsettingsdirectives', $localsettingsdirectives, SQLITE3_TEXT);

# updateMWMLocalSettings.php

$db = new SQLite3('mwmconfigdb.sqlite');
$stmt = $db->prepare('SELECT localsettingsdirectives FROM extensions');
$result = $stmt->execute();

$mwmLocalSettingsString = "";
while($res = $result->fetchArray(SQLITE3_ASSOC)){
    $mwmLocalSettingsString .= trim($res["localsettingsdirectives"])."\n";

$mwmLS = fopen("mwmLocalSettings.php", "w");
fwrite($mwmLS, "<?php\n".$mwmLocalSettingsString);
# Localsettings.php
$mwmls = "../mwmLocalSettings.php";
# MWStake MediaWiki Manager
if(file_exists($mwmls)) {
} else { 
	echo "ERROR: ".$mwmls." include not loaded.";

Target User Groups[edit]

Who can use the concepts in MWM how? Here I try to segregate target users into groups that share capabilities and needs.

User Group Point/Select/Type/Click CLI/SSH Scripting Edit configuration junior Edit configuration senior
Examples "Web Interface" Automate/schedule tasks
  • Edit LocalSettings.php
  • Run composer


  • Interpret logs
  • Report bugs/feature request
  • Branch code, develop and PR
UGUI "WebAdmin" Yes - "Macro" style only from within UI
("Excel Record Macro Style")
- -
UGAdmin "SysAdmin" Yes Yes Run/arrange .sh scripts Yes -
UGCoder "Developer" Yes Yes Run/arrange/compose/create/edit .sh scripts including API calls Yes Yes

Use Cases[edit]

Install/configure/upgrade/run/operate system(s)[edit]

  1. Favored path: Kubernetes-based only for mwmITLocal, mwmITIntra and mwmITCloud
Where How Why
mwmITLocal: locally on a single computer containerized for personal/private/development use
mwmITIntra: in an intranet


for corporate internal use
mwmITCloud: on the internet/in the cloud containerized for corporate internal/external/public use

Install/enable/disable/upgrade/configure extensions[edit]

MWStake MediaWiki Manager/MWStakeServices/ExtensionsCatalog

Backup/restore/clone/compare/consolidate system(s) (snapshots)[edit]

Inject/extract/facet/edit/consolidate/import/export/remove apps/structures/ontologies[edit]

CLI (Bash)[edit]


CLI (Bash)[edit]

Package system(s)[edit]

  1. mediawiki-apps.json

MWStake MWM Service Portfolio[edit]


Abstraction Layers[edit]


ALcontainerization: Podman[edit]

  1. The mediawiki container image contains a full MediaWiki installation.
  2. will copy persistence-relevant files/directories out to the host so they can be volumed in when starting the mediawiki container.

ALcli: shell scripts using MWAPI and CRUDing files in service volumes[edit]

ALapi: MWM API wrapping and parametrizing ALcli shell scripts and using MWAPI[edit]

Unit Testing[edit]

ALui: MWM UI using and parametrizing ALapi endpoints[edit]


Integration Testing[edit]

Development Broadcasting[edit]

There are videos about MWStake MWM at dataspects' YouTube channel.