Build

Learn how to get your raspberry pi booted into an operating system

Screen Shot 2013-01-18 at 5.12.32 PM Although I only live with 4 others, wife, son & 2 cats, in a small 5 room apartment most evenings we are in different rooms, or in the summer 3 different floors, wearing headphones chilling to our own choices in music & tv. As I think it's uncouth to yell out of the window or across the apartment to get someone's attention I setup a Raspberry Pi Model B as an XMPP server running MUC. As it's only for 3 people, unless we have visitors, I chose to run Prosody, it's pretty lightweight, easy to setup, the stable version is in the raspbian repos & i've used it before. I've also used and run ejabberd, openfire, tigase, jabberd,... but IMHO they are heavier on resources and a bit harder to setup, and are overkill for my needs and anyway I like lua.

 

As stable Prosody, currently 8.2,  is in the raspbian repos you install it via apt.

sudo apt-get install prosody

which will install (if they are not already installed)

liblua5.1-0 lua-event lua-expat lua-filesystem lua-sec lua-socket prosody
 ssl-cert

Once Prosody is installed you'll need to create a config file & add some users.

First create an admin user for the server. As Prosody is running on birstall.leicestershire.lan, i'll use This email address is being protected from spambots. You need JavaScript enabled to view it. as my admin account & create it using the prosodyctl utility.

sudo prosodyctl adduser%MINIFYHTML58c76454d66f6b895dceeb0cbc81194021%%MINIFYHTML58c76454d66f6b895dceeb0cbc81194022%This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML58c76454d66f6b895dceeb0cbc81194023%

which will ask you to enter a password for that user (twice)

Enter new password: 
Retype new password:

[As i'm going to disallow in-band registration i also created accounts for my wife & son & a non-admin account for myself after creating the admin account also using prosodyctl. But if you are going to allow users to create their own accounts you can  just skip to creating the config file.]

sudo prosodyctl adduser%MINIFYHTML58c76454d66f6b895dceeb0cbc81194024%%MINIFYHTML58c76454d66f6b895dceeb0cbc81194025%This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML58c76454d66f6b895dceeb0cbc81194026%
sudo prosodyctl adduser%MINIFYHTML58c76454d66f6b895dceeb0cbc81194027%%MINIFYHTML58c76454d66f6b895dceeb0cbc81194028%This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML58c76454d66f6b895dceeb0cbc81194029%
sudo prosodyctl adduser%MINIFYHTML58c76454d66f6b895dceeb0cbc81194030%%MINIFYHTML58c76454d66f6b895dceeb0cbc81194031%This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML58c76454d66f6b895dceeb0cbc81194032%

Now you need to create a config file. It's written in lua, but you don't need to know lua to create it as it's pretty human readable.

Create a file in /etc/prosody/conf.avail with the filename of FQDN of the host Prosody is running on and a suffix of .cfg.lua using whatever editor you are comfortable with, in my case I happen to like vi/vim so i'll use that.

sudo vi /etc/prosody/conf.avail/birstall.leicestershire.lan.cfg.lua

My configuration file looks like this.

VirtualHost "birstall.leicestershire.lan" -- FQDN of host server is running on
admins = {"%MINIFYHTML58c76454d66f6b895dceeb0cbc81194033%%MINIFYHTML58c76454d66f6b895dceeb0cbc81194034%This email address is being protected from spambots. You need JavaScript enabled to view it.%MINIFYHTML58c76454d66f6b895dceeb0cbc81194035%"} -- admin account
modules_enabled = {

                "roster"; -- Allow users to have a roster. Recommended 
;) "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in. "tls"; -- Add support for secure TLS on c2s/s2s connections "disco"; -- Service discovery "private"; -- Private XML storage (for room bookmarks, etc.) "vcard"; -- Allow users to set vCards "legacyauth"; -- Legacy authentication. Only used by some old clients and bots. "version"; -- Replies to server version requests "uptime"; -- Report how long server has been running "time"; -- Let others know the time here on this server "ping"; -- Replies to XMPP pings with pongs "adhoc"; -- Support for "ad-hoc commands" that can be executed with an XMPP client "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands "announce"; -- Send announcement to all online users "welcome"; -- Welcome users who register accounts "motd"; -- Send a message to users when they log in "posix"; -- POSIX functionality, sends server to background, enables syslog, etc. --"register"; -- Uncomment to enable mod_register }; -- allow_registration = true -- Uncomment to llow users to register new accounts motd_text = [[This is a private xmpp server. if you are not authorized please logoff immediately.]] welcome_message = [[$username welcome to $host]] disallow_s2s = true -- This is a private server so no federation Component "conference.birstall.leicestershire.lan" "muc" name = "MUC" restrict_room_creation = admin -- only admin user can create a new MUC

[If you want to allow in-band registration, users can register an account from their XMPP client, uncomment the

"register"; -- Enable mod_register

&

allow_registration = true -- Allow users to register new accounts

lines.]

After you have created & saved the configuration file you need to create a symlink to it in the /etc/prosody/conf.d directory.

sudo ln -s /etc/prosody/birstall.leicestershire.lan.cfg.lua /etc/prosody/birstall.leicestershire.lan.cfg.lua

[Change birstall.leicestershire.lan to your hosts name]

And then start Prosody

sudo /etc/init.d/prosody start

Actually you are restarting it as it's already running as you installed it using apt and it'll start automatically when you reboot as well. You can now login to the server, if you are the admin user create muc/chatrooms, im logged in users and do all the other things you can do using xmpp by using any xmpp compliant client such as adium, pidgin, Tkabber, psi, ...

This is just a very simple setup that works for my needs as I don't need to worry about setting up SRV records, portforwarding, federation or even much security. If you want to do a more complicated setup or just read a bit more about XMPP look at these sites.

http://prosody.im

http://xmpp.org

Share

Read more http://russelldavis.org/2013/01/18/setting-up-prosody-on-the-raspberry-pi-for-house-apartment-secret-club-house-wide-chatroom/

The $25 ARM GNU/Linux computer that could change the world

There isn’t much any small group of people can do to address problems like an inadequate school curriculum or the end of a financial bubble. But we felt that we could try to do something about the situation where computers had become so expensive and arcane that programming experimentation on them had to be forbidden by parents; and to find a platform that, like those old home computers, could boot into a programming environment.

 

Over the next few years, Eben, having left the university for industry, worked on building prototypes of what has now become the Raspberry Pi in his spare time.

 

Read more...

Feed Me...

Website Search