Skip to content

Commit

Permalink
Support connection to DB with certificate (docker)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-morin authored and sylvain-morin committed Oct 9, 2023
1 parent 32ded81 commit 3c8177e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions config_example.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const fs = require( "fs" );

const {
INAT_DB_HOST,
INAT_DB_USER,
INAT_DB_PASS,
INAT_ES_HOST,
INAT_REDIS_HOST,
INAT_WEB_HOST
INAT_WEB_HOST,
INAT_DB_SSL_KEY_PATH,
INAT_DB_SSL_CRT_PATH
} = process.env;
module.exports = {
// Host running the iNaturalist Rails app
Expand All @@ -25,7 +29,11 @@ module.exports = {
geometry_field: "geom",
srid: 4326,
password: INAT_DB_PASS || "inaturalist",
ssl: false
ssl: ( INAT_DB_SSL_KEY_PATH && INAT_DB_SSL_CRT_PATH ) ? {
rejectUnauthorized: false,
key: fs.readFileSync( INAT_DB_SSL_KEY_PATH ),
cert: fs.readFileSync( INAT_DB_SSL_CRT_PATH )
} : false
},
tileSize: 512,
debug: true,
Expand Down

0 comments on commit 3c8177e

Please sign in to comment.