Skip to main content

Configuration Reference

Values used in snippets are the default properties.

Environment Variables

Properties that have an environment variable specified will override the respective property in konifer.conf.

The order of configuration precedence is:

  1. Environment variable (for available properties)
  2. Property in konifer.conf
  3. Default value (if specified)

Datastore

Properties for configuring the datastore.

data-store {
provider = postgresql
postgresql {
database = konifer
host = localhost
port = 5432
user = postgres
password = ""
}
}
PropertyDescriptionAllowed InputDefaultEnvironment variable
data-store.providerThe implementation of your data storein-memory, postgresqlpostgresqlIN_MEMORY*
data-store.postgresql.databaseDatabase to use within the RDBMSStringkonifer
data-store.postgresql.hostPostgresql hostStringlocalhost
data-store.postgresql.portPostgresql portInteger5432
data-store.postgresql.userPostgresql userStringpostgresPG_USER
data-store.postgresql.passwordPostgresql passwordString""PG_PASSWORD
data-store.postgresql.ssl-modePostgresql SSL ModeStringprefer

If IN_MEMORY=true is set as an environment variable, both the data store and object store providers will be set to in-memory.

HTTP

http {
public-url = "http://localhost"
}
PropertyDescriptionAllowed InputDefault
http.public-urlThe URL used to resolve content selector links. This is the root public URL of your website/platform/API.Any URL beginning with http:// or https://http://localhost

Object Store

Properties for configuring the datastore.

objectstore {
provider = filesystem
s3 { # No defaults - overrides Default Provider Chain if supplied
access-key = "[no default]"
endpoint-url = "[no default]"
region = "[no default]"
secret-key = "[no default]"
}
filesystem {
mount-path = "[no default]"
}
}
PropertyDescriptionAllowed InputDefaultEnvironment variable
objectstore.providerThe implementation of your object storein-memory, s3, filesystemfilesystemIN_MEMORY*
objectstore.s3.access-key The access key of your S3 (or S3-compatible) object storeStringNone
objectstore.s3.endpoint-urlThe endpoint URL of your S3 (or S3-compatible) object storeStringNone
objectstore.s3.regionThe region of your object storeStringNone
objectstore.s3.secret-keyThe secret key of your object storeStringNoneS3_SECRET_KEY
objectstore.s3.force-path-styleCommunicate with S3 API using path-style or virtual-host styleBooleanfalse
objectstore.filesystem.mount-pathThe path that your filesystem is mounted to within your containerValid linux path (ex: /mnt/store)None

If IN_MEMORY=true is set as an environment variable, both the data store and object store providers will be set to in-memory.

Source

source {
url {
allowed-domains = []
max-bytes = 1048576 # 100MB
}
multipart {
max-bytes = 1048576 # 100MB
}
}
PropertyDescriptionAllowed InputDefault
source.url.allowed-domainsDomains that Konifer is permitted to access when storing assets from a URL sourceAny valid domain[]
source.url.max-bytesMaximum size of supplied asset content downloaded from URL. Will reject assets larger than this.Positive integer representing bytes1048576
source.multipart.max-bytesMaximum size of supplied asset content uploaded from Multipart source. Will reject assets larger than this.Positive integer representing bytes1048576

Variant Profiles

variant-profiles {
# Empty by default
"profile-name" {
}
}
PropertyDescriptionAllowed InputDefault
variant-profilesMap of defined variant profiles that canfor eager variants and on-demand variants. Keyed by the profile nameVariant profile object{}

All image transformation parameters can be used within a variant profile object.

Variant Generation

variant-generation {
queue-size = 1000
synchronous-priority = 80
workers = [2 X CPU cores]
}
PropertyDescriptionAllowed InputDefault
variant-generation.queue-sizeAmount of variant generation requests that can be queued up awaiting processing. Requests over this limit suspend the request.Positive integer1000
variant-generation.synchronous-priorityPercentage priority to give to synchronous variant generation tasks. The remaining priority is reversed for async tasks.1-9980
variant-generation.workersAmount of concurrent image processor workersPositive integer2 x CPU cores

URL Signing

url-signing {
enabled = false
algorithm = hmac_sha256
secret-key = "[no default]"
}
PropertyDescriptionAllowed InputDefaultEnvironment variable
url-signing.enabledEnable url-signing for GET requests or notBooleanfalse
url-signing.algorithmHMAC signing algorithm that signatures usehmac_sha256, hmac_sha384, hmac_sha512hmac_sha256
url-signing.secret-keyHMAC secret key used for validating signaturesStringNoneURL_SIGNING_SECRET_KEY

Path Configuration Reference

By default, nothing is configured within paths. If nothing is configured, the default configuration below is used.

paths {
# Match everything greedily after /
"/**" {
image {
lqip = []
}
transform {
preprocessing {
enabled = false
image {
# Preprocessing disabled by default
# Populate with URL manipulation parameters i.e. w = 100, h = 200, r = 90, etc.
}
}
eager-variants = []
on-demand-variant {
mode = enabled
}
expire {
strategy = never
ttl = [no default]
}
}
object-store {
bucket = assets
}
return-format {
redirect {
strategy = none
template {
string = localhost
}
presigned {
enabled = false
ttl = 30m
}
}
}
cache-control {
enabled = false
max-age = "[no default]"
s-maxage = "[no default]"
visibility = "[no default]"
revalidate = "[no default]"
stale-while-revalidate = "[no default]"
stale-if-error = "[no default]"
immutable = false
}
}
}

Image

"/**" {
image {
lqip = []
}
}
PropertyDescriptionAllowed InputDefault
image.lqipLQIP algorithms enabledblurhash, thumbhash[]

Transform

Preprocessing

"/**" {
transform {
preprocessing {
enabled = false
image {
# Preprocessing disabled by default
}
}
}
}
PropertyDescriptionAllowed InputDefault
transform.preprocessing.enabled Enable preprocessingBooleanfalse

All image transformation parameters can be used within the image block as well as:

PropertyDescriptionAllowed InputDefault
transform.preprocessing.image.max-height Maximum heightIntegerNone
transform.preprocessing.image.max-width Maximum widthIntegerNone
note

h and w take precedence over max-height and max-width respectively, if both are specified.

Eager Variants

"/**" {
transform {
eager-variants = []
}
}
PropertyDescriptionAllowed InputDefault
transform.eager-variantsList of variant profiles to generate eager variants fromprofiles names from variant-profiles arrayNone

On-demand Variant

"/**" {
transform {
on-demand-variant {
mode = enabled
}
}
}
PropertyDescriptionAllowed InputDefault
transform.on-demand-variant.modeOn-demand variant generation modeenabled, profile_only, disabledenabled

Expiration

"/**" {
transform {
expire {
strategy = never
ttl = [no default]
}
}
}
PropertyDescriptionAllowed InputDefault
transform.expire.strategyThe variant expiry strategy to usenever, ttl, idlenever
transform.expire.ttlThe time-to-live (in Duration format) used in idle or ttl strategies. Ignored when strategy is never.Duration e.g. 24h, 7d, 10mNo default
Duration

A duration is represented similarly to how Spring accepts a Duration property value. The time unit is appended to the amount. Units can be:

  • s for seconds
  • m for minutes
  • h for hours
  • d for days
note

Due to how expired variants are purged, expiration may be delayed by up to 1 minute after the configured TTL.

Object Store

"/**" {
object-store {
bucket = assets
}
}
PropertyDescriptionAllowed InputDefault
object-store.bucketBucket to persist assets and variants in. This can be safely changed without de-referencing existing assets, however, existing assets are not moved to new bucket.Valid bucket nameassets

Return Format

"/**" {
return-format {
redirect {
strategy = none
template {
string = localhost
}
presigned {
ttl = 30m
}
}
}
}
PropertyDescriptionAllowed InputDefault
return-format.redirect.strategyHow to serve redirect URLsnone, presigned, templatenone
return-format.redirect.template.stringTemplate string to use if strategy is templateValid URL stringlocalhost
return-format.redirect.presigned.ttlTime-to-live for presigned redirect URLs if strategy is presignedDuration-style format. Not less than 7 days (7d)30m (30 minutes)

Cache Control

"/**" {
cache-control {
enabled = false
max-age = "[no default]"
s-maxage = "[no default]"
visibility = "[no default]"
revalidate = "[no default]"
stale-while-revalidate = "[no default]"
stale-if-error = "[no default]"
immutable = false
}
}
PropertyDescriptionAllowed InputDefault
enabledWhether the Cache-Control header should be returnedBooleanfalse
max-ageSet the max-age descriptorInteger > 0
s-maxageSet the max-age descriptorInteger > 0
visibilitySet the visbility of the cached assetpublic, private
revalidateCache control revalidationmust-revalidate, proxy-revalidate, no-cache
stale-while-revalidate Set the stale-while-revalidate descriptorInteger > 0
stale-if-error Set the stale-if-error descriptorInteger > 0
immutableWhether to set the immutable descriptorBooleanfalse