Jump to content

Bootstrap

From tripwiki

How the playground wiki ebike2026 behind this demo was bootstrapped, step by step, so that a reader can repeat it. Each step was run on an explicit go and verified before the next one; the commands are the ones that ran. The wiki is a stock Canasta with Semantic MediaWiki, created for the talk Prototyping a wiki by reel driven development: Documenting the e-bike trip from Bari to Ljubljana at the MediaWiki Users and Developers Conference Fall 2026.

Environment

  • a workstation with a docker engine, here OrbStack on macOS
  • the hostname ebike2026.bitplan.com resolves to the workstation itself through /etc/hosts while the wiki is a local pilot
  • Canasta CLI 4.31.0 in docker mode, target Canasta version 3.5.34, installed per Help:Installation
curl -fsSL https://get.canasta.wiki | bash
canasta version

The installer and the canasta-docker wrapper it places were read before they ran.

Step 1: create the instance

echo "127.0.0.1 ebike2026.bitplan.com" | sudo tee -a /etc/hosts
mkdir -p ~/canasta && cd ~/canasta
canasta create -i ebike2026 -w ebike2026 -n ebike2026.bitplan.com

Result: MediaWiki 1.43.11, PHP 8.2, MariaDB 11.4, one wiki ebike2026 served through the Canasta edge on ports 80 and 443. The wiki is private by Canasta's DefaultSettings.php, anonymous read and edit off; Canasta generates the WikiSysop password into the instance directory. Let's Encrypt cannot reach a workstation, so the edge served its own certificate at first.

Step 2: the real certificate

A certificate for the wiki's hostname, obtained elsewhere since Let's Encrypt cannot reach the workstation, is handed to the instance as Canasta's custom certificate per Help:HAProxy edge:

cp fullchain.pem ~/canasta/ebike2026/config/certs/origin.crt
cp privkey.pem   ~/canasta/ebike2026/config/certs/origin.key   # mode 600
canasta config set -i ebike2026 TLS_MODE=custom

Verified: the issuer answering on https://ebike2026.bitplan.com is Let's Encrypt, curl without -k answers 200.

Step 3: Semantic MediaWiki and the extension set

Stock versions as bundled by Canasta 3.5.34, no override. Semantic MediaWiki per Help:Extensions and skins: the settings file config/settings/global/SemanticMediaWiki.php

<?php
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'ebike2026.bitplan.com' );

then

canasta extension enable ParserFunctions,Variables,PageForms,SemanticResultFormats,Maps,HeaderTabs,AdminLinks,Mermaid,Scribunto -i ebike2026
canasta maintenance extension SemanticMediaWiki:rebuildData -i ebike2026

Verified through the API: SemanticMediaWiki 6.0.0, SemanticResultFormats 5.0.0, PageForms 6.0.11, Maps 13.1.2, Header Tabs 2.3, Admin Links 0.7.3, Mermaid 6.0.2, ParserFunctions 1.6.1, Variables 2.6.0, Scribunto; job queue 0. The enable runs update.php and needs SMW loaded already, so the settings file comes first. The job queue is drained by the job runner built into Canasta's web container, no cron to add.

Step 4: tooling access

A wikipush credentials entry for the wiki id ebike2026, user WikiSysop, script path /w:

wikiuser -w ebike2026 -l https://ebike2026.bitplan.com -s /w -v "MediaWiki 1.43.11" -u WikiSysop --smw true -y

Reads need the login flag of the tools, -l, since the wiki is private; writes log in anyway. This page was pushed with that entry.

Step 5: the MetaModel

The Y-Principle generator ypgen 0.5.3 needs the MetaModel on a wiki before it can read a context from it, so a fresh wiki is bootstrapped from the sidif master: the sidif block of the MetaModel page on contexts.bitplan.com, extracted on the criterion id='sidif', then the generator with the sidif file. A dry run first, the default, then the run with -nd:

ypgen --sidif ~/wikibackup/MetaModel.sidif --wikiId ebike2026 -ga
ypgen --sidif ~/wikibackup/MetaModel.sidif --wikiId ebike2026 -ga -nd
wikipush -s contexts -t ebike2026 -p MetaModel -f

The context page itself is not generated and is copied as an explicit one-page list. Result: 109 pages written for the topics Context, Topic, Property, SMW_Type, Action and TopicLink; Concept:Context answers 1. Two generator defects known from an earlier bootstrap and reproduced here: the Python target writes nothing, 6 elements, and Form:Property, the largest form, is not written.

Step 6: the TripContext

The same way with the TripContext, topics Trip, Leg and Loc, revised on 2026-09-11 from the reel 2026-09-11 TripContext:

ypgen --sidif ~/wikibackup/TripContext.sidif --wikiId ebike2026 -ga
ypgen --sidif ~/wikibackup/TripContext.sidif --wikiId ebike2026 -ga -nd
wikipush -s contexts -t ebike2026 -p TripContext -f

Result: 49 pages written, only the three Python targets without a page. The Main Page carries the Contexts and Topics queries of contexts.bitplan.com and renders 2 Contexts.

Step 7: ProfiWiki base pages and topic icons

The generated pages use the ProfiWiki templates Link, Icon, PageSequence, WhatLinksHere and the magic word . Canasta bundles MagicNoCache; the templates and the icons come from the contexts wiki as an explicit page list, the Needed for ProfiWiki set of its HowTo page without Main Page, plus Template:Icon and the three TripContext topic icons:

canasta extension enable MagicNoCache -i ebike2026
wikipush -s contexts -t ebike2026 -wi -f -p "Template:!" Template:IconLink Template:Link Template:NeededFor Template:PageSequence Template:TemplateSequence Template:UtfIcon Template:WhatLinksHere Template:Icon Property:IsA "Property:Link target" "Property:Needed for" Icons ProfiWiki/NeededPages MetaModel File:Actionicon.png File:Component.png "File:Element into input.png" "File:Help Icon.png" File:Index.png File:Profiwikiicon.png File:Registry.png File:Tour-Icon.png File:Flag-Icon.png File:Location_pin_icon.png

-wi copies the images a page uses, -f overwrites. Result: 25 pages, 11 files. After the copy the Topics query of the Main Page answered nothing although the topics were there: the Concept pages had been parsed before the templates existed. A forced link update, action=purge with forcelinkupdate through the API, restored their semantic data; the same was needed for the two context pages MetaModel and TripContext, whose Contexts count had dropped to 0 after the copy. Rule: every page written before the templates and properties it uses were in place needs a forced link update afterwards, a plain purge does not do it. The Topic icons are shown at 48 px by the printout |? Topic icon#48px, since they are stored at 48 and 128 px. Verified: the Main Page renders 2 Contexts and 9 Topics with icons and no red links, no longer shows.

Step 8: Font Awesome icons on MediaWiki 1.43

Template:Icon of ProfiWiki emits a raw img tag pointing at a Font Awesome svg under the wiki's script path. Two things break on this stock install: MediaWiki 1.43 escapes a raw img tag to text, the setting that allowed it went with 1.41, and Canasta serves no Font Awesome. Fix:

  • the Font Awesome 4 svg tree, 3513 files, copied into the instance's public_assets/font-awesome/svg; Canasta serves that directory under the script path, so the icons answer at /w/public_assets/font-awesome/svg/<name>.svg
  • the ImageLink extension, whose imgLink parser tag places an external image on current MediaWiki:
canasta extension add ImageLink --repository https://github.com/BITPlan/ImageLink --branch master -i ebike2026
  • Template:Icon on this wiki changed to emit <imgLink src="https://stw.bitplan.com/w/public_assets/font-awesome/svg/<name>.svg" size=".." title=".."/> instead of the img tag; Template:IconLink and Template:PageSequence already wrap Template:Icon in imgLink and keep working with the change

Verified: the edit icon on MetaModel renders as an image, IconLink and PageSequence render their icons, nothing is escaped.

Step 9: diagrams

The generated pages carry uml and graphviz tags. Canasta does not bundle the Diagrams extension; it is added from its repository and pointed at the house rendering service diagrams, the python service the extension page names, so the web container needs no PlantUML or Graphviz of its own:

canasta extension add Diagrams --clone -i ebike2026

config/settings/global/Diagrams.php:

<?php
$wgDiagramsServiceUrl = 'https://diagrams.bitplan.com';

then canasta restart. The first render failed three times in a row on the service side, each a defect of the service against the extension's request, each fixed and deployed the same evening: the service took only a JSON body while the extension posts a form (diagrams #22); it answered the json double encoded as a string (diagrams #23); it ignored the PHP style types array types[0]=svg of the extension (diagrams #24); and it answered http urls behind its https proxy, which an https wiki blocks as mixed content (diagrams #25). Verified with diagrams 0.2.5: uml in svg and graphviz in png render with https urls.

Step 10: LegMap and raw html

✍️🤖 Agent/Alex: the leg map of contexts BariLjubljana2026 comes with the templates Template:LegMap, Template:LegMapLines, Template:LegLine, Template:LocFormat and Template:Trim, copied from contexts; LegMap takes the leg selection as the parameter query, default the Leg subobjects of the current page, so a trip page shows the legs of its day pages with query=[[-Has subobject::~{{FULLPAGENAME}}*]][[IsA::Leg]]. Template:Category and Category:ProfiWiki were the red links of Template:PageSequence, copied as well.

LegMapLines draws the iframe of the gpx line service with the html tag, which Canasta does not allow by default. config/settings/global/RawHtml.php, versioned with RCS beside it:

<?php
$wgRawHtml = true;

No restart needed, the settings files are read per request. Verified: BariLjubljana2026/2026-11-08-Venice renders the iframe with its 11 legs and no coordinate error; the wiki stays private per DefaultSettings.php. Tracked as SemanticTripWiki #2.

Findings on the way

  • SMW property types and the web process: values written while the property pages were still propagating were stored as pages, and a forced link update did not change that; a restart of the instance, which clears the property type cache of the web container, followed by the forced link update stored them typed. rebuildData from the CLI, on the other hand, emptied those pages' data. Rule for this bootstrap: after the property pages exist, restart once, then force link updates.

Result