From 92a206ad4f695e6bce00fbc337aa361abc904e40 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 25 Jun 2023 20:49:51 +0100 Subject: [PATCH] Add some genealogy-related extensions --- .env.sample | 12 ++++++++++++ LocalSettings.php.tmpl | 17 +++++++++++++++++ abra.sh | 4 ++-- entrypoint.sh.tmpl | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/.env.sample b/.env.sample index e99fc96..e715c29 100644 --- a/.env.sample +++ b/.env.sample @@ -67,6 +67,18 @@ SECRET_MEDIAWIKI_SECRET_KEY_VERSION=v1 # length=64 ## WikiMarkdown #MARKDOWN_ENABLED=1 +## Scribunto Lua scripting +#SCRIBUNTO_ENABLED=1 + +## TemplateStyles +#TEMPLATESTYLES_ENABLED=1 + +## Mermaid +#MERMAID_ENABLED=1 + +## Genealogy +#GENEALOGY_ENABLED=1 + ## Tweeki skin #TWEEKI_ENABLED=0 diff --git a/LocalSettings.php.tmpl b/LocalSettings.php.tmpl index 41a2833..5152718 100644 --- a/LocalSettings.php.tmpl +++ b/LocalSettings.php.tmpl @@ -232,6 +232,23 @@ $wgAllowMarkdownExtra = true; // allows usage of Parsedown Extra $wgAllowMarkdownExtended = true; // allows usage of Parsedown Extended {{ end }} +{{ if eq (env "SCRIBUNTO_ENABLED") "1" }} +wfLoadExtension( 'Scribunto' ); +$wgScribuntoDefaultEngine = 'luastandalone'; +{{ end }} + +{{ if eq (env "TEMPLATESTYLES_ENABLED") "1" }} +wfLoadExtension( 'TemplateStyles' ); +{{ end }} + +{{ if eq (env "MERMAID_ENABLED") "1" }} +wfLoadExtension( 'Mermaid' ); +{{ end }} + +{{ if eq (env "GENEALOGY_ENABLED") "1" }} +wfLoadExtension( 'Genealogy' ); +{{ end }} + $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg' diff --git a/abra.sh b/abra.sh index 52c49d9..edc6011 100644 --- a/abra.sh +++ b/abra.sh @@ -1,6 +1,6 @@ -export LOCAL_SETTINGS_CONF_VERSION=v20 +export LOCAL_SETTINGS_CONF_VERSION=v21 export HTACCESS_CONF_VERSION=v1 -export ENTRYPOINT_CONF_VERSION=v19 +export ENTRYPOINT_CONF_VERSION=v20 export COMPOSER_LOCAL_CONF_VERSION=v5 export PHP_INI_VERSION=v4 diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 72ff37c..d1b71c6 100755 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -20,6 +20,11 @@ composer_install() { # SMW needs this; some other extensions brought in by composer might as well. php /var/www/html/maintenance/update.php --quick + + {{ if eq (env "TEMPLATESTYLES_ENABLED") "1" }} + cd /var/www/html/extensions/TemplateStyles && \ + composer install --no-dev + {{ end }} } init_db() { @@ -116,6 +121,37 @@ init_extensions() { fi fi + if [ -n "${SCRIBUNTO_ENABLED-}" ]; then + if [ ! -d /var/www/html/extensions/Scribunto ]; then + git clone --depth 1 \ + https://github.com/wikimedia/mediawiki-extensions-Scribunto \ + /var/www/html/extensions/Scribunto + fi + fi + + if [ -n "${TEMPLATESTYLES_ENABLED-}" ]; then + if [ ! -d /var/www/html/extensions/TemplateStyles ]; then + git clone --depth 1 \ + https://github.com/wikimedia/mediawiki-extensions-TemplateStyles \ + /var/www/html/extensions/TemplateStyles + fi + fi + + if [ -n "${MERMAID_ENABLED-}" ]; then + if [ ! -d /var/www/html/extensions/Mermaid ]; then + git clone --depth 1 \ + https://github.com/SemanticMediaWiki/Mermaid \ + /var/www/html/extensions/Mermaid + fi + fi + + if [ -n "${GENEALOGY_ENABLED-}" ]; then + if [ ! -d /var/www/html/extensions/Genealogy ]; then + git clone --depth 1 \ + https://github.com/wikimedia/mediawiki-extensions-Genealogy \ + /var/www/html/extensions/Genealogy + fi + fi } init_skins() {