Merge pull request 'Add support for SemanticMediaWiki, MobileFrontend, MsUpload, PageForms, PageSchemas, WikiMarkdown, Tweeki' (#31) from flancian/wiki.social.coop:main into main

Reviewed-on: coop-cloud/mediawiki#31
This commit is contained in:
decentral1se 2023-05-30 23:00:40 +00:00
commit 57cf8db271
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 Connect
# OPENID_ENABLED=1 # OPENID_ENABLED=1
# COMPOSE_FILE="compose.yml:compose.openid.yml" # 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" # OPENID_CLIENT_ID="mediawiki"
# SECRET_OPENID_CLIENT_SECRET_VERSION=v1 # 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; exit;
} }
## Uncomment this to disable output compression ## Uncomment this to disable output compression
# $wgDisableOutputCompression = true; # $wgDisableOutputCompression = true;
@ -116,15 +115,27 @@ $wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['read'] = true; $wgGroupPermissions['*']['read'] = true;
{{ end }} {{ end }}
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
# Enabled skins. # Enabled skins.
# The following skins were automatically enabled: # The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' ); wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' ); wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' ); 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 # Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName'); # wfLoadExtensions('ExtensionName');
@ -143,23 +154,6 @@ $wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgVisualEditorAllowLossySwitching = false; $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" }} {{ if eq (env "SAML_ENABLED") "1" }}
wfLoadExtension( 'PluggableAuth' ); wfLoadExtension( 'PluggableAuth' );
@ -214,6 +208,30 @@ $wgSMTP = [
]; ];
{{ end }} {{ 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( $wgFileExtensions = array(
'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff',
'bmp', 'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg' '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
export HTACCESS_CONF_VERSION=v1 export HTACCESS_CONF_VERSION=v1
export ENTRYPOINT_CONF_VERSION=v3 export ENTRYPOINT_CONF_VERSION=v19
export COMPOSER_LOCAL_CONF_VERSION=v1 export COMPOSER_LOCAL_CONF_VERSION=v5
export PHP_INI_VERSION=v1 export PHP_INI_VERSION=v4
export SAML_ENTRYPOINT_CONF_VERSION=v3 export SAML_ENTRYPOINT_CONF_VERSION=v3

View File

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

View File

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

View File

@ -17,6 +17,9 @@ composer_install() {
set -eu set -eu
cd /var/www/html/ && composer update && composer install 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() { init_db() {
@ -50,6 +53,7 @@ init_db() {
} }
init_extensions() { init_extensions() {
if [ ! -d /var/www/html/extensions/PluggableAuth ]; then if [ ! -d /var/www/html/extensions/PluggableAuth ]; then
git clone --depth 1 -b REL1_39 \ git clone --depth 1 -b REL1_39 \
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PluggableAuth \ https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PluggableAuth \
@ -71,12 +75,67 @@ init_extensions() {
/var/www/html/extensions/OpenIDConnect /var/www/html/extensions/OpenIDConnect
fi fi
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
}
main() { main() {
set -eu set -eu
init_extensions init_extensions
init_skins
init_composer init_composer
composer_install composer_install
init_db init_db

View File

@ -2,3 +2,9 @@ upload_max_filesize = 10M
post_max_size = 10M post_max_size = 10M
max_execution_time = 7200 max_execution_time = 7200
max_file_uploads = 1000 max_file_uploads = 1000
{{ if eq (env "MEDIAWIKI_DEBUG") "0" }}
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
{{ else }}
error_reporting = E_ALL
{{ end }}