Fast and dirty install of Converse.js XMPP client as a replacement of Jappix

[ update ] go down… faster and safer solution with http-bind working all together at the end [ update ]

Since there isn’t an app to install via github like “conversejs_ynh”… I done a couple of roundabouts to solve the need of a xmpp client bypassing the old and unsupported jappix.

First, I already have a XMPP redirection for http-bind working.

Create/install an app “custom webpage”

Literally copycat (in the plagiarism sense of the word) the web https://inverse.chat even the folder structure.

The only thing that I changed from the original converse.html was the http-bind address to prevent overloading unnecessarily the creator’s http-bind, and by the way, the name of the file to index.html

Absolutely JUST THAT. Nothing more… and WORKS!!!

I feel so bad, for such a copy/paste technic, but solve the problem…

Anyother one tried?

4 Likes

Hi
Nice explanation!
Can you tell how you did http-bind?

Sure… install an app call redirect… in fact… I did it with thanks to this post:

1 Like

:smile:
I forgot that I myself had given solution for it.
Thanks

1 Like

Nope… thanks to you… that already solved me half the problem… now I’m fighting to prevent using the CDN they use, in one hand to completely host the web client, and in other hand not to abuse CDN traffic.

Aaaaaand… it’s done…

https://conversejs.org/docs/html/quickstart.html

There specify witch data need to be copied. Don’t forget the css/webfonts folder… is for the icons… the sounds folder… blah blah blah… everything available in the github.

Works …

1 Like

If anyone need it… here goes a link to the real files loaded… (PLEASE NOT TO ABUSE MY HTTP-BIND) :yum:

1 Like

Do you have jappix-mini like solution?

Once you have converse.js done… is just change the initialization script…

Just not to use fullscreen, but overlay instead.

Bonjour.

J’ai voulu tester, mais il doit y avoir quelque chose qui m’échappe.

Voilà ce que j’ai fait:

  1. initialisation webapp_custom

  2. install converse (root) dans /var/www/my_webapp/www:


wget https://miradordemontepinar.net/nextcloud/index.php/s/tMKdgajBoQ8jpT3/download

mv index.html index.html.bup

unzip download

mv converse-js-modded/* ./ && rmdir converse-js-modded

sed -i.bup -e '/bosh_service_url/ s/https:\/\/miradordemontepinar.net/https:\/\/MY_DOMAINE.noho.st/' index.html

chown -R webapp1:webapp1 *

Quand je rentre mes identifiants sur la page d’accueil de converse, rien ne se passe.

Avez-vous une idée ?


Hello.

I wanted to test it, but there must be something I don’t understand.

That’s what I did:

  1. webapp_custom initialization

  2. install converse (root) in /var/www/my_webapp/www:

wget https://miradordemontepinar.net/nextcloud/index.php/s/tMKdgajBoQ8jpT3/download

mv index.html index.html.bup

unzip download

mv converse-js-modded/* ./ && rmdir converse-j-modded

sed -i.bup -e '/bosh_service_url/ s/https:\/\//miradordemontepinar.net/https:\/\/MY_DOMAINE.noho.st/' index.html

chown -R webapp1:webapp1 *

```

When I enter my login details on the converse homepage, nothing happens.

Do you have any idea?

Nope, absolutely no idea. Change the httd-bind address to test… did your http-bind worked with jappix?

Jappix à toujours fonctionner sans que j’aie à modifier des fichiers à la main.
Je ne sais pas où regarder pour trouver de l’information.

J’ai testé avec ‘https://conversejs.org/http-bind’ et cela fonctionne. Mais pas avec mon nom de domaine. Pour info c’est un XXX.noho.st.


Jappix a always work without having to modify files by hand.
I don’t know where to look for information.

I tested with ‘https://conversejs.org/http-bind’ and it works. But not with my domain name. For the record, it’s a XXX.noho.st.

I’ve considering packaging Converse since a long time, but I didn’t manage to find time to package it. I hope we will have a package soon.

3 Likes

I’ll love to see it packaged, cos it will be automatically updated, and could pack the converse.js and the xmpp http-bind in a whole app. What I did was something dirty, unreliable, fast and uncomfortable… but works. If that solve the problem for someone… I’m happy.

Nowhere nobody said it hurts… but you are loading work in an external server that connects again to your server… it’s like another step that degrades security and speed. I don’t know if you need to reinstall or rework the http-bind, but sounds like that.

1 Like

@bjarkan
Oui, passer par un serveur externe est une mauvaise chose et va à l’encontre des objectifs de l’autohébergement.

Je ne comprends pas clairement les tenant et aboutissant de HTTP-bind, mais j’imagine que cela permet de mettre en relation converse.js et le serveur BOSH !?

Si c’est ça, cela veut surement dire que le service BOSH est accessible via un port externe du serveur ?

Bref, le HTTP-bind n’est pas une chose que je maitrise.

@Moul
Je serai ravi de voir un package arrivé pour cette webapp. Je ne sais pas faire du packaging, mais si je peux aider ce sera avec plaisir.


@bjarkan
Yes, going through an external server is a bad thing and goes against the objectives of self-hosting.

I don’t clearly understand the ins and outs of HTTP-bind, but I guess it allows to connect converse.js and the BOSH server!

If that’s the case, it probably means that the BOSH service is accessible via an external port on the server?

In short, HTTP-bind is not something I master.

@Moul
I will be happy to see a package arrived for this webapp. I don’t know how to make packaging, but if I can help it will be a pleasure.

1 Like

Hello @bjarkan,

I’m trying to package Converse for Yunohost and I’am stuck on the proxy/BOSH part.
I would like to avoid using https://github.com/YunoHost-Apps/redirect_ynh#invisible-proxy-redirect in the first time and put everything in a single app.

Do you mind sharing the file again? And sharing your nginx file and setup (subfolder or root)?

Better solution… dirty… but better… converse evolve… and the package I created is older than me…

up to date solution:
Create a My_webapp

wget Converse

copy that file to /var/www/my_webapp/www or through the sftp user created by my_webapp… anyway, goes there

edit the file… nano will do well…
change the bosh_service line…

like this

bosh_service_url: ‘https://domain.com/chat/http-bind’,
please … use your “domain.com” or whatever you have

in /etc/nginx/conf.d/domain.d/my_webapp.conf add before the last }

location = /mywebapp/http-bind {
proxy_pass http://localhost:5290/http-bind;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Port $server_port;

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
}

change mywebapp for the app address I use “chat” for example in my case

in metronome conf… need to activate it… for goodness sake…
/etc/metronome/metronome.cfg.lua

uncomment “bosh” in the modules_enable section… basically remove “–”
uncomment Http server, again … remove “–” just like this

– HTTP server
http_ports = { 5290 }
http_interfaces = { “127.0.0.1”, “::1”}

Restart services aaaaaaand it’s done.

2 Likes