MWStake MediaWiki Manager

From mwstake
Jump to: navigation, search
SUBPAGES
GitHub Repo Tag "CreateCampEMWCon2021"
Code Base at              https://github.com/dataspects/mediawiki-manager
Development Discussion at https://riot.im/app/#/room/#mwdeployment:matrix.org

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)
  12. ORTHOGONAL MODULARITY

Backlog[edit]

  • 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
...
containers:
  - image: docker.io/dataspects/mediawiki:1.35.0-2104121740
    name: mediawiki
    env:
      - name: WG_DB_PASSWORD
        value: 8n65f%6n5
      - ...
...
# Localsettings.php
$wgDBpassword = getenv("WG_DB_PASSWORD");

Config database[edit]

<?php
# 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);

$stmt->execute();
<?php
# 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);
fclose($mwmLS);
# Localsettings.php
$mwmls = "../mwmLocalSettings.php";
# MWStake MediaWiki Manager
if(file_exists($mwmls)) {
	require_once($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

PLUS

  • 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

containerized

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]

https://github.com/dataspects/mediawiki-manager/tree/main/cli/manage-content

Scripting[edit]

CLI (Bash)[edit]

https://github.com/dataspects/mediawiki-manager/blob/main/cli/manage-extensions/tests.sh

Package system(s)[edit]

  1. mediawiki-apps.json

MWStake MWM Service Portfolio[edit]

MWStake_MediaWiki_Manager/MWStakeServices

Abstraction Layers[edit]

Mediawiki-manager-Service-Architecture.png

ALcontainerization: Podman[edit]

  1. The mediawiki container image contains a full MediaWiki installation.
  2. initialize-persistent-mediawiki-service-volumes.sh 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]

MWM UI

Integration Testing[edit]

Development Broadcasting[edit]

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