• chevron_right

      Update Errol: the XMPP Automatic file sender

      jnanar · Sunday, 10 May, 2020 - 15:00 · 2 minutes

    Errol is a file sender that can be used to watch a directory and automatically transfers the new files (or modified ones) with XMPP.

    You can find the previous description here .

    I recently updated it to V2.0.1. This articles describes the changes since last article.

    Changelog

    • Replaced all the yield from syntax to async/await syntax for asyncio calls
    • Added some options to enable or not the muc/pubsub features. If your XMPP account does not have a proper pubsub service or if you don't want to advertise your file transfer, these functionalities are not mandatory anymore.
    • Moving from aionotify to watchdog . aionotify was not actively developed since 2 years. Even if is not asynchronous, watchdog can be used with hachiko .

    Errol should now be usable on Linux, Windows, Mac OS X and FreeBSD because watchdog supports all these operating systems. Note: only Linux has been tested so far.

    I also performed small improvements, refactoring and bug fixes.

    Getting started

    The list of dependencies has been updated but remains quite small.

    Installing

    You can easily install errol with pip.

    $ pip install errol

    On Archlinux, a PKGBUILD is available in AUR .

    Configuration

    The complete list of options is available in the template config file.

    $catconfig.example.ini[XMPP]pubsub_enable=truemuc_enable=truepubsub=pubsub.example.orgnode=be.agayon.errol:0room=chat@chat.example.orgjid=jid@example.org/errolpassword=passressource_receiver=-receiverressource_sender=-nick_sender=example_sendernick_receiver=example_receiverreceiver=jid@example.org/errol-receiverpresence_file=/tmp/errol_presence.txt
    • jid : the jabber account
    • password: the xmpp password
    • pubsub: the pubsub server (publish activity)
    • room: the MUC (chatroom) where errol display information.
    • presence_file: a writable file used to keep track of presences. I use it in a Django Application. 1

    The files will be sent by jid@example.org/errol-0 and received by jid@example.org/errol-receiver. The nicks are the usernames used on the MUC.

    Use it

    Errol should now be usable with only a simple XMPP account and a directory to watch. If you are interested by the Pubsub feature, don't hesitate to read the previous article . It contains a section to setup a pubsub node, configure it and access it with several tools.

    Links

    1. When receiver is online, the file contains '1' and '0' otherwise. It is not super clean but I did not wanted to bring XMPP features in a Django app.