libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit d6168f4f06c7a53ad710f1ac5a39cbacc031e5c5
parent 84e5a275999d6f23b7847ed79de0d0deac04239e
Author: MS <ms@taler.net>
Date:   Tue, 26 Jan 2021 15:12:29 +0100

fetch DB connection string from Env (Nexus)

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -42,7 +42,8 @@ import java.io.File val logger: Logger = LoggerFactory.getLogger("tech.libeufin.nexus") -const val DEFAULT_DB_CONNECTION = "jdbc:sqlite:/tmp/libeufin-nexus.sqlite3" +val LIBEUFIN_NEXUS_DB_CONNECTION = System.getenv( + "LIBEUFIN_NEXUS_DB_CONNECTIONS") ?: "jdbc:sqlite:/tmp/libeufin-nexus.sqlite3" class NexusCommand : CliktCommand() { init { @@ -57,7 +58,7 @@ class Serve : CliktCommand("Run nexus HTTP server") { helpFormatter = CliktHelpFormatter(showDefaultValues = true) } } - private val dbConnString by option().default(DEFAULT_DB_CONNECTION) + private val dbConnString by option().default(LIBEUFIN_NEXUS_DB_CONNECTION) private val host by option().default("127.0.0.1") private val port by option().int().default(5001) private val logLevel by option() @@ -84,7 +85,7 @@ class ResetTables : CliktCommand("Drop all the tables from the database") { helpFormatter = CliktHelpFormatter(showDefaultValues = true) } } - private val dbConnString by option().default(DEFAULT_DB_CONNECTION) + private val dbConnString by option().default(LIBEUFIN_NEXUS_DB_CONNECTION) override fun run() { execThrowableOrTerminate { dbDropTables(dbConnString) @@ -94,7 +95,7 @@ class ResetTables : CliktCommand("Drop all the tables from the database") { } class Superuser : CliktCommand("Add superuser or change pw") { - private val dbConnString by option().default(DEFAULT_DB_CONNECTION) + private val dbConnString by option().default(LIBEUFIN_NEXUS_DB_CONNECTION) private val username by argument() private val password by option().prompt(requireConfirmation = true, hideInput = true) override fun run() {