Docker images and OpenShift QuickStart for MediaWiki. It supports multi-site Wiki family.
- To host another wiki called ABC (accessible at
https://your.wiki.com/abc/), you need:
ABC_SITE_NAMEandABC_ADMIN_EMAIL(required)ABC_GOOGLE_ANALYTICS_ACCOUNT(optional): if you use Google AnalyticsABC_GOOGLE_LOGIN_SECRETandABC_GOOGLE_LOGIN_APP_ID(optional): follow the instructions for Extension:GoogleLogin to obtain the credentials for setting up login with Google.
- PreInstalled Plugins:
Cite, CiteThisPage, ConfirmAccount, Gadgets, GoogleAnalytics, GoogleLogin, ImageMap, InputBox, Interwiki, LocalisationUpdate, MarkdownExtraParser, MobileFrontend, Nuke, ParserFunctions, PdfHandler, Poem, Renameuser, SpamBlacklist, Scribunto, SyntaxHighlight_GeSHi, TitleBlacklist, UserMerge, WikiEditor, Google Analytics.
- Default Admin Username:
admin, Default Password:Admin123Acct.
- Create the following two files to provide database credentials and wiki settings:
-
db.env
MYSQL_DATABASE=mediawiki MYSQL_ROOT_PASSWORD=CHANGE_ME_ROOT_PASSWORD -
app.env
OPENSHIFT_MYSQL_DB_HOST=mysql OPENSHIFT_MYSQL_DB_PORT=3306 OPENSHIFT_APP_NAME=mediawiki OPENSHIFT_MYSQL_DB_USERNAME=root OPENSHIFT_MYSQL_DB_PASSWORD=CHANGE_ME_ROOT_PASSWORD SMTP_SERVER=smtp.CHANGE_ME.com SMTP_PORT=587 SMTP_DOMAIN=CHANGE_ME.COM SMTP_USER_NAME=SOME_USER@CHANGE_ME.COM SMTP_PASSWORD=CHANGE_ME_SMTP_PASSWORD META_SITE_NAME=CHANGE_ME_SITE_NAME META_ADMIN_EMAIL=ADMIN@CHANGE_ME.COM
- Add the following lines to
app.env,
-
if you use Google Analytics:
META_GOOGLE_ANALYTICS_ACCOUNT=UA-1234567-8 -
if you want Login via Google:
META_GOOGLE_LOGIN_SECRET=abcdefg META_GOOGLE_LOGIN_APP_ID=987654321-hijklmnop.apps.googleusercontent.com META_GOOGLE_LOGIN_DOMAIN=YOUR_APP_DOMAIN_IF_NEEDED
- Run
docker-compose up -d.
Build a multi-architecture image: docker buildx build --platform linux/amd64,linux/arm64/v8,linux/arm/v7 --rm=true --tag=USER/mediawiki:latest --push .
-
Sign up at https://www.openshift.com and create a new project
-
On the web console, click "Add to Project" -> "Import YAML/JSON", and paste the contents of the YAML file here. Or alternatively, use
occommand line:oc new-app -f https://raw.githubusercontent.com/baip/openshift-mediawiki/master/openshift/templates/mediawiki-mysql.yaml
The default wiki can be accessed at https://{app}-{project}.{shard}.{amws}.openshiftapps.com/ or https://{app}-{project}.{shard}.{amws}.openshiftapps.com/meta/.
-
After the app is created, you can further customize it by going to "Applications" -> "Deployments" -> "Environment" on the web console.
-
To automatically trigger a new build, follow the instructions here
-
Create an account at https://www.openshift.com
-
Create a PHP application with mysql:
$ rhc app create mediawiki php-5.4 mysql-5.5 -
Add this upstream mediawiki repo
$ cd mediawiki $ git remote add upstream -m master https://github.com/negati-ve/openshift-mediawiki.git $ git pull -s recursive -X theirs upstream master -
Then push the repo upstream
$ git push -
That's it, you can now checkout your application at: http://mediawiki-$yourlogin.rhcloud.com
In order to update or upgrade to the latest mediawiki, you'll need to re-pull and re-push.
- Pull from upstream:
$ cd mediawiki/ $ git pull -s recursive -X theirs upstream master - Push the new changes upstream
$ git push
php/ - Externally exposed php code goes here
libs/ - Additional libraries
misc/ - For not-externally exposed php code
../data - For persistent data
.openshift/pear.txt - list of pears to install
.openshift/action_hooks/build - Script that gets run every push, just prior to starting your app
Please leave php, libs and data directories but feel free to create additional directories if needed.
Note: Every time you push, everything in your remote repo dir gets recreated please store long term items (like an sqlite database) in ../data which will persist between pushes of your repo.