Skip to content

Commit

Permalink
upgrade Heroku/Docker to 12.22, upgrade min node version to 10.17 to …
Browse files Browse the repository at this point in the history
…be min version supported by sqlite3 module, and accomodate weird h: old heroku redis urls in new library
  • Loading branch information
schuyler1d committed Aug 11, 2021
1 parent f60a0d7 commit 564090d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
12
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILDER_IMAGE=node:10.15
ARG RUNTIME_IMAGE=node:10.15-alpine
ARG BUILDER_IMAGE=node:12.22
ARG RUNTIME_IMAGE=node:12.22-alpine
ARG PHONE_NUMBER_COUNTRY=US

FROM ${BUILDER_IMAGE} as builder
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Spoke",
"main": "src/server",
"engines": {
"node": ">=10.3",
"node": ">=10.17",
"npm": "3.10.10"
},
"scripts": {
Expand Down Expand Up @@ -229,6 +229,7 @@
"react-formal": "2.2.2",
"react-router": "^3.2.0",
"react-tooltip": "^4.2.13",
"recompose": "^0.30.0"
"recompose": "^0.30.0",
"webpack-cli": "^4.7.2"
}
}
6 changes: 5 additions & 1 deletion src/server/models/thinky.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ thinkyConn.r.getCountDistinct = async (query, distinctConstraint) =>
const redisUrl = process.env.REDIS_TLS_URL || process.env.REDIS_URL;

if (redisUrl) {
const redisSettings = { url: redisUrl };
// new redis client doesn't respect username placeholders so replace it
// this is especially true for legacy Heroku instances which had redis://h:<password>...
const redisSettings = {
url: redisUrl.replace(/redis:\/\/\w+:/, "redis://:")
};
if (/rediss/.test(redisSettings.url)) {
// secure redis protocol for Redis 6.0+
// https://devcenter.heroku.com/articles/securing-heroku-redis#using-node-js
Expand Down

0 comments on commit 564090d

Please sign in to comment.