How to deploy The Lounge, an IRC client and logger

Yesterday I started talking with a partner on how we would collaborate. I just wanted an IM so I invited them on our Gitter and Slack. But they don't use any of these solutions. They use IRC. Which is great but then I did not have any logger or private server around. And being most of the time on the go, I have no stable connection. I need this logger. So I deployed one on Clever Cloud. This is how I did it.

How to deploy The Lounge

Googling my way through a nice solution called The Lounge. It's in their word:

“The self-hosted web IRC client.
Always connected.”

So it allows me to connect to a server, and can act as a logger too. And it works on mobile as a PWA. Always a nice plus. It's written in JavaScript and uses SQLLite for persistence. In Clever Cloud terms, it means I will need a Node.JS runtime to run the server and an FS-Bucket addon to store files. Here's how I have deployed everything.

git clone https://github.com/thelounge/thelounge.git
cd thelounge
clever create --type node thelounge
clever env set NODE_ENV production
clever addon create fs-bucket --plan s fsLounge
clever service link-addon fsLounge
clever env set THELOUNGE_HOME /app/home/
clever env set CC_FS_BUCKET /home:bucket-84d43724-d8ff-44a3-a4d9-053c45c3a5e4-fsbucket.services.clever-cloud.com
clever env set CC_PRE_RUN_HOOK 'yarn build && cp ./config.js /app/home/config.js'
clever env set NODE_BUILD_TOOL yarn

To configure it you can copy the default configuration in the home directory. First I have copied the default conf at the project root: cp defaults/config.js ./config.js

I then edited ./config.js to change the port to 8080. If you look at the CC_PRE_RUN_HOOK variable you can see the file will be copied in the home directory define in the environment variable THELOUNGE_HOME. Do not forget to commit your changes!

If you want to know exactly what you can configure you can take a look at their documentation.

Now we should be all good to go so one last command and The Lounge will be online: clever deploy

From now on you should see the deployment logs. Once it's over and you see success, type clever open and it will open the Lounge in your default web brower.

If you haven't change the default config you should be prompted with a Login screen. We do have to create a user. To do so they have a CLI tool. Or you can configure an LDAP server or another supported user directory. We will use the CLI tool. Fastest way to do this is to ssh to your instance by typing clever ssh.

From there you can cd into the directory of the application and type node index list to see the current users. As expected there are none. So go ahead and type node index add username. You will be prompted for a password. The user will be created and now you can login 🙂 Here is my terminal output for these operations:

bas@35e83ff3-f546-4c93-8c1d-c564d6f8673f ~ $ cd app_1ae60928-cb87-4c73-8e74-44ffd7b6e49a/
bas@35e83ff3-f546-4c93-8c1d-c564d6f8673f ~/app_1ae60928-cb87-4c73-8e74-44ffd7b6e49a $ node index list
2019-01-16 16:24:48 [INFO] There are currently no users. Create one with thelounge add <name>.
bas@35e83ff3-f546-4c93-8c1d-c564d6f8673f ~/app_1ae60928-cb87-4c73-8e74-44ffd7b6e49a $ node index add ldoguin
2019-01-16 16:24:52 [PROMPT] Enter password: 
2019-01-16 16:24:56 [PROMPT] Save logs to disk? (yes) 
2019-01-16 16:24:58 [INFO] User ldoguin created.
2019-01-16 16:24:58 [INFO] User file located at /app/home/users/ldoguin.json.

And that's it now you have your own IRC client, always online, that works on mobile and support push notifications. If you want to go further you can add your own domain name and you will have automatic SSL support thanks to our Let's encrypt automatic integration. You can also spend some time on TheLounge website and look at the different themes you can install or how to change the CSS. Happy Hacking!

Blog

À lire également

Clever Tools: a year of enhancements for your deployments, on the road to v4

A command line interface (CLI) is at the core of developer experience. At Clever Cloud, we have been providing Clever Tools for almost 10 years.
Engineering Features

Otoroshi with LLM: simplify your API and AI service management on Clever Cloud

Your applications and services are evolving in an increasingly complex environment, requiring effective management of APIs and interactions with artificial intelligence models such as the very popular LLMs (Large Language Models).
Features

Markitdown-as-a-Service: from AI to production on Clever Cloud

Every day, new tools are released, AI brings new perspectives, you have new ideas. It's one of Clever Cloud's missions to help you to develop and test them in real-life conditions, effortlessly, before making them available to everyone.
Engineering