From f6e3d466d157e6c05ab716f57d2ec2b67533f164 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Mon, 24 Mar 2025 21:03:43 +0100 Subject: [PATCH 01/16] shubara(feat): first prototype of messagebox --- shubara/Shubara.i18n.php | 1 + shubara/resources/ext.shubara/ext.shubara.css | 19 +++++++++++++++---- shubara/src/Hooks.php | 2 ++ shubara/src/ParserFunctions/Messagebox.php | 14 ++++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/shubara/Shubara.i18n.php b/shubara/Shubara.i18n.php index 2a18ea8..63330f7 100644 --- a/shubara/Shubara.i18n.php +++ b/shubara/Shubara.i18n.php @@ -5,5 +5,6 @@ $magicWords['en'] = [ 'infobox' => [0, 'infobox'], 'infobox-list' => [0, 'infobox-list'], + 'messagebox' => [0, 'messagebox'], ]; diff --git a/shubara/resources/ext.shubara/ext.shubara.css b/shubara/resources/ext.shubara/ext.shubara.css index 539da26..7df7e0d 100644 --- a/shubara/resources/ext.shubara/ext.shubara.css +++ b/shubara/resources/ext.shubara/ext.shubara.css @@ -1,10 +1,6 @@ /* FIXME: This file is too long. It has to be broken up and then delivered on-demand * as a resource module, only if the required tag/parser hook is used. */ -.ext-shubara-navcards { - min-width: 280px; - gap: 10px; -} .ext-shubara-navcards-flex { display: flex; @@ -348,3 +344,18 @@ color: var(--color-emphasized); } } + +.ext-shubara-messagebox { + border-radius: 12px; + background: var(--color-surface-1); + border: 4px solid var(--color-surface-2); + padding-left: 10px; + margin-top: 4px; +} + +.ext-shubara-messagebox p { + display: flex; + flex-direction: row; + gap: 12px; + justify-content: flex-start; +} diff --git a/shubara/src/Hooks.php b/shubara/src/Hooks.php index 91d730a..f0966f3 100644 --- a/shubara/src/Hooks.php +++ b/shubara/src/Hooks.php @@ -11,6 +11,7 @@ use MediaWiki\Extension\Shubara\Tags\Projectstats; use MediaWiki\Extension\Shubara\Tags\NewsList; use MediaWiki\Extension\Shubara\ParserFunctions\Infobox; +use MediaWiki\Extension\Shubara\ParserFunctions\Messagebox; class Hooks implements ParserFirstCallInitHook, BeforePageDisplayHook { public function onParserFirstCallInit($parser) { @@ -22,6 +23,7 @@ public function onParserFirstCallInit($parser) { $parser->setHook('newslist', NewsList::run(...)); $parser->setFunctionHook('infobox', Infobox::main(...), SFH_NO_HASH); $parser->setFunctionHook('infobox-list', Infobox::list(...), SFH_NO_HASH); + $parser->setFunctionHook('messagebox', Messagebox::main(...), SFH_NO_HASH); return true; } diff --git a/shubara/src/ParserFunctions/Messagebox.php b/shubara/src/ParserFunctions/Messagebox.php index 922182e..9719204 100644 --- a/shubara/src/ParserFunctions/Messagebox.php +++ b/shubara/src/ParserFunctions/Messagebox.php @@ -9,8 +9,18 @@ /** * Render the messagebox parser function */ +// TODO: Rewrite this as a tag extension class Messagebox { - public static function run(Parser $parser) { - + public static function main(Parser $parser) { + $content = ''; + $input = array_slice(func_get_args(), 1); + + return [ + Html::rawElement('div', [ + // noexcerpt is there so Popups doesn't extract it + 'class' => 'ext-shubara-messagebox noexcerpt', + ], $parser->recursiveTagParseFully(implode('', $input))), + 'isHTML' => true + ]; } } From 663a3d40248e445e9c340db36f31a1fc9dc9818e Mon Sep 17 00:00:00 2001 From: GGorAA Date: Mon, 24 Mar 2025 22:18:25 +0100 Subject: [PATCH 02/16] cron(fix): rebuilt the entire cron system based on the yacron project now all cron jobs work and actually do whats expected from them --- mediawiki/Dockerfile | 13 ++++---- mediawiki/cron/crontab | 10 ------ mediawiki/cron/crontab.yaml | 46 ++++++++++++++++++++++++++++ mediawiki/cron/jobrunner | 2 -- mediawiki/cron/stats | 2 -- mediawiki/cron/stopforumspam-refresh | 2 -- mediawiki/cron/wearealive | 4 --- mediawiki/run-apache.sh | 2 ++ 8 files changed, 55 insertions(+), 26 deletions(-) delete mode 100644 mediawiki/cron/crontab create mode 100644 mediawiki/cron/crontab.yaml delete mode 100644 mediawiki/cron/wearealive diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index f11691d..c4a96be 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -38,6 +38,7 @@ RUN set -x; \ && pear install mail net_smtp \ # TODO: this shit stinks && pip3 install pygments --break-system-packages \ + && pip3 install yacron --break-system-packages \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/cache/apt/archives/* \ && a2enmod rewrite \ @@ -130,14 +131,13 @@ RUN set -x; \ COPY --from=shubara ./ $MW_HOME/extensions/Shubara #### Setup services -COPY cron/crontab $MW_HOME/ -COPY --exclude=cron/crontab cron/* /usr/local/bin/mw/ +COPY cron/crontab.yaml $MW_HOME/ +COPY --exclude=cron/crontab.yaml cron/* /usr/local/bin/mw/ RUN set -x; \ chmod -R +x /usr/local/bin/mw/ \ && mkdir /tmp/mw \ && cd $MW_HOME \ - && touch /var/log/cron.log \ - && cat crontab >> /etc/crontab + && cat crontab.yaml >> /etc/crontab.yaml #### Download StopForumSpam list RUN set -x; \ @@ -150,7 +150,7 @@ RUN set -x; \ RUN set -x; \ cd $MW_HOME \ && rm -r patches tests docs *.md COPYING CREDITS FAQ HISTORY INSTALL RELEASE-NOTES* \ - SECURITY UPGRADE *.json *.yml *.js *sample phpunit.xml.dist crontab + SECURITY UPGRADE *.json *.yml *.js *sample phpunit.xml.dist crontab.yaml EXPOSE 80 @@ -168,7 +168,8 @@ COPY LocalSettings.php $MW_HOME/LocalSettings.php COPY init_elastic.sh / RUN set -x; chmod +x /init_elastic.sh -CMD ["/run-apache.sh"] +# CMD ["/run-apache.sh"] +ENTRYPOINT yacron -c /etc/crontab.yaml VOLUME ["$MW_HOME/images", "$MW_VOLUME"] diff --git a/mediawiki/cron/crontab b/mediawiki/cron/crontab deleted file mode 100644 index 54c0d23..0000000 --- a/mediawiki/cron/crontab +++ /dev/null @@ -1,10 +0,0 @@ -### MEDIAWIKI ### - -# At every minute, create a "healtcheck" file for cron -* * * * * root /usr/local/bin/mw/wearealive -# At every minute, run jobs -* * * * * root /usr/local/bin/mw/jobrunner -# At 04:00 each day, update StopForumSpam lists -0 4 * * * root /usr/local/bin/mw/stopforumspam-refresh -# At 04:00 each day, refresh site statistics -0 4 * * * root /usr/local/bin/mw/stats diff --git a/mediawiki/cron/crontab.yaml b/mediawiki/cron/crontab.yaml new file mode 100644 index 0000000..544977e --- /dev/null +++ b/mediawiki/cron/crontab.yaml @@ -0,0 +1,46 @@ +jobs: + - name: mediawiki + command: /run-apache.sh + shell: /bin/bash + schedule: "@reboot" + captureStdout: true + captureStderr: true + onFailure: + report: + shell: + shell: /bin/bash + command: kill -s SIGINT 1 + + - name: jobrunner + command: /usr/local/bin/mw/jobrunner + shell: /bin/bash + schedule: "* * * * *" + captureStdout: true + captureStderr: true + onFailure: + report: + shell: + shell: /bin/bash + command: kill -s SIGINT 1 + - name: stopforumspam-refresh + command: /usr/local/bin/mw/stopforumspam-refresh + shell: /bin/bash + schedule: "0 4 * * *" + captureStdout: true + captureStderr: true + onFailure: + report: + shell: + shell: /bin/bash + command: kill -s SIGINT 1 + - name: stats + command: /usr/local/bin/mw/stats + shell: /bin/bash + schedule: "0 4 * * *" + captureStdout: true + captureStderr: true + onFailure: + report: + shell: + shell: /bin/bash + command: kill -s SIGINT 1 diff --git a/mediawiki/cron/jobrunner b/mediawiki/cron/jobrunner index 0825f07..a96b1c8 100644 --- a/mediawiki/cron/jobrunner +++ b/mediawiki/cron/jobrunner @@ -7,5 +7,3 @@ RUN_JOBS="$MW_HOME/maintenance/run.php" php $RUN_JOBS runJobs --maxtime=3600 --type="enotifNotify" # Everything else, limit the number of jobs on each batch php $RUN_JOBS runJobs --maxtime=3600 --maxjobs=40 - -touch /tmp/mw/jobrunner diff --git a/mediawiki/cron/stats b/mediawiki/cron/stats index b515169..88a65e1 100644 --- a/mediawiki/cron/stats +++ b/mediawiki/cron/stats @@ -2,5 +2,3 @@ php $MW_HOME/maintenance/run.php initSiteStats --update --active php $MW_HOME/maintenance/run.php initEditCount --background - -touch /tmp/mw/stats diff --git a/mediawiki/cron/stopforumspam-refresh b/mediawiki/cron/stopforumspam-refresh index bd6b425..c5c8b50 100644 --- a/mediawiki/cron/stopforumspam-refresh +++ b/mediawiki/cron/stopforumspam-refresh @@ -5,5 +5,3 @@ curl -O https://www.stopforumspam.com/downloads/listed_ip_30_all.zip unzip listed_ip_30_all.zip mv listed_ip_30_all.txt stopforumspam.txt php maintenance/run.php $MW_HOME/extensions/StopForumSpam/maintenance/updateDenyList - -touch /tmp/mw/stopforumspam-refresh diff --git a/mediawiki/cron/wearealive b/mediawiki/cron/wearealive deleted file mode 100644 index 4ca754e..0000000 --- a/mediawiki/cron/wearealive +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -touch /tmp/mw/cronisaliveandwell - diff --git a/mediawiki/run-apache.sh b/mediawiki/run-apache.sh index bc598ce..019c6ea 100644 --- a/mediawiki/run-apache.sh +++ b/mediawiki/run-apache.sh @@ -2,6 +2,8 @@ set -e +trap "exit" SIGINT SIGTERM + # TODO: Check if this is needed for first startup # it turns out that this line right here is the reason why it took AGES for the mediawiki # container to start up, and removing it made it BLAZINGLY fast (please don't kill me). From d9f24be013d9e81c654df85194af1435ba43377d Mon Sep 17 00:00:00 2001 From: GGorAA Date: Tue, 25 Mar 2025 01:07:42 +0100 Subject: [PATCH 03/16] cron(fix): disable failsWhen: producesStderr on related jobs --- mediawiki/cron/crontab.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mediawiki/cron/crontab.yaml b/mediawiki/cron/crontab.yaml index 544977e..33bbced 100644 --- a/mediawiki/cron/crontab.yaml +++ b/mediawiki/cron/crontab.yaml @@ -5,6 +5,8 @@ jobs: schedule: "@reboot" captureStdout: true captureStderr: true + failsWhen: + producesStderr: false onFailure: report: shell: @@ -17,6 +19,8 @@ jobs: schedule: "* * * * *" captureStdout: true captureStderr: true + failsWhen: + producesStderr: false onFailure: report: shell: @@ -28,6 +32,8 @@ jobs: schedule: "0 4 * * *" captureStdout: true captureStderr: true + failsWhen: + producesStderr: false onFailure: report: shell: From 9816ddc2b92fb8dcb3dde732236aa72885f66cd5 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Tue, 25 Mar 2025 12:17:45 +0100 Subject: [PATCH 04/16] mediawiki(feat): install TimedMediaHandler extension additionally, a new dependency is installed together with it - ffmpeg --- mediawiki/Dockerfile | 1 + mediawiki/LocalSettings.php | 7 +++++++ mediawiki/cron/crontab.yaml | 3 +++ mediawiki/ext/extensions.csv | 1 + 4 files changed, 12 insertions(+) diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index c4a96be..7e5d67c 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -35,6 +35,7 @@ RUN set -x; \ wget \ patch \ cron \ + ffmpeg \ && pear install mail net_smtp \ # TODO: this shit stinks && pip3 install pygments --break-system-packages \ diff --git a/mediawiki/LocalSettings.php b/mediawiki/LocalSettings.php index b475a89..e8354c3 100644 --- a/mediawiki/LocalSettings.php +++ b/mediawiki/LocalSettings.php @@ -149,6 +149,9 @@ $wgUseInstantCommons = true; $wgFileExtensions[] = 'svg'; +$wgFileExtensions[] = 'mp4'; +$wgFileExtensions[] = 'mov'; +$wgFileExtensions[] = 'mkv'; $wgSVGNativeRendering = true; ####################### Extensions ######################### @@ -213,6 +216,7 @@ wfLoadExtension('TemplateStyles'); wfLoadExtension('TextExtracts'); wfLoadExtension('Thanks'); +wfLoadExtension('TimedMediaHandler'); wfLoadExtension('TitleBlacklist'); wfLoadExtension('Translate'); wfLoadExtension('UniversalLanguageSelector'); @@ -225,6 +229,9 @@ $wgEnableMetaDescriptionFunctions = true; $wgDescriptionRemoveElements[] = '.ext-shubara-infobox'; +### TimedMediaHandler ### +$wgFFmpegLocation = '/usr/bin/ffmpeg'; + ### Math ### $wgMathInternalRestbaseURL = getenv('MW_REST_RESTBASE_URL'); diff --git a/mediawiki/cron/crontab.yaml b/mediawiki/cron/crontab.yaml index 33bbced..0b7527d 100644 --- a/mediawiki/cron/crontab.yaml +++ b/mediawiki/cron/crontab.yaml @@ -6,6 +6,7 @@ jobs: captureStdout: true captureStderr: true failsWhen: + producesStdout: false producesStderr: false onFailure: report: @@ -20,6 +21,7 @@ jobs: captureStdout: true captureStderr: true failsWhen: + producesStdout: false producesStderr: false onFailure: report: @@ -33,6 +35,7 @@ jobs: captureStdout: true captureStderr: true failsWhen: + producesStdout: false producesStderr: false onFailure: report: diff --git a/mediawiki/ext/extensions.csv b/mediawiki/ext/extensions.csv index 3e5be52..3c40b11 100644 --- a/mediawiki/ext/extensions.csv +++ b/mediawiki/ext/extensions.csv @@ -51,6 +51,7 @@ SyntaxHighlight_GeSHi,composer TemplateStyles,composer TextExtracts,simple Thanks,simple +TimedMediaHandler,composer TitleBlacklist,simple Translate,simple,2024.07 UniversalLanguageSelector,composer,2024.07 From 24dafd3ec4c28f0ea83e27c7a5c95aaea740cac3 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Tue, 25 Mar 2025 12:18:17 +0100 Subject: [PATCH 05/16] mediawiki(fix): DiscordNotifications has been absorbed by Miraheze, upd branch --- mediawiki/ext/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediawiki/ext/install.sh b/mediawiki/ext/install.sh index d87062f..580ca97 100644 --- a/mediawiki/ext/install.sh +++ b/mediawiki/ext/install.sh @@ -26,7 +26,7 @@ NON_WMGERRIT_EXTS_BRANCHES=( "main" "main" "REL1_43" - "REL1_40" + "master" ) if [ $1 = 'download' ]; then From f2ea55034be8152557f32aa1d93d87acea95ab76 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Thu, 3 Apr 2025 01:47:38 +0200 Subject: [PATCH 06/16] mediawiki: system update - Citizen is now v3.0.0 stable, not alpha commit - Language bundle is updated to 2025.03 --- mediawiki/Dockerfile | 17 ++++++++--------- mediawiki/ext/extensions.csv | 8 ++++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index 7e5d67c..f217955 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -61,8 +61,7 @@ ENV MW_VERSION=REL1_43 \ WWW_GROUP=www-data \ APACHE_LOG_DIR=/var/log/apache2 -# basically 3.0.0-alpha -ENV CITIZEN_VERSION=32e78ff279156ea8dfdeb615430211354922954e +ENV CITIZEN_VERSION=v3.0.0 ENV TEMPLATESTYLESEXTENDER_VERSION=v1.2.0 # logs should go to stdout / stderr @@ -92,13 +91,13 @@ RUN set -x; \ ##### Citizen skin RUN set -x; \ cd $MW_HOME/skins \ - # && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen - # Revert back to original download method once 3.0.0 fully releases and I will not - # need to use a commit hash. https://stackoverflow.com/a/3489576 - && mkdir Citizen && cd Citizen \ - && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ - && git fetch origin $CITIZEN_VERSION \ - && git reset --hard FETCH_HEAD + && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen + + # https://stackoverflow.com/a/3489576 + # && mkdir Citizen && cd Citizen \ + # && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ + # && git fetch origin $CITIZEN_VERSION \ + # && git reset --hard FETCH_HEAD COPY ext/* /ext/ diff --git a/mediawiki/ext/extensions.csv b/mediawiki/ext/extensions.csv index 3c40b11..ab719bb 100644 --- a/mediawiki/ext/extensions.csv +++ b/mediawiki/ext/extensions.csv @@ -1,12 +1,12 @@ AbuseFilter,composer AdvancedSearch,simple -Babel,composer,2024.07 +Babel,composer,2025.03 CategoryTree,simple CheckUser,simple Cite,simple CiteThisPage,simple CirrusSearch,composer -cldr,composer,2024.07 +cldr,composer,2025.03 CleanChanges,composer CodeEditor,composer ConfirmEdit,simple @@ -53,8 +53,8 @@ TextExtracts,simple Thanks,simple TimedMediaHandler,composer TitleBlacklist,simple -Translate,simple,2024.07 -UniversalLanguageSelector,composer,2024.07 +Translate,simple,2025.03 +UniversalLanguageSelector,composer,2025.03 UploadWizard,simple UserMerge,simple VisualEditor,other From cae8bb4fe1ad90164393a9e0da3b383ee6bc1dca Mon Sep 17 00:00:00 2001 From: GGorAA Date: Fri, 4 Apr 2025 03:01:59 +0200 Subject: [PATCH 07/16] mediawiki: set latest commit as Citizen version --- mediawiki/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index f217955..9e425df 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -61,7 +61,7 @@ ENV MW_VERSION=REL1_43 \ WWW_GROUP=www-data \ APACHE_LOG_DIR=/var/log/apache2 -ENV CITIZEN_VERSION=v3.0.0 +ENV CITIZEN_VERSION=6339841b5fb5a3e869f00eb25f203c11d64cdea1 ENV TEMPLATESTYLESEXTENDER_VERSION=v1.2.0 # logs should go to stdout / stderr @@ -91,13 +91,13 @@ RUN set -x; \ ##### Citizen skin RUN set -x; \ cd $MW_HOME/skins \ - && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen + # && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen # https://stackoverflow.com/a/3489576 - # && mkdir Citizen && cd Citizen \ - # && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ - # && git fetch origin $CITIZEN_VERSION \ - # && git reset --hard FETCH_HEAD + && mkdir Citizen && cd Citizen \ + && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ + && git fetch origin $CITIZEN_VERSION \ + && git reset --hard FETCH_HEAD COPY ext/* /ext/ From 78ca485f6d38de8abb9eaf134fb0ef160b7c462c Mon Sep 17 00:00:00 2001 From: GGorAA Date: Mon, 14 Apr 2025 23:46:25 +0200 Subject: [PATCH 08/16] fix(Translate): for some reason 2025.03 throws LESS errors, fixed that basically a hotfix, a patch that just replaces @background-color-interactive*--* with #EEEEEE, just to make the compiler shut the fuck up I will try to communicate with the dev team about this --- mediawiki/Dockerfile | 12 ++--- mediawiki/ext/install.sh | 4 +- mediawiki/patches/post/translate-bgci-h.patch | 53 +++++++++++++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 mediawiki/patches/post/translate-bgci-h.patch diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index 9e425df..f217955 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -61,7 +61,7 @@ ENV MW_VERSION=REL1_43 \ WWW_GROUP=www-data \ APACHE_LOG_DIR=/var/log/apache2 -ENV CITIZEN_VERSION=6339841b5fb5a3e869f00eb25f203c11d64cdea1 +ENV CITIZEN_VERSION=v3.0.0 ENV TEMPLATESTYLESEXTENDER_VERSION=v1.2.0 # logs should go to stdout / stderr @@ -91,13 +91,13 @@ RUN set -x; \ ##### Citizen skin RUN set -x; \ cd $MW_HOME/skins \ - # && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen + && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen # https://stackoverflow.com/a/3489576 - && mkdir Citizen && cd Citizen \ - && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ - && git fetch origin $CITIZEN_VERSION \ - && git reset --hard FETCH_HEAD + # && mkdir Citizen && cd Citizen \ + # && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ + # && git fetch origin $CITIZEN_VERSION \ + # && git reset --hard FETCH_HEAD COPY ext/* /ext/ diff --git a/mediawiki/ext/install.sh b/mediawiki/ext/install.sh index 580ca97..1c2bccd 100644 --- a/mediawiki/ext/install.sh +++ b/mediawiki/ext/install.sh @@ -10,7 +10,7 @@ NON_WMGERRIT_EXTS=( "https://github.com/StarCitizenTools/mediawiki-extensions-ShortDescription.git" "https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git" "https://github.com/Universal-Omega/DynamicPageList3.git" - "https://github.com/Universal-Omega/DiscordNotifications.git" + "https://github.com/miraheze/DiscordNotifications.git" ) NON_WMGERRIT_EXTS_NAMES=( @@ -26,7 +26,7 @@ NON_WMGERRIT_EXTS_BRANCHES=( "main" "main" "REL1_43" - "master" + "main" ) if [ $1 = 'download' ]; then diff --git a/mediawiki/patches/post/translate-bgci-h.patch b/mediawiki/patches/post/translate-bgci-h.patch new file mode 100644 index 0000000..13a86e5 --- /dev/null +++ b/mediawiki/patches/post/translate-bgci-h.patch @@ -0,0 +1,53 @@ +diff --color -ruN mediawiki/extensions/Translate/resources/css/ext.translate.editor.less mediawiki2/extensions/Translate/resources/css/ext.translate.editor.less +--- mediawiki/extensions/Translate/resources/css/ext.translate.editor.less 2025-04-14 23:19:23 ++++ mediawiki2/extensions/Translate/resources/css/ext.translate.editor.less 2025-04-14 23:37:54 +@@ -350,12 +350,12 @@ + + &:hover { + cursor: @cursor-base--hover; +- background-color: @background-color-interactive--hover; ++ background-color: #EEEEEE; + border-left-color: @border-color-progressive--hover; + } + + &:active { +- background-color: @background-color-interactive--active; ++ background-color: #EEEEEE; + border-left-color: @border-color-progressive--active; + } + } +@@ -514,11 +514,11 @@ + + &:hover { + cursor: @cursor-base--hover; +- background: @background-color-interactive-subtle--hover; ++ background: #EEEEEE; + } + + &:active { +- background: @background-color-interactive-subtle--active; ++ background: #EEEEEE; + } + } + +diff --color -ruN mediawiki/extensions/Translate/resources/css/ext.translate.messagetable.less mediawiki2/extensions/Translate/resources/css/ext.translate.messagetable.less +--- mediawiki/extensions/Translate/resources/css/ext.translate.messagetable.less 2025-04-14 23:19:23 ++++ mediawiki2/extensions/Translate/resources/css/ext.translate.messagetable.less 2025-04-14 23:21:07 +@@ -58,7 +58,7 @@ + } + + .tux-message-item:hover { +- background-color: @background-color-interactive--hover; ++ background-color: #EEEEEE; + } + + .tux-list-status span, +@@ -172,7 +172,7 @@ + } + + .tux-action-bar button:hover { +- background-color: @background-color-interactive--hover; ++ background-color: #EEEEEE; + } + + .tux-action-bar button:active, From 8756b379beb6f328156d041d7eb2596bbfe4b658 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Tue, 15 Apr 2025 11:30:04 +0200 Subject: [PATCH 09/16] chore: rename translate-bgci-h.patch to translate-bgci.patch --- .../patches/post/{translate-bgci-h.patch => translate-bgci.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mediawiki/patches/post/{translate-bgci-h.patch => translate-bgci.patch} (100%) diff --git a/mediawiki/patches/post/translate-bgci-h.patch b/mediawiki/patches/post/translate-bgci.patch similarity index 100% rename from mediawiki/patches/post/translate-bgci-h.patch rename to mediawiki/patches/post/translate-bgci.patch From a50905d7d65eaa6868b2e8e32a5352f781243525 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Tue, 15 Apr 2025 21:43:30 +0200 Subject: [PATCH 10/16] fix(mediawiki): enable $wgFixDoubleRedirects --- mediawiki/LocalSettings.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediawiki/LocalSettings.php b/mediawiki/LocalSettings.php index e8354c3..bf484c9 100644 --- a/mediawiki/LocalSettings.php +++ b/mediawiki/LocalSettings.php @@ -114,6 +114,8 @@ //Use $wgSquidServersNoPurge if you don't want MediaWiki to purge modified pages //$wgSquidServersNoPurge = array('127.0.0.1'); +$wgFixDoubleRedirects = true; + ####################### Email ######################### $wgEnableEmail = true; $wgEnableUserEmail = true; From 2fdf72276392c4cd69dd361cb7157cf99ba881c1 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Thu, 17 Apr 2025 13:52:39 +0200 Subject: [PATCH 11/16] fix(mediawiki): attempt to fix safe area padding for mobile devices --- mediawiki/patches/post/core_viewport_cover.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 mediawiki/patches/post/core_viewport_cover.patch diff --git a/mediawiki/patches/post/core_viewport_cover.patch b/mediawiki/patches/post/core_viewport_cover.patch new file mode 100644 index 0000000..661ae0c --- /dev/null +++ b/mediawiki/patches/post/core_viewport_cover.patch @@ -0,0 +1,13 @@ +diff --color -ruN mediawiki/includes/skins/Skin.php mediawiki2/includes/skins/Skin.php +--- mediawiki/includes/skins/Skin.php 2025-01-11 09:42:42 ++++ mediawiki2/includes/skins/Skin.php 2025-04-17 13:42:32 +@@ -406,7 +406,8 @@ + $out->addMeta( + 'viewport', + 'width=device-width, initial-scale=1.0, ' . +- 'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0' ++ 'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0, ' . ++ 'viewport-fit=cover' + ); + } else { + // Force the desktop experience on an iPad by resizing the mobile viewport to From 24b12a41b1f45baafc0a48dffe93f7d75545a720 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Mon, 21 Apr 2025 10:49:26 +0200 Subject: [PATCH 12/16] fix(mediawiki): update Citizen to latest commit (as of commit time) - fixes the issue with safe area not being respected - removed code_viewport_cover patch, it's integrated into Citizen now - enabled $wgCitizenEnableCommandPalette for local dev environment --- mediawiki/Dockerfile | 12 ++++++------ mediawiki/LocalSettings.php | 3 +++ mediawiki/patches/post/core_viewport_cover.patch | 13 ------------- 3 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 mediawiki/patches/post/core_viewport_cover.patch diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index f217955..f9d8edc 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -61,7 +61,7 @@ ENV MW_VERSION=REL1_43 \ WWW_GROUP=www-data \ APACHE_LOG_DIR=/var/log/apache2 -ENV CITIZEN_VERSION=v3.0.0 +ENV CITIZEN_VERSION=3bd79748a69e757f7bf9813b621ef834491f787a ENV TEMPLATESTYLESEXTENDER_VERSION=v1.2.0 # logs should go to stdout / stderr @@ -91,13 +91,13 @@ RUN set -x; \ ##### Citizen skin RUN set -x; \ cd $MW_HOME/skins \ - && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen + # && git clone --depth 1 -b $CITIZEN_VERSION https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git Citizen # https://stackoverflow.com/a/3489576 - # && mkdir Citizen && cd Citizen \ - # && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ - # && git fetch origin $CITIZEN_VERSION \ - # && git reset --hard FETCH_HEAD + && mkdir Citizen && cd Citizen \ + && git init && git remote add origin https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git \ + && git fetch origin $CITIZEN_VERSION \ + && git reset --hard FETCH_HEAD COPY ext/* /ext/ diff --git a/mediawiki/LocalSettings.php b/mediawiki/LocalSettings.php index bf484c9..da23830 100644 --- a/mediawiki/LocalSettings.php +++ b/mediawiki/LocalSettings.php @@ -471,4 +471,7 @@ if (str_contains($wgServer, 'localhost')) { // if running locally $wgShowDebug = true; $wgShowExceptionDetails = true; + + // experimental features + $wgCitizenEnableCommandPalette = true; } diff --git a/mediawiki/patches/post/core_viewport_cover.patch b/mediawiki/patches/post/core_viewport_cover.patch deleted file mode 100644 index 661ae0c..0000000 --- a/mediawiki/patches/post/core_viewport_cover.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --color -ruN mediawiki/includes/skins/Skin.php mediawiki2/includes/skins/Skin.php ---- mediawiki/includes/skins/Skin.php 2025-01-11 09:42:42 -+++ mediawiki2/includes/skins/Skin.php 2025-04-17 13:42:32 -@@ -406,7 +406,8 @@ - $out->addMeta( - 'viewport', - 'width=device-width, initial-scale=1.0, ' . -- 'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0' -+ 'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0, ' . -+ 'viewport-fit=cover' - ); - } else { - // Force the desktop experience on an iPad by resizing the mobile viewport to From 57035b2f7d57a66579637c00fc58943cae394c0a Mon Sep 17 00:00:00 2001 From: GGorAA Date: Sat, 26 Apr 2025 02:37:00 +0200 Subject: [PATCH 13/16] feat(bg): add patch for site background very crude implementation, basically 1-to-1 as original implementation from MediaWiki:Citizen.css will have to be updated to have src contents being filled up in PHP (generate different sizes, allow to load different sizes) related to issue #4 --- mediawiki/patches/post/citizen_sitebg.patch | 52 +++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 mediawiki/patches/post/citizen_sitebg.patch diff --git a/mediawiki/patches/post/citizen_sitebg.patch b/mediawiki/patches/post/citizen_sitebg.patch new file mode 100644 index 0000000..557662e --- /dev/null +++ b/mediawiki/patches/post/citizen_sitebg.patch @@ -0,0 +1,52 @@ +diff --color -ruN mediawiki/skins/Citizen/resources/skins.citizen.styles/common/content.less mediawiki2/skins/Citizen/resources/skins.citizen.styles/common/content.less +--- mediawiki/skins/Citizen/resources/skins.citizen.styles/common/content.less 2025-04-14 21:53:16 ++++ mediawiki2/skins/Citizen/resources/skins.citizen.styles/common/content.less 2025-04-26 02:23:07 +@@ -94,3 +94,37 @@ + margin: 0; + } + } ++ ++ ++/* could be technically done better, but idgaf and gzip will take care of dis */ ++.citizen-sitebg { ++ position: absolute; ++ width: 100vw; ++ mask-image: linear-gradient(to bottom, ++ color-mix(in srgb,black,transparent 50%) 0%, ++ color-mix(in srgb,var(--color-surface-0),transparent 50%) ++ 20%); ++} ++ ++.skin-theme-clientpref-day .citizen-sitebg { ++ mask-image: linear-gradient(to bottom, ++ color-mix(in srgb,white,transparent 50%) 0%, ++ color-mix(in srgb,var(--color-surface-0),transparent 50%) ++ 20%); ++} ++ ++.skin-theme-clientpref-night .citizen-sitebg { ++ mask-image: linear-gradient(to bottom, ++ color-mix(in srgb,black,transparent 50%) 0%, ++ color-mix(in srgb,var(--color-surface-0),transparent 50%) ++ 20%); ++} ++ ++@media (prefers-color-scheme: dark) { ++ .citizen-sitebg { ++ mask-image: linear-gradient(to bottom, ++ color-mix(in srgb,black,transparent 50%) 0%, ++ color-mix(in srgb,var(--color-surface-0),transparent 50%) ++ 20%); ++ } ++} +diff --color -ruN mediawiki/skins/Citizen/templates/skin.mustache mediawiki2/skins/Citizen/templates/skin.mustache +--- mediawiki/skins/Citizen/templates/skin.mustache 2025-04-14 21:53:17 ++++ mediawiki2/skins/Citizen/templates/skin.mustache 2025-04-26 02:14:41 +@@ -12,6 +12,7 @@ + + {{>Header}} +
++ +
{{{html-site-notice}}}
+
+ {{>PageHeader}} From 070c6060ebc53bd63d9f1d05428cd10915dbfb3b Mon Sep 17 00:00:00 2001 From: GGorAA Date: Thu, 1 May 2025 23:42:28 +0200 Subject: [PATCH 14/16] refactor: remove citizen_sitebg.patch --- README.md | 5 ++ mediawiki/patches/post/citizen_sitebg.patch | 52 ------------------- shubara/resources/ext.shubara/ext.shubara.css | 34 ++++++++++++ 3 files changed, 39 insertions(+), 52 deletions(-) delete mode 100644 mediawiki/patches/post/citizen_sitebg.patch diff --git a/README.md b/README.md index ea8f4db..05d9cbe 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,9 @@ Source code for the https://monowheel.wiki aka The EUC Wiki website. +As of now, you can only manually initialize a clean database using MediaWiki documentation, +which is cumbersome, but doable. I'm planning to make functionality for creating a 'test' +database, which will be derived directly from production data, but with all sensitive +information redacted (and some other tweaks). + Based on https://github.com/pastakhov/compose-mediawiki-ubuntu.git, thx man diff --git a/mediawiki/patches/post/citizen_sitebg.patch b/mediawiki/patches/post/citizen_sitebg.patch deleted file mode 100644 index 557662e..0000000 --- a/mediawiki/patches/post/citizen_sitebg.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff --color -ruN mediawiki/skins/Citizen/resources/skins.citizen.styles/common/content.less mediawiki2/skins/Citizen/resources/skins.citizen.styles/common/content.less ---- mediawiki/skins/Citizen/resources/skins.citizen.styles/common/content.less 2025-04-14 21:53:16 -+++ mediawiki2/skins/Citizen/resources/skins.citizen.styles/common/content.less 2025-04-26 02:23:07 -@@ -94,3 +94,37 @@ - margin: 0; - } - } -+ -+ -+/* could be technically done better, but idgaf and gzip will take care of dis */ -+.citizen-sitebg { -+ position: absolute; -+ width: 100vw; -+ mask-image: linear-gradient(to bottom, -+ color-mix(in srgb,black,transparent 50%) 0%, -+ color-mix(in srgb,var(--color-surface-0),transparent 50%) -+ 20%); -+} -+ -+.skin-theme-clientpref-day .citizen-sitebg { -+ mask-image: linear-gradient(to bottom, -+ color-mix(in srgb,white,transparent 50%) 0%, -+ color-mix(in srgb,var(--color-surface-0),transparent 50%) -+ 20%); -+} -+ -+.skin-theme-clientpref-night .citizen-sitebg { -+ mask-image: linear-gradient(to bottom, -+ color-mix(in srgb,black,transparent 50%) 0%, -+ color-mix(in srgb,var(--color-surface-0),transparent 50%) -+ 20%); -+} -+ -+@media (prefers-color-scheme: dark) { -+ .citizen-sitebg { -+ mask-image: linear-gradient(to bottom, -+ color-mix(in srgb,black,transparent 50%) 0%, -+ color-mix(in srgb,var(--color-surface-0),transparent 50%) -+ 20%); -+ } -+} -diff --color -ruN mediawiki/skins/Citizen/templates/skin.mustache mediawiki2/skins/Citizen/templates/skin.mustache ---- mediawiki/skins/Citizen/templates/skin.mustache 2025-04-14 21:53:17 -+++ mediawiki2/skins/Citizen/templates/skin.mustache 2025-04-26 02:14:41 -@@ -12,6 +12,7 @@ - - {{>Header}} -
-+ -
{{{html-site-notice}}}
-
- {{>PageHeader}} diff --git a/shubara/resources/ext.shubara/ext.shubara.css b/shubara/resources/ext.shubara/ext.shubara.css index 7df7e0d..170c279 100644 --- a/shubara/resources/ext.shubara/ext.shubara.css +++ b/shubara/resources/ext.shubara/ext.shubara.css @@ -359,3 +359,37 @@ gap: 12px; justify-content: flex-start; } + +.citizen-page-container { + --bg-image-gradient: linear-gradient(to bottom, + color-mix(in srgb,black,transparent 50%) 0%, + color-mix(in srgb,var(--color-surface-0),transparent 50%) + 20%); + + background-image: var(--bg-image-gradient), url(/w/images/8/84/Site_background.png); + background-repeat: no-repeat; + background-size: contain; +} + +.skin-theme-clientpref-day .citizen-page-container { + --bg-image-gradient: linear-gradient(to bottom, + color-mix(in srgb,white,transparent 50%) 0%, + color-mix(in srgb,var(--color-surface-0),transparent 50%) + 20%); +} + +.skin-theme-clientpref-night .citizen-page-container { + --bg-image-gradient: linear-gradient(to bottom, + color-mix(in srgb,black,transparent 50%) 0%, + color-mix(in srgb,var(--color-surface-0),transparent 50%) + 20%); +} + +@media (prefers-color-scheme: dark) { + .citizen-page-container { + --bg-image-gradient: linear-gradient(to bottom, + color-mix(in srgb,black,transparent 50%) 0%, + color-mix(in srgb,var(--color-surface-0),transparent 50%) + 20%); + } +} From 55039e350a53ec5ef5c8a0df61d8c8726a47e04c Mon Sep 17 00:00:00 2001 From: GGorAA Date: Thu, 1 May 2025 23:48:30 +0200 Subject: [PATCH 15/16] chore: merge master here --- shubara/resources/ext.shubara/ext.shubara.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/shubara/resources/ext.shubara/ext.shubara.css b/shubara/resources/ext.shubara/ext.shubara.css index 170c279..adf2d0b 100644 --- a/shubara/resources/ext.shubara/ext.shubara.css +++ b/shubara/resources/ext.shubara/ext.shubara.css @@ -393,3 +393,18 @@ 20%); } } + +.ext-shubara-messagebox { + border-radius: 12px; + background: var(--color-surface-1); + border: 4px solid var(--color-surface-2); + padding-left: 10px; + margin-top: 4px; +} + +.ext-shubara-messagebox p { + display: flex; + flex-direction: row; + gap: 12px; + justify-content: flex-start; +} From 4befdfe7269bc62ff7f43cf3a86303b02e2853d7 Mon Sep 17 00:00:00 2001 From: GGorAA Date: Sun, 10 Aug 2025 00:26:49 +0200 Subject: [PATCH 16/16] shubara: messagebox stuff --- shubara/resources/ext.shubara/ext.shubara.css | 4 ++++ shubara/src/Hooks.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shubara/resources/ext.shubara/ext.shubara.css b/shubara/resources/ext.shubara/ext.shubara.css index 3fe03cc..542269d 100644 --- a/shubara/resources/ext.shubara/ext.shubara.css +++ b/shubara/resources/ext.shubara/ext.shubara.css @@ -1,6 +1,10 @@ /* FIXME: This file is too long. It has to be broken up and then delivered on-demand * as a resource module, only if the required tag/parser hook is used. */ +.ext-shubara-navcards { + min-width: 280px; + gap: 10px; +} .ext-shubara-navcards-flex { display: flex; diff --git a/shubara/src/Hooks.php b/shubara/src/Hooks.php index f0966f3..3279b1f 100644 --- a/shubara/src/Hooks.php +++ b/shubara/src/Hooks.php @@ -10,8 +10,8 @@ use MediaWiki\Extension\Shubara\Tags\Imagechip; use MediaWiki\Extension\Shubara\Tags\Projectstats; use MediaWiki\Extension\Shubara\Tags\NewsList; +use MediaWiki\Extension\Shubara\Tags\Messagebox; use MediaWiki\Extension\Shubara\ParserFunctions\Infobox; -use MediaWiki\Extension\Shubara\ParserFunctions\Messagebox; class Hooks implements ParserFirstCallInitHook, BeforePageDisplayHook { public function onParserFirstCallInit($parser) { @@ -21,9 +21,9 @@ public function onParserFirstCallInit($parser) { $parser->setHook('imagechip', Imagechip::run(...)); $parser->setHook('projectstats', Projectstats::run(...)); $parser->setHook('newslist', NewsList::run(...)); + $parser->setHook('messagebox', Messagebox::run(...)); $parser->setFunctionHook('infobox', Infobox::main(...), SFH_NO_HASH); $parser->setFunctionHook('infobox-list', Infobox::list(...), SFH_NO_HASH); - $parser->setFunctionHook('messagebox', Messagebox::main(...), SFH_NO_HASH); return true; }