This seems to be the best sub-forum to ask this question. I'm coming from this topic: https://forum.openwrt.org/t/off-grid-messaging-though-openwrts-802-11s-mesh-network I've been working on the first step from that topic which is getting prosody to run.
Have any of you been successful in setting up and running prosody on a 21.02.0 openwrt router? In localhost mode only? I get the impression that maybe this package is missing one or two things in its setup or its configuration. I am absolutely a newbie to prosody, XMPP, and certificates so I am likely missing one or two understandings on this as well.
I've been following this guide that was provided in my last topic. It is partially outdated and it did not provide an how-to steps on getting prosody to run local only. It took me several attempts of running prosody to realize that using the example.org
in prosody will take me out to the internet, which I did not want it to do. I'm trying to create an off-grid chat system through openwrt routers. There will be no internet access in where these routers are going so everything will need to be pointed to localhost. I suspected this is what is tripping in me up if I follow the guide exactly.
I went to prosody's documentation webpages to follow the guides there. Upon a clean reset of openwrt in the router and installing prosody, if I follow the steps shown here and here, these following commands will not work in openwrt.
prosodyctl adduser user@localhost
prosodyctl cert generate localhost
I had to ctl-c
twice to get out of these commands. It did not matter if I used example.org
or localhost
. The commands just hang. No completion or showing any indication of work being done. Do you know why this is so?
I was able to create accounts with this command: prosodyctl register user localhost password
but I'm not sure this is setting things up correctly.
Like as before, it took me a lot of trials and errors to realize that I should not be using example.org
as shown in this guide to set the VirtualHost
with in the prosody.cfg.lau
file with. I discovered that if I wanted a local network, I should set the VirtualHost
to localhost
in the prosody.cfg.lau
file. Once that was in place, I was able to get pidgin to connect to prosody. Sort of.
As for the certificate problem, I tried to create my own self-signed certificates on another computer by following this guide but again, this took me out of local and to internet. Once more again, I realized I need to create a self-signed certificate that pointed to localhost only. I found this webpage and I tried this command example.
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
For about an hour, I was able to use this certificate in pidgin before pidgin kicked it out as invalid certificate. I created another new certificate and still, pidgin (immediately) spat that one out too. I'm still too much of a newbie in understanding the nuances of certificates (this is a first for me) so I'm not sure where I went wrong in creating these certificates.
That's where I am at now. If you were successful in getting prosody up and running in localhost-only mode on your 21.02.0 openwrt, I'd appreciate very much to hear from you on how you pulled it off.