SMWConTalk2020-04


Wolfgang Fahl

view SMWConTalk2020-04 as slides

<slideshow style="bitplan" headingmark="⌘⌘" incmark="…" scaled="true" font="Comic Sans MS, Calibri, cursive" >

title
WolfgangFahl.png

Push your
wikifarm pages with
encrypted credential handling
author

Wolfgang Fahl info@bitplan.com
footer
Lightning Talk
subfooter
EMW Con 2020

</slideshow>

⌘⌘ MediaWiki API[edit]

There are many implementations for different languages e.g.

Language Project By
Java MediaWiki-Japi BITPlan
Python pywikbot WikiMedia Foundation
JavaScript nodemw Maciej Brencz

⌘⌘ Dragtop Example[edit]

The Dragtop prototype shows how automation could be simplified. A main showstopper on the way to this is how to make the credentials available for the automation without interfering the user experience.

⌘⌘ Encrypted credential storage[edit]

#Mediawiki JAPI credentials for test2
#Mon Mar 16 08:09:44 CET 2020
url=http://test.bitplan.com
cypher=...
scriptPath=
secret=...
user=wf
salt=...
wikiId=test
version=MediaWiki 1.27.3
email=wf@bitplan.com

⌘⌘ Push pages example[edit]

Picturetestpage.png

see also https://test.wikipedia.org/wiki/PictureTestPage

./run -l -s master -t test -p Training
Apr 02, 2020 4:46:32 PM com.bitplan.mediawiki.japi.SSLWiki login
INFORMATION: http://master.bitplan.com/api.php?:Success
Apr 02, 2020 4:46:33 PM com.bitplan.mediawiki.japi.SSLWiki login
INFORMATION: http://test.bitplan.com/api.php?:Success
File:Book open2.png
http://master.bitplan.com/images/master/9/92/Book_open2.png
File:Bookicon.png
http://master.bitplan.com/images/master/2/23/Bookicon.png
File:Cr icon.png
http://master.bitplan.com/images/master/e/e8/Cr_icon.png
File:Graduate.png
http://master.bitplan.com/images/master/8/8a/Graduate.png
File:QuizcardIcon.png
http://master.bitplan.com/images/master/b/b8/QuizcardIcon.png
File:Traininglocation.png
http://master.bitplan.com/images/master/b/b1/Traininglocation.png
File:Users2.png
http://master.bitplan.com/images/master/6/6d/Users2.png
File:ZAnswerIcon.png
http://master.bitplan.com/images/master/6/64/ZAnswerIcon.png
File:ZQuestionIcon.png
http://master.bitplan.com/images/master/d/d5/ZQuestionIcon.png

⌘⌘ Derived pywikibot family file[edit]

Note that the password is NOT included and the password clear text feature of pywikibot is NOT used

# -*- coding: utf-8  -*-
from pywikibot import family

class Family(family.Family):
    name = 'test'
    langs = {
        'en': 'test.bitplan.com',
    }
    def scriptpath(self, code):
       return ''
       
    def isPublic(self):
        return False   
        
    def version(self, code):
        return "1.27.3"  # The MediaWiki version used. Very important in most cases. (contrary to documentation)   

    def protocol(self, code):
       return 'http'

⌘⌘ py-3rdparty-mediawiki[edit]

from wikibot.wikibot import WikiBot
wikibot=WikiBot.ofWikiId("test2")
wikibot.site ..
🖨 🚪