Skip to content

Configuration Properties

These are the configuration properties for the primary ioto.json5 configuration file.

See the following descriptions for other configuration files:

FileDescription
device.json5Device configuration file.
local.json5Local Ioto overrides configuration file.
web.json5Web server configuration file.
schema.json5Database data schema.

ai

Nameai
DescriptionAI Connection Properties.
Synopsisai: { "enable": true, endpoint: "..." }
NotesThe ai property collection defines AI configuration. The api.enable will enable/disable the service at runtime. The endpoint property defines the LLM API URL. The api.model defines the default LLM model. The api.key property defines the LLM access key.

certs

Namecerts
DescriptionIoto Certificates.
Synopsiscerts: { url: 'path' }
NotesThe certs.url property defines a root certificate bundle that is used to verify domains used by the URL client.

Example

js
certs: {
    url: 'certs/roots.crt',
}

conditional

Nameconditional
DescriptionConditional configuration properties.
Synopsisconditional: { "Set-Name": { /* properties */ }
NotesThe conditional property collection is used to define a suite of different configurations for Ioto. For example, it can select a "dev" profile for development and a "prod" profile for productions.

Selections are made based on a controlling top level property. The mode and profile properties are used to select relevant configuration sets to apply.

Example

js
conditional: {
    profile: {
        dev: {
            directories: {
                log: '.',
                state: 'state'
            }
        },
        prod: {
            directories: {
                log: '/var/log',
                state: '/var/lib/ioto'
            }
        }
    }
}

database

Namedatabase
DescriptionControl the Ioto database.
Synopsisdatabase: { properties... }
NotesThe database property collection defines the database, schema and operational parameters that govern the Ioto database.The path property defines the filename of the on-disk database store. Ioto will also create a database journal log file that appends a ".jnl" extension to this path.

The schema property defines the database scheme that defines the database indexes, entities and data types.

The maxJournalSize defines how big the database journal log should grow before Ioto rewrites the database. The maxJournalAge defines how long data should be preserved in the journal log before the database file is updated. These values should be sufficiently long as writing updated data to the journal is much more efficient that updating the database file.

The path and schema properties can use @db and @config prefixes which will be expanded to "state/db" and "state/config" respectively.

The service property defines when to run a database maintenance task to remove expired items that define an expiry time via the "ttl" schema property.

Example

js
database: {
    path: '@db/state.db',
    schema: '@config/schema.json5',
    maxJournalSize: '1mb',
    maxJournalAge: '1min',
    service: '1hr',
},

directories

Namedirectories
DescriptionDefine default Ioto directories.
Synopsisdirectories: { "log": ".", state: "./state" }
NotesThe directories property collection defines various directories used by Ioto. The directories.log directory is where log files will be saved. The directories.state directory is where runtime state including databases, certificates, web pages and configuration will be stored. These can be overridden via the ioto command line --config, --state and --ioto options.

Example

js
directories: {
    log: '/var/log',
    state: '/var/lib/ioto',
}

limits

Namelimits
DescriptionDefine execution limits for Ioto.
Synopsislimits: { "key": "value", ... }
NotesThe limits property collection defines various execution limits for Ioto. The limits.reconnect property defines the delay after MQTT communications are lost before the agent will reconnect. This is useful to throttle network load in the event of a network disconnection. The limits.stack property defines the default size of fiber coroutine stacks.

Example

js
limits: {
    reconnect: '10 secs',
    stack: '32K',
}

limits.stack

Namelimits.stack
DescriptionDefine the stack size of fiber coroutines for Ioto.
Synopsislimits: { stack: "Number" }
NotesThe limits.stack property specifies the stack size for Ioto coroutines. This should be set to the maximum anticipated stack size for your executing code. The default stack size is 64K. The core Ioto code requires a stack size of 12K.

It is recommended that you minimize your use of big stack buffer variables and your use of deep recursion both of which require much bigger fiber stacks.

Example

js
limits: {
    stack: '16K',
},

log

Namelog
DescriptionControl the Ioto log file output.
Synopsislog: { path: 'path', format: 'format', types: 'types', sources: 'sources' }
NotesThe log property collection defines how and where Ioto logs execution information.

The log.path property specifies the destination of the Ioto trace log. Set it to "stdout", "stderr" or a filename.

The format specifies a leading format for the message that contains printf style tokens that are expanded at runtime. The supported tokens are: 'A' for the application name, 'D' for the local datetime, 'H' for the system hostname, 'M' for the message, 'P' for the process ID , 'S' for the message source, and 'T' for the message type.

The types property specifies the types of messages to emit. It may contain the following types: debug, error, info and trace. It may be set to "all" for all types.

The sources property specifies a comma separated list of message sources to emit. Sources may be prefixed with "!" to subtract from the list. For example: "all,!json" will emit messages from all sources except "json".

Example

js
log: {
    path: '/var/log/ioto.log',
    format: '%D %H %A[%P] %T %S %M',
    types: 'error,info',
    sources: 'all'
}

mqtt

Namemqtt
DescriptionMQTT configuration.
Synopsismqtt: { properties }"
NotesThe mqtt property collection is used to configure MQTT communications. The mqtt.cert and mqtt.key properties define filenames to the X.509 certificate and key used to secure MQTT communications.

The mqtt.client defines the MQTT client ID used to uniquely identify the device.

The alpn property defines the HTTPS ALPN identification string required when using HTTP port 443 for communications. The mqtt.ca property defines the authority certificate that is used as the root certificate to verify the MQTT broker endpoint.

The timeout property defines the time period in which to disconnect an idle mqtt connection. The delay property defines how long to wait before reconnecting. The schedule property is a "cron" style specification that defines the time window in which MQTT connections can be established.

Example

js
mqtt: {
    cert: 'certs/mqtt.crt',
    key: 'certs/mqtt.key',
    client: 'my-device-id',
    endpoint: 'mqtt://broker.example.com',
    port: 443,
    ca: 'certs/root.crt',
    timeout: '5 mins',
    delay: '1 min',
    schedule: '* * * * *',
}

optimize

Nameoptimize
DescriptionBuild for debug or production release.
Synopsis`optimize: "debug
NotesIf debug is selected, Ioto will be built with debug symbols.

If release is selected, Ioto will be built optimized without debug symbols.
js
optimize: 'release'

profile

Nameprofile
DescriptionConfiguration profile to select.
Synopsis`profile: "dev
NotesThe profile property is used to select different build and execution configurations for Ioto at runtime. For example, it can select a "dev" profile for development and a "prod" profile for productions.

The profile property selects a set of configuration properties from the conditional.profile collections. These are copied to the top level and overwrite any existing top-level properties.

Example

js
profile: "prod"

services

Nameservices
DescriptionConfigure which Ioto services to enable at runtime.
Synopsis`services: { 'Service-Name': true
NotesThe services property collection defines which Ioto services to enable.

The supported services are:
  • ai — OpenAI LLM connections
  • database — Local embedded database
  • mqtt — MQTT services
  • url — Client HTTP service
  • web — Local web server

Some services depend on others. Lower-level services will be forcibly enabled if upper level services require them.

Example

js
services: {
    database: true,
    mqtt: true,
    url: true,
    web: true
}

timeouts

Ioto supports timeout properties that improve security by limiting the duration of requests. Additional timeouts are provided from the web.json5 timeouts configuration.

Nametimeouts
DescriptionCollection of timeout properties.
Synopsistimeouts: { "Timeout-Property": "Timeout-Value", ...}
NotesAll timeout values are strings, not numbers.

The string values may take human-readable suffixes which indicate the units for the value. The suffixes can be upper or lower case. The supported units are: infinite, never, sec, secs, seconds, min, mins, minute, minutes, hr, hrs, hour, hours, day, days, week, weeks, month, months, year, years.

Ioto has sensible defaults for these timeouts if not explicitly specified.

Example

js
timeouts: {
    api: "30 secs",
}

timeouts.api

Nametimeouts.api
DescriptionDefines the maximum duration of API requests.
Synopsisapi: "duration"
NotesThe api timeout will be used for general API calls. The default is 30 seconds.

Example

js
api: "30 secs"

tls

Nametls
DescriptionCollection of TLS properties.
Synopsistls: { "Tls-Property": "Tls-Value", ... }
NotesTLS properties apply to web server https connections. They do not apply to Ioto MQTT or Ioto client connections.

The authority, certificate and key paths may use @certs prefixes to refer to the "state/certs" director.

Example

js
tls: {
    authority: "@certs/ca.crt",
    certificate: "@certs/server.crt",
    key: "@certs/server.key",
    verify: {
        client: true,
        issuer: true
    }
}

tls.authority

Nametls.authority
DescriptionDefines the location of the certificate file for client authentication.
Synopsisauthority: "path"
NotesThe authority property defines the file containing the certificates to use when authenticating client certificates. This property is only necessary if you wish to verify client certificates. If so, you must also define the "verify.client" to be true.

The certificate file contains the concatenated certificates to use in preference order. The path may be an absolute path or it may be relative to the Home directory. The path can also use the "@certs" prefix which will be expanded to "state/certs".

Example

js
authority: "/var/ioto/ca.crt"

tls.certificate

Nametls.certificate
DescriptionDefines the location of the X.509 file containing the server certificate
Synopsiscertificate: "path"
NotesThe SSLCertificateFile directive defines the file containing the PEM encoded X.509 certificate for the server. The file may also contain the private key for the server in which case you do not need to use the key property.

Example

js
certificate: "@certs/server.crt"

tls.key

Nametls.key
DescriptionDefines the location of the server's private key.
Synopsiskey: "path/to/key"
NotesThe key property defines the file containing the PEM encoded private key file for the server. This property is not required if the server's private key is combined with the certificate file. The private key should not be encrypted.
SecurityThere is a dilemma here. If you use an encrypted private key, the server will pause until you enter the pass-phrase which makes headless operation impossible. If you do not encrypt the private key, your private key is more vulnerable should the server be compromised.

Example

js
key: "@certs/server.key.pem"

tls.verify

Nametls.verify
DescriptionCollection of TLS verification properties
Synopsisverify: { "client": "value", "issuer": "value" }
NotesControl the type of certificate verification.

Example

js
verify: {
    client: true,
    issuer: true,
}

tls.verify.client

Nametls.verify.client
DescriptionControl the type of client certificate verification.
Synopsis`client: true
NotesThis property controls whether the client must provide a client certificate for the server to verify the identity of the client. If disabled, no certificate is required. If one is supplied, it will be ignored. The certificate and the certificate's issuer will be verified. Use the "verify.issuer" directive to turn off verification of the issuer if you need to use a self-signed test certificate.

If the property is enabled, the client must provide a valid certificate. The default is disabled.

Example

js
verify: {
    client: true,
}

tls.verify.issuer

Nametls.verify.issuer
DescriptionDefines whether the issuer of the client certificate is verified.
Synopsis`issuer: true
NotesThis property controls whether the issuer of the client certificate will be verified. If set to off, the certificate issuer will not be verified. This is useful to accept self-signed test certificates.

Example

js
verify: {
    issuer: true,
}

version

Nameversion
DescriptionSet the agent version.
Synopsisversion: "SemVer Version String"
NotesThe version string defines the version of the embedded agent including your software. Don't confuse this with the underlying Ioto version. The version string must conform to the Semantic Versioning 2.0 spec.