Skip to content

Commit

Permalink
db: use process.env.DB_PATH
Browse files Browse the repository at this point in the history
On our server, we run our application from a read-only filesystem. We
need to add a way to configure where our database will be.

Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Jan 28, 2024
1 parent f2c0a30 commit 68a4aaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const express = require('express')
const debug = require('debug')('api')
const { PurpleInvoiceManager } = require('./invoicing')

const ENV_VARS = ["LN_NODE_ID", "LN_NODE_ADDRESS", "LN_RUNE", "LN_WS_PROXY", "DEEPL_KEY"]
const ENV_VARS = ["LN_NODE_ID", "LN_NODE_ADDRESS", "LN_RUNE", "LN_WS_PROXY", "DEEPL_KEY", "DB_PATH"]

function check_env() {
const missing = []
Expand All @@ -30,7 +30,7 @@ function PurpleApi(opts = {}) {
check_env()

const queue = {}
const db = lmdb.open({ path: '.' })
const db = lmdb.open({ path: process.env.DB_PATH })
const translations = db.openDB('translations')
const accounts = db.openDB('accounts')
const pubkeys_to_user_ids = db.openDB('pubkeys_to_user_ids')
Expand Down

0 comments on commit 68a4aaf

Please sign in to comment.