[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: fix connection to PostgreSQL
From: |
gnunet |
Subject: |
[libeufin] branch master updated: fix connection to PostgreSQL |
Date: |
Tue, 08 Dec 2020 14:08:34 +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 2074af0 fix connection to PostgreSQL
2074af0 is described below
commit 2074af0e9337273ba4eabeeff9ca1f8c97391878
Author: MS <ms@taler.net>
AuthorDate: Tue Dec 8 14:08:20 2020 +0100
fix connection to PostgreSQL
---
nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt | 8 ++++++--
nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 4 ++--
sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt | 6 +++++-
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 3 +--
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index f2a2c36..79ee4dc 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -30,6 +30,7 @@ import org.jetbrains.exposed.sql.transactions.transaction
import tech.libeufin.nexus.iso20022.EntryStatus
import tech.libeufin.util.EbicsInitState
import tech.libeufin.util.amount
+import java.net.URLEncoder
import java.sql.Connection
/**
@@ -93,7 +94,6 @@ object NexusBankMessagesTable : IntIdTable() {
class NexusBankMessageEntity(id: EntityID<Int>) : IntEntity(id) {
companion object :
IntEntityClass<NexusBankMessageEntity>(NexusBankMessagesTable)
-
var bankConnection by NexusBankConnectionEntity referencedOn
NexusBankMessagesTable.bankConnection
var messageId by NexusBankMessagesTable.messageId
var code by NexusBankMessagesTable.code
@@ -385,7 +385,11 @@ class NexusScheduledTaskEntity(id: EntityID<Int>) :
IntEntity(id) {
}
fun dbCreateTables(dbName: String) {
- Database.connect("jdbc:postgresql:${dbName}", "org.postgresql.Driver",
user = "libeufin")
+ Database.connect(
+ "jdbc:postgresql://127.0.0.1:5433/${dbName}",
+ "org.postgresql.Driver",
+ user = "libeufin"
+ )
TransactionManager.manager.defaultIsolationLevel =
Connection.TRANSACTION_SERIALIZABLE
transaction {
addLogger(StdOutSqlLogger)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 9d009f7..56fbbfc 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -51,7 +51,7 @@ class Serve : CliktCommand("Run nexus HTTP server") {
helpFormatter = CliktHelpFormatter(showDefaultValues = true)
}
}
- private val dbName by option().default("libeufin-nexus.sqlite3")
+ private val dbName by option().default("libeufindb")
private val host by option().default("127.0.0.1")
private val logLevel by option()
override fun run() {
@@ -72,7 +72,7 @@ class ParseCamt : CliktCommand("Parse a camt file") {
}
class Superuser : CliktCommand("Add superuser or change pw") {
- private val dbName by option().default("libeufin-nexus.sqlite3")
+ private val dbName by option().default("libeufindb")
private val username by argument()
private val password by option().prompt(requireConfirmation = true,
hideInput = true)
override fun run() {
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index a11a3b7..c7c1c7d 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -302,7 +302,11 @@ object BankAccountReportsTable : IntIdTable() {
}
fun dbCreateTables(dbName: String) {
- Database.connect("jdbc:postgresql:${dbName}", "org.postgresql.Driver")
+ Database.connect(
+ "jdbc:postgresql://127.0.0.1:5433/${dbName}",
+ "org.postgresql.Driver",
+ user = "libeufin"
+ )
TransactionManager.manager.defaultIsolationLevel =
Connection.TRANSACTION_SERIALIZABLE
transaction {
addLogger(StdOutSqlLogger)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 6ea2a02..f725656 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -93,7 +93,7 @@ class SandboxCommand : CliktCommand() {
}
class Serve : CliktCommand("Run sandbox HTTP server") {
- private val dbName by option().default("libeufin-sandbox.sqlite3")
+ private val dbName by option().default("libeufindb")
private val logLevel by option()
override fun run() {
LOGGER = LoggerFactory.getLogger("tech.libeufin.sandbox")
@@ -378,7 +378,6 @@ fun serverMain(dbName: String) {
this.authenticationPrivateKey =
ExposedBlob(pairA.private.encoded)
this.encryptionPrivateKey =
ExposedBlob(pairB.private.encoded)
this.signaturePrivateKey =
ExposedBlob(pairC.private.encoded)
-
}
}
call.respondText(
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: fix connection to PostgreSQL,
gnunet <=