2023-09-25 18:58:50 +00:00
|
|
|
λ ( secretsFile
|
|
|
|
: { staticDir : Text, connectionString : Text, signUpKey : Text
|
|
|
|
, nodeName : Text }
|
|
|
|
) →
|
|
|
|
let SqliteConfig =
|
|
|
|
{ Type =
|
|
|
|
{ filename : Text
|
|
|
|
, walEnabled : Optional Bool
|
|
|
|
, fkEnabled : Optional Bool
|
|
|
|
, extraPragmas : Optional (List Text)
|
|
|
|
}
|
|
|
|
, default =
|
|
|
|
{ walEnabled = None Bool
|
|
|
|
, fkEnabled = None Bool
|
|
|
|
, extraPragmas = None (List Text)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let PostgresConfig =
|
|
|
|
{ Type =
|
|
|
|
{ connectionString : Text
|
|
|
|
, poolStripes : Natural
|
|
|
|
, poolIdleTimeout : Natural
|
|
|
|
}
|
|
|
|
, default = { poolStripes = 0, poolIdleTimeout = 300 }
|
|
|
|
}
|
|
|
|
|
|
|
|
let LogLevel =
|
|
|
|
{ Type =
|
|
|
|
< LogLevelDebug
|
|
|
|
| LogLevelInfo
|
|
|
|
| LogLevelWarn
|
|
|
|
| LogLevelError
|
|
|
|
| LogLevelOther : Text
|
|
|
|
>
|
|
|
|
}
|
|
|
|
|
|
|
|
let Config =
|
|
|
|
{ Type =
|
|
|
|
{ listenPort : Natural
|
|
|
|
, database : PostgresConfig.Type
|
|
|
|
, databasePoolSize : Natural
|
|
|
|
, staticDir : Text
|
|
|
|
, logLevel : LogLevel.Type
|
|
|
|
, nodeName : Text
|
|
|
|
, signUpKey : Text
|
|
|
|
, rpId : Text
|
|
|
|
}
|
|
|
|
, default =
|
|
|
|
{ databasePoolSize = 10
|
|
|
|
, staticDir = "./static"
|
|
|
|
, logLevel = LogLevel.Type.LogLevelInfo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
in Config::{
|
|
|
|
, listenPort = 62936
|
2023-09-26 16:11:21 +00:00
|
|
|
, database = PostgresConfig::{ connectionString = secretsFile.connectionString }
|
2023-09-25 18:58:50 +00:00
|
|
|
, logLevel = LogLevel.Type.LogLevelInfo
|
2023-09-26 16:11:21 +00:00
|
|
|
, signUpKey = secretsFile.signUpKey
|
2023-09-25 18:58:50 +00:00
|
|
|
, rpId = "lotte-test.chir.rs"
|
2023-09-26 16:11:21 +00:00
|
|
|
, staticDir = secretsFile.staticDir
|
|
|
|
, nodeName = secretsFile.nodeName
|
2023-09-25 18:58:50 +00:00
|
|
|
}
|