diff --git a/justfile b/justfile new file mode 100644 index 00000000..688ba129 --- /dev/null +++ b/justfile @@ -0,0 +1,6 @@ +# A justfile for dex-explorer development. +# Documents common tasks for local dev. + +# build container image +container: + podman build -f Containerfile . diff --git a/src/utils/indexer/connector.tsx b/src/utils/indexer/connector.tsx index e7b86274..3c226853 100644 --- a/src/utils/indexer/connector.tsx +++ b/src/utils/indexer/connector.tsx @@ -8,7 +8,19 @@ export class IndexerQuerier { private pool: Pool; constructor(connectionString: string) { - this.pool = new Pool({ connectionString }); + const dbConfig = { + connectionString: connectionString, + // If a CA certificate was specified as an env var, pass that info to the database config. + // Be advised that if CA_CERT is set, then PENUMBRA_INDEXER_ENDPOINT must *lack* an `sslmode` param! + // This is documented here: https://node-postgres.com/features/ssl#usage-with-connectionstring + ...(process.env.CA_CERT != null && { + ssl: { + rejectUnauthorized: true, + ca: process.env.CA_CERT, + }, + }), + }; + this.pool = new Pool(dbConfig); } /**