sqlitebrowser / dbhub.io

A "Cloud" for SQLite databases. Collaborative development for your data. 😊
https://dbhub.io
GNU Affero General Public License v3.0
363 stars 39 forks source link

common: memcached now requires tls for production #294

Closed justinclift closed 5 months ago

justinclift commented 5 months ago

As we're looking to use a dedicated Memcached server shared between our backend systems, we'll be passing traffic over the wire for that environment.

This PR adds the code needed for using TLS with memcached. It's only needed in production though.

Note that this requires memcached to be configured with TLS. On our current Ubuntu 20.04 LTS servers, it needs this added to their /etc/memcached.conf file:

-Z -o ssl_chain_cert=/etc/letsencrypt/live/SERVER_FQDN/fullchain.pem,ssl_key=/etc/letsencrypt/live/SERVER_FQDN/privkey.pem

The SERVER_FQDN piece needs updating for each individual server in question. :wink:

Take special note of the fullchain.pem file name there. Don't use cert.pem instead, otherwise you'll get errors when the client doesn't want to connect to the TLS server ("Unknown Authority").

justinclift commented 5 months ago

@MKleusberg FYI. :smile:

justinclift commented 5 months ago

This isn't deployed yet. I'll probably do it Thursday, as I have other (unrelated) stuff I need to do tomorrow instead.

justinclift commented 5 months ago

@MKleusberg @chrisjlocke This has been deployed to production now. Actually, everything right up to the latest commit as of right now (7f5821270a77bd38e279527731dc40f034599604) is now live. :smile:

justinclift commented 5 months ago

@MKleusberg The "Usage" page is throwing an error (in production) when the user doesn't have usage data to display:

image

Would you be ok to take a look at that? I'm pretty sure it'll be a simple fix, but I'm so desperately in need of sleep that I'd better not try it. :wink:

chrisjlocke commented 5 months ago

And the dark mode stuff? I see a blog post in the making... ;)

justinclift commented 5 months ago

Yeah, it's in there too. I'll take a look at that error above in a few hours.

justinclift commented 5 months ago

Looks like using coalesce() in the ApiUsageData() function should fix the problem. A fix with that is just running through the Cypress tests on my local pc now. If it passes, I'll push that to the master branch then deploy it to our infrastructure.

justinclift commented 5 months ago

Yep, that worked. The fix is now added to our master branch, and has been deployed to production.

MKleusberg commented 5 months ago

Awesome :+1: