I've been helping write documentation and manage the website for SuperTuxKart, an open-source racing game. The website uses MediaWiki, but we've discussed things and decided after our switch away from SourceForge hosting not to allow free account creation. However, this left us in a dilemma as to how to allow contributions to the wiki while avoiding the spam accounts that plagued the previous one.
We decided that allowing pull requests to submit content to GitHub, then deploy it to MediaWiki would work well. After some research and experimenting, I created a semi-working shell script that uses git-mediawiki to
- Clone the wiki
- Push the wiki to GitHub
- Fetch and merge changes from the wiki
- Fetch and merge changes from GitHub (though the wiki has priority in case of a merge conflict)
- Push to the wiki and to GitHub.
What I am looking for is a GitHub webhook service to run this script regularly (e.g. every 15 minutes) and whenever there is a commit to GitHub. It also needs some method of write access to the git repository without using my own credentials. I can't just have a script git pull updates to the server because MediaWiki pages can't be read from a normal git repository; they must be in a database.
The content of my script is below:
#!/bin/bash
#
# Auto sync script for the SuperTuxKart wiki
# Set up repo if not already done
if ! [ -d "supertuxkart.net" ]
then
echo "Setting up repository..."
git clone --origin wiki mediawiki::https://supertuxkart.net
cd "supertuxkart.net"
git remote add github https://github.com/MTres19/supertuxkart.net.git
git push github master
fi
cd "supertuxkart.net"
git pull --rebase wiki
git pull --rebase -s recursive -X ours github master
git push wiki master
git push github master