Page MenuHomePhabricator

Include QuickStatements in Wikibase release packages
Closed, ResolvedPublic13 Estimated Story Points

Description

As a Wikibase Release manager I want to publish releases of QuickStatements so that Wikibase users can use it on their installations.

Acceptance Criteria:

  • Version(s) of Quickstatements that are compatible/required to be installed are indicated (write a build metadata file that can be used later)
  • Quickstatements should be released in a docker container complete with a webserver
  • Automated testing of integration between the relevant QuickStatements and the released version of Wikibase has happened during the releasing process

Testing should cover:

  • OAuth Item creation and checking it was inserted.

Event Timeline

toan renamed this task from Include QuickStatements in Release Pipeline to Include QuickStatements in Wikibase release packages.Jan 21 2021, 10:45 AM
toan updated the task description. (Show Details)
toan set the point value for this task to 13.
toan updated the task description. (Show Details)
toan added subscribers: Samantha_Alipio_WMDE, toan.
  • Quickstatements and it's dependencies should be included in a separate tarball

was removed and asked @Samantha_Alipio_WMDE it this should be included.

The results/worklog from the install process for QS should flow into the hands of the technical writer for inclusion here: https://www.mediawiki.org/wiki/Wikibase/Suite#QuickStatements

So the gerrithub chain goes

  1. Some initial additions to the build scripts https://github.com/wmde/wikibase-release-prototype/pull/51
  1. Building quickstatements.docker.tar.gz https://github.com/wmde/wikibase-release-prototype/pull/52
  1. Test that it works and a publish step https://github.com/wmde/wikibase-release-prototype/pull/53/

I'll do a writeup on the documentation tomorrow.

@danshick-wmde hopefully this should cover all the steps

OAuth:

  1. Clone repo or download the zip https://www.mediawiki.org/wiki/Extension:OAuth
  2. Update LocalSettings.php
wfLoadExtension( 'OAuth' );
$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;
  1. add it to composer.local.json and run composer update aswell
  2. run update.php
  3. Check /wiki/Special:Version that it shows up

Quickstatements:

  1. Clone the repositories:

Repositories should be in the following directories.

  • Quickstatements: /www_root/quickstatements/
  • Magnustools: /www_root/magnustools/
  1. run composer install in quickstatements
  1. Place the following files in the corresponding folders

use these env variables and replace with envsubst or replace them manually

MW_SITE_NAME="site name"
WB_PUBLIC_SCHEME_HOST_AND_PORT=<public ip>
WIKIBASE_SCHEME_AND_HOST=<localhost>
WB_PROPERTY_NAMESPACE=122
WB_ITEM_NAMESPACE=120
WB_PROPERTY_PREFIX="Property:"
WB_ITEM_PREFIX="Item:"

config.json: /www_root/quickstatements/public_html/config.json

{
	"site" : "${MW_SITE_NAME}" ,
	"bot_config_file" : "/var/www/html/bot.ini" ,
	"logfile" : "/var/log/quickstatements/tool.log" ,
	"sites" : {
		"${MW_SITE_NAME}" : {
			"oauth" : {
				"language":"${MW_SITE_LANG}" ,
				"project":"${MW_SITE_NAME}" ,
				"ini_file":"/quickstatements/data/oauth.ini" ,
				"publicMwOAuthUrl":"${WB_PUBLIC_SCHEME_HOST_AND_PORT}/w/index.php?title=Special:OAuth" ,
				"mwOAuthUrl":"${WB_PUBLIC_SCHEME_HOST_AND_PORT}/w/index.php?title=Special:OAuth" ,
				"mwOAuthIW":"mw"
			} ,
			"server" : "${WB_PUBLIC_HOST_AND_PORT}" ,
			"api" : "${WIKIBASE_SCHEME_AND_HOST}/w/api.php" ,
			"pageBase" : "${WB_PUBLIC_SCHEME_HOST_AND_PORT}/wiki/" ,
			"toolBase" : "${QS_PUBLIC_SCHEME_HOST_AND_PORT}/" ,
			"types" : {
				"P" : { "type":"property" , "ns":"${WB_PROPERTY_NAMESPACE}" , "ns_prefix":"${WB_PROPERTY_PREFIX}" } ,
				"Q" : { "type":"item" , "ns":"${WB_ITEM_NAMESPACE}" , "ns_prefix":"${WB_ITEM_PREFIX}" }
			}
		}
	}
}

oauth.ini: /quickstatements/data/oauth.ini

; HTTP User-Agent header
agent = 'Wikibase 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>'

Then create an OAuth consumer

# set these environment variables
MW_ADMIN_NAME=<Admin username> 
QS_PUBLIC_SCHEME_HOST_AND_PORT=<public ip>


# execute this on mediawiki with OAuth
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

A successful response should return with "created": true flag set.

{"created":true,"id":1,"name":"QuickStatements","key":"30e532f04e1bdf63ac281fcbc819170c","secret":"f60f31ad4196af40bb0598e1d4d3435a3515604e","approved":1}

Replace the <OAUTH_CONSUMER_KEY> and <OAUTH_CONSUMER_SECRET> with the key and secret that was generated.

With this setup you should be able to visit the webserver and log in

Thanks for this. Information added to https://www.mediawiki.org/wiki/Wikibase/Suite#QuickStatements .

One question: are these LocalSettings additions specific to a Wikibase install, or should they go along with a standard OAuth install?:

$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;
$wgGroupPermissions['sysop']['mwoauthviewprivate'] = true;
$wgGroupPermissions['sysop']['mwoauthupdateownconsumer'] = true;