Skip to content

Further details

Database🔗

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

Note

Chutney has been tested with H2 and PostgreSQL databases.

To configure your datasource, use the property spring.datasource

1
2
3
spring:
    datasource:
        url: jdbc:h2:mem:dbName

Note

You can find an example in maven module local-dev, which uses an embedded H2 with filesystem persistence.

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 depends on SLF4J API logging library.

At runtime, the Chutney server use the Logback SLF4J implementation and bridges all legacy APIs (JCL, LOG4J and JUL).

Warning

Since the server bridges all legacy APIs, you must be careful to not include any of the following libraries :

1
2
3
4
5
* jcl-over-slf4j
* log4j-over-slf4j and slf4j-reload4j
* jul-to-slf4j

Read [Bridging legacy APIs](https://logback.qos.ch/manual/configuration.html){:target="_blank"} for further details.

A Logback configuration must be package in the packaging project, in classpath root.

Logback configuration examples
<configuration>
    <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="WARN">
        <appender-ref ref="stdout"/>
    </root>
</configuration>
<configuration>
    <appender name="total" class="ch.qos.logback.core.rolling.RollingFileAppender"> 
        <file>total.log</file>
        <encoder>
            <pattern>%d | %logger{16} | %level | %msg%n</pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>total.%i.log</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>50</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>50MB</maxFileSize>
        </triggeringPolicy>
    </appender>

    <root level="WARN">
        <appender-ref ref="total"/>
    </root>
</configuration>

Server (TLS/SSL)🔗

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
!!! note "Server HTTPS configuration"
``` yaml
server:
    port: 443
    ssl:
        keystore: # keystore path
        key-store-password: # keystore password
        key-password: # key 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