back to ~fox

updating tardis' instance of the lounge

The Lounge is a web-based irc client. We run it because it's a really nice interface for users who are unfamiliar with irc to get started. It's also worth pointing out that users get persistent connections, so they get history and it avoids join/part spam.

the lounge on tardis

We used to run shout, before it was forked into the Lounge. This is important, because it means we run a really old config.js file, and there have been several iterations of node.js since.

A registration page was written, allowing users to sign up for accounts.

To facilitate this, the npm package that serves the lounge was edited. Please bear that in mind if you want to upgrade it!

a brief recommendation from someone who runs their own instance

If someone is reading this in the future, and is starting from scratch, I highly suggest that instead of installing the lounge through npm, you do the following:

  1. git clone
  2. cd lounge && npm install (don't install globally)
  3. Use git tag and git checkout [tag] to choose which version you want to run.
  4. NODE_ENV=production npm run-script build
  5. Run the lounge in screen, via forever, or using systemd. (Make sure you make a config.js file or just run npm start to have it use the defaults.)

If you do it this way, it's a lot easier to do upgrades (git checkout master && git pull, choose your new version in git tag and git checkout [tag]. Next, rm -rfv node_modules, and run steps NODE_ENV=production npm run-script build again).

Though I appreciate this does not on paper seem easier, it means that any changes you make to the client (like adding a custom sign-up link) are tracked under git and so are a lot easier to find later.

updating the lounge on tardis


The lounge runs on taran, under the user shout.

I backed up /usr/lib/node_modules/thelounge to /home/shout/usr-lib-node_modules-thelounge-19-08-2017 (hopefully that makes it fairly obvious where it came from).

You might want to double-check that taran is running a new enough version of node.js before attempting the update (we had issues in the past with this).

I also backed up /home/shout/.lounge to /home/shout/.lounge-backup-19-08-2017. Our user configs are much more valuable than the actual lounge instance itself -- so even though an update should not break the stuff in ~/.lounge, it's not worth being silly about.

the upgrade

As root, run npm update -g thelounge.

There's some script that auto-restarts the lounge when it dies, so (as user shout) running lounge stop will actually effectively be a restart. I don't know where this script lives, but it's worth bearing in mind.

Next, restore the links for the shout-register service.

There's a one line addition for registration after the login <button> element. The file you need to edit is /usr/lib/node_modules/thelounge/client/index.html.

There's a few lines of css you need to add, too. All the css for the register button classes. The file you need to edit is /usr/lib/node_modules/thelounge/client/css/style.css.

Although your mileage might vary, for the current upgrade (v2.4.0), the register link was added to line 113 of index.html.

shout@taran:~/staging/lounge$ diff client/index.html /usr/lib/node_modules/thelounge/client/index.html 
>        <a href="" class="btn2">Register</a><!-- register -->

And the css changes were dumped in around line 190.

shout@taran:~/staging/lounge$ diff client/css/style.css /usr/lib/node_modules/thelounge/client/css/style.css 
> .btn2 {
>         border: 2px solid #84bdce;
>         border-radius: 3px;
>         color: #84bdce;
>         display: inline-block;
>         font-size: 12px;
>         font-weight: bold;
>         letter-spacing: 1px;
>         margin-bottom: 10px;
>         padding: 9px 17px;
>         text-transform: uppercase;
>         transition: background .2s, border-color .2s, color .2s;
>         word-spacing: 3px;
> }
> .btn2:disabled,
> .btn2:hover {
>         background: #84bdce;
>         color: #fff;
> }
> .btn2:active {
>         box-shadow: none;
>         opacity: .8;
> } 
> .btn2:disabled {
>         opacity: .6;
> } 



Unfortunately, it looks like the users will not automatically reconnect (even when they log in). I added a note to the shout page to ask them to manually issue a /connect, which will reconnect them.