SMWConTalk2020-04

From BITPlan Wiki
Jump to navigation Jump to search

<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

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

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

#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

⌘⌘ Derived pywikibot family file

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-3rdpart-mediawiki

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