Skip to content

Commit 45e9605

Browse files
committed
v1.29.4
1 parent 0cc3f12 commit 45e9605

File tree

6 files changed

+63
-8
lines changed

6 files changed

+63
-8
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@
105105
"tsconfig-paths": "^4.2.0",
106106
"type-fest": "4.10.3"
107107
},
108-
"version": "1.29.3"
108+
"version": "1.29.4"
109109
}

packages/backend/src/config/app.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ type AppConfig = {
1010
appEnv: string
1111
isProd: boolean
1212
isDev: boolean
13+
version: string
1314
postgresDatabase: string
1415
postgresPort: number
1516
postgresHost: string
1617
postgresUsername: string
17-
postgresPassword?: string
18-
version: string
18+
postgresPassword: string
1919
postgresEnableSsl: boolean
20+
tilesDatabase: string
21+
tilesPort: number
22+
tilesHost: string
23+
tilesUsername: string
24+
tilesPassword: string
25+
tilesEnableSsl: boolean
2026
baseUrl: string
2127
encryptionKey: string
2228
sessionSecretKey: string
@@ -72,6 +78,12 @@ const appConfig: AppConfig = {
7278
postgresUsername: process.env.POSTGRES_USERNAME,
7379
postgresPassword: process.env.POSTGRES_PASSWORD,
7480
postgresEnableSsl: process.env.POSTGRES_ENABLE_SSL === 'true',
81+
tilesDatabase: process.env.TILES_DATABASE || 'plumber_tiles_dev',
82+
tilesPort: parseInt(process.env.TILES_PORT || '5432'),
83+
tilesHost: process.env.TILES_HOST || 'localhost',
84+
tilesUsername: process.env.TILES_USERNAME,
85+
tilesPassword: process.env.TILES_PASSWORD,
86+
tilesEnableSsl: process.env.TILES_ENABLE_SSL === 'true',
7587
encryptionKey: process.env.ENCRYPTION_KEY || '',
7688
sessionSecretKey: process.env.SESSION_SECRET_KEY || '',
7789
adminJwtSecretKey: process.env.ADMIN_JWT_SECRET_KEY || '',
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import pg from 'pg'
2+
import process from 'process'
3+
4+
// The following two lines are required to get count values as number.
5+
// More info: https://github.com/knex/knex/issues/387#issuecomment-51554522
6+
pg.types.setTypeParser(20, 'text', parseInt)
7+
import type { Knex } from 'knex'
8+
import knex from 'knex'
9+
10+
import logger from '../helpers/logger'
11+
12+
import appConfig from './app'
13+
14+
export const tilesDbConfig = {
15+
client: 'pg',
16+
connection: {
17+
host: appConfig.tilesHost,
18+
port: appConfig.tilesPort,
19+
user: appConfig.tilesUsername,
20+
password: appConfig.tilesPassword,
21+
database: appConfig.tilesDatabase,
22+
ssl: appConfig.tilesEnableSsl
23+
? {
24+
rejectUnauthorized: false,
25+
}
26+
: false,
27+
} as pg.ClientConfig,
28+
pool: { min: 0, max: 20 },
29+
}
30+
31+
export const tilesClient: Knex = knex(tilesDbConfig)
32+
33+
const CONNECTION_REFUSED = 'ECONNREFUSED'
34+
35+
tilesClient.raw('SELECT 1').catch((err) => {
36+
if (err.code === CONNECTION_REFUSED) {
37+
logger.error(
38+
'Make sure you have installed PostgreSQL and it is running.',
39+
err,
40+
)
41+
process.exit()
42+
}
43+
})

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.29.3",
3+
"version": "1.29.4",
44
"scripts": {
55
"dev": "wait-on tcp:3000 && vite --host --force",
66
"build": "tsc && vite build --mode=${VITE_MODE:-prod}",

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"name": "@plumber/types",
33
"description": "Shared types for plumber",
44
"types": "./index.d.ts",
5-
"version": "1.29.3"
5+
"version": "1.29.4"
66
}

0 commit comments

Comments
 (0)