Skip to content

Further details

Database🔗

Liquibase is used to manage Chutney RDBMS schema.
You can find corresponding changelog here.

Note

  • Chutney is tested with SQLite, H2 and PostgreSQL databases.
  • Chutney configure those database throught spring profiles. db-h2 for H2, db-sqliteor db-sqlite-rw(different datasources for read and write) for SQLite and db-pg for PostgreSQL
  • You can find complete examples in maven module chutney/server, for all three database types.

To configure your datasource, use the property spring.datasource

1
2
3
spring:
    datasource:
        url: jdbc:sqlite:.chutney/data/chutney.db
1
2
3
spring:
    datasource:
        url: jdbc:h2:mem:dbName
1
2
3
4
spring:
    datasource:
        url: jdbc:postgresql://host:port/dbName?ssl=true&sslmode=verify-ca&sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory&currentSchema=mySchema
        username: user

Logs🔗

Chutney uses SLF4J with Logback as the runtime implementation.
A default logback.xml is packaged in the server jar and logs to the console at level WARN.

Warning

Do not add logging bridges yourself — they are already included.

Avoid:

  • jcl-over-slf4j
  • log4j-over-slf4j / slf4j-reload4j
  • jul-to-slf4j

For complete details, see the Spring boot logging documentation.
Below are just a few common examples.

Override the log configuration🔗

You can replace or adjust the default logging without repackaging.

Use a custom Logback file🔗

1
2
3
4
5
# JVM system property
java -Dlogging.config=file:./my-logback.xml -jar chutney-server-<version>-boot.jar

# or environment variable
LOGGING_CONFIG=file:./my-logback.xml java -jar chutney-server-<version>-boot.jar

Quick tweaks via application.yml🔗

For simple level changes:

1
2
3
4
logging:
  level:
    root: INFO
    com.company.yourpackage: DEBUG

Use a full Logback file if you need to change appenders or patterns.

Server (TLS/SSL)🔗

Chutney server enforces the use of secure calls on any incoming requests.

Server HTTPS configuration

1
2
3
4
5
6
7
8
server:
    port: 443
    ssl:
        keystore: # keystore path
        key-store-password: # keystore password
        key-password: # key password (default is key-store-password)
        trust-store: # truststore path
        trust-store-password: # truststore password

Chutney Server provides undertow-https-redirect Spring profile to redirect unsecured request to the right secured port.

Using undertow-https-redirect Spring profile
  • Activate the profile
1
2
3
4
spring:
    profiles:
        active:
          - undertow-https-redirect
  • Configure the HTTP listener
1
2
3
4
server:
    http:
        port: 80 # (1)
        interface: 0.0.0.0 # (2)
  1. HTTP port to use
  2. Interface to bind to