Add support for SemanticMediaWiki, MobileFrontend, MsUpload, PageForms, PageSchemas, WikiMarkdown, Tweeki #31

Merged
decentral1se merged 13 commits from flancian/wiki.social.coop:main into main 2023-05-30 23:00:42 +00:00
7 changed files with 140 additions and 35 deletions

View File

@ -42,6 +42,31 @@ SECRET_MEDIAWIKI_SECRET_KEY_VERSION=v1 # length=64
## OpenID Connect
# OPENID_ENABLED=1
# COMPOSE_FILE="compose.yml:compose.openid.yml"
# OPENID_KEYCLOAK_URL="https://keycloak.local:8080/auth/realms/acme/"
# OPENID_KEYCLOAK_URL="https://keycloak.local:8080/realms/acme/"
# OPENID_CLIENT_ID="mediawiki"
# SECRET_OPENID_CLIENT_SECRET_VERSION=v1
## WikiMarkdown
#MARKDOWN_ENABLED=1
## MobileFrontend
#MOBILEFRONTEND_ENABLED=1
## MsUpload
#MSU_ENABLED=1
## PageForms
#PAGEFORMS_ENABLED=1
## PageSchemas
#PAGESCHEMAS_ENABLED=1
## SemanticMediaWiki
#SEMANTICMW_ENABLED=1
## WikiMarkdown
#MARKDOWN_ENABLED=1
## Tweeki skin
#TWEEKI_ENABLED=0

View File

@ -5,7 +5,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
@ -116,15 +115,27 @@ $wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['read'] = true;
{{ end }}
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
wfLoadSkin( 'MinervaNeue' );
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
{{ if eq (env "TWEEKI_ENABLED") "1" }}
wfLoadSkin( 'Tweeki' );
$wgDefaultSkin = "tweeki";
{{ else }}
$wgDefaultSkin = "vector";
{{ end }}
{{ if eq (env "MOBILEFRONTEND_ENABLED") "1" }}
wfLoadExtension( 'MobileFrontend' );
$wgDefaultMobileSkin = 'minerva';
{{ end }}
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
@ -143,23 +154,6 @@ $wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgVisualEditorAllowLossySwitching = false;
$wgVirtualRestConfig['modules']['parsoid'] = [
// URL to the Parsoid instance - use port 8142 if you use the Debian package - the parameter 'URL' was first used but is now deprecated (string)
'url' => 'http://parsoid:8000/',
// Parsoid "domain" (string, optional) - MediaWiki >= 1.26
'domain' => 'localhost',
// Parsoid "prefix" (string, optional) - deprecated since MediaWiki 1.26, use 'domain'
'prefix' => 'localhost',
// Forward cookies in the case of private wikis (string or false, optional)
'forwardCookies' => true,
// request timeout in seconds (integer or null, optional)
'timeout' => null,
// Parsoid HTTP proxy (string or null, optional)
'HTTPProxy' => null,
// whether to parse URL as if they were meant for RESTBase (boolean or null, optional)
'restbaseCompat' => null,
];
{{ if eq (env "SAML_ENABLED") "1" }}
wfLoadExtension( 'PluggableAuth' );
@ -214,6 +208,30 @@ $wgSMTP = [
];
{{ end }}
{{ if eq (env "MSU_ENABLED") "1" }}
wfLoadExtension( 'MsUpload' );
$wgAllowJavaUploads = true; // Solves problem with Office 2007 and newer files (docx, xlsx, etc.)
{{ end }}
{{ if eq (env "PAGEFORMS_ENABLED") "1" }}
wfLoadExtension( 'PageForms' );
{{ end }}
{{ if eq (env "PAGESCHEMAS_ENABLED") "1" }}
wfLoadExtension( 'PageSchemas' );
{{ end }}
{{ if eq (env "SEMANTICMW_ENABLED") "1" }}
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( '{{ env "DOMAIN" }}' );
{{ end }}
{{ if eq (env "MARKDOWN_ENABLED") "1" }}
wfLoadExtension( 'WikiMarkdown' );
$wgAllowMarkdownExtra = true; // allows usage of Parsedown Extra
$wgAllowMarkdownExtended = true; // allows usage of Parsedown Extended
{{ end }}
$wgFileExtensions = array(
'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff',
'bmp', 'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg'

View File

@ -1,8 +1,8 @@
export LOCAL_SETTINGS_CONF_VERSION=v6
export LOCAL_SETTINGS_CONF_VERSION=v20
Review

Usually we increment "+1" on these versions. Can imagine you did this because you have different versions on your fork? This might be confusing to folks if they see such a version increment but I think in practice nobody will notice and nobodys deploy will break. Just wanted to note this for due dilligence.

Usually we increment "+1" on these versions. Can imagine you did this because you have different versions on your fork? This might be confusing to folks if they see such a version increment but I think in practice nobody will notice and nobodys deploy will break. Just wanted to note this for due dilligence.
Review

This is me getting rid of the following kind of error message, step by step while running abra app deploy -C -- for ~tens of steps :)

continueFATA[0002] failed to update config wiki-alpha_social_coop_entrypoint2_v16: Error response from daemon: rpc error: code = InvalidArgument desc = only updates to Labels are allowed

I'm guessing there's a way to 'squash' these changes into minimal increments on integrating to the main branch, but I don't know what it is?

This is me getting rid of the following kind of error message, step by step while running abra app deploy -C -- for ~tens of steps :) continueFATA[0002] failed to update config wiki-alpha_social_coop_entrypoint2_v16: Error response from daemon: rpc error: code = InvalidArgument desc = only updates to Labels are allowed I'm guessing there's a way to 'squash' these changes into minimal increments on integrating to the main branch, but I don't know what it is?
Review

You would undeploy / deploy to "squash" the changes in the sense that the daemon wouldn't complain about "only updates blah blah" because it's a "fresh slate".

You would `undeploy` / `deploy` to "squash" the changes in the sense that the daemon wouldn't complain about "only updates blah blah" because it's a "fresh slate".
export HTACCESS_CONF_VERSION=v1
export ENTRYPOINT_CONF_VERSION=v3
export COMPOSER_LOCAL_CONF_VERSION=v1
export PHP_INI_VERSION=v1
export ENTRYPOINT_CONF_VERSION=v19
export COMPOSER_LOCAL_CONF_VERSION=v5
export PHP_INI_VERSION=v4
export SAML_ENTRYPOINT_CONF_VERSION=v3

View File

@ -63,14 +63,6 @@ services:
networks:
- internal
parsoid:
image: thenets/parsoid:0.11.0
hostname: parsoidserver
networks:
- internal
environment:
PARSOID_DOMAIN_localhost: http://app:80/api.php
volumes:
mariadb:
mediawiki_images:

View File

@ -1,4 +1,9 @@
{
{{ if eq (env "SEMANTICMW_ENABLED") "1" }}
"require": {
"mediawiki/semantic-media-wiki": "^4.1.0"
},
{{ end }}
"extra": {
"merge-plugin": {
"include": [

View File

@ -17,6 +17,9 @@ composer_install() {
set -eu
cd /var/www/html/ && composer update && composer install
# SMW needs this; some other extensions brought in by composer might as well.
php /var/www/html/maintenance/update.php --quick
}
init_db() {
@ -50,6 +53,7 @@ init_db() {
}
init_extensions() {
if [ ! -d /var/www/html/extensions/PluggableAuth ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PluggableAuth \
@ -71,12 +75,67 @@ init_extensions() {
/var/www/html/extensions/OpenIDConnect
fi
fi
if [ -n "${MOBILEFRONTEND_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/MobileFrontend ]; then
git clone --depth 1 -b REL1_39 \
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend.git \
/var/www/html/extensions/MobileFrontend
fi
fi
if [ -n "${MSU_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/MsUpload ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/MsUpload \
/var/www/html/extensions/MsUpload
fi
fi
if [ -n "${PAGEFORMS_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/PageForms ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms \
/var/www/html/extensions/PageForms
fi
fi
if [ -n "${PAGESCHEMAS_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/PageSchemas ]; then
git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageSchemas \
/var/www/html/extensions/PageSchemas
fi
fi
if [ -n "${MARKDOWN_ENABLED-}" ]; then
if [ ! -d /var/www/html/extensions/WikiMarkdown ]; then
git clone --depth 1 \
https://github.com/kuenzign/WikiMarkdown \
/var/www/html/extensions/WikiMarkdown
fi
fi
}
init_skins() {
if [ -n "${TWEEKI_ENABLED-}" ]; then
if [ ! -d /var/www/html/skins/Tweeki ]; then
git clone --depth 1 \
https://github.com/thaider/Tweeki \
/var/www/html/skins/Tweeki
fi
fi
decentral1se marked this conversation as resolved
Review

Indentation looks a bit off but whatevs.

Indentation looks a bit off but whatevs.
Review

Yes, thank you, fixed :)

Yes, thank you, fixed :)
}
main() {
set -eu
init_extensions
init_skins
init_composer
composer_install
init_db

View File

@ -2,3 +2,9 @@ upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 7200
max_file_uploads = 1000
{{ if eq (env "MEDIAWIKI_DEBUG") "0" }}
decentral1se marked this conversation as resolved
Review

Did you mean "1"? I see the default is MEDIAWIKI_DEBUG=0 in the .env.sample and elsewhere in the LocalSettings.php.tmpl it is {{ if eq (env "MEDIAWIKI_DEBUG") "1" }}.

Did you mean `"1"`? I see the default is `MEDIAWIKI_DEBUG=0` in the `.env.sample` and elsewhere in the `LocalSettings.php.tmpl` it is `{{ if eq (env "MEDIAWIKI_DEBUG") "1" }}`.
Review

Indeed I did, thank you :)

Indeed I did, thank you :)
Review

Oh, actually I didn't ;) This was meant to disable deprecation warnings and such -- I added an else block to make this clearer, I think this looks better?

Oh, actually I didn't ;) This was meant to *disable* deprecation warnings and such -- I added an else block to make this clearer, I think this looks better?
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
{{ else }}
error_reporting = E_ALL
{{ end }}