File protection sync plugin for pywikibot.
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.pylintrc
.travis.yml
README.md
__init__.py
fileprotectionsync.py
fileprotectionsync_config-prod.py

README.md

Build Status

pywiki-fileprotectionsync

Production

Setup

Fetch code:

# (tooluser in ~/src)
$ git clone --depth 1 https://github.com/wikimedia/pywikibot-core.git
$ git clone https://github.com/Krinkle/pywiki-fileprotectionsync.git

Configure user:

$ mkdir -p ~/.pywikibot && chmod 700 ~/.pywikibot
$ touch ~/.pywikibot/{.pwd,user-config.py} && chmod 600 ~/.pywikibot/{.pwd,user-config.py}
$ edit ~/.pywikibot/user-config.py
	# -*- coding: utf-8  -*-
	import os
	family = 'commons'
	mylang = 'commons'
	usernames['commons']['commons'] = u'KrinkleBot'
	sysopnames['commons']['commons'] = u'KrinkleBot'
	password_file = os.path.expanduser('~/.pywikibot/.pwd')
$ edit ~/.pywikibot/.pwd
("<username>", BotPassword("<botname>", "<password>"))

Install pywikibot:

# (tooluser in ~/)
$ virtualenv pywiki -p python3
$ source ~/pywiki/bin/activate
$ cd ~/src/pywikibot-core
$ python setup.py develop

Configure fileprotectionsync:

# (you in ~/src/pywiki-fileprotectionsync)
$ ln -sf fileprotectionsync_config-prod.py fileprotectionsync_config.py

# (you in ~/)
$ edit crontab.txt
0,15,30,45 * * * * /usr/bin/jsub -once -quiet -l release=trusty -mem 500m -N fileprotectionsync $HOME/pywiki/bin/python $HOME/src/pywiki-fileprotectionsync/fileprotectionsync.py

To run it manually:

$ $HOME/pywiki/bin/python $HOME/src/pywiki-fileprotectionsync/fileprotectionsync.py