forked from maiora/backend-api
Compare commits
No commits in common. "0103863e8bc380c6d22b19d2113fdc9688ef1155" and "fabdbfd32ab1abe2fe3ad8fd7bac9a4b1fe4b21a" have entirely different histories.
0103863e8b
...
fabdbfd32a
1
.gitignore
vendored
1
.gitignore
vendored
@ -41,4 +41,3 @@ bin/
|
|||||||
### Mac OS ###
|
### Mac OS ###
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea/.name
|
.idea/.name
|
||||||
*.log
|
|
||||||
|
@ -9,10 +9,6 @@ plugins {
|
|||||||
kotlin("plugin.serialization") version "1.9.23" // Aggiungi il plugin di Serialization
|
kotlin("plugin.serialization") version "1.9.23" // Aggiungi il plugin di Serialization
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
|
||||||
mainClass.set("eu.maiora.ApplicationKt")
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "org.maiora"
|
group = "org.maiora"
|
||||||
version = "1.0-SNAPSHOT"
|
version = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@ import io.ktor.server.engine.*
|
|||||||
import io.ktor.server.netty.*
|
import io.ktor.server.netty.*
|
||||||
import io.ktor.server.plugins.callloging.*
|
import io.ktor.server.plugins.callloging.*
|
||||||
import io.ktor.server.plugins.cors.routing.*
|
import io.ktor.server.plugins.cors.routing.*
|
||||||
import java.io.FileInputStream
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
embeddedServer(Netty, port = 8098, host = "0.0.0.0", module = Application::module)
|
embeddedServer(Netty, port = 8098, host = "0.0.0.0", module = Application::module)
|
||||||
@ -19,10 +17,9 @@ fun main() {
|
|||||||
|
|
||||||
fun Application.module() {
|
fun Application.module() {
|
||||||
val config = ApplicationConfig("application.conf")
|
val config = ApplicationConfig("application.conf")
|
||||||
val configFile = loadConfig()
|
val dbUrl = config.property("ktor.database.url").getString()
|
||||||
val dbUrl = configFile.getProperty("ktor.database.url")
|
val username = config.property("ktor.database.username").getString()
|
||||||
val username = configFile.getProperty("ktor.database.username")
|
val password = config.property("ktor.database.password").getString()
|
||||||
val password = configFile.getProperty("ktor.database.password")
|
|
||||||
val secret = config.property("ktor.jwt.secret").getString()
|
val secret = config.property("ktor.jwt.secret").getString()
|
||||||
configureDatabases(dbUrl, username, password)
|
configureDatabases(dbUrl, username, password)
|
||||||
configureSecurity(secret)
|
configureSecurity(secret)
|
||||||
@ -42,10 +39,3 @@ fun Application.module() {
|
|||||||
allowMethod(HttpMethod.Delete)
|
allowMethod(HttpMethod.Delete)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadConfig(): Properties {
|
|
||||||
val properties = Properties()
|
|
||||||
val inputStream = FileInputStream("/home/ristocloudadm/config.properties")
|
|
||||||
properties.load(inputStream)
|
|
||||||
return properties
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,18 @@
|
|||||||
ktor {
|
ktor {
|
||||||
|
database {
|
||||||
|
; url = "jdbc:postgresql://192.168.20.49:5432/caritas"
|
||||||
|
; username = "caritas"
|
||||||
|
; password = "caritas"
|
||||||
|
; driver = "org.postgresql.Driver"
|
||||||
|
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
|
||||||
|
url = "jdbc:sqlserver://192.168.20.45;databaseName=EP_FAER;integratedSecurity=false;encrypt=true;trustServerCertificate=true;"
|
||||||
|
username = "SA"
|
||||||
|
password = "I5fz9l1a"
|
||||||
|
;driver = "oracle.jdbc.OracleDriver"
|
||||||
|
;url = "jdbc:oracle:thin:@//192.168.20.101:1521/SIR"
|
||||||
|
;username = "EP_DONORIONE"
|
||||||
|
;password = "ep_donorione"
|
||||||
|
}
|
||||||
jwt {
|
jwt {
|
||||||
# secret per JWT generato partendo dalla stringa '?Backend_API*06022025!' codificato in Base64
|
# secret per JWT generato partendo dalla stringa '?Backend_API*06022025!' codificato in Base64
|
||||||
secret = "P0JhY2tlbmRfQVBJKjA2MDIyMDI1IQ=="
|
secret = "P0JhY2tlbmRfQVBJKjA2MDIyMDI1IQ=="
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
<configuration>
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
|
||||||
<file>./logFile.log</file>
|
|
||||||
<append>true</append>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
<root level="trace">
|
|
||||||
<appender-ref ref="FILE"/>
|
|
||||||
<appender-ref ref="STDOUT"/>
|
|
||||||
</root>
|
|
||||||
<logger name="io.netty" level="INFO"/>
|
|
||||||
</configuration>
|
|
Loading…
Reference in New Issue
Block a user