Configuration File
This configuration file allows the update client to work across many different platforms and environments with a single software binary. All fields in the configuration are strings.
Example basic configuration:
{
"device_enrollment_token": "[REDACTED]",
"name": "demo_device",
"persistent_directory": "/opt/thistle",
"public_keys": [
"RWRsXruIAEOcDvpml30guv+LcYbz9dANWqGpr/m3TC1ohzt+z078H91R"
]
}
Compulsory fields
Name | Descripiton |
---|---|
name | Name to use when registering with the server |
persistent_directory | Location of a directory where the Thistle Client can store persistent state. Note: in the case of a bootloader setup, this field should point out the /boot directory |
public_keys | Array of public key strings for signature verification. A signature will be checked against public keys one by one, in their order of appearance in the array. If the signature is verified by one of the public keys, the OTA manifest is accepted; otherwise, it’s rejected. A new key pair can be generated with the help of the Thistle Release Helper and external signing tools provided by Thistle |
Enrollment fields
Depending on the device provisioning method, either the device_enrollment_token
, or both device_id
and device_token
will be required.
Name | Descripiton |
---|---|
device_enrollment_token | API token dedicated to enrolling a device with the Thistle backend server. Each token is specific to a given project |
device_id | A unique identifier for a given device received from the Thistle backend server |
device_token | A unique token for a given device received from the Thistle backend server |
Optional fields
Name | Descripiton |
---|---|
network_timeout | Timeout value for network requests, in seconds. Defaults to 30 |
polling_interval_s | Interval at which the update client will check for updates, in seconds. Defaults to 3600 |
single_check | Only perform one single round of update check and then exit the program. Defaults to false |
stop_after_download | This mode of operation will download an update bundle, and then exit the program. The next run of the program will install the update. This mode also enables single_check . Defaults to false |
backup_manifest_url | Backup manifest URL to use as a fallback in the cases where the Thistle backend server could not be reachable |
identity_path | Path on the device to the identity file that is used for device enrollment |
metadata_path | Path on the device to the metadata file |
Optional bootloader specific fields
Name | Descripiton |
---|---|
bootloader | Bootloader to use. Can be either set to Thistle-Uboot , RaspberryPi , or Custom . If no bootloader is set, only files will be updatable |
part_a | Path to the “A” partition, compulsory when a bootloader is set |
part_b | Path to the “B” partition, compulsory when a bootloader is set |
determine_boot_part_script | Helper script to determine currently booted partition. Auto-detection will be attempted if no script is specified. Note this can be helpful to work with OverlayFS |
switch_part_command | Required for Custom bootloader. This script is used to indicate the bootloader to switch the booting partition at the next reboot |
Example configuration with bootloader
{
"device_enrollment_token": "[REDACTED]",
"name": "demo_device",
"persistent_directory": "/boot",
"public_keys": [
"RWRsXruIAEOcDvpml30guv+LcYbz9dANWqGpr/m3TC1ohzt+z078H91R"
],
"part_a": "/dev/mmcblk0p2",
"part_b": "/dev/mmcblk0p3",
"bootloader": "raspberrypi"
}