Update Errol: the XMPP Automatic file sender

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.

$ cat config.example.ini

[XMPP]
pubsub_enable=true
muc_enable=true
pubsub=pubsub.example.org
node=be.agayon.errol:0
room=chat@chat.example.org
jid=jid@example.org/errol
password=pass
ressource_receiver=-receiver
ressource_sender=-
nick_sender=example_sender
nick_receiver=example_receiver
receiver=jid@example.org/errol-receiver
presence_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. [ref]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.[/ref]

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

links

social