diff options
author | MS <ms@taler.net> | 2021-01-26 15:12:29 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2021-01-26 15:12:29 +0100 |
commit | d6168f4f06c7a53ad710f1ac5a39cbacc031e5c5 (patch) | |
tree | 432025fd850cff6e4e5beff53dc79a770b193022 /nexus | |
parent | 84e5a275999d6f23b7847ed79de0d0deac04239e (diff) | |
download | libeufin-d6168f4f06c7a53ad710f1ac5a39cbacc031e5c5.tar.gz libeufin-d6168f4f06c7a53ad710f1ac5a39cbacc031e5c5.tar.bz2 libeufin-d6168f4f06c7a53ad710f1ac5a39cbacc031e5c5.zip |
fetch DB connection string from Env (Nexus)
Diffstat (limited to 'nexus')
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 9 |
1 files 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 index 2b7abe55..4c02bc3e 100644 --- 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() { |