Commit aff33216 authored by Jesper Zedlitz's avatar Jesper Zedlitz

Anpassungen für Wikibase 1.35

parent b5312e9b
# Wikibase with Query Service
#
# This docker-compose example can be used to pull the images from docker hub.
#
# Examples:
#
# Access Wikibase via "http://localhost:8181"
# (or "http://$(docker-machine ip):8181" if using docker-machine)
#
# Access Query Service via "http://localhost:8282"
# (or "http://$(docker-machine ip):8282" if using docker-machine)
version: '3'
services:
wikibase:
image: wikibase/wikibase:1.33-bundle
build: wikibase
links:
- mysql
ports:
......@@ -39,11 +28,15 @@ services:
- DB_USER=wikiuser
- DB_PASS=sqlpass
- DB_NAME=my_wiki
- MW_SITENAME=gedbas4all
- QS_PUBLIC_SCHEME_HOST_AND_PORT=http://localhost:9191
- OAUTH_CLIENT_ID=aZvERFfF0vF3eghEw5SGXmYPuOdCAimr85JEGao8
- OAUTH_SECRET=M8yJKvweTSnlroMQe0gKTQJugk2kfhAMJh0B6X18Q4KiNxoUEcCBNCpUwOgC0aIhix0gHaHcQxz2lcK3m8nCxd8At9Un76aMzqvLzvIlLs0OcWpUxdTpnY3LPAX2TWyt
- OAUTH_CALLBACK=http://localhost:8181/wiki/Special:OAuth2Client/callback
mysql:
image: mariadb:10.3
# ports:
# - "3306:3306"
ports:
- "3336:3306"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_DATABASE: 'my_wiki'
......
This diff is collapsed.
FROM ubuntu:xenial as fetcher
RUN apt-get update && \
apt-get install --yes --no-install-recommends unzip=6.* jq=1.* curl=7.* ca-certificates=201* git php-cli php-dom php-curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY download-extension.sh .
COPY download-oauth2-client.sh .
ADD https://github.com/wikidata/WikibaseImport/archive/master.tar.gz /WikibaseImport.tar.gz
RUN bash download-oauth2-client.sh;\
bash download-extension.sh OAuth;\
bash download-extension.sh Elastica;\
bash download-extension.sh CirrusSearch;\
bash download-extension.sh WikibaseCirrusSearch;\
bash download-extension.sh UniversalLanguageSelector;\
bash download-extension.sh cldr;\
bash download-extension.sh EntitySchema;\
bash download-extension.sh WikibaseQualityConstraints;\
tar xzf OAuth.tar.gz;\
tar xzf Elastica.tar.gz;\
tar xzf CirrusSearch.tar.gz;\
tar xzf WikibaseCirrusSearch.tar.gz;\
tar xzf UniversalLanguageSelector.tar.gz;\
tar xzf cldr.tar.gz;\
tar xzf WikibaseImport.tar.gz;\
tar xzf EntitySchema.tar.gz;\
tar xzf WikibaseQualityConstraints.tar.gz;\
rm ./*.tar.gz
FROM wikibase/wikibase:1.35 as collector
COPY --from=fetcher /WikibaseImport-master /var/www/html/extensions/WikibaseImport
COPY --from=fetcher /Elastica /var/www/html/extensions/Elastica
COPY --from=fetcher /OAuth /var/www/html/extensions/OAuth
COPY --from=fetcher /CirrusSearch /var/www/html/extensions/CirrusSearch
COPY --from=fetcher /WikibaseCirrusSearch /var/www/html/extensions/WikibaseCirrusSearch
COPY --from=fetcher /UniversalLanguageSelector /var/www/html/extensions/UniversalLanguageSelector
COPY --from=fetcher /cldr /var/www/html/extensions/cldr
COPY --from=fetcher /EntitySchema /var/www/html/extensions/EntitySchema
COPY --from=fetcher /WikibaseQualityConstraints /var/www/html/extensions/WikibaseQualityConstraints
COPY --from=fetcher /MW-OAuth2Client /var/www/html/extensions/MW-OAuth2Client
FROM composer:1 as composer
COPY --from=collector /var/www/html /var/www/html
WORKDIR /var/www/html/
RUN rm /var/www/html/composer.lock
RUN composer install --no-dev
FROM wikibase/wikibase:1.35
RUN apt-get update && \
apt-get install --yes --no-install-recommends jq=1.* && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=composer /var/www/html /var/www/html
COPY LocalSettings.php.wikibase-bundle.template /LocalSettings.php.wikibase-bundle.template
COPY extra-install.sh /
COPY extra-entrypoint-run-first.sh /
RUN cat /LocalSettings.php.wikibase-bundle.template >> /LocalSettings.php.template && rm /LocalSettings.php.wikibase-bundle.template
COPY oauth.ini /templates/oauth.ini
# OAuth
wfLoadExtension( 'OAuth' );
${DOLLAR}wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
${DOLLAR}wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
${DOLLAR}wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
${DOLLAR}wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;
# WikibaseImport
require_once "${DOLLAR}IP/extensions/WikibaseImport/WikibaseImport.php";
# CirrusSearch
wfLoadExtension( 'Elastica' );
wfLoadExtension( 'CirrusSearch' );
wfLoadExtension( 'WikibaseCirrusSearch' );
${DOLLAR}wgCirrusSearchServers = [ '${MW_ELASTIC_HOST}' ];
${DOLLAR}wgSearchType = 'CirrusSearch';
${DOLLAR}wgCirrusSearchExtraIndexSettings['index.mapping.total_fields.limit'] = 5000;
${DOLLAR}wgWBCSUseCirrus = true;
# UniversalLanguageSelector
wfLoadExtension( 'UniversalLanguageSelector' );
# cldr
wfLoadExtension( 'cldr' );
# EntitySchema
wfLoadExtension( 'EntitySchema' );
# WikibaseQualityConstraints
wfLoadExtension( 'WikibaseQualityConstraints' );
${DOLLAR}wgGroupPermissions['*']['autocreateaccount'] = true;
${DOLLAR}wgPluggableAuth_EnableAutoLogin = true;
${DOLLAR}wgPluggableAuth_EnableLocalLogin = false;
wfLoadExtension( 'MW-OAuth2Client' );
${DOLLAR}wgOAuth2Client['client']['id'] = "${OAUTH_CLIENT_ID}";
${DOLLAR}wgOAuth2Client['client']['secret'] = "${OAUTH_SECRET}";
${DOLLAR}wgOAuth2Client['configuration']['authorize_endpoint']='https://team.genealogy.net/o/authorize/';
${DOLLAR}wgOAuth2Client['configuration']['access_token_endpoint']='https://team.genealogy.net/o/token/';
${DOLLAR}wgOAuth2Client['configuration']['api_endpoint']='https://team.genealogy.net/o/me/';
${DOLLAR}wgOAuth2Client['configuration']['redirect_uri']="${OAUTH_CALLBACK}";
${DOLLAR}wgOAuth2Client['configuration']['email'] = 'email';
${DOLLAR}wgOAuth2Client['configuration']['scopes'] = 'read';
${DOLLAR}wgOAuth2Client['configuration']['username'] = 'name';
${DOLLAR}wgLanguageCode = "de";
${DOLLAR}wgSitename = "${MW_SITENAME}";
${DOLLAR}wgLogo = "https://www.genealogy.net/images/CG-Logo-2018_135px.png";
#!/usr/bin/env bash
EXTENSION=$1
TAR_URL=$(curl -s "https://www.mediawiki.org/w/api.php?action=query&list=extdistbranches&edbexts=$EXTENSION&formatversion=2&format=json" | jq -r ".query.extdistbranches.extensions.$EXTENSION.REL1_35")
curl -s "$TAR_URL" -o "$EXTENSION".tar.gz
#!/bin/sh
cd /root/
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
cd /
git clone https://github.com/Schine/MW-OAuth2Client.git
cd MW-OAuth2Client
git submodule update --init
cd vendors/oauth2-client
php /root/composer.phar install
#!/usr/bin/env bash
/wait-for-it.sh $MW_ELASTIC_HOST:$MW_ELASTIC_PORT -t 300
#!/bin/bash
php /var/www/html/extensions/CirrusSearch/maintenance/UpdateSearchIndexConfig.php
php /var/www/html/extensions/CirrusSearch/maintenance/ForceSearchIndex.php --skipParse
php /var/www/html/extensions/CirrusSearch/maintenance/ForceSearchIndex.php --skipLinks --indexOnSkip
n=0
until [ $n -ge 5 ]
do
php /var/www/html/extensions/OAuth/maintenance/createOAuthConsumer.php --approve --callbackUrl $QS_PUBLIC_SCHEME_HOST_AND_PORT/api.php \
--callbackIsPrefix true --user $MW_ADMIN_NAME --name QuickStatements --description QuickStatements --version 1.0.1 \
--grants createeditmovepage --grants editpage --grants highvolume --jsonOnSuccess > /quickstatements/data/qs-oauth.json && break
n=$[$n+1]
sleep 5s
done
if [[ -f /quickstatements/data/qs-oauth.json ]]; then
export OAUTH_CONSUMER_KEY=$(jq -r '.key' /quickstatements/data/qs-oauth.json);
export OAUTH_CONSUMER_SECRET=$(jq -r '.secret' /quickstatements/data/qs-oauth.json);
envsubst < /templates/oauth.ini > /quickstatements/data/oauth.ini
fi
; HTTP User-Agent header
agent = 'Wikibase Docker QuickStatements'
; assigned by Special:OAuthConsumerRegistration (request modelled after https://www.wikidata.org/wiki/Special:OAuthListConsumers/view/77b4ae5506dd7dbb0bb07f80e3ae3ca9)
consumerKey = '${OAUTH_CONSUMER_KEY}'
consumerSecret = '${OAUTH_CONSUMER_SECRET}'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment