Use a single config file
This commit is contained in:
parent
a1e7c8ba98
commit
0993d93ccc
@ -1,22 +0,0 @@
|
|||||||
database:
|
|
||||||
host: localhost
|
|
||||||
port: 3306
|
|
||||||
name: notes
|
|
||||||
username: notes
|
|
||||||
password: notes
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: 127.0.0.1
|
|
||||||
port: ${PORT:-8081}
|
|
||||||
cors: true
|
|
||||||
|
|
||||||
jwt:
|
|
||||||
auth:
|
|
||||||
secret: uiqzRNiMYwbObn/Ps5xTasYVeu/63ZuI+1oB98Ez+lY=
|
|
||||||
validity: 1
|
|
||||||
unit: HOURS
|
|
||||||
refresh:
|
|
||||||
secret: wWchkx44YGig4Q5Z7b7+E/3ymGEGd6PS7UGedMul3bg=
|
|
||||||
validity: 15
|
|
||||||
unit: DAYS
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
database:
|
|
||||||
host: ${MYSQL_HOST}
|
|
||||||
port: 3306
|
|
||||||
name: ${MYSQL_DATABASE}
|
|
||||||
username: ${MYSQL_USER}
|
|
||||||
password: ${MYSQL_PASSWORD}
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: 0.0.0.0
|
|
||||||
port: ${PORT:-8081}
|
|
||||||
cors: ${CORS:-true}
|
|
||||||
|
|
||||||
jwt:
|
|
||||||
auth:
|
|
||||||
secret: ${JWT_SECRET} # Can be generated with `openssl rand -base64 32`
|
|
||||||
validity: 1
|
|
||||||
unit: HOURS
|
|
||||||
refresh:
|
|
||||||
secret: ${JWT_REFRESH_SECRET} # Can be generated with `openssl rand -base64 32`
|
|
||||||
validity: 15
|
|
||||||
unit: DAYS
|
|
||||||
|
|
||||||
22
api/resources/application.yaml
Normal file
22
api/resources/application.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
database:
|
||||||
|
host: ${MYSQL_HOST:-localhost}
|
||||||
|
port: ${MYSQL_PORT:-3306}
|
||||||
|
name: ${MYSQL_DATABASE:-notes}
|
||||||
|
username: ${MYSQL_USER:-notes}
|
||||||
|
password: ${MYSQL_PASSWORD:-notes}
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: ${HOST:-127.0.0.1}
|
||||||
|
port: ${PORT:-8081}
|
||||||
|
cors: ${CORS:-true}
|
||||||
|
|
||||||
|
jwt:
|
||||||
|
auth:
|
||||||
|
secret: ${JWT_SECRET:-uiqzRNiMYwbObn/Ps5xTasYVeu/63ZuI+1oB98Ez+lY=} # Can be generated with `openssl rand -base64 32`
|
||||||
|
validity: 1
|
||||||
|
unit: HOURS
|
||||||
|
refresh:
|
||||||
|
|
||||||
|
secret: ${JWT_REFRESH_SECRET=-wWchkx44YGig4Q5Z7b7+E/3ymGEGd6PS7UGedMul3bg=} # Can be generated with `openssl rand -base64 32`
|
||||||
|
validity: 15
|
||||||
|
unit: DAYS
|
||||||
@ -16,10 +16,7 @@ import javax.sql.DataSource
|
|||||||
* [Kodein] controller module containing the app configuration
|
* [Kodein] controller module containing the app configuration
|
||||||
*/
|
*/
|
||||||
val configurationModule = Kodein.Module(name = "Configuration") {
|
val configurationModule = Kodein.Module(name = "Configuration") {
|
||||||
bind() from singleton {
|
bind() from singleton { ConfigLoader().loadConfigOrThrow<Config>("/application.yaml") }
|
||||||
val configFile by this.kodein.instance<String>(tag = "config file")
|
|
||||||
ConfigLoader().loadConfigOrThrow<Config>(configFile)
|
|
||||||
}
|
|
||||||
bind<SimpleJWT>(tag = "auth") with singleton { configureAuthJwt(this.kodein) }
|
bind<SimpleJWT>(tag = "auth") with singleton { configureAuthJwt(this.kodein) }
|
||||||
bind<SimpleJWT>(tag = "refresh") with singleton { configureRefreshJwt(this.kodein) }
|
bind<SimpleJWT>(tag = "refresh") with singleton { configureRefreshJwt(this.kodein) }
|
||||||
bind<DataSource>() with singleton { configureDatasource(this.kodein) }
|
bind<DataSource>() with singleton { configureDatasource(this.kodein) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user