소스 검색

initial checkpoint

orbitzs 4 년 전
커밋
96a105de1f
100개의 변경된 파일2598개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      apache2/.env
  2. 12 0
      apache2/docker-compose.yml
  3. 3 0
      calibre-web/.env
  4. 2 0
      calibre-web/books/recipe/add_book.sh
  5. 2 0
      calibre-web/books/recipe/docker_add_book.sh
  6. 2 0
      calibre-web/books/recipe/docker_upkindle.sh
  7. 13 0
      calibre-web/books/recipe/upkindle.sh
  8. 34 0
      calibre-web/docker-compose.yml
  9. 6 0
      ftp/.env
  10. 1 0
      ftp/build/docker-pure-ftpd
  11. 21 0
      ftp/docker-compose.yml
  12. 8 0
      ftp2/.env
  13. 1 0
      ftp2/build/docker-vsftpd
  14. 21 0
      ftp2/docker-compose.yml
  15. 57 0
      gogs/data/gogs/conf/app.ini
  16. 9 0
      gogs/docker-compose.yml
  17. 8 0
      guacamole/.env
  18. 42 0
      guacamole/docker-compose.yml
  19. 2 0
      httpd/.env
  20. 14 0
      httpd/docker-compose.yml
  21. 12 0
      jupyter/.env
  22. 14 0
      jupyter/docker-compose.yml
  23. 8 0
      jupyter/startnb.sh
  24. 7 0
      mywiki/.env
  25. 117 0
      mywiki/build/dockerfile
  26. 117 0
      mywiki/build/my_wiki1.35/dockerfile
  27. 71 0
      mywiki/docker-compose.yml
  28. 20 0
      mywiki/www/docs/kss/scripts/kss-node-check.sh
  29. 9 0
      mywiki/www/extensions/CirrusSearch/maintenance/elasticsearch-scripts/count-cluster.sh
  30. 93 0
      mywiki/www/extensions/CirrusSearch/scripts/run-phan.sh
  31. 11 0
      mywiki/www/extensions/Maps/.gitignore
  32. 12 0
      mywiki/www/extensions/Maps/.scrutinizer.yml
  33. 45 0
      mywiki/www/extensions/Maps/.travis.install.sh
  34. 28 0
      mywiki/www/extensions/Maps/.travis.yml
  35. 39 0
      mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.eslintrc
  36. 1 0
      mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.gitignore
  37. 8 0
      mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.mversionrc
  38. 8 0
      mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.travis.yml
  39. 12 0
      mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet.fullscreen/.jshintrc
  40. 10 0
      mywiki/www/extensions/Validator/.gitignore
  41. 12 0
      mywiki/www/extensions/Validator/.scrutinizer.yml
  42. 20 0
      mywiki/www/extensions/Validator/.travis.yml
  43. 14 0
      mywiki/www/extensions/Validator/build/travis/after_success.sh
  44. 39 0
      mywiki/www/extensions/Validator/build/travis/before_script.sh
  45. 14 0
      mywiki/www/extensions/Validator/build/travis/script.sh
  46. 55 0
      mywiki/www/extensions/VisualEditor/bin/listRecentCommits.sh
  47. 23 0
      mywiki/www/extensions/VisualEditor/bin/pre-commit.sh
  48. 68 0
      mywiki/www/extensions/VisualEditor/bin/updateSubmodule.sh
  49. 41 0
      mywiki/www/extensions/VisualEditor/lib/ve/bin/sync-gh-pages.sh
  50. 63 0
      mywiki/www/extensions/VisualEditor/lib/ve/bin/update-oojs-ui.sh
  51. 59 0
      mywiki/www/extensions/VisualEditor/lib/ve/bin/update-oojs.sh
  52. 59 0
      mywiki/www/extensions/VisualEditor/lib/ve/bin/update-unicodejs.sh
  53. 122 0
      mywiki/www/includes/limit.sh
  54. 14 0
      mywiki/www/maintenance/dev/includes/php.sh
  55. 8 0
      mywiki/www/maintenance/dev/includes/require-php.sh
  56. 8 0
      mywiki/www/maintenance/dev/install.sh
  57. 18 0
      mywiki/www/maintenance/dev/installmw.sh
  58. 57 0
      mywiki/www/maintenance/dev/installphp.sh
  59. 14 0
      mywiki/www/maintenance/dev/start.sh
  60. 84 0
      mywiki/www/maintenance/resources/update-oojs-ui.sh
  61. 59 0
      mywiki/www/maintenance/resources/update-oojs.sh
  62. 1 0
      mywiki/www/vendor/composer/installers
  63. 12 0
      mywiki/www/vendor/data-values/common/.gitignore
  64. 13 0
      mywiki/www/vendor/data-values/common/.scrutinizer.yml
  65. 15 0
      mywiki/www/vendor/data-values/common/.travis.yml
  66. 12 0
      mywiki/www/vendor/data-values/data-values/.gitignore
  67. 13 0
      mywiki/www/vendor/data-values/data-values/.scrutinizer.yml
  68. 14 0
      mywiki/www/vendor/data-values/data-values/.travis.yml
  69. 12 0
      mywiki/www/vendor/data-values/geo/.gitignore
  70. 13 0
      mywiki/www/vendor/data-values/geo/.scrutinizer.yml
  71. 26 0
      mywiki/www/vendor/data-values/geo/.travis.yml
  72. 12 0
      mywiki/www/vendor/data-values/interfaces/.gitignore
  73. 13 0
      mywiki/www/vendor/data-values/interfaces/.scrutinizer.yml
  74. 19 0
      mywiki/www/vendor/data-values/interfaces/.travis.yml
  75. 12 0
      mywiki/www/vendor/data-values/validators/.gitignore
  76. 13 0
      mywiki/www/vendor/data-values/validators/.scrutinizer.yml
  77. 14 0
      mywiki/www/vendor/data-values/validators/.travis.yml
  78. 14 0
      mywiki/www/vendor/doctrine/instantiator/.travis.install.sh
  79. 38 0
      mywiki/www/vendor/firebase/php-jwt/run-tests.sh
  80. 1 0
      mywiki/www/vendor/jakub-onderka/php-parallel-lint
  81. 11 0
      mywiki/www/vendor/jeroen/file-fetcher/.gitignore
  82. 12 0
      mywiki/www/vendor/jeroen/file-fetcher/.scrutinizer.yml
  83. 24 0
      mywiki/www/vendor/jeroen/file-fetcher/.travis.yml
  84. 10 0
      mywiki/www/vendor/jeroen/simple-cache/.gitignore
  85. 6 0
      mywiki/www/vendor/jeroen/simple-cache/.gitreview
  86. 22 0
      mywiki/www/vendor/jeroen/simple-cache/.travis.yml
  87. 3 0
      mywiki/www/vendor/mediawiki/mediawiki-codesniffer/utils/gen-changelog.sh
  88. 11 0
      mywiki/www/vendor/param-processor/param-processor/.gitignore
  89. 13 0
      mywiki/www/vendor/param-processor/param-processor/.scrutinizer.yml
  90. 26 0
      mywiki/www/vendor/param-processor/param-processor/.travis.yml
  91. 3 0
      mywiki/www/vendor/pear/net_smtp/phpdoc.sh
  92. 5 0
      mywiki/www/vendor/pear/pear-core-minimal/copy-from-pear-core.sh
  93. 63 0
      mywiki/www/vendor/ruflin/elastica/ansible/provision.sh
  94. 27 0
      mywiki/www/vendor/ruflin/elastica/docker-compose.yml
  95. 7 0
      mywiki135/.env
  96. 119 0
      mywiki135/build/dockerfile
  97. 125 0
      mywiki135/build/my_wiki1.35/dockerfile
  98. 62 0
      mywiki135/docker-compose.yml
  99. 20 0
      mywiki135/www/docs/kss/scripts/kss-node-check.sh
  100. 9 0
      mywiki135/www/extensions/CirrusSearch/maintenance/elasticsearch-scripts/count-cluster.sh

+ 2 - 0
apache2/.env

@@ -0,0 +1,2 @@
+CONTAINER_NAME=apache2
+APACHE_ROOT=/home/tuffy/docker/apache2

+ 12 - 0
apache2/docker-compose.yml

@@ -0,0 +1,12 @@
+version: "2.1"
+services:
+
+  apache:
+    image: 'bitnami/apache:latest'
+    container_name: ${CONTAINER_NAME} 
+    ports:
+      - '8100:8080'
+    volumes:
+      - ${APACHE_ROOT}/data:/app
+      - ${APACHE_ROOT}/config:/vhosts
+    restart: "no" 

+ 3 - 0
calibre-web/.env

@@ -0,0 +1,3 @@
+CALIBRE_WEB_NAME=calibre-web
+CALIBRE_NAME=calibre
+CALIBRE_ROOT=/home/tuffy/docker/calibre-web

+ 2 - 0
calibre-web/books/recipe/add_book.sh

@@ -0,0 +1,2 @@
+#calibredb  --with-library "/config/news_library" add --series "oriental daily" -a "oriental daily" /config/recipe/dl/a.mobi
+calibredb  --with-library "http://localhost:8080" add --series "oriental daily" -a "oriental daily" /config/recipe/dl/a.mobi

+ 2 - 0
calibre-web/books/recipe/docker_add_book.sh

@@ -0,0 +1,2 @@
+docker exec -it -u abc calibre  "/config/recipe/add_book.sh" 
+

+ 2 - 0
calibre-web/books/recipe/docker_upkindle.sh

@@ -0,0 +1,2 @@
+docker exec -it -u abc calibre  "/config/recipe/upkindle.sh" 
+

+ 13 - 0
calibre-web/books/recipe/upkindle.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+TODAY=`date +"%Y%m%d"`
+ROOTPATH=/config
+RECIPEPATH=$ROOTPATH/recipe
+MOBIPATH=$RECIPEPATH/dl
+OPTIONS="--output-profile kindle_pw"
+echo $RECIPEPATH
+#
+# download oriental daily
+#
+ebook-convert "$RECIPEPATH/oriental_daily_pure.recipe" $MOBIPATH/$TODAY-orient.mobi $OPTIONS
+calibre-smtp  --attachment $MOBIPATH/$TODAY-orient.mobi --relay smtp.gmail.com --port 587 --username cigarbar@gmail.com --password "on2next1" --encryption-method TLS cigarbar@gmail.com larry1chan@kindle.cn ""
+

+ 34 - 0
calibre-web/docker-compose.yml

@@ -0,0 +1,34 @@
+version: "2.1"
+services:
+  calibre-web:
+    image: ghcr.io/linuxserver/calibre-web
+    container_name: ${CALIBRE_WEB_NAME} 
+    environment:
+      - PUID=1000
+      - PGID=1000
+      - TZ=Asia/Hong_Kong
+      - DOCKER_MODS=linuxserver/calibre-web:calibre
+    volumes:
+      - ${CALIBRE_ROOT}/calibre-web/config:/config 
+      - ${CALIBRE_ROOT}/books:/books
+    ports:
+      - 8083:8083
+    restart: "no" 
+
+  calibre:
+    image: ghcr.io/linuxserver/calibre
+    container_name: ${CALIBRE_NAME} 
+    environment:
+      - PUID=1000
+      - PGID=1000
+      - TZ=Asia/Hong_Kong
+      - GUAC_USER=tuffy #  
+      - GUAC_PASS=5f4dcc3b5aa765d61d8327deb882cf99 # password=password
+      - UMASK_SET=022 #optional
+      - CLI_ARGS= #optional
+    volumes:
+      - ${CALIBRE_ROOT}/books:/config
+    ports:
+      - 8080:8080
+      - 8081:8081
+    restart: "no" 

+ 6 - 0
ftp/.env

@@ -0,0 +1,6 @@
+DATA_ROOT=/home/tuffy/docker/ftp
+CONTAINER_NAME=ftpd
+PUBLICHOST=tufbunny.local
+FTP_USER_NAME=fuser
+FTP_USER_PASS=123456
+FTP_USER_HOME=/home/ftpusers/fuser

+ 1 - 0
ftp/build/docker-pure-ftpd

@@ -0,0 +1 @@
+Subproject commit 93c9fadc38a408c2409439ce533941aaa681f869

+ 21 - 0
ftp/docker-compose.yml

@@ -0,0 +1,21 @@
+version: '3'
+
+
+services:
+  ftpd_server:
+    image: laxaurus/ftpd:1.0 
+    container_name: ${CONTAINER_NAME}
+    ports:
+      - "7021:21"
+#      - "30000-30009:30000-30009"
+    volumes: 
+      - "${DATA_ROOT}/data:${FTP_USER_HOME}"
+      - "${DATA_ROOT}/passwd:/etc/pure-ftpd/passwd"
+    environment:
+      PUBLICHOST: ${PUBLICHOST}
+      FTP_USER_NAME: ${FTP_USER_NAME}
+      FTP_USER_PASS: ${FTP_USER_PASS}
+      FTP_USER_HOME: ${FTP_USER_HOME}
+      ADDED_FLAGS: "--tls=0 -K --umask 000:000"
+    hostname: ${PUBLICHOST}
+    restart: "no"

+ 8 - 0
ftp2/.env

@@ -0,0 +1,8 @@
+DATA_ROOT=/home/tuffy/docker/ftp2
+CONTAINER_NAME=vsftpd
+FTP_USER=fuser
+FTP_PASS=123456
+FILE_OPEN_MODE=0755
+LOCAL_UMASK=002
+CHMOD_ENABLE=YES
+LISTEN_IPV6=NO

+ 1 - 0
ftp2/build/docker-vsftpd

@@ -0,0 +1 @@
+Subproject commit 10e7439c6b34dada709ebb11e9aa6a5b2a14bb44

+ 21 - 0
ftp2/docker-compose.yml

@@ -0,0 +1,21 @@
+version: '3'
+
+
+services:
+  vsftpd:
+    image: laxaurus/vsftpd:1.0 
+    container_name: ${CONTAINER_NAME}
+    ports:
+      - "7021:21"
+
+    volumes: 
+       - "${DATA_ROOT}/data:/home/vsftpd"
+       - "${DATA_ROOT}/log:/var/log/vsftpd"
+    environment:
+      
+      FTP_USER: ${FTP_USER}
+      FTP_PASS: ${FTP_PASS}
+      FILE_OPEN_MODE: ${FILE_OPEN_MODE}
+      LOCAL_UMASK: ${LOCAL_UMASK}
+      CHMOD_ENABLE: ${CHMOD_ENABLE}
+    restart: "no"

+ 57 - 0
gogs/data/gogs/conf/app.ini

@@ -0,0 +1,57 @@
+BRAND_NAME = Gogs
+RUN_USER   = git
+RUN_MODE   = prod
+
+[database]
+TYPE     = sqlite3
+HOST     = 127.0.0.1:3306
+NAME     = gogs
+USER     = gogs
+PASSWORD = 
+SSL_MODE = disable
+PATH     = data/gogs.db
+
+[repository]
+ROOT = /data/git/gogs-repositories
+
+[server]
+DOMAIN           = localhost
+HTTP_PORT        = 3000
+EXTERNAL_URL     = http://localhost:3000/
+DISABLE_SSH      = false
+SSH_PORT         = 22
+START_SSH_SERVER = false
+OFFLINE_MODE     = false
+
+[mailer]
+ENABLED = true
+HOST    = smtp.exmail.qq.com:465
+FROM    = sales@algometic.com
+USER    = sales@algometic,com
+PASSWD  = 1234
+
+[auth]
+REQUIRE_EMAIL_CONFIRMATION  = true
+DISABLE_REGISTRATION        = false
+ENABLE_REGISTRATION_CAPTCHA = true
+REQUIRE_SIGNIN_VIEW         = false
+
+[user]
+ENABLE_EMAIL_NOTIFICATION = true
+
+[picture]
+DISABLE_GRAVATAR        = false
+ENABLE_FEDERATED_AVATAR = false
+
+[session]
+PROVIDER = file
+
+[log]
+MODE      = file
+LEVEL     = Info
+ROOT_PATH = /app/gogs/log
+
+[security]
+INSTALL_LOCK = true
+SECRET_KEY   = s4VPb9UZkZ42aMy
+

+ 9 - 0
gogs/docker-compose.yml

@@ -0,0 +1,9 @@
+gogs:
+  restart: "no" 
+  image: gogs/gogs
+  volumes:
+    - ./data:/data
+  container_name: gogs_git
+  ports:
+    - "10022:22"
+    - "3000:3000"

+ 8 - 0
guacamole/.env

@@ -0,0 +1,8 @@
+CONTAINER_PREFIX=guaca
+GUACA_ROOT=/home/tuffy/docker/guacamole
+GUACD_HOSTNAME=guacd
+MYSQL_ROOT_PASSWORD=guacamole
+MYSQL_USER=guacamole
+MYSQL_PASSWORD=password
+MYSQL_DATABASE=guacamole_db
+MYSQL_HOSTNAME=db

+ 42 - 0
guacamole/docker-compose.yml

@@ -0,0 +1,42 @@
+version: '3.1'
+
+services:
+
+  guacd:
+    image:  guacamole/guacd:1.2.0
+    container_name: ${CONTAINER_PREFIX}_cd
+    restart: "no"
+    ports:
+      - 4822:4822
+
+
+  db:
+    image: mysql:latest
+    container_name: ${CONTAINER_PREFIX}_db
+    restart: "no"
+    environment:
+      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 
+      - MYSQL_USER=${MYSQL_USER}
+      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
+      - MYSQL_DATABASE=${MYSQL_DATABASE}
+    volumes:
+      - ${GUACA_ROOT}/backups:/var/backups
+      - ${GUACA_ROOT}/data_dir/$MYSQL_DATABASE:/var/lib/mysql/$MYSQL_DATABASE
+
+  guaca:
+    image: guacamole/guacamole:1.2.0
+    container_name: ${CONTAINER_PREFIX}
+    restart: "no"
+    links: 
+      - db
+      - guacd
+    ports:
+      - 8111:8080
+    environment:
+      - MYSQL_HOSTNAME=${MYSQL_HOSTNAME}
+      - GUACD_HOSTNAME=${GUACD_HOSTNAME}      
+      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 
+      - MYSQL_USER=${MYSQL_USER}
+      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
+      - MYSQL_DATABASE=${MYSQL_DATABASE}      
+

+ 2 - 0
httpd/.env

@@ -0,0 +1,2 @@
+HTTPD_ROOT=/home/tuffy/docker/httpd
+HTTPD_NAME=apache

+ 14 - 0
httpd/docker-compose.yml

@@ -0,0 +1,14 @@
+version: "2.1"
+services:
+ 
+ httpd:
+    image: httpd:2.4 
+    container_name: ${HTTPD_NAME} 
+    volumes:
+      - ${HTTPD_ROOT}/htdocs:/usr/local/apache2/htdocs 
+      - ${HTTPD_ROOT}/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf 
+      - ${HTTPD_ROOT}/logs:/var/log/apache2 
+    ports:
+      - 8480:80
+    restart: "no" 
+

+ 12 - 0
jupyter/.env

@@ -0,0 +1,12 @@
+CONTAINER_NAME=scipy-jupyter
+
+LOCAL_WORKING_DIR=/home/tuffy/docker/jupyter/notebooks
+PORT=8888
+# Provide data sets
+LOCAL_DATASETS=/home/tuffy/docker/jupyter/datasets
+# Provide local modules
+#LOCAL_MODULES=/home/tuffy/docker/jupyter/python_modules
+LOCAL_MODULES=/home/tuffy/projects/amapi/venv/lib/python3.8/site-packages
+# beautyandthebeast
+ACCESS_TOKEN=sha1:4a216e7de9eb:e566c7ebd8587f5b5c3f4ebf8cc220649751eb78
+

+ 14 - 0
jupyter/docker-compose.yml

@@ -0,0 +1,14 @@
+version:  '3'
+services:
+  datascience-notebook:
+      image:    jupyter/scipy-notebook
+      volumes:
+        - ${LOCAL_WORKING_DIR}:/home/jovyan/work
+        - ${LOCAL_DATASETS}:/home/jovyan/work/datasets
+        - ${LOCAL_MODULES}:/home/jovyan/work/modules
+      ports:
+        - ${PORT}:8888
+      container_name:  ${CONTAINER_NAME} 
+      command: "start-notebook.sh \
+               --NotebookApp.password=${ACCESS_TOKEN}" 
+      restart: "no"

+ 8 - 0
jupyter/startnb.sh

@@ -0,0 +1,8 @@
+# run this script at the shell prompt using the source command as in 
+# source ./startnb.sh
+#
+#
+.  ~/projects/amapi/venv/bin/activate 
+docker-compose up -d
+code
+

+ 7 - 0
mywiki/.env

@@ -0,0 +1,7 @@
+CONTAINER_PREFIX=mywiki
+MWIKI_ROOT=/home/tuffy/docker/mywiki
+MYSQL_ROOT_PASSWORD=root 
+MYSQL_USER=root
+MYSQL_PASSWORD=root
+MYSQL_DATABASE=my_wiki
+PARSOID_DOMAIN_NAME=mediawiki

+ 117 - 0
mywiki/build/dockerfile

@@ -0,0 +1,117 @@
+FROM php:7.0-apache
+
+# System dependencies
+RUN set -eux; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		git \
+		librsvg2-bin \
+		imagemagick \
+		# Required for SyntaxHighlighting
+		python3 \
+	; \
+	rm -rf /var/lib/apt/lists/*
+
+# Install the PHP extensions we need
+RUN set -eux; \
+	\
+	savedAptMark="$(apt-mark showmanual)"; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		libicu-dev \
+	; \
+	\
+	docker-php-ext-install -j "$(nproc)" \
+		intl \
+		mbstring \
+		mysqli \
+		opcache \
+	; \
+	\
+	pecl install APCu-5.1.19; \
+	docker-php-ext-enable \
+		apcu \
+	; \
+	\
+	# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
+	apt-mark auto '.*' > /dev/null; \
+	apt-mark manual $savedAptMark; \
+	ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
+		| awk '/=>/ { print $3 }' \
+		| sort -u \
+		| xargs -r dpkg-query -S \
+		| cut -d: -f1 \
+		| sort -u \
+		| xargs -rt apt-mark manual; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
+	rm -rf /var/lib/apt/lists/*
+
+# Enable Short URLs
+RUN set -eux; \
+	a2enmod rewrite; \
+	{ \
+		echo "<Directory /var/www/html>"; \
+		echo "  RewriteEngine On"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-f"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-d"; \
+		echo "  RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \
+		echo "</Directory>"; \
+	} > "$APACHE_CONFDIR/conf-available/short-url.conf"; \
+	a2enconf short-url
+
+# Enable AllowEncodedSlashes for VisualEditor
+RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf"
+
+# set recommended PHP.ini settings
+# see https://secure.php.net/manual/en/opcache.installation.php
+RUN { \
+		echo 'opcache.memory_consumption=128'; \
+		echo 'opcache.interned_strings_buffer=8'; \
+		echo 'opcache.max_accelerated_files=4000'; \
+		echo 'opcache.revalidate_freq=60'; \
+	} > /usr/local/etc/php/conf.d/opcache-recommended.ini
+
+# SQLite Directory Setup
+RUN set -eux; \
+	mkdir -p /var/www/data; \
+	chown -R www-data:www-data /var/www/data
+
+# Version
+ENV MEDIAWIKI_MAJOR_VERSION 1.27
+ENV MEDIAWIKI_VERSION 1.27.0
+
+# MediaWiki setup
+RUN set -eux; \
+	fetchDeps=" \
+		gnupg \
+		dirmngr \
+        python3 \
+	"; \
+	apt-get update; \
+	apt-get install -y --no-install-recommends $fetchDeps; \
+	\
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \
+	export GNUPGHOME="$(mktemp -d)"; \
+# gpg key from https://www.mediawiki.org/keys/keys.txt
+	# gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys \
+	# 	D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \
+	# 	441276E9CCD15F44F6D97D18C119E1A64D70938E \
+	# 	F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \
+	# 	1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \
+	# ; \
+	# gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	tar -x --strip-components=1 -f mediawiki.tar.gz; \
+	gpgconf --kill all; \
+	rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	chown -R www-data:www-data extensions skins cache images; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
+	rm -rf /var/lib/apt/lists/*
+
+VOLUME /var/www/
+
+CMD ["apache2-foreground"]

+ 117 - 0
mywiki/build/my_wiki1.35/dockerfile

@@ -0,0 +1,117 @@
+FROM php:7.3-apache
+
+# System dependencies
+RUN set -eux; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		git \
+		librsvg2-bin \
+		imagemagick \
+		# Required for SyntaxHighlighting
+		python3 \
+	; \
+	rm -rf /var/lib/apt/lists/*
+
+# Install the PHP extensions we need
+RUN set -eux; \
+	\
+	savedAptMark="$(apt-mark showmanual)"; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		libicu-dev \
+	; \
+	\
+	docker-php-ext-install -j "$(nproc)" \
+		intl \
+		mbstring \
+		mysqli \
+		opcache \
+	; \
+	\
+	pecl install APCu-5.1.19; \
+	docker-php-ext-enable \
+		apcu \
+	; \
+	\
+	# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
+	apt-mark auto '.*' > /dev/null; \
+	apt-mark manual $savedAptMark; \
+	ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
+		| awk '/=>/ { print $3 }' \
+		| sort -u \
+		| xargs -r dpkg-query -S \
+		| cut -d: -f1 \
+		| sort -u \
+		| xargs -rt apt-mark manual; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
+	rm -rf /var/lib/apt/lists/*
+
+# Enable Short URLs
+RUN set -eux; \
+	a2enmod rewrite; \
+	{ \
+		echo "<Directory /var/www/html>"; \
+		echo "  RewriteEngine On"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-f"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-d"; \
+		echo "  RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \
+		echo "</Directory>"; \
+	} > "$APACHE_CONFDIR/conf-available/short-url.conf"; \
+	a2enconf short-url
+
+# Enable AllowEncodedSlashes for VisualEditor
+RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf"
+
+# set recommended PHP.ini settings
+# see https://secure.php.net/manual/en/opcache.installation.php
+RUN { \
+		echo 'opcache.memory_consumption=128'; \
+		echo 'opcache.interned_strings_buffer=8'; \
+		echo 'opcache.max_accelerated_files=4000'; \
+		echo 'opcache.revalidate_freq=60'; \
+	} > /usr/local/etc/php/conf.d/opcache-recommended.ini
+
+# SQLite Directory Setup
+RUN set -eux; \
+	mkdir -p /var/www/data; \
+	chown -R www-data:www-data /var/www/data
+
+# Version
+ENV MEDIAWIKI_MAJOR_VERSION 1.35
+ENV MEDIAWIKI_VERSION 1.35.1
+
+# MediaWiki setup
+RUN set -eux; \
+	fetchDeps=" \
+		gnupg \
+		dirmngr \
+        python3 \
+	"; \
+	apt-get update; \
+	apt-get install -y --no-install-recommends $fetchDeps; \
+	\
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \
+	export GNUPGHOME="$(mktemp -d)"; \
+# gpg key from https://www.mediawiki.org/keys/keys.txt
+	# gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys \
+	# 	D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \
+	# 	441276E9CCD15F44F6D97D18C119E1A64D70938E \
+	# 	F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \
+	# 	1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \
+	# ; \
+	# gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	tar -x --strip-components=1 -f mediawiki.tar.gz; \
+	gpgconf --kill all; \
+	rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	chown -R www-data:www-data extensions skins cache images; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
+	rm -rf /var/lib/apt/lists/*
+
+VOLUME /var/www/
+
+CMD ["apache2-foreground"]

+ 71 - 0
mywiki/docker-compose.yml

@@ -0,0 +1,71 @@
+version: '3.1'
+volumes:
+  files:
+    driver: local
+    driver_opts: 
+      type: volume 
+      o: 'bind'
+      device: "${MWIKI_ROOT}/www"
+  es01:
+    driver: local
+    driver_opts: 
+      type: volume 
+      o: 'bind'
+      device: "${MWIKI_ROOT}/es"
+
+
+services:
+
+  elasticsearch:
+    image: elasticsearch:5.4.3-alpine
+    container_name: ${CONTAINER_PREFIX}_es
+    restart: "no"
+    ports:
+      - 9255:9200
+    volumes:
+      - es01:/usr/share/elasticsearch/data
+
+  parsoid:
+    image: thenets/parsoid:0.8
+    container_name: ${CONTAINER_PREFIX}_parsoid
+    restart: "no"
+    ports:
+      - 8142:8000
+    environment: 
+      - PARSOID_DOMAIN_${PARSOID_DOMAIN_NAME}=http://${PARSOID_DOMAIN_NAME}/api.php 
+
+  db:
+    image: mysql
+    container_name: ${CONTAINER_PREFIX}_mysql
+    command: --default-authentication-plugin=mysql_native_password
+    restart: "no"
+    environment:
+      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 
+      - MYSQL_USER==${MYSQL_USER}
+      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
+      - MYSQL_DATABASE=${MYSQL_DATABASE}
+    volumes: 
+      - ${MWIKI_ROOT}/backups:/var/backups
+      - ${MWIKI_ROOT}/data_dir:/var/lib/mysql
+
+  mediawiki:
+    image: laxaurus/mediawiki:1.1
+    container_name: ${CONTAINER_PREFIX}
+    restart: "no"
+    ports:
+      - 8055:80
+    links:
+      - db
+      - parsoid
+    volumes:
+      - files:/var/www/html
+      #- ${MWIKI_ROOT}/etc:/etc/mediawiki/parsoid 
+
+
+      #- ${MWIKI_ROOT}/www:/var/www/html
+      
+      # After initial setup, download LocalSettings.php to the same directory as
+      # this yaml and uncomment the following line and use compose to restart
+      # the mediawiki service
+      #- ${MwIKI_ROOT}/LocalSettings.php:/var/www/html/LocalSettings.php
+      #- ${MWIKI_ROOT}/images:/var/www/html/images

+ 20 - 0
mywiki/www/docs/kss/scripts/kss-node-check.sh

@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+if command -v npm > /dev/null ; then
+  npm install
+else
+  # If npm isn't installed, but kss-node is, exit normally.
+  # This allows setting it up on one machine, and running it on
+  # another (e.g. Tools Labs execution nodes) that doesn't have npm
+  # installed.  However, "npm install" still needs to be run
+  # occasionally to keep kss updated.
+
+  KSS_NODE="${BASH_SOURCE%/*}/../node_modules/.bin/kss-node"
+  if ! [ -x "$KSS_NODE" ] ; then
+    echo "Neither kss-node nor npm are installed."
+    echo "To install npm, see http://nodejs.org/"
+    echo "When npm is installed, the Makefile can automatically"
+    echo "install kss-node."
+    exit 1
+  fi
+fi

+ 9 - 0
mywiki/www/extensions/CirrusSearch/maintenance/elasticsearch-scripts/count-cluster.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo index,codfw,eqiad,labsearch
+for i in `curl -s elastic2001.codfw.wmnet:9200/_cat/aliases?h=a | egrep '(_content|_general) *$'`; do
+	EQ_DOCS=`curl -s elastic1001.eqiad.wmnet:9200/$i/_count | jq .count`;
+	COD_DOCS=`curl -s elastic2001.codfw.wmnet:9200/$i/_count | jq .count`;
+	LS_DOCS=`curl -s nobelium.eqiad.wmnet:9200/$i/_count | jq .count`;
+	echo "$i,$COD_DOCS,$EQ_DOCS,$LS_DOCS";
+done

+ 93 - 0
mywiki/www/extensions/CirrusSearch/scripts/run-phan.sh

@@ -0,0 +1,93 @@
+#!/bin/bash
+
+MW_PREFIX="/vagrant/mediawiki"
+PHAN_DIR="/vagrant/srv/phan"
+CIRRUS="extensions/CirrusSearch/includes/ extensions/CirrusSearch/maintenance/ extensions/CirrusSearch/profiles"
+DEPS="extensions/Elastica/ extensions/BetaFeatures includes vendor/ maintenance/ languages/ extensions/CirrusSearch/vendor"
+PACKAGES="php7.0-cli php7.0-bz2 php7.0-dev php7.0-json php7.0-mbstring php7.0-curl php7.0-sqlite3 php7.0-xml php7.0-zip php7.0-mysql \
+          php5.6-cli php5.6-bz2 php5.6-dev php5.6-json php5.6-mbstring php5.6-curl php5.6-sqlite3 php5.6-xml php5.6-zip php5.6-mysql \
+          php-redis php-igbinary"
+
+set -e
+
+if [ ! -d /vagrant ]; then
+	echo "This script must be run inside a mediawiki vagrant box"
+	exit 1
+fi
+
+if [ ! -f /etc/apt/sources.list.d/ondrej-php-trusty.list ]; then
+	echo "Adding ppa:ondrej/php which contains php7"
+	# apt has an issue with onrej's name if utf-8 isn't used
+	export LC_ALL=en_US.UTF-8
+	export LANG=en_US.UTF-8
+	sudo add-apt-repository -y ppa:ondrej/php
+fi
+
+for i in $PACKAGES; do
+	PACKAGE_MATCHER="$PACKAGE_MATCHER|^$i\$"
+done
+PACKAGE_MATCHER="${PACKAGE_MATCHER:1}"
+
+if ! dpkg --get-selections | cut -d '	' -f 1 | egrep "$PACKAGE_MATCHER" > /dev/null; then
+	echo "Didn't find all required packages, installing..."
+	sudo apt-get update
+	sudo apt-get install -y $PACKAGES
+fi
+
+if ! which php5 > /dev/null; then
+	# Sadly the php7 packages also require installing a new version of php5, and
+	# it doesn't include a BC symlink from php5 -> php5.6. So lets just make one
+	sudo ln -s "$(which php5.6)" /usr/local/bin/php5
+fi
+
+if ! dpkg -s php-ast > /dev/null 2>&1; then
+	echo "Installing php-ast extension"
+	sudo apt-get install -y php-ast
+fi
+
+if [ ! -f /etc/php/7.0/cli/conf.d/20-ast.ini ]; then
+	# can't use phpenmod, it will also install a symlink for php5 which doesn't work
+	echo "Enabling usage of php-ast in php7"
+	sudo ln -s /etc/php/7.0/mods-available/ast.ini /etc/php/7.0/cli/conf.d/20-ast.ini
+fi
+
+if [ ! -d "$PHAN_DIR" ]; then
+	echo "Didn't find phan, cloning"
+	git clone https://github.com/etsy/phan.git "$PHAN_DIR"
+fi
+
+if [ ! -f "$PHAN_DIR/vendor/autoload.php" ]; then
+	echo "Installing phan dependencies"
+	pushd "$PHAN_DIR"
+	php7.0 $(which composer) install
+	popd
+	if [ ! -f "$PHAN_DIR/vendor/autoload.php" ]; then
+		echo "Failed initializing composer for phan"
+		exit 1
+	fi
+fi
+
+echo "Collecting files to run phan against..."
+for i in $CIRRUS; do
+  ALL_DIRS="$ALL_DIRS $MW_PREFIX/$i"
+done
+for i in $DEPS; do
+  SKIP_ANALYSIS="$SKIP_ANALYSIS,$MW_PREFIX/$i"
+  ALL_DIRS="$ALL_DIRS $MW_PREFIX/$i"
+done
+# Strip leading comma
+SKIP_ANALYSIS="${SKIP_ANALYSIS:1}"
+
+# Build list of files
+echo "Sourcing files from: $ALL_DIRS"
+PHAN_IN=/tmp/phan.in.$$
+find $ALL_DIRS -iname '*.php' > "$PHAN_IN"
+echo "/vagrant/mediawiki/extensions/CirrusSearch/scripts/phan.stubs.php" >> "$PHAN_IN"
+# Run phan
+echo "Running phan..."
+echo "Parsing but not analyzing: $SKIP_ANALYSIS"
+echo "Number of files to handle: " $(wc -l < "$PHAN_IN")
+php7.0 "$PHAN_DIR/phan" -f "$PHAN_IN" -3 "$SKIP_ANALYSIS" -o /tmp/phan.out -p
+rm "$PHAN_IN"
+echo
+echo "Done. Results are in /tmp/phan.out"

+ 11 - 0
mywiki/www/extensions/Maps/.gitignore

@@ -0,0 +1,11 @@
+*~
+*.kate-swp
+
+!.*
+.idea/
+
+vendor/
+extensions/
+
+composer.phar
+composer.lock

+ 12 - 0
mywiki/www/extensions/Maps/.scrutinizer.yml

@@ -0,0 +1,12 @@
+inherit: true
+
+tools:
+    external_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 45 - 0
mywiki/www/extensions/Maps/.travis.install.sh

@@ -0,0 +1,45 @@
+#! /bin/bash
+
+set -x
+
+originalDirectory=$(pwd)
+
+cd ..
+
+wget https://github.com/wikimedia/mediawiki-core/archive/$MW.tar.gz
+tar -zxf $MW.tar.gz
+mv mediawiki-$MW phase3
+
+cd phase3
+
+composer install --prefer-source
+
+if [ "$DB" == "postgres" ]
+then
+	psql -c 'create database its_a_mw;' -U postgres
+	php maintenance/install.php --dbtype $DBTYPE --dbuser postgres --dbname its_a_mw --pass nyan TravisWiki admin --scriptpath /TravisWiki
+else
+	mysql -e 'create database its_a_mw;'
+	php maintenance/install.php --dbtype $DBTYPE --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin --scriptpath /TravisWiki
+fi
+
+cd extensions
+
+cp -r $originalDirectory Maps
+
+cd Maps
+composer install --prefer-source
+
+[[ ! -z $SMW ]] && composer require "mediawiki/semantic-media-wiki=$SMW" --prefer-source
+
+cd ../..
+
+echo 'require_once( __DIR__ . "/extensions/Maps/Maps.php" );' >> LocalSettings.php
+
+echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php
+echo 'ini_set("display_errors", 1);' >> LocalSettings.php
+echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
+echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
+echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php
+
+php maintenance/update.php --quick

+ 28 - 0
mywiki/www/extensions/Maps/.travis.yml

@@ -0,0 +1,28 @@
+language: php
+
+sudo: false
+
+matrix:
+  include:
+    - env: DBTYPE=mysql; MW=1.27.1
+      php: 7
+    - env: DBTYPE=mysql; MW=master; SMW=2.4.1
+      php: 7
+    - env: DBTYPE=sqlite; MW=1.23.0; SMW=2.4.1
+      php: 5.5
+    - env: DBTYPE=mysql; MW=1.24.0
+      php: 5.5
+    - env: DBTYPE=sqlite; MW=master; TYPE=coverage
+      php: 5.6
+
+install:
+  - travis_retry composer self-update
+  - bash .travis.install.sh
+
+script: ../phase3/tests/phpunit/phpunit.php -c ../phase3/extensions/Maps/phpunit.xml.dist
+
+after_success:
+  - if [[ "$TYPE" != "coverage" ]]; then exit 0; fi
+  - ../phase3/tests/phpunit/phpunit.php -c ../phase3/extensions/Maps/phpunit.xml.dist --coverage-clover coverage.clover
+  - wget https://scrutinizer-ci.com/ocular.phar
+  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

+ 39 - 0
mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.eslintrc

@@ -0,0 +1,39 @@
+{
+  "rules": {
+    "camelcase": 2,
+    "quotes": [2, "single", "avoid-escape"],
+    "no-mixed-spaces-and-tabs": [2, "smart-tabs"],
+    "space-before-function-paren": 2,
+    "space-in-parens": 2,
+    "object-curly-spacing": 2,
+    "array-bracket-spacing": 2,
+    "computed-property-spacing": 2,
+    "space-before-blocks": 2,
+    "keyword-spacing": 2,
+    "no-lonely-if": 2,
+    "comma-style": 2,
+    "no-underscore-dangle": 0,
+    "no-constant-condition": 0,
+    "no-multi-spaces": 0,
+    "strict": 0,
+    "key-spacing": 0,
+    "no-shadow": 0,
+    "no-unused-vars": 2,
+    "eqeqeq": 2
+  },
+  "globals": {
+    "L": true,
+    "module": false,
+    "define": false,
+    "require": true
+  },
+  "plugins": [
+    "html"
+  ],
+  "settings": {
+    "html/report-bad-indent": 2
+  },
+  "env": {
+    "browser": true
+  }
+}

+ 1 - 0
mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.gitignore

@@ -0,0 +1 @@
+leaflet-providers.min.js

+ 8 - 0
mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.mversionrc

@@ -0,0 +1,8 @@
+{
+  "commitMessage": "Bumped version to %s",
+  "tagName": "%s",
+  "scripts": {
+  	"preupdate": "npm run min",
+  	"postupdate": "git push && git push --tags && npm publish"
+  }
+}

+ 8 - 0
mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet-providers/.travis.yml

@@ -0,0 +1,8 @@
+---
+language: node_js
+node_js:
+  - "0.10"
+notifications:
+   email: false
+git:
+  depth: 10

+ 12 - 0
mywiki/www/extensions/Maps/includes/services/Leaflet/leaflet.fullscreen/.jshintrc

@@ -0,0 +1,12 @@
+{
+	"browser": true,
+	"curly": true,
+	"eqeqeq": true,
+	"undef": true,
+	"quotmark": "single",
+	"trailing": true,
+	"globals": {
+		"L": true,
+		"jQuery": true
+	}
+}

+ 10 - 0
mywiki/www/extensions/Validator/.gitignore

@@ -0,0 +1,10 @@
+*~
+*.kate-swp
+
+!.*
+.idea
+
+composer.phar
+composer.lock
+
+vendor/

+ 12 - 0
mywiki/www/extensions/Validator/.scrutinizer.yml

@@ -0,0 +1,12 @@
+inherit: true
+
+tools:
+    external_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 20 - 0
mywiki/www/extensions/Validator/.travis.yml

@@ -0,0 +1,20 @@
+language: php
+
+matrix:
+  include:
+    - env: DBTYPE=mysql; MW=master
+      php: 5.6
+    - env: DBTYPE=mysql; MW=1.21.0
+      php: 5.5
+    - env: DBTYPE=sqlite; MW=1.22.0
+      php: 5.6
+    - env: DBTYPE=sqlite; MW=master; TYPE=coverage
+      php: 7
+
+before_script: bash ./build/travis/before_script.sh
+
+script: bash ./build/travis/script.sh
+
+after_success: bash ./build/travis/after_success.sh
+
+sudo: false

+ 14 - 0
mywiki/www/extensions/Validator/build/travis/after_success.sh

@@ -0,0 +1,14 @@
+#! /bin/bash
+
+set -x
+
+originalDirectory=$(pwd)
+
+if [ "$TYPE" == "coverage" ]
+then
+	wget https://scrutinizer-ci.com/ocular.phar
+	du -hs $originalDirectory/build/coverage.clover
+	ls -lap $originalDirectory
+	ls -lap $originalDirectory/build
+	php ocular.phar code-coverage:upload --format=php-clover $originalDirectory/build/coverage.clover
+fi

+ 39 - 0
mywiki/www/extensions/Validator/build/travis/before_script.sh

@@ -0,0 +1,39 @@
+#! /bin/bash
+
+set -x
+
+originalDirectory=$(pwd)
+
+cd ..
+
+wget https://github.com/wikimedia/mediawiki-core/archive/$MW.tar.gz
+tar -zxf $MW.tar.gz
+mv mediawiki-$MW phase3
+
+cd phase3
+
+composer self-update
+composer install --prefer-source
+
+mysql -e 'create database its_a_mw;'
+php maintenance/install.php --dbtype $DBTYPE --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin
+
+cd extensions
+
+cp -r $originalDirectory Validator
+
+cd Validator
+composer install --prefer-source
+composer require 'phpunit/phpunit=3.7.*' --prefer-source
+
+cd ../..
+
+echo 'require_once( __DIR__ . "/extensions/Validator/Validator.php" );' >> LocalSettings.php
+
+echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php
+echo 'ini_set("display_errors", 1);' >> LocalSettings.php
+echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
+echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
+echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php
+
+php maintenance/update.php --quick

+ 14 - 0
mywiki/www/extensions/Validator/build/travis/script.sh

@@ -0,0 +1,14 @@
+#! /bin/bash
+
+set -x
+
+originalDirectory=$(pwd)
+
+cd ../phase3/tests/phpunit
+
+if [ "$TYPE" == "coverage" ]
+then
+	php phpunit.php --group Validator -c ../../extensions/Validator/phpunit.xml.dist --coverage-clover $originalDirectory/build/coverage.clover
+else
+	php phpunit.php --group Validator -c ../../extensions/Validator/phpunit.xml.dist
+fi

+ 55 - 0
mywiki/www/extensions/VisualEditor/bin/listRecentCommits.sh

@@ -0,0 +1,55 @@
+#!/bin/bash -eu
+
+# This script generates a structured git log of commits to the VisualEditor-MediaWiki repository,
+# and walks the submodule updates to the lib/ve submodule and the OOjs and OOjs UI pull-through
+# build commits to detail all changes since a given branch point.
+
+# Using `git branch -a | grep wmf | sort -V` to automatically pick the latest branch version would
+# be nice here, but doesn't work because Mac OS X's version of sort is too old.
+
+# cd to the VisualEditor directory
+cd $(cd $(dirname $0)/..; pwd)
+
+# Ensure input is correct
+if [ -z "${1:-}" ]
+then
+	echo >&2 "Usage: listRecentCommits.sh <startBranch>"
+	exit 1
+fi
+STARTHASH=`git rev-parse $1`
+if [ "$?" -ne "0" ]
+then
+	echo >&2 "Parameter is not a valid git branch"
+	exit 1
+fi
+
+echo "Listing changes since '$1' (hash: $STARTHASH)"
+echo ""
+
+LOCALCHANGES=`git log $1.. --oneline --no-merges --reverse --color=never |
+	egrep --color=never -v '(translatewiki|BrowserTest)'`
+
+# Iterate over lines matching "Update VE core submodule"
+while read -r CHANGE
+do
+	printf "$CHANGE\n"
+
+	if [[ $CHANGE == *"Update VE core submodule"* ]]
+	then
+		CHANGEHASH=`cut -f1 -d' ' <<< $CHANGE`
+
+		SUBCHANGES=`git log --format=%B -n1 $CHANGEHASH -- |
+			sed -n -e '/New changes/,/^$/p' |
+			tail -n +2 |
+			sed -e '$ d' |
+			grep --color=never -v 'translatewiki'`
+		while read -r SUBCHANGE
+		do
+			printf "\t$SUBCHANGE\n"
+		done <<< "$SUBCHANGES"
+
+		# Extra new-line between sub-module pulls for clarity
+		printf "\n"
+	fi
+done <<< "$LOCALCHANGES"
+exit

+ 23 - 0
mywiki/www/extensions/VisualEditor/bin/pre-commit.sh

@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+# If the VE core sub-module was touched
+if git diff --quiet --cached lib/ve; then
+
+    GITBRANCH=`git rev-parse --abbrev-ref HEAD`;
+
+    # … and it doesn't look like
+    if [[ $GITBRANCH != "sync-repos" ]]; then
+        echo "VE core sub-module was touched but commit isn't from 'sync-repos'.";
+        exit 1;
+    fi
+
+fi
+
+# Stash any uncommited changes
+git stash -q --keep-index
+
+npm install || git stash pop -q && exit 1
+npm test && git add -u .docs/* || git stash pop -q && exit 1
+
+# Re-apply any uncommited changes
+git stash pop -q

+ 68 - 0
mywiki/www/extensions/VisualEditor/bin/updateSubmodule.sh

@@ -0,0 +1,68 @@
+#!/bin/bash -eu
+
+# This script generates a commit that updates the lib/ve submodule
+# ./bin/updateSubmodule.sh        updates to master
+# ./bin/updateSubmodule.sh hash   updates to specified hash
+
+# cd to the VisualEditor directory
+cd $(cd $(dirname $0)/..; pwd)
+
+# Check that both working directories are clean
+if git status -uno --ignore-submodules | grep -i changes > /dev/null
+then
+	echo >&2 "Working directory must be clean"
+	exit 1
+fi
+cd lib/ve
+if git status -uno --ignore-submodules | grep -i changes > /dev/null
+then
+	echo >&2 "lib/ve working directory must be clean"
+	exit 1
+fi
+cd ../..
+
+git fetch origin
+# Create sync-repos branch if needed and reset it to master
+git checkout -B sync-repos origin/master
+git submodule update
+cd lib/ve
+git fetch origin
+
+# Figure out what to set the submodule to
+if [ -n "${1:-}" ]
+then
+	TARGET="$1"
+	TARGETDESC="$1"
+else
+	TARGET=origin/master
+	TARGETDESC="master ($(git rev-parse --short origin/master))"
+fi
+
+# Generate commit summary
+# TODO recurse
+NEWCHANGES=$(git log ..$TARGET --oneline --no-merges --reverse --color=never)
+NEWCHANGESDISPLAY=$(git log ..$TARGET --oneline --no-merges --reverse --color=always)
+COMMITMSG=$(cat <<END
+Update VE core submodule to $TARGETDESC
+
+New changes:
+$NEWCHANGES
+END
+)
+# Check out master of VE core
+git checkout $TARGET
+
+# Commit
+cd ../..
+git commit lib/ve -m "$COMMITMSG" > /dev/null
+if [ "$?" == "1" ]
+then
+	echo >&2 "No changes"
+else
+	cat >&2 <<END
+
+
+Created commit with changes:
+$NEWCHANGESDISPLAY
+END
+fi

+ 41 - 0
mywiki/www/extensions/VisualEditor/lib/ve/bin/sync-gh-pages.sh

@@ -0,0 +1,41 @@
+#!/bin/bash -eu
+
+# This script builds a new gh-pages branch from latest master
+
+cd "$(dirname $0)/.."
+git fetch origin
+git checkout -B gh-pages origin/master
+git reset --hard origin/master
+
+git clean -dffx
+# Run npm-install to fetch qunitjs and build dist/
+npm install
+
+html='<!DOCTYPE html>
+<meta charset="utf-8">
+<title>VisualEditor</title>
+<link rel=stylesheet href="lib/oojs-ui/oojs-ui-apex.css">
+<link rel=stylesheet href="demos/ve/demo.css">
+<style>
+	article {
+		margin: 1em auto;
+		width: 45em;
+		max-width: 80%;
+		text-align: center;
+	}
+	article img {
+		max-width: 100%;
+	}
+</style>
+<article>
+	<img src="demos/ve/VisualEditor-logo.svg" alt="VisualEditor logo">
+	<div class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-buttonWidget"><a role="button" href="demos/ve/desktop-dist.html" tabindex="0" class="oo-ui-buttonElement-button"><span class="oo-ui-labelElement-label">Demo</span></a></div></a>
+	<div class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-buttonWidget"><a role="button" href="tests/" tabindex="0" class="oo-ui-buttonElement-button"><span class="oo-ui-labelElement-label">Test suite</span></a></div>
+</article>'
+echo "$html" > index.html
+
+git add index.html
+git add -f node_modules/qunitjs dist/
+
+git commit -m "Create gh-pages branch"
+git push origin -f HEAD

+ 63 - 0
mywiki/www/extensions/VisualEditor/lib/ve/bin/update-oojs-ui.sh

@@ -0,0 +1,63 @@
+#!/bin/bash -eu
+
+# This script generates a commit that updates our copy of OOjs UI
+
+if [ -n "${2:-}" ]
+then
+	# Too many parameters
+	echo >&2 "Usage: $0 [<version>]"
+	exit 1
+fi
+
+REPO_DIR=$(cd "$(dirname $0)/.."; pwd) # Root dir of the git repo working tree
+TARGET_DIR="lib/oojs-ui" # Destination relative to the root of the repo
+NPM_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-oojs-ui') # e.g. /tmp/update-oojs-ui.rI0I5Vir
+
+# Prepare working tree
+cd "$REPO_DIR"
+git reset -- $TARGET_DIR
+git checkout -- $TARGET_DIR
+git fetch origin
+git checkout -B upstream-oojs-ui origin/master
+
+# Fetch upstream version
+cd $NPM_DIR
+if [ -n "${1:-}" ]
+then
+	npm install "oojs-ui@$1"
+else
+	npm install oojs-ui
+fi
+
+OOJSUI_VERSION=$(node -e 'console.log(require("./node_modules/oojs-ui/package.json").version);')
+if [ "$OOJSUI_VERSION" == "" ]
+then
+	echo 'Could not find OOjs UI version'
+	exit 1
+fi
+
+# Copy files
+# - Exclude the minimised distribution files
+# - Support: IE9
+#   VE requires SVG support, but IE9 doesn't support the CSS background fallback
+#   so ends up using the PNGs. Otherwise they would not be required.
+rsync --force --recursive --delete --exclude 'oojs-ui*.min.*' --exclude 'oojs-ui.js' ./node_modules/oojs-ui/dist/ "$REPO_DIR/$TARGET_DIR"
+
+# Clean up temporary area
+rm -rf "$NPM_DIR"
+
+# Generate commit
+cd $REPO_DIR
+
+COMMITMSG=$(cat <<END
+Update OOjs UI to v$OOJSUI_VERSION
+
+Release notes:
+ https://git.wikimedia.org/blob/oojs%2Fui.git/v$OOJSUI_VERSION/History.md
+END
+)
+
+# Stage deletion, modification and creation of files. Then commit.
+git add --update $TARGET_DIR
+git add $TARGET_DIR
+git commit -m "$COMMITMSG"

+ 59 - 0
mywiki/www/extensions/VisualEditor/lib/ve/bin/update-oojs.sh

@@ -0,0 +1,59 @@
+#!/bin/bash -eu
+
+# This script generates a commit that updates our copy of OOjs
+
+if [ -n "${2:-}" ]
+then
+	# Too many parameters
+	echo >&2 "Usage: $0 [<version>]"
+	exit 1
+fi
+
+REPO_DIR=$(cd "$(dirname $0)/.."; pwd) # Root dir of the git repo working tree
+TARGET_DIR="lib/oojs" # Destination relative to the root of the repo
+NPM_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-oojs') # e.g. /tmp/update-oojs.rI0I5Vir
+
+# Prepare working tree
+cd "$REPO_DIR"
+git reset -- $TARGET_DIR
+git checkout -- $TARGET_DIR
+git fetch origin
+git checkout -B upstream-oojs origin/master
+
+# Fetch upstream version
+cd $NPM_DIR
+if [ -n "${1:-}" ]
+then
+	npm install "oojs@$1"
+else
+	npm install oojs
+fi
+
+OOJS_VERSION=$(node -e 'console.log(require("./node_modules/oojs/package.json").version);')
+if [ "$OOJS_VERSION" == "" ]
+then
+	echo 'Could not find OOjs version'
+	exit 1
+fi
+
+# Copy file(s)
+rsync --force ./node_modules/oojs/dist/oojs.jquery.js "$REPO_DIR/$TARGET_DIR"
+
+# Clean up temporary area
+rm -rf "$NPM_DIR"
+
+# Generate commit
+cd $REPO_DIR
+
+COMMITMSG=$(cat <<END
+Update OOjs to v$OOJS_VERSION
+
+Release notes:
+ https://git.wikimedia.org/blob/oojs%2Fcore.git/v$OOJS_VERSION/History.md
+END
+)
+
+# Stage deletion, modification and creation of files. Then commit.
+git add --update $TARGET_DIR
+git add $TARGET_DIR
+git commit -m "$COMMITMSG"

+ 59 - 0
mywiki/www/extensions/VisualEditor/lib/ve/bin/update-unicodejs.sh

@@ -0,0 +1,59 @@
+#!/bin/bash -eu
+
+# This script generates a commit that updates our copy of UnicodeJS
+
+if [ -n "${2:-}" ]
+then
+	# Too many parameters
+	echo >&2 "Usage: $0 [<version>]"
+	exit 1
+fi
+
+REPO_DIR=$(cd "$(dirname $0)/.."; pwd) # Root dir of the git repo working tree
+TARGET_DIR="lib/unicodejs" # Destination relative to the root of the repo
+NPM_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-unicodejs') # e.g. /tmp/update-unicodejs.rI0I5Vir
+
+# Prepare working tree
+cd "$REPO_DIR"
+git reset -- $TARGET_DIR
+git checkout -- $TARGET_DIR
+git fetch origin
+git checkout -B upstream-unicodejs origin/master
+
+# Fetch upstream version
+cd $NPM_DIR
+if [ -n "${1:-}" ]
+then
+	npm install "unicodejs@$1"
+else
+	npm install unicodejs
+fi
+
+UNICODEJS_VERSION=$(node -e 'console.log(require("./node_modules/unicodejs/package.json").version);')
+if [ "$UNICODEJS_VERSION" == "" ]
+then
+	echo 'Could not find UnicodeJS version'
+	exit 1
+fi
+
+# Copy file(s)
+rsync --force ./node_modules/unicodejs/dist/unicodejs.js "$REPO_DIR/$TARGET_DIR"
+
+# Clean up temporary area
+rm -rf "$NPM_DIR"
+
+# Generate commit
+cd $REPO_DIR
+
+COMMITMSG=$(cat <<END
+Update UnicodeJS to v$UNICODEJS_VERSION
+
+Release notes:
+ https://git.wikimedia.org/blob/unicodejs.git/v$UNICODEJS_VERSION/History.md
+END
+)
+
+# Stage deletion, modification and creation of files. Then commit.
+git add --update $TARGET_DIR
+git add $TARGET_DIR
+git commit -m "$COMMITMSG"

+ 122 - 0
mywiki/www/includes/limit.sh

@@ -0,0 +1,122 @@
+#!/bin/bash
+#
+# Resource limiting wrapper for command execution
+#
+# Why is this in shell script? Because bash has a setrlimit() wrapper
+# and is available on most Linux systems. If Perl was distributed with
+# BSD::Resource included, we would happily use that instead, but it isn't.
+
+# Clean up cgroup
+cleanup() {
+	# First we have to move the current task into a "garbage" group, otherwise
+	# the cgroup will not be empty, and attempting to remove it will fail with
+	# "Device or resource busy"
+	if [ -w "$MW_CGROUP"/tasks ]; then
+		GARBAGE="$MW_CGROUP"
+	else
+		GARBAGE="$MW_CGROUP"/garbage-`id -un`
+		if [ ! -e "$GARBAGE" ]; then
+			mkdir -m 0700 "$GARBAGE"
+		fi
+	fi
+	echo $BASHPID > "$GARBAGE"/tasks
+
+	# Suppress errors in case the cgroup has disappeared due to a release script
+	rmdir "$MW_CGROUP"/$$ 2>/dev/null
+}
+
+updateTaskCount() {
+	# There are lots of ways to count lines in a file in shell script, but this
+	# is one of the few that doesn't create another process, which would
+	# increase the returned number of tasks.
+	readarray < "$MW_CGROUP"/$$/tasks
+	NUM_TASKS=${#MAPFILE[*]}
+}
+
+log() {
+	echo limit.sh: "$*" >&3
+	echo limit.sh: "$*" >&2
+}
+
+MW_INCLUDE_STDERR=
+MW_USE_LOG_PIPE=
+MW_CPU_LIMIT=0
+MW_CGROUP=
+MW_MEM_LIMIT=0
+MW_FILE_SIZE_LIMIT=0
+MW_WALL_CLOCK_LIMIT=0
+
+# Override settings
+eval "$2"
+
+if [ -n "$MW_INCLUDE_STDERR" ]; then
+	exec 2>&1
+fi
+if [ -z "$MW_USE_LOG_PIPE" ]; then
+	# Open a dummy log FD
+	exec 3>/dev/null
+fi
+
+if [ "$MW_CPU_LIMIT" -gt 0 ]; then
+	ulimit -t "$MW_CPU_LIMIT"
+fi
+if [ "$MW_MEM_LIMIT" -gt 0 ]; then
+	if [ -n "$MW_CGROUP" ]; then
+		# Create cgroup
+		if ! mkdir -m 0700 "$MW_CGROUP"/$$; then
+			log "failed to create the cgroup."
+			MW_CGROUP=""
+		fi
+	fi
+	if [ -n "$MW_CGROUP" ]; then
+		echo $$ > "$MW_CGROUP"/$$/tasks
+		if [ -n "$MW_CGROUP_NOTIFY" ]; then
+			echo "1" > "$MW_CGROUP"/$$/notify_on_release
+		fi
+		# Memory
+		echo $(($MW_MEM_LIMIT*1024)) > "$MW_CGROUP"/$$/memory.limit_in_bytes
+		# Memory+swap
+		# This will be missing if there is no swap
+		if [ -e "$MW_CGROUP"/$$/memory.memsw.limit_in_bytes ]; then
+			echo $(($MW_MEM_LIMIT*1024)) > "$MW_CGROUP"/$$/memory.memsw.limit_in_bytes
+		fi
+	else
+		ulimit -v "$MW_MEM_LIMIT"
+	fi
+else
+	MW_CGROUP=""
+fi
+if [ "$MW_FILE_SIZE_LIMIT" -gt 0 ]; then
+	ulimit -f "$MW_FILE_SIZE_LIMIT"
+fi
+if [ "$MW_WALL_CLOCK_LIMIT" -gt 0 -a -x "/usr/bin/timeout" ]; then
+	/usr/bin/timeout $MW_WALL_CLOCK_LIMIT /bin/bash -c "$1" 3>&-
+	STATUS="$?"
+	if [ "$STATUS" == 124 ]; then
+		log "timed out executing command \"$1\""
+	fi
+else
+	eval "$1" 3>&-
+	STATUS="$?"
+fi
+
+if [ -n "$MW_CGROUP" ]; then
+	updateTaskCount
+
+	if [ $NUM_TASKS -gt 1 ]; then
+		# Spawn a monitor process which will continue to poll for completion
+		# of all processes in the cgroup after termination of the parent shell
+		(
+			while [ $NUM_TASKS -gt 1 ]; do
+				sleep 10
+				updateTaskCount
+			done
+			cleanup
+		) >&/dev/null < /dev/null 3>&- &
+		disown -a
+	else
+		cleanup
+	fi
+fi
+exit "$STATUS"
+

+ 14 - 0
mywiki/www/maintenance/dev/includes/php.sh

@@ -0,0 +1,14 @@
+# Include-able script to determine the location of our php if any
+# We search for a environment var called PHP, native php,
+# a local copy, home directory location used by installphp.sh
+# and previous home directory location
+# The binary path is returned in $PHP if any
+
+for binary in $PHP $(which php || true) "$DEV/php/bin/php" "$HOME/.mediawiki/php/bin/php" "$HOME/.mwphp/bin/php" ]; do
+	if [ -x "$binary" ]; then
+		if "$binary" -r 'exit((int)!version_compare(PHP_VERSION, "5.4", ">="));'; then
+			PHP="$binary"
+			break
+		fi
+	fi
+done

+ 8 - 0
mywiki/www/maintenance/dev/includes/require-php.sh

@@ -0,0 +1,8 @@
+# Include-able script to require that we have a known php binary we can execute
+
+. "$DEV/includes/php.sh"
+
+if [ "x$PHP" == "x" -o ! -x "$PHP" ]; then
+	echo "Local copy of PHP is not installed"
+	exit 1
+fi

+ 8 - 0
mywiki/www/maintenance/dev/install.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+"$DEV/installphp.sh"
+"$DEV/installmw.sh"
+"$DEV/start.sh"

+ 18 - 0
mywiki/www/maintenance/dev/installmw.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+. "$DEV/includes/require-php.sh"
+
+set -e
+
+PORT=4881
+
+cd "$DEV/../../"; # $IP
+
+mkdir -p "$DEV/data"
+"$PHP" maintenance/install.php --server="http://localhost:$PORT" --scriptpath="" --dbtype=sqlite --dbpath="$DEV/data" --pass=admin "Trunk Test" "$USER"
+echo ""
+echo "Development wiki created with admin user $USER and password 'admin'."
+echo ""

+ 57 - 0
mywiki/www/maintenance/dev/installphp.sh

@@ -0,0 +1,57 @@
+#!/bin/bash
+
+if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+set -e # DO NOT USE PIPES unless this is rewritten
+
+. "$DEV/includes/php.sh"
+
+if [ "x$PHP" != "x" -a -x "$PHP" ]; then
+	echo "PHP is already installed"
+	exit 0
+fi
+
+TAR=php5.4-latest.tar.gz
+PHPURL="http://snaps.php.net/$TAR"
+
+cd "$DEV"
+
+echo "Preparing to download and install a local copy of PHP 5.4, note that this can take some time to do."
+echo "If you wish to avoid re-doing this for uture dev installations of MediaWiki we suggest installing php in ~/.mediawiki/php"
+echo -n "Install PHP in ~/.mediawiki/php [y/N]: "
+read INSTALLINHOME
+
+case "$INSTALLINHOME" in
+	[Yy] | [Yy][Ee][Ss] )
+		PREFIX="$HOME/.mediawiki/php"
+		;;
+	*)
+		PREFIX="$DEV/php/"
+		;;
+esac
+
+# Some debain-like systems bundle wget but not curl, some other systems
+# like os x bundle curl but not wget... use whatever is available
+echo -n "Downloading PHP 5.4"
+if command -v wget &>/dev/null; then
+	echo "- using wget"
+	wget "$PHPURL"
+elif command -v curl &>/dev/null; then
+	echo "- using curl"
+	curl -O "$PHPURL"
+else
+	echo "- aborting"
+	echo "Could not find curl or wget." >&2;
+	exit 1;
+fi
+
+echo "Extracting php 5.4"
+tar -xzf "$TAR"
+
+cd php5.4-*/
+
+echo "Configuring and installing php 5.4 in $PREFIX"
+./configure --prefix="$PREFIX"
+make
+make install

+ 14 - 0
mywiki/www/maintenance/dev/start.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [ "x$BASH_SOURCE" == "x" ]; then echo '$BASH_SOURCE not set'; exit 1; fi
+DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
+
+. "$DEV/includes/require-php.sh"
+
+PORT=4881
+
+echo "Starting up MediaWiki at http://localhost:$PORT/"
+echo ""
+
+cd "$DEV/../../"; # $IP
+"$PHP" -S "localhost:$PORT" "$DEV/includes/router.php"

+ 84 - 0
mywiki/www/maintenance/resources/update-oojs-ui.sh

@@ -0,0 +1,84 @@
+#!/bin/bash -eu
+
+# This script generates a commit that updates our copy of OOjs UI
+
+if [ -n "${2:-}" ]
+then
+	# Too many parameters
+	echo >&2 "Usage: $0 [<version>]"
+	exit 1
+fi
+
+REPO_DIR=$(cd "$(dirname $0)/../.."; pwd) # Root dir of the git repo working tree
+TARGET_DIR="resources/lib/oojs-ui" # Destination relative to the root of the repo
+NPM_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-oojs-ui') # e.g. /tmp/update-oojs-ui.rI0I5Vir
+
+# Prepare working tree
+cd "$REPO_DIR"
+git reset composer.json
+git checkout composer.json
+git reset -- $TARGET_DIR
+git checkout -- $TARGET_DIR
+git fetch origin
+git checkout -B upstream-oojs-ui origin/master
+
+# Fetch upstream version
+cd $NPM_DIR
+if [ -n "${1:-}" ]
+then
+	npm install "oojs-ui@$1"
+else
+	npm install oojs-ui
+fi
+
+OOJSUI_VERSION=$(node -e 'console.log(require("./node_modules/oojs-ui/package.json").version);')
+if [ "$OOJSUI_VERSION" == "" ]
+then
+	echo 'Could not find OOjs UI version'
+	exit 1
+fi
+
+# Copy files, picking the necessary ones from source and distribution
+rm -r "$REPO_DIR/$TARGET_DIR"
+mkdir -p "$REPO_DIR/$TARGET_DIR/i18n"
+mkdir -p "$REPO_DIR/$TARGET_DIR/images"
+mkdir -p "$REPO_DIR/$TARGET_DIR/themes/mediawiki/images"
+mkdir -p "$REPO_DIR/$TARGET_DIR/themes/apex/images"
+cp ./node_modules/oojs-ui/dist/oojs-ui-core.js "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-core-{mediawiki,apex}.css "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-widgets.js "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-widgets-{mediawiki,apex}.css "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-toolbars.js "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-toolbars-{mediawiki,apex}.css "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-windows.js "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-windows-{mediawiki,apex}.css "$REPO_DIR/$TARGET_DIR"
+cp ./node_modules/oojs-ui/dist/oojs-ui-{mediawiki,apex}.js "$REPO_DIR/$TARGET_DIR"
+cp -R ./node_modules/oojs-ui/dist/i18n "$REPO_DIR/$TARGET_DIR"
+cp -R ./node_modules/oojs-ui/dist/images "$REPO_DIR/$TARGET_DIR"
+cp -R ./node_modules/oojs-ui/dist/themes/mediawiki/images "$REPO_DIR/$TARGET_DIR/themes/mediawiki"
+cp ./node_modules/oojs-ui/src/themes/mediawiki/*.json "$REPO_DIR/$TARGET_DIR/themes/mediawiki"
+cp -R ./node_modules/oojs-ui/dist/themes/apex/images "$REPO_DIR/$TARGET_DIR/themes/apex"
+cp ./node_modules/oojs-ui/src/themes/apex/*.json "$REPO_DIR/$TARGET_DIR/themes/apex"
+
+# Clean up temporary area
+rm -rf "$NPM_DIR"
+
+# Generate commit
+cd $REPO_DIR
+
+COMMITMSG=$(cat <<END
+Update OOjs UI to v$OOJSUI_VERSION
+
+Release notes:
+ https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v$OOJSUI_VERSION
+END
+)
+
+# Update composer.json as well
+composer require oojs/oojs-ui $OOJSUI_VERSION --no-update
+
+# Stage deletion, modification and creation of files. Then commit.
+git add --update $TARGET_DIR
+git add $TARGET_DIR
+git add composer.json
+git commit -m "$COMMITMSG"

+ 59 - 0
mywiki/www/maintenance/resources/update-oojs.sh

@@ -0,0 +1,59 @@
+#!/bin/bash -eu
+
+# This script generates a commit that updates our copy of OOjs
+
+if [ -n "${2:-}" ]
+then
+	# Too many parameters
+	echo >&2 "Usage: $0 [<version>]"
+	exit 1
+fi
+
+REPO_DIR=$(cd "$(dirname $0)/../.."; pwd) # Root dir of the git repo working tree
+TARGET_DIR="resources/lib/oojs" # Destination relative to the root of the repo
+NPM_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-oojs') # e.g. /tmp/update-oojs.rI0I5Vir
+
+# Prepare working tree
+cd "$REPO_DIR"
+git reset -- $TARGET_DIR
+git checkout -- $TARGET_DIR
+git fetch origin
+git checkout -B upstream-oojs origin/master
+
+# Fetch upstream version
+cd $NPM_DIR
+if [ -n "${1:-}" ]
+then
+	npm install "oojs@$1"
+else
+	npm install oojs
+fi
+
+OOJS_VERSION=$(node -e 'console.log(require("./node_modules/oojs/package.json").version);')
+if [ "$OOJS_VERSION" == "" ]
+then
+	echo 'Could not find OOjs version'
+	exit 1
+fi
+
+# Copy file(s)
+rsync --force ./node_modules/oojs/dist/oojs.jquery.js "$REPO_DIR/$TARGET_DIR"
+
+# Clean up temporary area
+rm -rf "$NPM_DIR"
+
+# Generate commit
+cd $REPO_DIR
+
+COMMITMSG=$(cat <<END
+Update OOjs to v$OOJS_VERSION
+
+Release notes:
+ https://phabricator.wikimedia.org/diffusion/GOJS/browse/master/History.md;v$OOJS_VERSION
+END
+)
+
+# Stage deletion, modification and creation of files. Then commit.
+git add --update $TARGET_DIR
+git add $TARGET_DIR
+git commit -m "$COMMITMSG"

+ 1 - 0
mywiki/www/vendor/composer/installers

@@ -0,0 +1 @@
+Subproject commit d78064c68299743e0161004f2de3a0204e33b804

+ 12 - 0
mywiki/www/vendor/data-values/common/.gitignore

@@ -0,0 +1,12 @@
+*~
+*.kate-swp
+*.swp
+
+!.*
+
+.idea/
+build/
+vendor/
+
+composer.phar
+composer.lock

+ 13 - 0
mywiki/www/vendor/data-values/common/.scrutinizer.yml

@@ -0,0 +1,13 @@
+build: true
+inherit: true
+
+tools:
+    php_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 15 - 0
mywiki/www/vendor/data-values/common/.travis.yml

@@ -0,0 +1,15 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - 7
+  - hhvm
+
+before_script:
+  - travis_retry composer install --prefer-source
+
+script:
+  - composer ci

+ 12 - 0
mywiki/www/vendor/data-values/data-values/.gitignore

@@ -0,0 +1,12 @@
+*~
+*.kate-swp
+*.swp
+
+!.*
+
+.idea/
+build/
+vendor/
+
+composer.phar
+composer.lock

+ 13 - 0
mywiki/www/vendor/data-values/data-values/.scrutinizer.yml

@@ -0,0 +1,13 @@
+build: true
+inherit: true
+
+tools:
+    php_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 14 - 0
mywiki/www/vendor/data-values/data-values/.travis.yml

@@ -0,0 +1,14 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - hhvm
+
+before_script:
+  - composer install --prefer-source
+
+script:
+  - phpunit

+ 12 - 0
mywiki/www/vendor/data-values/geo/.gitignore

@@ -0,0 +1,12 @@
+*~
+*.kate-swp
+*.swp
+
+!.*
+
+.idea/
+build/
+vendor/
+
+composer.phar
+composer.lock

+ 13 - 0
mywiki/www/vendor/data-values/geo/.scrutinizer.yml

@@ -0,0 +1,13 @@
+build: true
+inherit: true
+
+tools:
+    php_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 26 - 0
mywiki/www/vendor/data-values/geo/.travis.yml

@@ -0,0 +1,26 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - 7.0
+  - 7.1
+  - hhvm
+
+before_script:
+  - composer install --prefer-source
+
+script:
+  - phpunit
+
+after_success:
+  - if [[ "`phpenv version-name`" != "7.0" ]]; then exit 0; fi
+  - vendor/bin/phpunit --coverage-clover coverage.clover
+  - wget https://scrutinizer-ci.com/ocular.phar
+  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
+
+cache:
+  directories:
+    - $HOME/.composer/cache

+ 12 - 0
mywiki/www/vendor/data-values/interfaces/.gitignore

@@ -0,0 +1,12 @@
+*~
+*.kate-swp
+*.swp
+
+!.*
+
+.idea/
+build/
+vendor/
+
+composer.phar
+composer.lock

+ 13 - 0
mywiki/www/vendor/data-values/interfaces/.scrutinizer.yml

@@ -0,0 +1,13 @@
+build: true
+inherit: true
+
+tools:
+    php_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 19 - 0
mywiki/www/vendor/data-values/interfaces/.travis.yml

@@ -0,0 +1,19 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - 7
+  - hhvm
+
+before_script:
+  - composer install --prefer-source
+
+script:
+  - phpunit
+
+cache:
+  directories:
+    - $HOME/.composer/cache

+ 12 - 0
mywiki/www/vendor/data-values/validators/.gitignore

@@ -0,0 +1,12 @@
+*~
+*.kate-swp
+*.swp
+
+!.*
+
+.idea/
+build/
+vendor/
+
+composer.phar
+composer.lock

+ 13 - 0
mywiki/www/vendor/data-values/validators/.scrutinizer.yml

@@ -0,0 +1,13 @@
+build: true
+inherit: true
+
+tools:
+    php_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 14 - 0
mywiki/www/vendor/data-values/validators/.travis.yml

@@ -0,0 +1,14 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - hhvm
+
+before_script:
+  - composer install --prefer-source
+
+script:
+  - phpunit

+ 14 - 0
mywiki/www/vendor/doctrine/instantiator/.travis.install.sh

@@ -0,0 +1,14 @@
+#!/bin/sh
+set -x
+if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] || [ "$TRAVIS_PHP_VERSION" = 'hhvm-nightly' ] ; then
+    curl -sS https://getcomposer.org/installer > composer-installer.php
+    hhvm composer-installer.php
+    hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar update --prefer-source
+elif [ "$TRAVIS_PHP_VERSION" = '5.3.3' ] ; then
+    composer self-update
+    composer update --prefer-source --no-dev
+    composer dump-autoload
+else
+    composer self-update
+    composer update --prefer-source
+fi

+ 38 - 0
mywiki/www/vendor/firebase/php-jwt/run-tests.sh

@@ -0,0 +1,38 @@
+
+#!/usr/bin/env bash
+gpg --fingerprint D8406D0D82947747293778314AA394086372C20A
+if [ $? -ne 0 ]; then
+    echo -e "\033[33mDownloading PGP Public Key...\033[0m"
+    gpg --recv-keys D8406D0D82947747293778314AA394086372C20A
+    # Sebastian Bergmann <sb@sebastian-bergmann.de>
+    gpg --fingerprint D8406D0D82947747293778314AA394086372C20A
+    if [ $? -ne 0 ]; then
+        echo -e "\033[31mCould not download PGP public key for verification\033[0m"
+        exit
+    fi
+fi
+
+# Let's grab the latest release and its signature
+if [ ! -f phpunit.phar ]; then
+    wget https://phar.phpunit.de/phpunit.phar
+fi
+if [ ! -f phpunit.phar.asc ]; then
+    wget https://phar.phpunit.de/phpunit.phar.asc
+fi
+
+# Verify before running
+gpg --verify phpunit.phar.asc phpunit.phar
+if [ $? -eq 0 ]; then
+    echo
+    echo -e "\033[33mBegin Unit Testing\033[0m"
+    # Run the testing suite
+    php --version
+    php phpunit.phar --configuration phpunit.xml.dist
+else
+    echo
+    chmod -x phpunit.phar
+    mv phpunit.phar /tmp/bad-phpunit.phar
+    mv phpunit.phar.asc /tmp/bad-phpunit.phar.asc
+    echo -e "\033[31mSignature did not match! PHPUnit has been moved to /tmp/bad-phpunit.phar\033[0m"
+    exit 1
+fi

+ 1 - 0
mywiki/www/vendor/jakub-onderka/php-parallel-lint

@@ -0,0 +1 @@
+Subproject commit 2ead2e4043ab125bee9554f356e0a86742c2d4fa

+ 11 - 0
mywiki/www/vendor/jeroen/file-fetcher/.gitignore

@@ -0,0 +1,11 @@
+.*
+*~
+*.kate-swp
+
+!.gitignore
+!.gitreview
+!.travis.yml
+!.scrutinizer.yml
+
+/vendor/
+composer.lock

+ 12 - 0
mywiki/www/vendor/jeroen/file-fetcher/.scrutinizer.yml

@@ -0,0 +1,12 @@
+build: true
+inherit: true
+
+tools:
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 24 - 0
mywiki/www/vendor/jeroen/file-fetcher/.travis.yml

@@ -0,0 +1,24 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.6
+  - 7
+  - hhvm
+
+before_script: travis_retry composer install
+
+script: composer ci
+
+after_script:
+  - phpunit --coverage-clover build/logs/clover.xml
+  - composer require satooshi/php-coveralls:dev-master
+  - php vendor/bin/coveralls -v
+
+notifications:
+  email:
+    recipients:
+      - jeroendedauw@gmail.com
+    on_success: change
+    on_failure: always

+ 10 - 0
mywiki/www/vendor/jeroen/simple-cache/.gitignore

@@ -0,0 +1,10 @@
+.*
+*~
+*.kate-swp
+
+!.gitignore
+!.gitreview
+!.travis.yml
+
+vendor/
+composer.lock

+ 6 - 0
mywiki/www/vendor/jeroen/simple-cache/.gitreview

@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=mediawiki/extensions/SimpleCache
+defaultbranch=master
+defaultrebase=0

+ 22 - 0
mywiki/www/vendor/jeroen/simple-cache/.travis.yml

@@ -0,0 +1,22 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - hhvm
+  - hhvm-nightly
+
+script: phpunit --coverage-clover build/logs/clover.xml
+
+after_script:
+  - composer require satooshi/php-coveralls:dev-master
+  - php vendor/bin/coveralls -v
+
+notifications:
+  email:
+    recipients:
+      - jeroendedauw@gmail.com
+    on_success: change
+    on_failure: always

+ 3 - 0
mywiki/www/vendor/mediawiki/mediawiki-codesniffer/utils/gen-changelog.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+# Generate changelog for HISTORY.md based on git log
+git log --format='* %s (%aN)' --no-merges --reverse $(git describe --abbrev=0)...HEAD | sort

+ 11 - 0
mywiki/www/vendor/param-processor/param-processor/.gitignore

@@ -0,0 +1,11 @@
+*~
+*.kate-swp
+
+!.*
+.idea/
+
+composer.phar
+composer.lock
+
+vendor/
+build/

+ 13 - 0
mywiki/www/vendor/param-processor/param-processor/.scrutinizer.yml

@@ -0,0 +1,13 @@
+inherit: true
+build: true
+
+tools:
+    php_code_coverage: true
+    php_code_sniffer: true
+    php_cpd: true
+    php_cs_fixer: true
+    php_loc: true
+    php_mess_detector: true
+    php_pdepend: true
+    php_analyzer: true
+    sensiolabs_security_checker: true

+ 26 - 0
mywiki/www/vendor/param-processor/param-processor/.travis.yml

@@ -0,0 +1,26 @@
+language: php
+
+php:
+  - 5.6
+  - 7
+  - hhvm
+
+before_script:
+  - composer install
+
+script:
+  - composer ci
+
+notifications:
+  email:
+    recipients:
+      - jeroendedauw@gmail.com
+    on_success: change
+    on_failure: always
+
+sudo: false
+
+cache:
+  directories:
+  - "$HOME/.composer/cache"
+  - node_modules

+ 3 - 0
mywiki/www/vendor/pear/net_smtp/phpdoc.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+phpdoc -f Net/SMTP.php -t docs/api -p -ti "Net_SMTP Package API" -dn Net_SMTP -dc Net_SMTP -ed examples

+ 5 - 0
mywiki/www/vendor/pear/pear-core-minimal/copy-from-pear-core.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+cp ../pear-core/OS/Guess.php        src/OS/Guess.php
+cp ../pear-core/PEAR.php            src/PEAR.php
+cp ../pear-core/PEAR/ErrorStack.php src/PEAR/ErrorStack.php
+cp ../pear-core/System.php          src/System.php

+ 63 - 0
mywiki/www/vendor/ruflin/elastica/ansible/provision.sh

@@ -0,0 +1,63 @@
+#!/bin/bash
+
+set -o xtrace
+
+install_ansible() {
+    sudo apt-get update
+    sudo apt-get install python python-pip python-dev -y
+    sudo pip install ansible==1.8.2
+    sudo mkdir -p /etc/ansible/
+    echo "localhost" | sudo tee /etc/ansible/hosts
+}
+
+run_playbook() {
+    # Write to stdout directly
+    export PYTHONUNBUFFERED=1
+
+    # No cows >_<
+    export ANSIBLE_NOCOWS=1
+
+    # Root of git repo
+    if [ -z "$ES_PROJECT_ROOT" ]; then
+        export ES_PROJECT_ROOT="$(dirname $(dirname $(readlink -f $0)))"
+    fi
+
+    if [ ! -x $(which ansible-playbook) ]; then
+        echo "Ansible is not installed"
+        return 1
+    fi
+
+    ansible-playbook $ES_PROJECT_ROOT/ansible/es-playbook.yml -v | tee /tmp/ansible-playbook-progress
+
+    if grep -q "FATAL\|ERROR" /tmp/ansible-playbook-progress; then
+        return 1
+    fi
+}
+
+check_cluster() {
+    curl -m 5 -s -o /dev/null "http://localhost:9200" &&
+    curl -m 5 -s -o /dev/null "http://localhost:9201"
+    return $?
+}
+
+travis_retry() {
+    # We don't use builtin Travis CI function, because this script is also used for vagrant provision.
+    # But main idea of restarts is so simple, so lets override it without name change.
+
+    $@ && return 0
+
+    echo "The command $@ failed. Retrying, 2 of 3"
+    sleep 60s && $@ && return 0
+
+    echo "The command $@ failed. Retrying, 3 of 3"
+    sleep 60s && $@ && return 0
+
+    echo "The command $@ failed."
+    return 1
+}
+
+travis_retry install_ansible || exit 1
+
+travis_retry run_playbook || exit 1
+
+travis_retry check_cluster || exit 1

+ 27 - 0
mywiki/www/vendor/ruflin/elastica/docker-compose.yml

@@ -0,0 +1,27 @@
+elastica:
+  #build: . 
+  image: ruflin/elastica
+  ports:
+    - "9200:9200"
+  links:
+    - nginx
+    - elasticsearch
+  environment:
+    - ES_HOST=elasticsearch
+    - PROXY_HOST=nginx
+elasticsearch:
+  #build: ./env/elasticsearch/ 
+  image: ruflin/elasticsearch-elastica
+  volumes_from:
+    - data
+nginx:
+  #build: ./env/nginx/
+  image: ruflin/nginx-elastica
+  links:
+    - elasticsearch
+# data container to share data between elasticsearch nodes for snapshot testing
+data:
+  image: ruflin/elastica-data
+  volumes:
+    - "/tmp/backups/backup1"
+    - "/tmp/backups/backup2"

+ 7 - 0
mywiki135/.env

@@ -0,0 +1,7 @@
+CONTAINER_PREFIX=mywiki135
+MWIKI_ROOT=/home/tuffy/docker/mywiki135
+MYSQL_ROOT_PASSWORD=root 
+MYSQL_USER=root
+MYSQL_PASSWORD=root
+MYSQL_DATABASE=my_wiki
+PARSOID_DOMAIN_NAME=mediawiki

+ 119 - 0
mywiki135/build/dockerfile

@@ -0,0 +1,119 @@
+FROM php:7.0-apache
+
+# System dependencies
+RUN set -eux; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		git \
+		librsvg2-bin \
+		imagemagick \
+		# Required for SyntaxHighlighting
+		python3 \
+                ghostscript \
+		poppler-utils \
+	; \
+	rm -rf /var/lib/apt/lists/*
+
+# Install the PHP extensions we need
+RUN set -eux; \
+	\
+	savedAptMark="$(apt-mark showmanual)"; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		libicu-dev \
+	; \
+	\
+	docker-php-ext-install -j "$(nproc)" \
+		intl \
+		mbstring \
+		mysqli \
+		opcache \
+	; \
+	\
+	pecl install APCu-5.1.19; \
+	docker-php-ext-enable \
+		apcu \
+	; \
+	\
+	# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
+	apt-mark auto '.*' > /dev/null; \
+	apt-mark manual $savedAptMark; \
+	ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
+		| awk '/=>/ { print $3 }' \
+		| sort -u \
+		| xargs -r dpkg-query -S \
+		| cut -d: -f1 \
+		| sort -u \
+		| xargs -rt apt-mark manual; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
+	rm -rf /var/lib/apt/lists/*
+
+# Enable Short URLs
+RUN set -eux; \
+	a2enmod rewrite; \
+	{ \
+		echo "<Directory /var/www/html>"; \
+		echo "  RewriteEngine On"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-f"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-d"; \
+		echo "  RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \
+		echo "</Directory>"; \
+	} > "$APACHE_CONFDIR/conf-available/short-url.conf"; \
+	a2enconf short-url
+
+# Enable AllowEncodedSlashes for VisualEditor
+RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf"
+
+# set recommended PHP.ini settings
+# see https://secure.php.net/manual/en/opcache.installation.php
+RUN { \
+		echo 'opcache.memory_consumption=128'; \
+		echo 'opcache.interned_strings_buffer=8'; \
+		echo 'opcache.max_accelerated_files=4000'; \
+		echo 'opcache.revalidate_freq=60'; \
+	} > /usr/local/etc/php/conf.d/opcache-recommended.ini
+
+# SQLite Directory Setup
+RUN set -eux; \
+	mkdir -p /var/www/data; \
+	chown -R www-data:www-data /var/www/data
+
+# Version
+ENV MEDIAWIKI_MAJOR_VERSION 1.27
+ENV MEDIAWIKI_VERSION 1.27.0
+
+# MediaWiki setup
+RUN set -eux; \
+	fetchDeps=" \
+		gnupg \
+		dirmngr \
+        python3 \
+	"; \
+	apt-get update; \
+	apt-get install -y --no-install-recommends $fetchDeps; \
+	\
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \
+	export GNUPGHOME="$(mktemp -d)"; \
+# gpg key from https://www.mediawiki.org/keys/keys.txt
+	# gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys \
+	# 	D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \
+	# 	441276E9CCD15F44F6D97D18C119E1A64D70938E \
+	# 	F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \
+	# 	1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \
+	# ; \
+	# gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	tar -x --strip-components=1 -f mediawiki.tar.gz; \
+	gpgconf --kill all; \
+	rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	chown -R www-data:www-data extensions skins cache images; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
+	rm -rf /var/lib/apt/lists/*
+
+VOLUME /var/www/
+
+CMD ["apache2-foreground"]

+ 125 - 0
mywiki135/build/my_wiki1.35/dockerfile

@@ -0,0 +1,125 @@
+FROM php:7.3-apache
+
+# System dependencies
+RUN set -eux; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		git \
+		librsvg2-bin \
+		imagemagick \
+		# Required for SyntaxHighlighting
+		python3 \
+	; \
+	rm -rf /var/lib/apt/lists/*
+
+# Install the PHP extensions we need
+RUN set -eux; \
+	\
+	savedAptMark="$(apt-mark showmanual)"; \
+	\
+	apt-get update; \
+	apt-get install -y --no-install-recommends \
+		libicu-dev \
+	; \
+	\
+	docker-php-ext-install -j "$(nproc)" \
+		intl \
+		mbstring \
+		mysqli \
+		opcache \
+	; \
+	\
+	pecl install APCu-5.1.19; \
+	docker-php-ext-enable \
+		apcu \
+	; \
+	\
+	# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
+	apt-mark auto '.*' > /dev/null; \
+	apt-mark manual $savedAptMark; \
+	ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
+		| awk '/=>/ { print $3 }' \
+		| sort -u \
+		| xargs -r dpkg-query -S \
+		| cut -d: -f1 \
+		| sort -u \
+		| xargs -rt apt-mark manual; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
+	rm -rf /var/lib/apt/lists/*
+
+# Enable Short URLs
+RUN set -eux; \
+	a2enmod rewrite; \
+	{ \
+		echo "<Directory /var/www/html>"; \
+		echo "  RewriteEngine On"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-f"; \
+		echo "  RewriteCond %{REQUEST_FILENAME} !-d"; \
+		echo "  RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]"; \
+		echo "</Directory>"; \
+	} > "$APACHE_CONFDIR/conf-available/short-url.conf"; \
+	a2enconf short-url
+
+# Enable AllowEncodedSlashes for VisualEditor
+RUN sed -i "s/<\/VirtualHost>/\tAllowEncodedSlashes NoDecode\n<\/VirtualHost>/" "$APACHE_CONFDIR/sites-available/000-default.conf"
+
+# set recommended PHP.ini settings
+# see https://secure.php.net/manual/en/opcache.installation.php
+RUN { \
+		echo 'opcache.memory_consumption=128'; \
+		echo 'opcache.interned_strings_buffer=8'; \
+		echo 'opcache.max_accelerated_files=4000'; \
+		echo 'opcache.revalidate_freq=60'; \
+	} > /usr/local/etc/php/conf.d/opcache-recommended.ini
+
+# SQLite Directory Setup
+RUN set -eux; \
+	mkdir -p /var/www/data; \
+	chown -R www-data:www-data /var/www/data
+
+# Version
+ENV MEDIAWIKI_MAJOR_VERSION 1.35
+ENV MEDIAWIKI_VERSION 1.35.1
+
+
+# MediaWiki setup
+RUN set -eux; \
+	fetchDeps=" \
+		gnupg \
+		dirmngr \
+		python3-pygments \
+	"; \
+	# fetchAdditional="\
+	# 	python3 \
+	# ";\
+	apt-get update; \
+	apt-get install -y --no-install-recommends $fetchDeps; \  
+	\
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz; \
+	curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-${MEDIAWIKI_VERSION}.tar.gz.sig" -o mediawiki.tar.gz.sig; \
+	export GNUPGHOME="$(mktemp -d)"; \
+# gpg key from https://www.mediawiki.org/keys/keys.txt
+	# gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys \
+	# 	D7D6767D135A514BEB86E9BA75682B08E8A3FEC4 \
+	# 	441276E9CCD15F44F6D97D18C119E1A64D70938E \
+	# 	F7F780D82EBFB8A56556E7EE82403E59F9F8CD79 \
+	# 	1D98867E82982C8FE0ABC25F9B69B3109D3BB7B0 \
+	# ; \
+	# gpg --batch --verify mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	tar -x --strip-components=1 -f mediawiki.tar.gz; \
+	gpgconf --kill all; \
+	rm -r "$GNUPGHOME" mediawiki.tar.gz.sig mediawiki.tar.gz; \
+	curl -fSL "https://extdist.wmflabs.org/dist/extensions/SyntaxHighlight_GeSHi-REL1_35-6bd7a93.tar.gz" -o extensions/SyntaxHighlight_GeSHi-REL1_35.tar.gz; \
+	curl -fSL "https://extdist.wmflabs.org/dist/extensions/WikidataPageBanner-REL1_35-4cea5a0.tar.gz" -o extensions/WikidataPageBanner-REL1_35.tar.gz; \
+	curl -fSL "https://extdist.wmflabs.org/dist/extensions/CirrusSearch-REL1_35-f835850.tar.gz" -o extensions/CirrusSearch-REL1_35.tar.gz; \
+	curl -fSL "https://extdist.wmflabs.org/dist/extensions/Elastica-REL1_35-3e3b76f.tar.gz" -o extensions/Elastica-REL1_35.tar.gz; \
+	chown -R www-data:www-data extensions skins cache images; \
+	\
+	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
+	rm -rf /var/lib/apt/lists/*
+
+VOLUME /var/www/
+
+CMD ["apache2-foreground"]

+ 62 - 0
mywiki135/docker-compose.yml

@@ -0,0 +1,62 @@
+version: '3.1'
+volumes:
+  files:
+    driver: local
+    driver_opts: 
+      type: volume 
+      o: 'bind'
+      device: "${MWIKI_ROOT}/www"
+  es01:
+    driver: local
+    driver_opts: 
+      type: volume 
+      o: 'bind'
+      device: "${MWIKI_ROOT}/es"
+
+
+services:
+
+  elasticsearch:
+    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
+    container_name: ${CONTAINER_PREFIX}_es
+    restart: "no"
+    ports:
+      - 9255:9200
+    volumes:
+      - es01:/usr/share/elasticsearch/data
+
+  parsoid:
+    image: thenets/parsoid:0.11
+    container_name: ${CONTAINER_PREFIX}_parsoid
+    restart: "no"
+    ports:
+      - 8142:8000
+    environment: 
+      - PARSOID_DOMAIN_${PARSOID_DOMAIN_NAME}=http://${PARSOID_DOMAIN_NAME}/api.php 
+
+  db:
+    image: mysql
+    container_name: ${CONTAINER_PREFIX}_mysql
+    command: --default-authentication-plugin=mysql_native_password
+    restart: "no"
+    environment:
+      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 
+      - MYSQL_USER==${MYSQL_USER}
+      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
+      - MYSQL_DATABASE=${MYSQL_DATABASE}
+    volumes: 
+      - ${MWIKI_ROOT}/backups:/var/backups
+      - ${MWIKI_ROOT}/data_dir:/var/lib/mysql
+
+  mediawiki:
+    image: laxaurus/mediawiki:1.2
+    container_name: ${CONTAINER_PREFIX}
+    restart: "no"
+    ports:
+      - 8055:80
+    links:
+      - db
+      - parsoid
+    volumes:
+      - files:/var/www/html
+

+ 20 - 0
mywiki135/www/docs/kss/scripts/kss-node-check.sh

@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+if command -v npm > /dev/null ; then
+  npm install
+else
+  # If npm isn't installed, but kss-node is, exit normally.
+  # This allows setting it up on one machine, and running it on
+  # another (e.g. Tools Labs execution nodes) that doesn't have npm
+  # installed.  However, "npm install" still needs to be run
+  # occasionally to keep kss updated.
+
+  KSS_NODE="${BASH_SOURCE%/*}/../node_modules/.bin/kss-node"
+  if ! [ -x "$KSS_NODE" ] ; then
+    echo "Neither kss-node nor npm are installed."
+    echo "To install npm, see http://nodejs.org/"
+    echo "When npm is installed, the Makefile can automatically"
+    echo "install kss-node."
+    exit 1
+  fi
+fi

+ 9 - 0
mywiki135/www/extensions/CirrusSearch/maintenance/elasticsearch-scripts/count-cluster.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo index,codfw,eqiad,labsearch
+for i in `curl -s elastic2001.codfw.wmnet:9200/_cat/aliases?h=a | egrep '(_content|_general) *$'`; do
+	EQ_DOCS=`curl -s elastic1001.eqiad.wmnet:9200/$i/_count | jq .count`;
+	COD_DOCS=`curl -s elastic2001.codfw.wmnet:9200/$i/_count | jq .count`;
+	LS_DOCS=`curl -s nobelium.eqiad.wmnet:9200/$i/_count | jq .count`;
+	echo "$i,$COD_DOCS,$EQ_DOCS,$LS_DOCS";
+done

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.