SàT progress note 2019-W18

goffi 03/05/2019, 08:04 jabber-xmpp-en SàT project libre SàT progress

Hello,

this week I've had to fix the way jid are used for file transfer.

To explain you the problem, I need to explain you how communication is done in XMPP (*). To be brief, when an entity (with jid louise@example.net) want to access a component (with jid files.example.net), it sends a "stanza" which is an XML element. There are 3 kinds of stanza (presence, message, and iq).
In our case we use iq stanza, so Louise sends something like:

<iqfrom="louise@example.net"to="files.example.net"type="set">
  […]
</iq>

and the component answers with something like this:

<iqfrom="files.example.net"to="louise@example.net"type="result">
  […]
</iq>

Last week I've explained how I've used the local part in components to access files from somebody else. So far, when creating a stanza, I was using the jid we are connecting with in the from attribute (i.e. where we set the sender of the message).

This is working well with clients, or components if you don't use local part, but when somebody was accessing files from pierre@files.example.net, the jid used by the component is files.example.net, a different one, so this was not working anymore.

To fix that, I've simply had to change the code to use the jid used to contact the components (i.e. the one in the to attribute of the original request) instead.

I've also fixed a MAM (Message Archive Management, XEP-0313) bug where the same messages were requested again on next start up under certain conditions.

Finally, I've completed a generic invitation mechanism to notify somebody when an event or photo album is available. When the invitation is received, the data needed to retrieve the thing is saved in a private "list of interest", which is a pubsub node. With that I can now diplay in Libervia the available photo albums as you can see in the screen capture below.

Libervia Photo Album Vignette

We are nearly there, I still have to complete the guest page (page for people without XMPP account), so they can see events or photo albums, and I can launch the beta. It's a matter of days now.

Thanks for reading, as always feedbacks are welcome.

(*) to learn more about XMPP, you can check my series of articles "Let's talk XMPP". It's originally written in French, and only 4 articles on 10 are translated, help would be welcomed to translate the other ones.

SàT progress note 2019-W17

goffi 26/04/2019, 10:26 jabber-xmpp-en SàT project libre SàT progress

Hello,

this week I've had little time to work on SàT : thanks to the extended easter week-end, I've had a break.

I did manage to work a bit on the file sharing service, still focusing on the photo album. As I've explained last week, file sharing can be used directly from device to device (e.g. retrieving pictures taken on a mobile phone from desktop computer), or with a server-side service.

XMPP allows to create "components" which can be seen as generic plugins to create services on the server (generic in the way that it's not tied to a specific server implementation, but can be used with anyone implementing XEP-0114). Starting with the incoming v0.7, SàT can be used as a component, and file sharing is the first one.

Until now, it was only used to store personal data, so the files could be accessed with the jid of the component. For instance, if your server is example.net your file sharing component may have the jid files.example.net. To access photo albums, we need the path of the album (e.g. /photos/week-end) which is set in the node attribute in XEP-0329, so you can request files.example.net to retrieve your files (i.e. photo album) from /photos/week-end.
Problem: if Louise is connected to files.example.net and wants to access /photos/week-end, she will get her own album. How to do if she wants to access the one of Pierre?

That's were the local part is used, i.e. the part before the @ in a jid. The files.example.net component will receive all traffic sent to any jid finishing with @files.example.net. So when Louise wants to access Pierre files, she can use pierre@files.example.net instead of just the domain name. That's what I've implemented this week. By using just pierre, the component will associate this with its own server (i.e. example.net), and will look for files from pierre@example.net (and check which ones Louise can access).

But what for people with an account outside of example.net, for instance what if file sharing service allows nestor@example.org to store files? Louise can't request nestor@files.example.net because it would get the files of nestor@example.net (note the .net insteaf of .org , it's a different user). To allow to retrieve the files of an external account, we should be able to use a full jid in the request, but it's forbidden to use @ in local part of the jid.

That's where XEP-0106 is used, it allows to escape a jid to do exactly that. I've implemented that so Louise can request nestor\40example.org@files.example.net to retrieve files from nestor@example.org. Don't worry for the complicated address, the end-user should not have to type it herself.

Last but not least, I have also fixed the margin issue with paragraphs and added missing Atom feeds links, it should hopefully be more confortable to read this blog.

To summarize, during this short week I've implemented a way to retrieve files from an other user in file sharing component, I've implemented XEP-0106, I've fixed a small CSS issue on the blog and I've added missing links for Atom feed.

E

edhelas 26/04/2019, 10:50

SàT progress note 2019-W16

goffi 18/04/2019, 06:14 jabber-xmpp-en SàT project libre SàT progress

Hello everybody,

this is the time for a second progress report.

After the implementation of the button for translations, I've updated the French version of Libervia, and of the new website I'm currently working on (which is not yet online). For now this is done locally using tools like Gtranslator or Poedit, I plan to install at some point a web app like Weblate or Pootle and if possible to integrate is with SàT/XMPP (at least for authentication) to make contributions easier.

Beside that I've mainly been working on photos album, I want to be able to use it with 0.7.
For a bit of background, photo album is a specialized view of file sharing. I've evaluated two XEP (XMPP Extension Protocol) for that:

  • File Repository and Sharing (XEP-0214) which is based on Pubsub and Collections Nodes (XEP-0248)
  • File Information Sharing (XEP-0329) which is a simple way to share a repository

File sharing is usable either with direct sharing of a repository from a device (e.g. photos from a mobile phone), or with a server component which host files.

I've chosed the second one (File Information Sharing) for now because the Pubsub one is based on Collections which is, in my opinion, currently not usable: permissions from collection nodes are overwritting ones of leaf nodes, and as a result a private node can be accidentaly opened. This needs to be addressed, it's not the first time I discard pubsub collections because of that, I'll try to propose changes to standard after the 0.7 release.

The other reason I've chosen "File Information Sharing" (FIS) is that the Pubsub one handles mirrors and versions, which I feeled overcomplicated at the time. With FIS, I could make an implementation quickly, and I have a working UI now, which is already quite usable (see this blog post to see how it looks like).

But when I'm using the component, I have no way to change access (everything is managed, there is just no interface to change it), so when I put a file on the file sharing component, it stays private for now, not ideal when you want to share a photo album.

So I've worked on a quick way to do it, using ad-hoc commands: one to change file/directory permissions, and one to delete files. It's nearly finished and will be the last thing before starting beta phase.

That said, Pubsub has already everything needed to manage access and subscriptions (to know when new files/photos are available), so I plan to re-evaluate XEP-0214 at a later point, and if I still find it ill-adapted, maybe propose an other option.

I've also noticed a couple of CSS issues on the blog engine (mainly some padding around paragraph would make it easier to read), and I've been noticed that link to Atom feed is missing on the blog. I was planning to fix that this week but could not find the time (I'm working on SàT on my free time). So I hope to do this in the next few days.

That's it for this week. I'm looking forward to start debugging phase, and then finally release.

SàT Progress note 2019-W15

goffi 11/04/2019, 06:01 jabber-xmpp-en SàT project libre SàT progress

Hello everybody,

I've decided to start writing regular progress notes on this blog, so I can have more feedback from you :). The goal is on one hand to show what is worked on, and on the other hand to explain some technical/design decisions. I'll try to make it weekly, but it's not a promise (maybe this one will be the only one who knows). Also even if I often try to publish both in French and English, this is additional work and I need to focus, so this will probably be English only.

For people who haven't heard about the project, Salut à Toi (or SàT) is a communication ecosystem, libre (free as in freedom), decentralised, encrypted, multi-platforms and based on the rock solid XMPP standard. There are numerous features, among which chat, blog, events, files sharing, etc. and even a web framework. You can check https://salut-a-toi.org for details. Cagou is the frontend for desktop/Android, Libervia the web frontend (which include the web framework), jp the command line frontend, and Primivitus the TUI (Terminal User Interface).

Let's go with this first weekly progress note.

This week I've been working on connection change on Cagou on Android: when disconnected, the backend will try to reconnect every 30 s, this makes no sense when network has been disabled, and would be bad for battery. Now, thanks to pyjnius and android module from python-for-android, backend can check connectivity status, and get notified when there is a change. With those data, the reconnection can be adapted to the situation.

This was the last feature I wanted to implement for Cagou. It is now ready for beta. I'm already aware of a couple of troubles, they will be corrected during beta phase.

To save some bandwith on connection, roster versioning has been implemented.
So far SàT was requesting whole roster (the name of the contact list in XMPP) at each startup, which is not really optimal. Roster versioning lets client keep a local cache, and request only for changes (added/removed contacts) since its version in cache.
This was already handled in wokkel that SàT is using, but roster needed to be saved in local storage, and updates to be managed. A jp roster resync command has been added to force a full resynchronisation with server.

On Libervia I've added a button to change language. Localisation was already managed in the engine, but not used.
An explicit button is needed because there is no good way to auto detect language of user (checking user location is not good for various reasons, and browser language is not good either because user can be using a third party browser in a library for instance), so this needs to be visible and easy to change.
I try to keep Libervia working as much as possible without javascript, so the button had to work without javascript enabled. When javascript is enabled, changing language on the dropdown will immediately reload the page with new locale. When javascript is not enabled, an additional button is visible to use the desired language.
capture of language selector with extra button when javascript is not available

Beta version is coming, the last thing I want to implement is a discovery page for photo albums. I've also started to write a new website using Libervia, where I'll move (and improve) SàT documentation, which is currently mainly on the wiki.

That's all for today, please let me know if this progress note is useful/interesting, and if it worth publishing it more or less every week.

N.B.: I haven't made a blog post with the links to my 2 talks at FOSDEM, so here it is:

First talk, about using XMPP beyond instant messaging can be found at:

Second talk, a presentation of SàT focusing on its use of Python

C

clacke 15/04/2019, 10:39