From 6b557fd77753f2af881037934bd6b1b0885503d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 8 Aug 2024 15:20:19 +0200 Subject: [PATCH 01/28] add dockerized wiki configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Müller --- .gitignore | 3 + gcp/Dockerfile | 49 ++++ gcp/LocalSettings.php | 556 ++++++++++++++++++++++++++++++++++++++++ gcp/README.md | 53 ++++ gcp/composer.local.json | 21 ++ gcp/docker-compose.yaml | 24 ++ gcp/podman-compose.yaml | 23 ++ gcp/test/.ruby-version | 1 + gcp/test/Gemfile | 7 + gcp/test/Gemfile.lock | 41 +++ gcp/test/test.rb | 50 ++++ 11 files changed, 828 insertions(+) create mode 100644 gcp/Dockerfile create mode 100644 gcp/LocalSettings.php create mode 100644 gcp/README.md create mode 100644 gcp/composer.local.json create mode 100644 gcp/docker-compose.yaml create mode 100644 gcp/podman-compose.yaml create mode 100644 gcp/test/.ruby-version create mode 100644 gcp/test/Gemfile create mode 100644 gcp/test/Gemfile.lock create mode 100644 gcp/test/test.rb diff --git a/.gitignore b/.gitignore index 7eb7b6d..2d3e86d 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ nubis/terraform/.terraform nubis/terraform/terraform.tfvars nubis/builder/artifacts/*-dev/ nubis/builder/artifacts/AMIs.json + +# Database dump for local development +wiki.sql* \ No newline at end of file diff --git a/gcp/Dockerfile b/gcp/Dockerfile new file mode 100644 index 0000000..45e2ab7 --- /dev/null +++ b/gcp/Dockerfile @@ -0,0 +1,49 @@ +# Ensure both post 1. numbers match here. +FROM docker.io/mediawiki:1.39 +ENV MWIKI_VER=39 +WORKDIR /var/www/html/ + +ARG UID=10001 +ARG GID=10001 + +RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg unzip + +# Prepare for nonroot user +RUN groupadd -g $GID app; \ + useradd -g $GID -u $UID -m -s /usr/sbin/nologin app; \ + chown -R app:app /var/www/html/ + +USER app + +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmAccount /var/www/html/extensions/ConfirmAccount + +#extensions/googleAnalytics, do we need this? +#RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/googleAnalytics /var/www/html/extensions/googleAnalyics + +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/LabeledSectionTransclusion /var/www/html/extensions/LabeledSectionTransclusion +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/TimedMediaHandler /var/www/html/extensions/TimedMediaHandler +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS /var/www/html/extensions/RSS +#extensions/Sandstone +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms /var/www/html/extensions/PageForms +#extensions/Smartsheet-MediaWiki-Extension need to replace/upgrade +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/UrlGetParameters /var/www/html/extensions/UrlGetParameters +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/NoTitle /var/www/html/extensions/NoTitle +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets /var/www/html/extensions/Widgets +RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend /var/www/html/extensions/MobileFrontend +#RUN git clone --depth 1 --single-branch --branch master https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla +#extensions/ImportFromEtherpad can we drop? requires pandoc +#extensions/MobileFrontend can we drop? vector has some mobile modes +#skins/GraphViz need replacement, do we even need? +#extensions/SemanticResultFormats composer +#extensions/SemanticMediaWiki composer +#extensions/SemanticWatchlist compose +#extensions/SubPageList composer +#skins/common/fonts/Fira do we need still? if so we need to update it + +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ + php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ + php composer-setup.php && \ + php -r "unlink('composer-setup.php');" + +COPY composer.local.json /var/www/html/composer.local.json +RUN php composer.phar update --no-dev diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php new file mode 100644 index 0000000..a0662e4 --- /dev/null +++ b/gcp/LocalSettings.php @@ -0,0 +1,556 @@ + "Mozilla2", + 101 => "Mozilla2_Talk", + 102 => "Calendar", + 103 => "Calendar_Talk", + 106 => "Gecko", + 107 => "Gecko_Talk", + 108 => "PluginFutures", + 109 => "PluginFutures_Talk", + 110 => "SVG", + 111 => "SVG_Talk", + 112 => "XUL", + 113 => "XUL_Talk", + 114 => "L10n", + 115 => "L10n_Talk", + 116 => "Update", + 117 => "Update_Talk", + 118 => "SVGDev", + 119 => "SVGDev_Talk", + 122 => "Bugzilla", + 123 => "Bugzilla_Talk", + 128 => "MailNews", + 129 => "MailNews_Talk", + # 132 - 141 - Semantic MediaWiki extension + ); + +$wgNamespacesToBeSearchedDefault = array( + -1 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 10 => 0, + 0 => 1, 9 => 1, 11 => 1, + 100 => 1, 101 => 1, + 102 => 1, 103 => 1, + 104 => 1, 105 => 1, + 106 => 1, 107 => 1, + 108 => 1, 109 => 1, + 110 => 1, 111 => 1, + 112 => 1, 113 => 1, + 114 => 1, 115 => 1, + 116 => 1, 117 => 1, + 118 => 1, 119 => 1, + 120 => 1, 121 => 1, + 122 => 1, 123 => 1, + 124 => 1, 125 => 1, + 126 => 1, 127 => 1, + 128 => 1, 129 => 1, + 130 => 1, 131 => 1, +); + +# Enable subpages in all namespaces +$wgNamespacesWithSubpages = array_fill(0, 200, true); + +## 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( 'CologneBlue' ); +#wfLoadSkin( 'Modern' ); +wfLoadSkin( 'MonoBook' ); +wfLoadSkin( 'Vector' ); + + +# End of automatically generated settings. +# Add more configuration options below. + +# May need to disable some/all of these as they are only included with default installs somewhere in 1.3x. + +# Bug 721366 and 731672 +require_once("$IP/extensions/Bugzilla/Bugzilla.php"); +//wfLoadExtension( 'Bugzilla' ); +wfLoadExtension( 'ConfirmAccount' ); +$wgConfirmAccountRequestFormItems['Biography'] = array( 'enabled' => true, 'minWords' => 15 ); +$wgUseRealNamesOnly = false; +$wgAccountRequestToS = true; +$wgAllowAccountRequestFiles = false; +$wgAccountRequestThrottle = 50; +$wgConfirmAccountSaveInfo = false; +$wgConfirmAccountCaptchas = true; + +wfLoadExtensions( [ 'ConfirmEdit', 'ConfirmEdit/ReCaptchaNoCaptcha' ] ); +$wgCaptchaTriggers['edit'] = false; +$wgCaptchaTriggers['create'] = false; +$wgCaptchaTriggers['addurl'] = false; +$wgCaptchaTriggers['createaccount'] = true; +$wgCaptchaTriggers['badlogin'] = true; +$wgCaptchaClass = 'ReCaptchaNoCaptcha'; +#$wgReCaptchaSiteKey = getenv("wgReCaptchaSiteKey") ? getenv("wgReCaptchaSiteKey") : ""; # NEEDS TO BE ADDED VIA GCP SECRET MANAGER +#$wgReCaptchaSecretKey = getenv("wgReCaptchaSecretKey") ? getenv("wgReCaptchaSecretKey") : ""; + +wfLoadExtension( 'Gadgets' ); +#wfLoadExtension( 'googleAnalytics' ); +wfLoadExtension( 'ImageMap' ); +wfLoadExtension( 'Interwiki' ); +wfLoadExtension( 'LabeledSectionTransclusion' ); +wfLoadExtension( 'Nuke' ); +wfLoadExtension( 'TimedMediaHandler'); +wfLoadExtension( 'ParserFunctions' ); +wfLoadExtension( 'Renameuser' ); + +wfLoadExtension( 'RSS' ); +$wgRSSUrlWhitelist = array( 'http://benjamin.smedbergs.us/weekly-updates.fcgi/project/firefox/feed', + 'http://blog.wikimedia.org/feed/', + 'https://blog.mozilla.org/feed/', + 'https://hacks.mozilla.org/feed/', + 'https://quality.mozilla.org/feed/', + 'https://blog.lizardwrangler.com/feed/', + 'https://brendaneich.com/feed/', + ); + +wfLoadExtension( 'PageForms' ); + +wfLoadExtension( 'SpamBlacklist' ); +$wgSpamBlacklistFiles = array( + // database title + "DB: $wgDBname Spam_blacklist", + ); + +wfLoadExtension( 'SyntaxHighlight_GeSHi' ); +wfLoadExtension( 'UrlGetParameters' ); + +wfLoadExtension( 'WikiEditor' ); +# Enables use of WikiEditor by default but still allow users to disable it in preferences +$wgDefaultUserOptions['usebetatoolbar'] = 1; +$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1; +# Displays the Preview and Changes tabs +$wgDefaultUserOptions['wikieditor-preview'] = 1; +// Make default the user option to prompt for an edit summary if none is provided +// does not affect users who have already set this option +// bug 1080898 +$wgDefaultUserOptions['forceeditsummary'] = true; + +wfLoadExtension( 'NoTitle' ); +wfLoadExtension( 'InputBox' ); +wfLoadExtension( 'Widgets' ); +wfLoadExtension( 'MobileFrontend' ); +wfLoadExtension( 'InputBox' ); + + +wfLoadExtension( 'SemanticResultFormats' ); +wfLoadExtension( 'SemanticMediaWiki' ); +$smwgNamespaceIndex = 132; +$smwgQMaxSize = 40; +$smwgQMaxDepth = 20; +$smwgEnabledEditPageHelp = false; +enableSemantics( 'localhost' ); +//wfLoadExtension( 'SmiteSpam' ); +//wfLoadExtension( 'SandStone' ); +wfLoadExtension( 'SubPageList' ); + +## +# ask API feature will be available at api.php?action=<$wgSMWAskAPI_ActionName> +# Default it 'ask' +## +global $wgSMWAskAPI_ActionName; +$wgSMWAskAPI_ActionName = 'ask'; + +wfLoadExtension( 'SemanticWatchlist' ); + +$wgLogos = [ + 'icon' => "$wgUploadPath/mozilla-wiki-logo-alt-135px.png", + '1x' => "$wgUploadPath/mozilla-wiki-logo-alt-135px.png" +]; + +######### Bug 397718 ############ +$wgMimeDetectorCommand= "file -bi"; #use external mime detector (Linux) +################################# + +$wgAllowExternalImages = true; + +$wgSitename = "MozillaWiki"; +# $wgMetaNamespace = "MozillaWiki"; + +# The relative URL path to the favicon +$wgFavicon = "$wgUploadPath/favicon.ico"; + +$wgShowExceptionDetails = true; + +$wgMemoryLimit = "256M"; + + +#survive reboots +$wgCacheDirectory = "/var/tmp/wikimo-cache"; + +$wgShowIPinHeader = false; +$wgFileExtensions = array( 'gz', 'tar', 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'doc', 'xls', 'zip', 'ics', 'mp3', 'ogg', 'odt', 'odp', 'svg', 'odt', 'ods', 'odg', 'webm' ); + +$wgAllowTitlesInSVG = true; + +// Don't convert, just serve and let the browser render/save/whatever +$wgSVGConverter = 'rsvg'; + +$wgWhitelistRead = array( 'Main Page', 'Special:Userlogin', 'Special:Userlogout', '-', 'MediaWiki:Monobook.css', 'MediaWiki:Monobook.js' ); + +$wgAutoConfirmAge = 5 * 3600 * 24; // 5 days to pass isNewbie() +$wgAutoConfirmCount = 10; // and have ten edits + +$wgRCMaxAge = 31536000; // one year + +# Controls the title displayed by subpages +$wgRestrictDisplayTitle = false; + +// Implicitly add all users to 'inactive' group whose accounts: +// * are older than 6 months, and +// * have less than 1 edit. +// don't wipe out existing autopromote autoconfirm +$wgAutopromote['inactive'] = array( '&', + array( APCOND_AGE, 60 * 60 * 24 * 30 * 6 ), + array( '!', array( APCOND_EDITCOUNT, 1 ) ), +); + +// TRUE in this case revokes the permission. +$wgRevokePermissions['inactive']['createpage'] = true; +$wgRevokePermissions['inactive']['createtalk'] = true; +$wgRevokePermissions['inactive']['move'] = true; +$wgRevokePermissions['inactive']['movefile'] = true; +$wgRevokePermissions['inactive']['move-subpages'] = true; +$wgRevokePermissions['inactive']['upload'] = true; +$wgRevokePermissions['inactive']['reupload'] = true; +$wgRevokePermissions['inactive']['reupload-own'] = true; + +// Bug 1082298 +$wgPFEnableStringFunctions = true; + +// must disable jquery table on legacy mediawiki-bugzilla extension for mobile editing to work +$wgBugzillaJqueryTable = false; \ No newline at end of file diff --git a/gcp/README.md b/gcp/README.md new file mode 100644 index 0000000..4f33e36 --- /dev/null +++ b/gcp/README.md @@ -0,0 +1,53 @@ +# wikimo test +## Dev Environment +Make sure to have the wikimo database dump downloaded into this folder. +Use `gsutil cp gs://wikimo-share/wiki.sql .` to do so. + +Having this file, start the MariaDB container only using `docker compose up db`. +With the `wiki.sql` file being present, the container will autoimport the dump (which may take a while) and restart the database afterwards. + +You can then start the whole setup using `docker compose up -d`, the wiki should be up and running then. + +## "Runbook" + +Use `docker compose up --build mediawiki` after changing the version in `Dockerfile`. + +To migrate the `wiki.sql` dump to the latest version use the following path: + +- switch the version in `Dockerfile` to `mediawiki:1.35` and update MWIKI_VER to match the point release number. +- Run `docker compose exec mediawiki php maintenance/update.php` + +- switch the version in `Dockerfile` to `mediawiki:1.39` and update MWIKI_VER to match the point release number. +- Run `docker compose exec mediawiki php maintenance/update.php` +- Run `docker compose exec mediawiki php extensions/SemanticMediaWiki/maintenance/populateHashField.php` +- Run `docker compose exec mediawiki php extensions/SemanticMediaWiki/maintenance/rebuildData.php -v --with-maintenance-log` <- this takes a while, may not need? we should clean up spam before doing this + +### Notes +- switch the version in `Dockerfile` to `mediawiki:1.xx` and update MWIKI_VER to match the point release number. +- Run `docker-compose exec mediawiki php maintenance/run.php update.php` + +Make sure to mount the local `LocalSettings.php` into the container. It includes all required settings for `mediawiki:1.42.1` so far. + +## Cleanup Scripts +Scripts that could be run on >=1.27 +```shell +compose exec mediawiki php maintenance/deleteArchivedRevisions.php --delete +compose exec mediawiki php maintenance/removeUnusedAccounts.php --delete +``` + +## Migration Plan +1. Put the AWS Wiki into maintenance. +2. Dump the DB. +3. Import DB and images into GCP environment. +4. Deploy a 1.35 build to GCP. +5. Run `php maintenance/update.php` with 1.35. +6. Deploy a 1.39 build to GCP +7. Run `php maintenance/update.php` with 1.39 +8. Run `php maintenance/deleteArchivedRevisions.php --delete`. +9. Run `php maintenance/removeUnusedAccounts.php --delete`. +10. Run `php maintenance/populateHashField.php`. +11. Run `php maintenance/rebuildData.php -v --with-maintenance-log`. +12. Check GCP version of wiki. +13. Update DNS to point to GCP Wiki. +14. Remove maintenance mode on GCP Wiki. +15. Clean up AWS Wiki (and optionally Nubis). \ No newline at end of file diff --git a/gcp/composer.local.json b/gcp/composer.local.json new file mode 100644 index 0000000..8614f1b --- /dev/null +++ b/gcp/composer.local.json @@ -0,0 +1,21 @@ +{ + "config": { + "allow-plugins": true + }, + "require": { + "mediawiki/sub-page-list": "~3.0", + "mediawiki/semantic-media-wiki": "~4.1", + "mediawiki/semantic-result-formats": "~4.2", + "mediawiki/semantic-watchlist": "~1.0", + "wikimedia/normalized-exception": "v1.0.1", + "wikimedia/at-ease": "v2.1.0" + }, + "extra": { + "merge-plugin": { + "include": [ + "extensions/TimedMediaHandler/composer.json", + "extensions/Widgets/composer.json" + ] + } + } +} \ No newline at end of file diff --git a/gcp/docker-compose.yaml b/gcp/docker-compose.yaml new file mode 100644 index 0000000..04789f8 --- /dev/null +++ b/gcp/docker-compose.yaml @@ -0,0 +1,24 @@ +services: + mediawiki: + build: . + ports: + - 8080:80 + volumes: + - ./images:/var/www/html/images + - ./LocalSettings.php:/var/www/html/LocalSettings.php + - ../mediawiki-bugzilla/:/var/www/html/extensions/Bugzilla # can be removed once our changes are upstream + db: + image: docker.io/mariadb:11 + restart: always + environment: + MYSQL_DATABASE: 'db' + MYSQL_USER: 'user' + MYSQL_PASSWORD: 'password' + MYSQL_ROOT_PASSWORD: 'password' + ports: + - '127.0.0.1:3306:3306' + volumes: + - data:/var/lib/mysql + - ./wiki.sql:/docker-entrypoint-initdb.d/wiki.sql +volumes: + data: diff --git a/gcp/podman-compose.yaml b/gcp/podman-compose.yaml new file mode 100644 index 0000000..77ab6ca --- /dev/null +++ b/gcp/podman-compose.yaml @@ -0,0 +1,23 @@ +services: + mediawiki: + image: docker.io/mediawiki:1.39 + ports: + - 8080:80 + volumes: + - /var/www/html/images + - ./LocalSettings.php:/var/www/html/LocalSettings.php + db: + image: docker.io/mariadb:11 + restart: always + environment: + MYSQL_DATABASE: 'db' + MYSQL_USER: 'user' + MYSQL_PASSWORD: 'password' + MYSQL_ROOT_PASSWORD: 'password' + ports: + - '127.0.0.1:3306:3306' + volumes: + - data:/var/lib/mysql + - ./wiki.sql:/docker-entrypoint-initdb.d/wiki.sql +volumes: + data: diff --git a/gcp/test/.ruby-version b/gcp/test/.ruby-version new file mode 100644 index 0000000..bea438e --- /dev/null +++ b/gcp/test/.ruby-version @@ -0,0 +1 @@ +3.3.1 diff --git a/gcp/test/Gemfile b/gcp/test/Gemfile new file mode 100644 index 0000000..f339105 --- /dev/null +++ b/gcp/test/Gemfile @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gem 'nokogiri', '~> 1.16' + +gem 'typhoeus', '~> 1.4' diff --git a/gcp/test/Gemfile.lock b/gcp/test/Gemfile.lock new file mode 100644 index 0000000..4345c15 --- /dev/null +++ b/gcp/test/Gemfile.lock @@ -0,0 +1,41 @@ +GEM + remote: https://rubygems.org/ + specs: + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-arm-linux-gnu) + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86-linux-gnu) + ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) + nokogiri (1.16.7-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86-linux) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-linux) + racc (~> 1.4) + racc (1.8.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) + +PLATFORMS + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux + +DEPENDENCIES + nokogiri (~> 1.16) + typhoeus (~> 1.4) + +BUNDLED WITH + 2.5.9 diff --git a/gcp/test/test.rb b/gcp/test/test.rb new file mode 100644 index 0000000..af0dfff --- /dev/null +++ b/gcp/test/test.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require 'typhoeus' +require 'nokogiri' + +BASE_URL_PROD = 'https://wiki.mozilla.org' +BASE_URL_TEST = 'http://localhost:8080/index.php' + +INSPECT_ELEMENT = '#content' + +TEST_PAGES_COUNT = 1000 +TEST_KEYWORDS = ['Warning: ', 'Error: '].freeze + +def fetch_page(url) + response = Typhoeus.get(url, followlocation: true) + url = response.effective_url + html = response.response_body + code = response.response_code + + puts "WARN: #{url} Status code is #{code}" unless code == 200 + + [html, url] +end + +def parse_html(html) + parsed_data = Nokogiri::HTML.parse(html) + + parsed_data.css(INSPECT_ELEMENT).inner_text +end + +def pages_equal?(prod_page, test_page, keyword) + prod_has_keyword = prod_page.include?(keyword) + test_has_keyword = test_page.include?(keyword) + + puts "NOK: #{url} (#{prod_has_keyword})" if prod_has_keyword != test_has_keyword +end + +TEST_PAGES_COUNT.times do |i| + html, url = fetch_page("#{BASE_URL_PROD}/Special:Random") + prod_page = parse_html(html) + + html, = fetch_page(url.gsub(BASE_URL_PROD, BASE_URL_TEST)) + test_page = parse_html(html) + + print "\r#{i}" + + TEST_KEYWORDS.each do |keyword| + pages_equal?(prod_page, test_page, keyword) + end +end From 6aae7402e14730ae81d5a50014fb8746d01af68a Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Mon, 19 Aug 2024 16:09:29 -0400 Subject: [PATCH 02/28] expose port Signed-off-by: Basma1912 --- gcp/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 45e2ab7..b06fa1a 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -47,3 +47,4 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && COPY composer.local.json /var/www/html/composer.local.json RUN php composer.phar update --no-dev +EXPOSE 8000 From b9de7b18ba0fab8382c7e79ad21094746c4767e9 Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Mon, 19 Aug 2024 16:25:33 -0400 Subject: [PATCH 03/28] expose port Signed-off-by: Basma1912 --- gcp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index b06fa1a..964a11e 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -47,4 +47,4 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && COPY composer.local.json /var/www/html/composer.local.json RUN php composer.phar update --no-dev -EXPOSE 8000 +EXPOSE 8080 From 5f464975faff573fa88b7491fd4edf5ac3829735 Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Mon, 19 Aug 2024 16:29:26 -0400 Subject: [PATCH 04/28] revert_expose port Signed-off-by: Basma1912 --- gcp/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 964a11e..45e2ab7 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -47,4 +47,3 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && COPY composer.local.json /var/www/html/composer.local.json RUN php composer.phar update --no-dev -EXPOSE 8080 From d9862d0bceac007bd4ef36cb6ae2b59897308664 Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Mon, 19 Aug 2024 16:42:48 -0400 Subject: [PATCH 05/28] revert_expose port Signed-off-by: Basma1912 --- gcp/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 45e2ab7..7ea441a 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -46,4 +46,5 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php -r "unlink('composer-setup.php');" COPY composer.local.json /var/www/html/composer.local.json +COPY ports.conf /etc/apache2/ports.conf RUN php composer.phar update --no-dev From b86608314d8c455e197c68bf3a8e670bfb27beeb Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Mon, 19 Aug 2024 16:44:53 -0400 Subject: [PATCH 06/28] revert_expose port Signed-off-by: Basma1912 --- gcp/ports.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gcp/ports.conf diff --git a/gcp/ports.conf b/gcp/ports.conf new file mode 100644 index 0000000..3cb043e --- /dev/null +++ b/gcp/ports.conf @@ -0,0 +1,13 @@ +# If you just change the port or add more ports here, you will likely also +# have to change the VirtualHost statement in +# /etc/apache2/sites-enabled/000-default.conf + +Listen 8080 + + + Listen 443 + + + + Listen 443 + \ No newline at end of file From 61fc17ab660d6c1bdce4a6b77be9db030844a120 Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Mon, 19 Aug 2024 18:33:33 -0400 Subject: [PATCH 07/28] revert_expose port Signed-off-by: Basma1912 --- gcp/ports.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/ports.conf b/gcp/ports.conf index 3cb043e..afbac3b 100644 --- a/gcp/ports.conf +++ b/gcp/ports.conf @@ -2,7 +2,7 @@ # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default.conf -Listen 8080 +Listen 8000 Listen 443 From 6f3192e6566b090cd86324735cac5afa97292856 Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Tue, 20 Aug 2024 09:28:17 -0400 Subject: [PATCH 08/28] uncomment_bugzilla_line Signed-off-by: Basma1912 --- gcp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 7ea441a..13a1345 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -30,7 +30,7 @@ RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerri RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/NoTitle /var/www/html/extensions/NoTitle RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets /var/www/html/extensions/Widgets RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend /var/www/html/extensions/MobileFrontend -#RUN git clone --depth 1 --single-branch --branch master https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla +RUN git clone --depth 1 --single-branch --branch master https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla #extensions/ImportFromEtherpad can we drop? requires pandoc #extensions/MobileFrontend can we drop? vector has some mobile modes #skins/GraphViz need replacement, do we even need? From 3b08cb0c01b2449d686066302f4b06239ec1996f Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Tue, 20 Aug 2024 09:44:44 -0400 Subject: [PATCH 09/28] comment_bugzilla_line Signed-off-by: Basma1912 --- gcp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 13a1345..7ea441a 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -30,7 +30,7 @@ RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerri RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/NoTitle /var/www/html/extensions/NoTitle RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets /var/www/html/extensions/Widgets RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend /var/www/html/extensions/MobileFrontend -RUN git clone --depth 1 --single-branch --branch master https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla +#RUN git clone --depth 1 --single-branch --branch master https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla #extensions/ImportFromEtherpad can we drop? requires pandoc #extensions/MobileFrontend can we drop? vector has some mobile modes #skins/GraphViz need replacement, do we even need? From 89e53b38ecb800ffad19456b30213f1d84c94362 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Tue, 20 Aug 2024 13:00:22 -0700 Subject: [PATCH 10/28] Pull in Bugzilla. --- gcp/Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 7ea441a..f6d10ce 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -16,10 +16,6 @@ RUN groupadd -g $GID app; \ USER app RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmAccount /var/www/html/extensions/ConfirmAccount - -#extensions/googleAnalytics, do we need this? -#RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/googleAnalytics /var/www/html/extensions/googleAnalyics - RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/LabeledSectionTransclusion /var/www/html/extensions/LabeledSectionTransclusion RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/TimedMediaHandler /var/www/html/extensions/TimedMediaHandler RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS /var/www/html/extensions/RSS @@ -30,7 +26,7 @@ RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerri RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/NoTitle /var/www/html/extensions/NoTitle RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets /var/www/html/extensions/Widgets RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend /var/www/html/extensions/MobileFrontend -#RUN git clone --depth 1 --single-branch --branch master https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla +RUN git clone --depth 1 --single-branch --branch main https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla #extensions/ImportFromEtherpad can we drop? requires pandoc #extensions/MobileFrontend can we drop? vector has some mobile modes #skins/GraphViz need replacement, do we even need? From 78250c24ed72ced1673820499858713dec3e8a09 Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Wed, 21 Aug 2024 09:19:47 -0400 Subject: [PATCH 11/28] add_copy_LOCALsettings.php line Signed-off-by: Basma1912 --- gcp/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index f6d10ce..39b1da3 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -43,4 +43,5 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && COPY composer.local.json /var/www/html/composer.local.json COPY ports.conf /etc/apache2/ports.conf +COPY LocalSettings.php /var/www/html/LocalSettings.php RUN php composer.phar update --no-dev From 55890a4cb74bd0fac3e0adc59445d3743a3a371b Mon Sep 17 00:00:00 2001 From: Basma1912 Date: Wed, 21 Aug 2024 09:47:41 -0400 Subject: [PATCH 12/28] revert_back --- gcp/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 39b1da3..f6d10ce 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -43,5 +43,4 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && COPY composer.local.json /var/www/html/composer.local.json COPY ports.conf /etc/apache2/ports.conf -COPY LocalSettings.php /var/www/html/LocalSettings.php RUN php composer.phar update --no-dev From 1067f9f09fc60b5a7a20aae45bcacc8f8a728eb1 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Wed, 21 Aug 2024 13:00:06 -0700 Subject: [PATCH 13/28] Pull in localsettings. --- gcp/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index f6d10ce..39b1da3 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -43,4 +43,5 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && COPY composer.local.json /var/www/html/composer.local.json COPY ports.conf /etc/apache2/ports.conf +COPY LocalSettings.php /var/www/html/LocalSettings.php RUN php composer.phar update --no-dev From 51b00b2f7b51bcc52af383de1dec0671ac9c8361 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Thu, 22 Aug 2024 11:12:10 -0700 Subject: [PATCH 14/28] Add support for readonly. --- gcp/LocalSettings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index a0662e4..c46cf67 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -553,4 +553,6 @@ $wgPFEnableStringFunctions = true; // must disable jquery table on legacy mediawiki-bugzilla extension for mobile editing to work -$wgBugzillaJqueryTable = false; \ No newline at end of file +$wgBugzillaJqueryTable = false; + +$wgReadOnly = getenv("wgReadOnly") ? getenv("wgReadOnly") : false; From 78aebd69d8bc9c49f2b171fd1f3a9e6026919981 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Tue, 27 Aug 2024 09:09:04 -0700 Subject: [PATCH 15/28] Support a upgrade mode. --- gcp/LocalSettings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index c46cf67..061ccd0 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -555,4 +555,9 @@ // must disable jquery table on legacy mediawiki-bugzilla extension for mobile editing to work $wgBugzillaJqueryTable = false; -$wgReadOnly = getenv("wgReadOnly") ? getenv("wgReadOnly") : false; +// +if (getenv("UPGRADE_MODE")) { + $wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'This wiki is currently being upgraded to a newer software version. Please check back soon.'; +} else { + $wgReadOnly = getenv("wgReadOnly") ? getenv("wgReadOnly") : false; +} From 533ed35dd5a8331671e35903fa6ea7d176da9d27 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Thu, 5 Sep 2024 10:07:21 -0700 Subject: [PATCH 16/28] prep for 1.35 upgrade. --- gcp/Dockerfile | 14 ++--------- gcp/LocalSettings.php | 51 ++++++++++++++++++++--------------------- gcp/README.md | 14 +++-------- gcp/composer.local.json | 2 +- 4 files changed, 31 insertions(+), 50 deletions(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index 39b1da3..a92c83f 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -1,6 +1,6 @@ # Ensure both post 1. numbers match here. -FROM docker.io/mediawiki:1.39 -ENV MWIKI_VER=39 +FROM docker.io/mediawiki:1.35 +ENV MWIKI_VER=35 WORKDIR /var/www/html/ ARG UID=10001 @@ -19,22 +19,12 @@ RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerri RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/LabeledSectionTransclusion /var/www/html/extensions/LabeledSectionTransclusion RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/TimedMediaHandler /var/www/html/extensions/TimedMediaHandler RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS /var/www/html/extensions/RSS -#extensions/Sandstone RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/PageForms /var/www/html/extensions/PageForms -#extensions/Smartsheet-MediaWiki-Extension need to replace/upgrade RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/UrlGetParameters /var/www/html/extensions/UrlGetParameters RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/NoTitle /var/www/html/extensions/NoTitle RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets /var/www/html/extensions/Widgets RUN git clone --depth 1 --single-branch --branch REL1_${MWIKI_VER} https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend /var/www/html/extensions/MobileFrontend RUN git clone --depth 1 --single-branch --branch main https://github.com/mozilla/mediawiki-bugzilla.git /var/www/html/extensions/Bugzilla -#extensions/ImportFromEtherpad can we drop? requires pandoc -#extensions/MobileFrontend can we drop? vector has some mobile modes -#skins/GraphViz need replacement, do we even need? -#extensions/SemanticResultFormats composer -#extensions/SemanticMediaWiki composer -#extensions/SemanticWatchlist compose -#extensions/SubPageList composer -#skins/common/fonts/Fira do we need still? if so we need to update it RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 061ccd0..965d606 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -18,8 +18,6 @@ ## Uncomment this to disable output compression # $wgDisableOutputCompression = true; -#$wgSitename = "WikiMo"; - ## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. ## For more information on customizing the URLs @@ -33,7 +31,7 @@ $wgUploadPath = "{$wgScriptPath}/images"; ## The protocol and server name to use in fully-qualified URLs -$wgServer = getenv("wgServer") ? getenv("wgServer") : "http://localhost:8080"; +$wgServer = getenv("wgServer") ? getenv("wgServer") : "http://localhost:8000"; ## The URL path to static resources (images, scripts, etc.) $wgResourceBasePath = $wgScriptPath; @@ -117,7 +115,6 @@ # Path to the GNU diff3 utility. Used for conflict resolution. $wgDiff3 = "/usr/bin/diff3"; - ### ### Only allow logged-in users to edit ### @@ -447,7 +444,6 @@ ); wfLoadExtension( 'SyntaxHighlight_GeSHi' ); -wfLoadExtension( 'UrlGetParameters' ); wfLoadExtension( 'WikiEditor' ); # Enables use of WikiEditor by default but still allow users to disable it in preferences @@ -466,26 +462,29 @@ wfLoadExtension( 'MobileFrontend' ); wfLoadExtension( 'InputBox' ); - -wfLoadExtension( 'SemanticResultFormats' ); -wfLoadExtension( 'SemanticMediaWiki' ); -$smwgNamespaceIndex = 132; -$smwgQMaxSize = 40; -$smwgQMaxDepth = 20; -$smwgEnabledEditPageHelp = false; -enableSemantics( 'localhost' ); -//wfLoadExtension( 'SmiteSpam' ); -//wfLoadExtension( 'SandStone' ); -wfLoadExtension( 'SubPageList' ); - -## -# ask API feature will be available at api.php?action=<$wgSMWAskAPI_ActionName> -# Default it 'ask' -## -global $wgSMWAskAPI_ActionName; -$wgSMWAskAPI_ActionName = 'ask'; - -wfLoadExtension( 'SemanticWatchlist' ); +// Disable for 1.35 upgrade +if (getenv("MWIKI_VER") != "35") { + $smwgConfigFileDir = "/data/smw"; + wfLoadExtension('SemanticResultFormats'); + wfLoadExtension('SemanticMediaWiki'); + $smwgNamespaceIndex = 132; + $smwgQMaxSize = 40; + $smwgQMaxDepth = 20; + $smwgEnabledEditPageHelp = false; + enableSemantics('localhost'); + + ## + # ask API feature will be available at api.php?action=<$wgSMWAskAPI_ActionName> + # Default it 'ask' + ## + global $wgSMWAskAPI_ActionName; + $wgSMWAskAPI_ActionName = 'ask'; + + wfLoadExtension( 'SemanticWatchlist' ); + + wfLoadExtension('SubPageList'); + wfLoadExtension('UrlGetParameters'); +} $wgLogos = [ 'icon' => "$wgUploadPath/mozilla-wiki-logo-alt-135px.png", @@ -510,7 +509,7 @@ #survive reboots -$wgCacheDirectory = "/var/tmp/wikimo-cache"; +//$wgCacheDirectory = "/var/tmp/wikimo-cache"; $wgShowIPinHeader = false; $wgFileExtensions = array( 'gz', 'tar', 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'doc', 'xls', 'zip', 'ics', 'mp3', 'ogg', 'odt', 'odp', 'svg', 'odt', 'ods', 'odg', 'webm' ); diff --git a/gcp/README.md b/gcp/README.md index 4f33e36..7896701 100644 --- a/gcp/README.md +++ b/gcp/README.md @@ -1,23 +1,17 @@ # wikimo test -## Dev Environment -Make sure to have the wikimo database dump downloaded into this folder. -Use `gsutil cp gs://wikimo-share/wiki.sql .` to do so. - -Having this file, start the MariaDB container only using `docker compose up db`. -With the `wiki.sql` file being present, the container will autoimport the dump (which may take a while) and restart the database afterwards. - -You can then start the whole setup using `docker compose up -d`, the wiki should be up and running then. ## "Runbook" Use `docker compose up --build mediawiki` after changing the version in `Dockerfile`. -To migrate the `wiki.sql` dump to the latest version use the following path: +To migrate the db dump to the latest version use the following path: - switch the version in `Dockerfile` to `mediawiki:1.35` and update MWIKI_VER to match the point release number. +- Set "wikimedia/at-ease": "v2.1.0" to "wikimedia/at-ease": "v2.0.0" - Run `docker compose exec mediawiki php maintenance/update.php` - switch the version in `Dockerfile` to `mediawiki:1.39` and update MWIKI_VER to match the point release number. +- Set "wikimedia/at-ease": "v2.0.0" to "wikimedia/at-ease": "v2.1.0" - Run `docker compose exec mediawiki php maintenance/update.php` - Run `docker compose exec mediawiki php extensions/SemanticMediaWiki/maintenance/populateHashField.php` - Run `docker compose exec mediawiki php extensions/SemanticMediaWiki/maintenance/rebuildData.php -v --with-maintenance-log` <- this takes a while, may not need? we should clean up spam before doing this @@ -26,8 +20,6 @@ To migrate the `wiki.sql` dump to the latest version use the following path: - switch the version in `Dockerfile` to `mediawiki:1.xx` and update MWIKI_VER to match the point release number. - Run `docker-compose exec mediawiki php maintenance/run.php update.php` -Make sure to mount the local `LocalSettings.php` into the container. It includes all required settings for `mediawiki:1.42.1` so far. - ## Cleanup Scripts Scripts that could be run on >=1.27 ```shell diff --git a/gcp/composer.local.json b/gcp/composer.local.json index 8614f1b..315aa3b 100644 --- a/gcp/composer.local.json +++ b/gcp/composer.local.json @@ -8,7 +8,7 @@ "mediawiki/semantic-result-formats": "~4.2", "mediawiki/semantic-watchlist": "~1.0", "wikimedia/normalized-exception": "v1.0.1", - "wikimedia/at-ease": "v2.1.0" + "wikimedia/at-ease": "v2.0.0" }, "extra": { "merge-plugin": { From 31e1140aa4213dde0c9f5758c6d04b8f634fb994 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Thu, 5 Sep 2024 10:21:37 -0700 Subject: [PATCH 17/28] small fixes in settings. --- gcp/LocalSettings.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 965d606..5e87aef 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -50,7 +50,7 @@ ## Database settings $wgDBtype = "mysql"; -$wgDBserver = getenv("wgDBserver") ? getenv("wgDBserver") : "db"; +$wgDBserver = getenv("wgDBserver") ? getenv("wgDBserver") : "localhost"; $wgDBname = getenv("wgDBname") ? getenv("wgDBname") : "db"; $wgDBuser = getenv("wgDBuser") ? getenv("wgDBuser") : "root"; $wgDBpassword = getenv("wgDBpassword") ? getenv("wgDBpassword") : "password"; @@ -498,7 +498,6 @@ $wgAllowExternalImages = true; $wgSitename = "MozillaWiki"; -# $wgMetaNamespace = "MozillaWiki"; # The relative URL path to the favicon $wgFavicon = "$wgUploadPath/favicon.ico"; @@ -512,7 +511,7 @@ //$wgCacheDirectory = "/var/tmp/wikimo-cache"; $wgShowIPinHeader = false; -$wgFileExtensions = array( 'gz', 'tar', 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'doc', 'xls', 'zip', 'ics', 'mp3', 'ogg', 'odt', 'odp', 'svg', 'odt', 'ods', 'odg', 'webm' ); +$wgFileExtensions = array( 'gz', 'tar', 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'doc', 'xls', 'zip', 'ics', 'mp3', 'ogg', 'odt', 'odp', 'svg', 'odt', 'ods', 'odg', 'webm' ); $wgAllowTitlesInSVG = true; From 965a9a0b49870850082a3f26b54699cc56571078 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Tue, 10 Sep 2024 08:54:49 -0700 Subject: [PATCH 18/28] remove cache options. --- gcp/LocalSettings.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 5e87aef..08b5a5a 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -65,8 +65,7 @@ $wgDBmysql5 = false; ## Shared memory settings -$wgMainCacheType = CACHE_NONE; -$wgMemCachedServers = []; +//$wgMainCacheType = CACHE_NONE; ## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: From 298d202e299bf62846de9b34f5823bc02789b6d7 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Tue, 10 Sep 2024 11:25:47 -0700 Subject: [PATCH 19/28] bump to 39 for testing --- gcp/Dockerfile | 4 ++-- gcp/composer.local.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcp/Dockerfile b/gcp/Dockerfile index a92c83f..5b99337 100644 --- a/gcp/Dockerfile +++ b/gcp/Dockerfile @@ -1,6 +1,6 @@ # Ensure both post 1. numbers match here. -FROM docker.io/mediawiki:1.35 -ENV MWIKI_VER=35 +FROM docker.io/mediawiki:1.39 +ENV MWIKI_VER=39 WORKDIR /var/www/html/ ARG UID=10001 diff --git a/gcp/composer.local.json b/gcp/composer.local.json index 315aa3b..8614f1b 100644 --- a/gcp/composer.local.json +++ b/gcp/composer.local.json @@ -8,7 +8,7 @@ "mediawiki/semantic-result-formats": "~4.2", "mediawiki/semantic-watchlist": "~1.0", "wikimedia/normalized-exception": "v1.0.1", - "wikimedia/at-ease": "v2.0.0" + "wikimedia/at-ease": "v2.1.0" }, "extra": { "merge-plugin": { From 0f2c8f3c927e08c2c0165f98308ef6810f9b03cc Mon Sep 17 00:00:00 2001 From: Cassandra Date: Tue, 10 Sep 2024 15:57:14 -0700 Subject: [PATCH 20/28] setup paths. --- gcp/LocalSettings.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 08b5a5a..c74c007 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -24,6 +24,10 @@ ## (like /w/index.php/Page_title to /wiki/Page_title) please see: ## https://www.mediawiki.org/wiki/Manual:Short_URL $wgScriptPath = ""; +$wgArticlePath = '/$1'; +$wgScript = '/index.php'; +$wgUsePathInfo = false; +$wgScriptExtension = ".php"; ## The relative URL path to the skins directory $wgStylePath = "$wgScriptPath/skins"; From fd48c9113765507c419b570334e3c33fff5326e7 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Wed, 11 Sep 2024 16:46:19 -0700 Subject: [PATCH 21/28] fix cache --- gcp/LocalSettings.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index c74c007..fddbae1 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -93,7 +93,7 @@ ## Set $wgCacheDirectory to a writable directory on the web server ## to make your wiki go slightly faster. The directory should not ## be publically accessible from the web. -#$wgCacheDirectory = "$IP/cache"; +$wgCacheDirectory = "/var/tmp/cache"; # Site language code, should be one of the list in ./languages/data/Names.php $wgLanguageCode = "en"; @@ -509,10 +509,6 @@ $wgMemoryLimit = "256M"; - -#survive reboots -//$wgCacheDirectory = "/var/tmp/wikimo-cache"; - $wgShowIPinHeader = false; $wgFileExtensions = array( 'gz', 'tar', 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'doc', 'xls', 'zip', 'ics', 'mp3', 'ogg', 'odt', 'odp', 'svg', 'odt', 'ods', 'odg', 'webm' ); From 43ee1b5c1c681dbfbcd77583c960fa5bad429b12 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Thu, 12 Sep 2024 09:38:30 -0700 Subject: [PATCH 22/28] add tmp dir. --- gcp/LocalSettings.php | 1 + 1 file changed, 1 insertion(+) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index fddbae1..abf08ee 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -94,6 +94,7 @@ ## to make your wiki go slightly faster. The directory should not ## be publically accessible from the web. $wgCacheDirectory = "/var/tmp/cache"; +$wgTmpDirectory = "/var/tmp/cache/tmp"; # Site language code, should be one of the list in ./languages/data/Names.php $wgLanguageCode = "en"; From 6a7d39d927e03842ffc5c233a4b74a52a916c0e7 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Thu, 12 Sep 2024 14:42:05 -0700 Subject: [PATCH 23/28] remove tmp and use default --- gcp/LocalSettings.php | 1 - 1 file changed, 1 deletion(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index abf08ee..fddbae1 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -94,7 +94,6 @@ ## to make your wiki go slightly faster. The directory should not ## be publically accessible from the web. $wgCacheDirectory = "/var/tmp/cache"; -$wgTmpDirectory = "/var/tmp/cache/tmp"; # Site language code, should be one of the list in ./languages/data/Names.php $wgLanguageCode = "en"; From 3ead49d583d2eb9a5dd94669f84a68935d090d76 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Thu, 12 Sep 2024 14:52:52 -0700 Subject: [PATCH 24/28] another try --- gcp/LocalSettings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index fddbae1..9dd5f41 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -93,7 +93,8 @@ ## Set $wgCacheDirectory to a writable directory on the web server ## to make your wiki go slightly faster. The directory should not ## be publically accessible from the web. -$wgCacheDirectory = "/var/tmp/cache"; +//$wgCacheDirectory = "/var/tmp/cache"; +$wgTmpDirectory = "/var/tmp/cache"; # Site language code, should be one of the list in ./languages/data/Names.php $wgLanguageCode = "en"; From c16a63cbf83e0d2f7abd588507bc1db2760dcd39 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Mon, 16 Sep 2024 08:43:32 -0700 Subject: [PATCH 25/28] disable createaccount for testing and for confirmaccount. --- gcp/LocalSettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 9dd5f41..b799439 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -131,7 +131,7 @@ $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['*']['createtalk'] = false; -$wgGroupPermissions['*']['createaccount'] = true; +$wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['*']['patrolmarks'] = false; $wgGroupPermissions['*']['editmyusercss'] = false; $wgGroupPermissions['*']['editmyuserjs'] = false; From c704e10ce4e535fa2e9c7b925edb778aefe20099 Mon Sep 17 00:00:00 2001 From: Cassandra Date: Mon, 16 Sep 2024 09:14:59 -0700 Subject: [PATCH 26/28] change how upgrade mode works. --- gcp/LocalSettings.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index b799439..2f38ac3 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -554,8 +554,6 @@ $wgBugzillaJqueryTable = false; // -if (getenv("UPGRADE_MODE")) { +if (getenv("UPGRADE_MODE") == "true") { $wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'This wiki is currently being upgraded to a newer software version. Please check back soon.'; -} else { - $wgReadOnly = getenv("wgReadOnly") ? getenv("wgReadOnly") : false; } From e15e6e2e07e1fb71eaf730950864729aa85c10ec Mon Sep 17 00:00:00 2001 From: Cassandra Date: Tue, 17 Sep 2024 14:17:01 -0700 Subject: [PATCH 27/28] fix some plugin loads and try another skin for mobile. --- gcp/LocalSettings.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 2f38ac3..94ef4df 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -1,4 +1,4 @@ - Date: Wed, 18 Sep 2024 14:32:32 -0700 Subject: [PATCH 28/28] disable page bounce. --- gcp/LocalSettings.php | 1 + 1 file changed, 1 insertion(+) diff --git a/gcp/LocalSettings.php b/gcp/LocalSettings.php index 94ef4df..5ca36e3 100644 --- a/gcp/LocalSettings.php +++ b/gcp/LocalSettings.php @@ -473,6 +473,7 @@ $smwgQMaxSize = 40; $smwgQMaxDepth = 20; $smwgEnabledEditPageHelp = false; + $wgDefaultUserOptions['smw-prefs-general-options-show-entity-issue-panel'] = false; enableSemantics('localhost'); ##