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

Wiki > The Lounge

The Lounge is a self-hosted IRC client with a web interface. It stays connected to your IRC networks while your browser is closed, and keeps your chat history. 15450 was randomly generated for this article; you may use any 5-digit port between 10000 and 32767.

Installation

  1. Connect to your slot via SSH.

  2. Install The Lounge from npm:

     npm install --prefix ~/thelounge thelounge@latest
    
  3. Make the thelounge command available. Skip the PATH line if you've already done this for another program:

     mkdir -p ~/bin && ln -sf ~/thelounge/node_modules/.bin/thelounge ~/bin/thelounge
     echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc
    
  4. Create The Lounge's data folder with its default config, and set the port:

     mkdir -p -m 700 ~/.thelounge
     cp ~/thelounge/node_modules/thelounge/dist/defaults/config.js ~/.thelounge/config.js
     sed -i 's/port: 9000,/port: 15450,/' ~/.thelounge/config.js
    
  5. Start The Lounge:

     screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start
    
  6. Create a user account. You'll be asked for a password (use one different from your Whatbox password) and whether to save logs to disk:

     thelounge add user
    
  7. Visit http://server.whatbox.ca:15450 and log in with the account you just created.

The Lounge runs in private mode by default: nobody can use it without an account. Add more accounts the same way as step 6.

Configuration

The settings live in ~/.thelounge/config.js. Edit it with nano -w ~/.thelounge/config.js, then restart The Lounge for the changes to take effect:

pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start"
screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start

Useful commands (run thelounge --help for the full list):

  • thelounge list: show all accounts.
  • thelounge reset <name>: set a new password for an account.
  • thelounge edit <name>: open an account's settings file in your editor.
  • thelounge remove <name>: delete an account.
  • thelounge install <package>: install a theme or plugin from npm.

Automatically Restart (optional)

  1. Create the restart script:

     touch ~/thelounge_restart.cron
     nano -w ~/thelounge_restart.cron
    
  2. Paste the following:

    #!/bin/bash
    if pgrep -fx "node /home/user/thelounge/node_modules/thelounge/index.js start" > /dev/null
    then
        echo "The Lounge is running."
    else
        echo "The Lounge is not running, starting The Lounge"
        screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start
    fi
    exit
    
  3. Press Ctrl+X, then Y, then Enter to save.

  4. Make it executable and open your crontab:

     chmod +x ~/thelounge_restart.cron
     EDITOR=nano crontab -e
    
  5. Add these lines at the bottom, then save:

     @reboot /home/user/thelounge_restart.cron >/dev/null 2>&1
     */5 * * * * /home/user/thelounge_restart.cron >/dev/null 2>&1
    
  1. On the Manage Links page, select Add a custom app.

  2. Enter thelounge as the name and 15450 as the port, and enable WebSockets.

  3. Save, then visit https://thelounge.example.box.ca.

  4. Once that works, make The Lounge only reachable through the link. In ~/.thelounge/config.js, change host: undefined, to host: "127.0.0.1", and reverseProxy: false, to reverseProxy: true,:

     sed -i 's/host: undefined,/host: "127.0.0.1",/; s/reverseProxy: false,/reverseProxy: true,/' ~/.thelounge/config.js
    
  5. Restart The Lounge:

     pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start"
     screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start
    

    http://server.whatbox.ca:15450 stops working; https://thelounge.example.box.ca keeps working.

Updating

  1. If you set up the restart script, comment out its lines with EDITOR=nano crontab -e so it doesn't restart The Lounge while you update.

  2. Stop The Lounge, update it, and start it again:

     pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start"
     npm install --prefix ~/thelounge thelounge@latest
     screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start
    
  3. Uncomment the crontab lines.

Your accounts, settings and logs in ~/.thelounge are kept.

Moving from the old instructions

Earlier versions of this article built The Lounge from its git repository into ~/thelounge, with a restart script at ~/.thelounge/cron. Your accounts and settings in ~/.thelounge work with the new install. To switch:

  1. Remove the * * * * * /home/user/.thelounge/cron line with EDITOR=nano crontab -e, and delete the old script: rm ~/.thelounge/cron

  2. Stop the old install and move it out of the way:

     pkill -f "/home/user/.local/bin/thelounge start"
     mv ~/thelounge ~/thelounge-old
     rm ~/.local/bin/thelounge
    
  3. Follow Installation steps 2, 3 and 5 (skip step 4: your config.js already has your port), then log in with your existing account.

  4. When everything works, remove the old copy: rm -r ~/thelounge-old

Uninstalling

  1. Remove the restart script lines with EDITOR=nano crontab -e, and delete the script: rm ~/thelounge_restart.cron

  2. Stop The Lounge and remove its files. The second line deletes your accounts, settings and logs:

     pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start"
     rm -r ~/thelounge ~/bin/thelounge
     rm -r ~/.thelounge
    
  3. If you created a Managed Link, delete it on the Manage Links page.

Troubleshooting

  • Forgot your password: run thelounge reset <name> and log in with the new password.
  • The page loads but stays on "Connecting": if you use a Managed Link, make sure WebSockets is enabled on it.
  • EADDRINUSE in the screen session (screen -r thelounge, detach with Ctrl+A then D): another program is using the port. Pick a different port, change port: in ~/.thelounge/config.js, and start The Lounge again.
  • thelounge: command not found: run source ~/.bashrc, or log out and back in.