#115 Allow inline configuration as an option

This commit is contained in:
Alan Grainger
2025-07-30 10:47:16 +02:00
parent 93b6e6ef51
commit dc07787566
5 changed files with 27 additions and 7 deletions
+7 -2
View File
@@ -4,8 +4,13 @@ import { DownloadAll, SharedLink } from './types'
let config = {}
try {
const configJson = require(process.env.IPP_CONFIG || '../config.json')
if (typeof configJson === 'object') config = configJson
if (process.env.CONFIG) {
// Attempt to parse docker-compose config string into JSON (if specified)
config = JSON.parse(process.env.CONFIG)
} else {
const configJson = require(process.env.IPP_CONFIG || '../config.json')
if (typeof configJson === 'object') config = configJson
}
} catch (e) {
console.log(e)
}