MediaWiki-Docker/Extension/Citoid
This page instructs you to install Extension:Citoid inside MediaWiki-Docker.
Follow the Quickstart instructions at MediaWiki-Docker page. Once MediaWiki is running and available at http://localhost:8080
, then continue with instructions on this page.
All commands should be run in the directory where you installed MediaWiki. All mentioned files are also located there.
Enable required extensions
Citation template extensions
If you are using citation templates imported from the Wikipedias, these are dependant on a number of other extensions, including:
Clone the extension and configure
git clone "https://gerrit.wikimedia.org/r/mediawiki/extensions/Citoid" extensions/Citoid
If not already there, add this to the end of LocalSettings.php
.
wfLoadExtension( 'Citoid' );
If you do not want to hack on the service, only set-up the extension, you can point to extension towards an external deploy of the service by adding the following to the end of LocalSettings.php
.
$wgCitoidFullRestbaseURL = 'https://www.mediawiki.org/api/rest_';
This completes your installation. However if you want to hack on the citoid service and require a local installation, skip this instruction and continue below.
Install and configure citoid service
This page is currently a draft.
|
Clone the service
mkdir srv
git clone "https://gerrit.wikimedia.org/r/mediawiki/services/citoid" srv/citoid
Make Dockerfile for citoid
cd srv/citoid
touch Dockerfile
Paste in the following:
FROM docker-registry.wikimedia.org/nodejs20-slim
WORKDIR /opt/citoid
COPY . ./
RUN npm install
EXPOSE 1970
CMD [ "npm", "start" ]
docker-compose.override.yml
services:
# Note, adding a citoid service requires changes to LocalSettings.php to work.
citoid:
build: "./srv/citoid/"
ports:
- "1970:1970"
Configure
Configure the extension to work with the cloned service; these directions are installation without zotero. Installation with zotero requires further installation/configuration.
$wgCitoidServiceUrl = 'http://localhost:1970/api'; # Configured without restbase
Install and configure zotero
This page is currently a draft.
|
In prod we run zotero behind citoid. Here's a sample
docker-compose.override.yml
file for such an installation. Note installation and dockerfiles for zotero are also required, but not provided here.
services:
# Note, adding a citoid service requires changes to LocalSettings.php to work.
citoid:
build: "./srv/citoid/"
ports:
- "1970:1970"
zotero:
image: docker-registry.wikimedia.org/repos/mediawiki/services/zotero:latest
ports:
- "1969:1969"