diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 84957864..71ae0b3a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -25,7 +25,6 @@ jobs: shellcheck cleanup/*.sh shellcheck mariadb/docker-entrypoint.sh shellcheck mediawiki/*.sh - shellcheck mwlib/docker-entrypoint.sh shellcheck nextcloud/docker-entrypoint.sh shellcheck redis/docker-entrypoint.sh shellcheck rocketchat/docker-entrypoint.sh diff --git a/.gitignore b/.gitignore index 9d127570..4e7c5e89 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,9 @@ baseimages/stretch_chroot baseimages/alpine_chroot hubot-rocketchat/packages/* hubot-rocketchat/redis-dump +mediawiki/config/logos.php mediawiki/config/namespaces.php -mediawiki/kblogo.png +mediawiki/logos/* mediawiki/_db mediawiki/_deleted mediawiki/_images diff --git a/mediawiki/Dockerfile b/mediawiki/Dockerfile index e1dc1a13..343c487f 100644 --- a/mediawiki/Dockerfile +++ b/mediawiki/Dockerfile @@ -1,31 +1,32 @@ -FROM alpine:3.13 -MAINTAINER Evgeny Golyshev +FROM alpine:3.20 -ENV MEDIAWIKI_VERSION REL1_35 +LABEL maintainer="Evgeny Golyshev " -RUN echo http://mirror.yandex.ru/mirrors/alpine/v3.13/community >> /etc/apk/repositories \ +ENV MEDIAWIKI_VERSION REL1_42 + +RUN echo http://mirror.yandex.ru/mirrors/alpine/v3.20/community >> /etc/apk/repositories \ && apk --update add \ bash \ curl \ git \ mysql-client \ nginx \ - php7 \ - php7-ctype \ - php7-curl \ - php7-dom \ - php7-fileinfo \ - php7-fpm \ - php7-gd \ - php7-iconv \ - php7-intl \ - php7-json \ - php7-mbstring \ - php7-mysqli \ - php7-pecl-apcu \ - php7-session \ - php7-xml \ - php7-xmlreader \ + php83 \ + php83-ctype \ + php83-curl \ + php83-dom \ + php83-fileinfo \ + php83-fpm \ + php83-gd \ + php83-iconv \ + php83-intl \ + php83-json \ + php83-mbstring \ + php83-mysqli \ + php83-pecl-apcu \ + php83-session \ + php83-xml \ + php83-xmlreader \ python3 \ supervisor \ && cd /usr/bin \ @@ -65,9 +66,9 @@ RUN echo http://mirror.yandex.ru/mirrors/alpine/v3.13/community >> /etc/apk/repo git \ && rm -rf /var/cache/apk/* -COPY ./config/LocalSettings.php ./config/namespaces.ph[p] /var/www/w/ +COPY ./config/LocalSettings.php ./config/logos.ph[p] ./config/namespaces.ph[p] /var/www/w/ -COPY ./config/default /etc/nginx/conf.d/default.conf +COPY ./config/default /etc/nginx/http.d/default.conf COPY ./config/supervisord.conf /etc/supervisor/supervisord.conf @@ -75,7 +76,7 @@ COPY ./rollout_fixes.sh /usr/bin/rollout_fixes.sh COPY ./docker-entrypoint.sh /usr/bin/docker-entrypoint.sh -COPY ./logo.svg ./kblogo.pn[g] /var/www/w/resources/assets/ +COPY ./logos/ /var/www/w/resources/assets/ RUN /usr/bin/rollout_fixes.sh diff --git a/mediawiki/README.md b/mediawiki/README.md index 1014c856..44023bd4 100644 --- a/mediawiki/README.md +++ b/mediawiki/README.md @@ -12,26 +12,26 @@ MediaWiki is one of the most famous wiki engines. It's best known for being used Version - 1.35 + 1.42 Release date - 20 Sep 2020 + 27 Jun 2024 Port 8004 - Data volume + Data volumes - /srv/mediawiki/deleted:/var/www/w/deleted
- /srv/mediawiki/images:/var/www/w/images + ./_deleted:/var/www/w/deleted
+ ./_images:/var/www/w/images Base image - Official Docker image based on Alpine 3.13 + Official Docker image based on Alpine 3.20 @@ -46,7 +46,7 @@ MediaWiki is one of the most famous wiki engines. It's best known for being used ## Features -* Nginx [1.18.0](http://nginx.org/en/CHANGES-1.18) and PHP [7.4.15](http://php.net/ChangeLog-7.php#7.4.15). +* Nginx [1.26.1](http://nginx.org/en/CHANGES-1.26) and PHP [8.3.9](http://php.net/ChangeLog-8.php#8.3.9). * The [Cite](https://www.mediawiki.org/wiki/Extension:Cite) extension which allows creating references as footnotes on a page, using `` and `` tags. * The [MobileFrontend](https://www.mediawiki.org/wiki/Extension:MobileFrontend) extension which provides a mobile view. * The [SyntaxHighlight](https://mediawiki.org/wiki/Extension:SyntaxHighlight) extension which provides rich formatting of source code using the `` tag. @@ -58,30 +58,94 @@ MediaWiki is one of the most famous wiki engines. It's best known for being used `docker-compose.yml` supports the following parameters. -| Parameter | Description | Default | -| --- | --- | --- | -| PORT | Port wiki is available on | 8004 | -| WG_SITENAME | Wiki name | My KB | -| WG_META_NAMESPACE | [Name](https://mediawiki.org/wiki/Manual:$wgMetaNamespace) used for the project namespace | My_KB | -| WG_PROTOCOL | Protocol which is used for accessing wiki (`http` and `https`) | `http` | -| WG_SERVER | [Domain or IP](https://mediawiki.org/wiki/Manual:$wgServer) of the wiki host | 127.0.0.1:8004 | -| WG_EMERGENCY_CONTACT | Wiki [admin email address](https://mediawiki.org/wiki/Manual:$wgEmergencyContact) | username@domain.com | -| WG_PASSWORD_SENDER | [Password reminder email address](https://mediawiki.org/wiki/Manual:$wgPasswordSender) | username@domain.com | -| WG_DB_SERVER | [Database server host](https://mediawiki.org/wiki/Manual:$wgDBserver) | 127.0.0.1:33061 | -| WG_DB_NAME | [Database name](https://mediawiki.org/wiki/Manual:$wgDBname) | knowledge_base | -| WG_DB_USER | [Database user](https://mediawiki.org/wiki/Manual:$wgDBuser) | root | -| WG_DB_PASSWORD | [Database password](https://mediawiki.org/wiki/Manual:$wgDBpassword) | cusdeb | -| ALLOW_ACCOUNT_CREATION | Allows users to create accounts (`true` and `false`) | `true` | -| ALLOW_ACCOUNT_EDITING | Allows users to edit their accounts (`true` and `false`) | `true` | -| ALLOW_ANONYMOUS_READING | Allows users to read wiki anonymously (`true` and `false`). If the parameter is `false`, wiki is **private** | `false` | -| ALLOW_ANONYMOUS_EDITING | Allows users to edit wiki anonymously (`true` and `false`) | `true` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescriptionDefault
Basic
PORTPort wiki is available on8004
WG_SITENAMEWiki nameMy KB
WG_META_NAMESPACEName used for the project namespaceMy_KB
WG_PROTOCOLProtocol which is used for accessing wiki (http and https)http
WG_SERVERDomain or IP of the wiki host127.0.0.1:8004
WG_EMERGENCY_CONTACTWiki admin email addressusername@domain.com
WG_PASSWORD_SENDERPassword reminder email addressusername@domain.com
WG_DB_NAMEDatabase nameknowledge_base
Permissions
ALLOW_ACCOUNT_CREATIONAllows users to create accounts (true and false)true
ALLOW_ACCOUNT_EDITINGAllows users to edit their accounts (true and false)true
ALLOW_ANONYMOUS_READINGAllows users to read wiki anonymously (true and false). If the parameter is false, wiki is privatefalse
ALLOW_ANONYMOUS_EDITINGAllows users to edit wiki anonymously (true and false)true
MobileFrontend
COLLAPSE_SECTIONS_BY_DEFAULTControls whether to collapse sections by default (true and false)false
## How to create an administrator Administrators are wiki users who are members of the "sysop" user group (see details [here](https://mediawiki.org/wiki/Manual:Administrators)). An administrator can be created, using the [createAndPromote.php](https://mediawiki.org/wiki/Manual:CreateAndPromote.php) script: 1. Run `docker exec` on a running MediaWiki container. -2. Run `php7 maintenance/createAndPromote.php --sysop ` inside the container. +2. Run `php maintenance/createAndPromote.php --sysop ` inside the container. ## How to register custom namespaces @@ -104,6 +168,24 @@ Then, rebuild the Docker image and re-run the container. After this you will get In order to modify a [php.ini](https://php.net/manual/en/configuration.file.php) parameter, use the environment variable the name of which consists of `PHP_INI_` and the name of the parameter. For example, to change the [post_max_size](https://php.net/manual/en/ini.core.php#ini.post-max-size) parameter, pass the `PHP_INI_post_max_size` environment variable to the container. -## How to change logo +## How to change logos + +Place all the logos in the `logos` directory, they can be accessed using the path `$wgResourceBasePath/resources/assets`. For example, you have placed `cusdeb.svg` and `cusdeb-wordmark.svg` in this directory. Next, create a file `config/logos.php` with the following content: + +```php +$wgLogos = [ + 'icon' => "$wgResourceBasePath/resources/assets/cusdeb.svg", + 'tagline' => [ + 'src' => "$wgResourceBasePath/resources/assets/cusdeb-wordmark.svg", + 'width' => 135, + 'height' => 15, + ], +]; +``` + +and rebuild the image. See [$wgLogos](https://mediawiki.org/wiki/Manual:$wgLogos) for details. + +## How to upgrade from MariaDB 10.5 to MariaDB 10.6 -Provide a square logo named `kblogo.png` which is 135x135px or 150x150px. +1. Run `docker exec` on a running MariaDB container. +2. Run `mariadb-upgrade -uroot -p`. diff --git a/mediawiki/config/LocalSettings.php b/mediawiki/config/LocalSettings.php index 892b6161..42546505 100644 --- a/mediawiki/config/LocalSettings.php +++ b/mediawiki/config/LocalSettings.php @@ -36,10 +36,6 @@ ## The URL path to static resources (images, scripts, etc.) $wgResourceBasePath = $wgScriptPath; -## The URL path to the logo. Make sure you change this from the default, -## or else you'll overwrite your logo when you upgrade! -$wgLogo = "$wgResourceBasePath/resources/assets/wiki.png"; - ## UPO means: this is also a user preference option $wgEnableEmail = false; @@ -135,7 +131,7 @@ ## Default skin: you can change the default skin. Use the internal symbolic ## names, ie 'vector', 'monobook': -$wgDefaultSkin = "vector"; +$wgDefaultSkin = "vector-2022"; wfLoadSkin( 'vector' ); # End of automatically generated settings. @@ -154,10 +150,9 @@ // that $wgVirtualRestConfig['modules']['parsoid']['url'] be pointed to localhost if this setting is enabled. $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true; -$wgMFDefaultSkinClass = 'SkinVector'; +$wgMFCollapseSectionsByDefault = COLLAPSE_SECTIONS_BY_DEFAULT; -// Cannot use wfLoadExtension here since extension.json does not exist. -require "$IP/extensions/Collection/Collection.php"; +$wgMFDefaultSkinClass = 'SkinVector'; $wgCollectionFormats = array( 'rl' => 'PDF', @@ -175,6 +170,7 @@ function wfMetricCounter() { } wfLoadExtension('Cite'); +wfLoadExtension('Collection'); wfLoadExtension('MobileFrontend'); wfLoadExtension('Parsoid', 'vendor/wikimedia/parsoid/extension.json'); wfLoadExtension('SyntaxHighlight_GeSHi'); diff --git a/mediawiki/config/default b/mediawiki/config/default index ef20de91..872b61e6 100644 --- a/mediawiki/config/default +++ b/mediawiki/config/default @@ -15,7 +15,7 @@ server { location ~ ^/w/(index|load|api|thumb|opensearch_desc|rest|img_auth)\.php$ { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; + fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; } location /w/images { diff --git a/mediawiki/config/supervisord.conf b/mediawiki/config/supervisord.conf index 17776bfd..ac874572 100644 --- a/mediawiki/config/supervisord.conf +++ b/mediawiki/config/supervisord.conf @@ -36,5 +36,5 @@ serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socke command=/usr/sbin/nginx -g 'daemon off;' -c /etc/nginx/nginx.conf [program:php-fpm] -command=/usr/sbin/php-fpm7 --nodaemonize +command=/usr/sbin/php-fpm83 --nodaemonize diff --git a/mediawiki/docker-compose.yml b/mediawiki/docker-compose.yml index 37b3898c..244dc71b 100644 --- a/mediawiki/docker-compose.yml +++ b/mediawiki/docker-compose.yml @@ -1,64 +1,19 @@ -version: "2" services: mediawiki: - image: cusdeb/mediawiki:1.35-amd64 - environment: - - PORT=${PORT} - - PHP_INI_post_max_size=${PHP_INI_post_max_size} - - PHP_INI_upload_max_filesize=${PHP_INI_upload_max_filesize} - - WG_SITENAME=${WG_SITENAME} - - WG_META_NAMESPACE=${WG_META_NAMESPACE} - - WG_PROTOCOL=${WG_PROTOCOL} - - WG_SERVER=${WG_SERVER} - - WG_EMERGENCY_CONTACT=${WG_EMERGENCY_CONTACT} - - WG_PASSWORD_SENDER=${WG_PASSWORD_SENDER} - - WG_DB_SERVER=${WG_DB_SERVER} - - WG_DB_NAME=${WG_DB_NAME} - - WG_DB_USER=${WG_DB_USER} - - WG_DB_PASSWORD=${WG_DB_PASSWORD} - - ALLOW_ACCOUNT_CREATION=${ALLOW_ACCOUNT_CREATION} - - ALLOW_ACCOUNT_EDITING=${ALLOW_ACCOUNT_EDITING} - - ALLOW_ANONYMOUS_READING=${ALLOW_ANONYMOUS_READING} - - ALLOW_ANONYMOUS_EDITING=${ALLOW_ANONYMOUS_EDITING} - - METRIC_COUNTER=${METRIC_COUNTER} - # Render server - - CREDENTIALS=${CREDENTIALS} - - RENDER_SERVER_HOST=${RENDER_SERVER_HOST} - network_mode: "host" + image: cusdeb/mediawiki:1.42-amd64 + env_file: .env + restart: always volumes: - ./_deleted:/var/www/w/deleted - ./_images:/var/www/w/images - mariadb: - image: cusdeb/mariadb:10.5-amd64 - network_mode: "host" + ports: + - "127.0.0.1:8004:8004" + db: + image: cusdeb/mariadb:10.6-amd64 environment: - - MYSQLD_port=33061 - MYSQL_ROOT_PASSWORD=cusdeb - - MYSQL_DATABASE= - - MYSQL_USER= - - MYSQL_PASSWORD= + env_file: .env + restart: always volumes: - ./_db:/var/lib/mysql - mw_qserve: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - MW_QSERVE_PORT=${MW_QSERVE_PORT} - - TYPE=mw-qserve - postman: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - TYPE=postman - nserve: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - RENDER_SERVER_PORT=${RENDER_SERVER_PORT} - - TYPE=nserve - nslave: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - TYPE=nslave diff --git a/mediawiki/docker-entrypoint.sh b/mediawiki/docker-entrypoint.sh index 0ef88095..10391720 100755 --- a/mediawiki/docker-entrypoint.sh +++ b/mediawiki/docker-entrypoint.sh @@ -1,11 +1,15 @@ #!/bin/bash +# +# Configurable parameters +# + PORT=${PORT:=8004} # shellcheck disable=SC2034 SECRET_KEY="$(python3 -c "import secrets, string; print(''.join(secrets.choice(string.ascii_letters + string.digits) for _ in range(64)))")" -WG_SITENAME=${WG_SITENAME:="My KB"} +WG_SITENAME=${WG_SITENAME:=""} WG_META_NAMESPACE=${WG_META_NAMESPACE:=My_KB} @@ -17,14 +21,8 @@ WG_EMERGENCY_CONTACT=${WG_EMERGENCY_CONTACT:=username@domain.com} WG_PASSWORD_SENDER=${WG_PASSWORD_SENDER:=username@domain.com} -WG_DB_SERVER=${WG_DB_SERVER:=127.0.0.1:33061} - WG_DB_NAME=${WG_DB_NAME:=knowledge_base} -WG_DB_USER=${WG_DB_USER:=root} - -WG_DB_PASSWORD=${WG_DB_PASSWORD:=cusdeb} - ALLOW_ACCOUNT_CREATION=${ALLOW_ACCOUNT_CREATION:=true} ALLOW_ACCOUNT_EDITING=${ALLOW_ACCOUNT_EDITING:=true} @@ -33,6 +31,8 @@ ALLOW_ANONYMOUS_READING=${ALLOW_ANONYMOUS_READING:=false} ALLOW_ANONYMOUS_EDITING=${ALLOW_ANONYMOUS_EDITING:=true} +COLLAPSE_SECTIONS_BY_DEFAULT=${COLLAPSE_SECTIONS_BY_DEFAULT:=false} + METRIC_COUNTER=${METRIC_COUNTER:=""} CREDENTIALS=${CREDENTIALS:=""} @@ -43,6 +43,16 @@ export PHP_INI_post_max_size="${PHP_INI_post_max_size:=25M}" export PHP_INI_upload_max_filesize="${PHP_INI_upload_max_filesize:=25M}" +# +# Static parameters +# + +WG_DB_SERVER=db:3306 + +WG_DB_USER=root + +WG_DB_PASSWORD=cusdeb + # Does variable substitution for LocalSettings.php. # Globals: # None @@ -56,19 +66,23 @@ substitute() { sed -i -e "s#${var_name}#${!var_name}#" /var/www/w/LocalSettings.php } +if [[ -f /var/www/w/logos.php ]]; then + cat /var/www/w/logos.php >> /var/www/w/LocalSettings.php +fi + if [[ -f /var/www/w/namespaces.php ]]; then cat /var/www/w/namespaces.php >> /var/www/w/LocalSettings.php fi -change_ini_param.py --config-file /etc/php7/php-fpm.d/www.conf --section www "listen" "/var/run/php/php7.0-fpm.sock" +change_ini_param.py --config-file /etc/php83/php-fpm.d/www.conf --section www "listen" "/var/run/php/php8.3-fpm.sock" -change_ini_param.py --config-file /etc/php7/php-fpm.d/www.conf --section www "listen.owner" "nginx" +change_ini_param.py --config-file /etc/php83/php-fpm.d/www.conf --section www "listen.owner" "nginx" -change_ini_param.py --config-file /etc/php7/php-fpm.d/www.conf --section www "listen.group" "nginx" +change_ini_param.py --config-file /etc/php83/php-fpm.d/www.conf --section www "listen.group" "nginx" -change_ini_param.py --config-file /etc/php7/php-fpm.d/www.conf --section www "user" "nginx" +change_ini_param.py --config-file /etc/php83/php-fpm.d/www.conf --section www "user" "nginx" -change_ini_param.py --config-file /etc/php7/php-fpm.d/www.conf --section www "group" "nginx" +change_ini_param.py --config-file /etc/php83/php-fpm.d/www.conf --section www "group" "nginx" >&2 echo "Preparing LocalSettings.php" @@ -87,6 +101,7 @@ substitute ALLOW_ACCOUNT_CREATION substitute ALLOW_ACCOUNT_EDITING substitute ALLOW_ANONYMOUS_READING substitute ALLOW_ANONYMOUS_EDITING +substitute COLLAPSE_SECTIONS_BY_DEFAULT substitute RENDER_SERVER substitute CREDENTIALS substitute METRIC_COUNTER @@ -112,9 +127,9 @@ fi >&2 echo "Executing maintenance/update.php" cd /var/www/w || exit 1 -php7 maintenance/update.php +php maintenance/update.php -sed -i -e "s/PORT/${PORT}/" /etc/nginx/conf.d/default.conf +sed -i -e "s/PORT/${PORT}/" /etc/nginx/http.d/default.conf >&2 echo "Fixing ownership" chown -R nginx:nginx /var/www/w/deleted @@ -133,7 +148,7 @@ for key_val in $(env); do val=${!var} config_option=${var#PHP_INI_} >&2 echo "Changing '${config_option}' to '${val}'" - change_ini_param.py --config-file /etc/php7/php.ini --section PHP "${config_option}" "${val}" + change_ini_param.py --config-file /etc/php83/php.ini --section PHP "${config_option}" "${val}" fi done diff --git a/mediawiki/logos/README.md b/mediawiki/logos/README.md new file mode 100644 index 00000000..aa8c4b27 --- /dev/null +++ b/mediawiki/logos/README.md @@ -0,0 +1 @@ +The directory contains logos for this wiki. diff --git a/mediawiki/rollout_fixes.sh b/mediawiki/rollout_fixes.sh index 6e3f76ab..ede12cb3 100755 --- a/mediawiki/rollout_fixes.sh +++ b/mediawiki/rollout_fixes.sh @@ -1,6 +1,5 @@ #!/bin/sh -# The directories are necessary for nginx and php-fpm, but they do not exist in the container. -mkdir /run/nginx +# The directory is necessary for php-fpm, but it does not exist in the container. mkdir /run/php diff --git a/mwlib/Dockerfile b/mwlib/Dockerfile deleted file mode 100644 index 6c78c4d1..00000000 --- a/mwlib/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -FROM alpine:3.11 -MAINTAINER Evgeny Golyshev - -# The following version of mwlib.rl depends on mwlib 0.16.2. -ENV MWLIB_RL_VER "0.14.5" - -COPY patches /root/patches - -RUN apk --update add \ - bash \ - curl \ - g++ \ - gcc \ - jpeg-dev \ - libffi-dev \ - libstdc++ \ - libxml2-dev \ - libxslt-dev \ - make \ - musl-dev \ - py2-pip \ - py-setuptools \ - python-dev \ - re2c \ - # Install Pillow 6.1.0 otherwise the latest one will be installed, - # but that's not what we need. - && pip install Pillow==6.1.0 \ - && pip install mwlib.rl=="${MWLIB_RL_VER}" \ - && cd \ - && curl -O https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh \ - && chmod +x wait-for-it.sh \ - && mv wait-for-it.sh /usr/local/bin \ - # Apply patches - && cd / \ - && for path in $(ls /root/patches/*.patch 2> /dev/null); do \ - patch -p0 < "${path}"; \ - done \ - # Cleanup - && apk del \ - curl \ - g++ \ - gcc \ - make \ - py2-pip \ - re2c \ - && rm -rf /var/cache/apk/* - -COPY ./docker-entrypoint.sh /entrypoint.sh - -CMD ["/entrypoint.sh"] - diff --git a/mwlib/docker-compose.yml b/mwlib/docker-compose.yml deleted file mode 100644 index ef1b207b..00000000 --- a/mwlib/docker-compose.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.3" -services: - mw_qserve: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - MW_QSERVE_PORT=${MW_QSERVE_PORT} - - TYPE=mw-qserve - postman: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - TYPE=postman - nserve: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - RENDER_SERVER_PORT=${RENDER_SERVER_PORT} - - TYPE=nserve - nslave: - image: cusdeb/mwlib:0.16.2 - network_mode: "host" - environment: - - TYPE=nslave diff --git a/mwlib/docker-entrypoint.sh b/mwlib/docker-entrypoint.sh deleted file mode 100755 index 81964f66..00000000 --- a/mwlib/docker-entrypoint.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -export RENDER_SERVER_PORT=${RENDER_SERVER_PORT:=8007} - -export MW_QSERVE_PORT=${MW_QSERVE_PORT:=14311} - -export TYPE=${TYPE:=nserve} - -case "${TYPE}" in -mw-qserve) - mw-qserve -p "${MW_QSERVE_PORT}" - - ;; -postman) - wait-for-it.sh -h 127.0.0.1 -p "${MW_QSERVE_PORT}" -t 90 -- >&2 echo "mw-qserve is ready" - - postman - - ;; -nserve) - wait-for-it.sh -h 127.0.0.1 -p "${MW_QSERVE_PORT}" -t 90 -- >&2 echo "mw-qserve is ready" - - nserve --port="${RENDER_SERVER_PORT}" - - ;; -nslave) - wait-for-it.sh -h 127.0.0.1 -p "${MW_QSERVE_PORT}" -t 90 -- >&2 echo "mw-qserve is ready" - - nslave --cachedir ~/cache/ --url=http://127.0.0.1:8898/cache - - ;; -*) - >&2 echo "Unknown ${TYPE} service type" - exit 1 - ;; -esac diff --git a/mwlib/patches/do-not-check-localhost-127.x.x-192.168.x.x.patch b/mwlib/patches/do-not-check-localhost-127.x.x-192.168.x.x.patch deleted file mode 100644 index 5fb801d0..00000000 --- a/mwlib/patches/do-not-check-localhost-127.x.x-192.168.x.x.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- /usr/lib/python2.7/site-packages/mwlib/nserve.py -+++ /usr/lib/python2.7/site-packages/mwlib/nserve.py -@@ -276,9 +276,6 @@ - return collection_id - - def is_good_baseurl(self, url): -- netloc = urlparse.urlparse(url)[1].split(':')[0].lower() -- if netloc == "localhost" or netloc.startswith("127.0.") or netloc.startswith("192.168."): -- return False - return True - - def _get_params(self, post_data, collection_id):