From cc95e24bbe4c12143a2f72ab45df3015fdbad0fc Mon Sep 17 00:00:00 2001 From: lens0021 Date: Wed, 20 Feb 2019 19:37:43 +0900 Subject: [PATCH] Install LocalisationUpdate --- Dockerfile | 2 ++ configs/LocalSettings.php | 3 +++ cron/crontab | 1 + cron/localisation-update | 13 +++++++++++++ extension-installer/install_extensions.rb | 1 + run | 2 ++ 6 files changed, 22 insertions(+) create mode 100755 cron/localisation-update diff --git a/Dockerfile b/Dockerfile index f8050f97..1d149e17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,8 @@ RUN crontab /tmp/crontab && rm /tmp/crontab RUN sudo -u www-data mkdir -p /srv/femiwiki.com/sitemap COPY cron/generate-sitemap /usr/local/bin/generate-sitemap +# Install 'localisation-update' script +COPY cron/localisation-update /usr/local/bin/localisation-update # Store femiwiki resources COPY --chown=www-data:www-data resources /srv/femiwiki.com/ diff --git a/configs/LocalSettings.php b/configs/LocalSettings.php index 6bdbe046..b132f4a3 100644 --- a/configs/LocalSettings.php +++ b/configs/LocalSettings.php @@ -482,6 +482,9 @@ # PageImages wfLoadExtension( 'PageImages' ); +# LocalisationUpdate +wfLoadExtension( 'LocalisationUpdate' ); + # FacetedCategory wfLoadExtension( 'FacetedCategory' ); diff --git a/cron/crontab b/cron/crontab index 3b6d2f1a..40080ec9 100644 --- a/cron/crontab +++ b/cron/crontab @@ -1 +1,2 @@ 0 1,5,9,13,17,21 * * * /usr/local/bin/generate-sitemap +0 5 * * * /usr/local/bin/localisation-update diff --git a/cron/localisation-update b/cron/localisation-update new file mode 100755 index 00000000..f819ac5e --- /dev/null +++ b/cron/localisation-update @@ -0,0 +1,13 @@ +#!/bin/bash + +# 주기적으로 실행해야하는 스크립트. 미디어위키의 시스템 메시지를 항상 최신으로 +# 유지시켜 준다. +# +# Reference: +# https://www.mediawiki.org/wiki/Extension:LocalisationUpdate + +set -euo pipefail; IFS=$'\n\t' + +cd /srv/femiwiki.com/extensions/LocalisationUpdate + +sudo -u www-data php update.php --quiet diff --git a/extension-installer/install_extensions.rb b/extension-installer/install_extensions.rb index 4f4ebccc..45244dc2 100644 --- a/extension-installer/install_extensions.rb +++ b/extension-installer/install_extensions.rb @@ -49,6 +49,7 @@ 'Widgets', 'UniversalLanguageSelector', 'Translate', + 'LocalisationUpdate', ] # 3rd party extensions and their URLs extensions_3rdparty = { diff --git a/run b/run index 15fd8797..875123fe 100755 --- a/run +++ b/run @@ -28,6 +28,8 @@ fi # Run update script /srv/femiwiki.com/maintenance/update.php --quick +# Update localisations for MediaWiki messages in the background +php /srv/femiwiki.com/extensions/LocalisationUpdate/update.php & # Start cron daemon cron