Whatbox Logo
Login for certain variables to be updated with your slot's information

Wiki > The Lounge

The Lounge is a Node.js-based IRC client with a web-based graphical interface.

Installation

These instructions will use the randomly generated port number 28718. Feel free to use an available port of your choice anywhere that port is listed.

  1. Create a directory for The Lounge, its config, and its data:

     mkdir ~/.thelounge
    
  2. Install The Lounge:

     cd ~/.thelounge
     npm install thelounge
    
  3. Start The Lounge to generate a config file, and then kill the process:

     npx thelounge start --config port=28718
     ^C
    

    If the port 28718 is unavailable, you can change it to an available port number of your choice throughout the rest of this document, or you can refresh this page to get a new randomly generated port number.

  4. Edit the config file to permanently point to that port:

     sed -i 's/port: 9000,/port: 28718,/' config.js
    
  5. Generate a user account:

     npx thelounge add user
    
  6. Start TheLounge:

     npx thelounge start > /dev/null 2>&1 &
    

TheLounge should now be accessible at http://server.whatbox.ca:28718/. Log in with the username and password you created.

Optional: Configure The Lounge to use SSL

  1. Generate a self-signed SSL certificate:

     openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout thelounge.key -out thelounge.crt -subj "/CN=server.whatbox.ca" -addext "subjectAltName=DNS:server.whatbox.ca"
    
  2. Edit the config file to enable HTTPS support and to point to the certificate:

     sed -z 's/enable: false,\n\t\tkey: "",\n\t\tcertificate: "",/enable: true,\n\t\tkey: "/home/user/.thelounge/thelounge.key",\n\t\tcertificate: "/home/user/.thelounge/thelounge.crt",/' -i config.js
    
  3. Restart The Lounge:

     pkill -f thelounge
     npx thelounge start > /dev/null 2>&1 &
    

The Lounge should be now accessible at https://server.whatbox.ca:28718/.

Automatically Restarting The Lounge

You can create a cron job that automatically restarts The Lounge when it goes down:

cd ~/.thelounge  
             
cat > cron <<'EOF'
#!/bin/bash

cmd='npx thelounge start'

if ! pgrep --full "$cmd" --uid $USER > /dev/null
then
  cd ~/.thelounge         
  $cmd > /dev/null 2>&1 &
fi
EOF

chmod +x cron
(crontab -l 2> /dev/null;echo "* * * * * $HOME/.thelounge/cron") | crontab -