gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: fetch DB connection string from Env (N


From: gnunet
Subject: [libeufin] branch master updated: fetch DB connection string from Env (Nexus)
Date: Tue, 26 Jan 2021 15:12:37 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new d6168f4  fetch DB connection string from Env (Nexus)
d6168f4 is described below

commit d6168f4f06c7a53ad710f1ac5a39cbacc031e5c5
Author: MS <ms@taler.net>
AuthorDate: Tue Jan 26 15:12:29 2021 +0100

    fetch DB connection string from Env (Nexus)
---
 nexus/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
index 2b7abe5..4c02bc3 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() {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]