Gradually modernizing the codebase

Team blog: Developers

I’m working my way through modernizing the lib.reviews codebase, starting with older dependencies.

Today included:

  • Switch to maintained bcrypt dependency for password hashing (compatible with previous hashes)
  • Phase out deprecated request dependency
  • vendored Thinky ORM (unmaintained) and improved its accessibility; removed its reliance on bluebird
  • made test suite fixture setup more resilient against interruption or errors by using a test wrapper
  • replaced unmaintained node-webhooks with internal webhook handler
  • replaced unmaintained remote-ac autocomplete library with vendored & modernized version

The changes ahead will include:

  • moving away from the unmaintained greenlock library for managing HTTPS certs; I’ll likely just use certbot and a trigger to re-generate certs as needed
  • likely dropping pm2 for managing production deploys in favor of just using systemd

And the biggest planned change is to move from RethinkDB (unmaintained DB backend) to PostgreSQL. That literally touches every aspect of the site, so it may need to proceed in a long-lived branch until we’re ready to flip the switch.