Upload settings
Configure where Foxlet uploads recordings when you import them to your Primary Site.
Choose an upload destination
Set PRIMARY_SITE_MODE explicitly to match your Primary Site. If you don't set PRIMARY_SITE_MODE, Foxlet uploads to a Foxglove-hosted Primary Site.
- Foxglove-hosted
- Self-hosted or BYOS
For a Foxglove-hosted Primary Site, set:
PRIMARY_SITE_MODE=hosted
No cloud credentials are needed. Foxglove provides the upload destination.
For a self-hosted Primary Site or a bring-your-own-storage (BYOS) Primary Site, set:
PRIMARY_SITE_MODE=self-managed
For a BYOS Primary Site, first complete the site's bucket access, ingest path policy, and notification setup. The rule that matches the uploaded files must have the action "Index" and the device "From metadata".
Set INBOX_BUCKET_NAME to the self-hosted inbox bucket or the BYOS indexed bucket, without a scheme such as s3:// or gs://. For Azure, use the container name or <account>/<container>. BYOS sites support AWS, Google Cloud Storage, and Azure.
Add the variables where you configure Foxlet, such as /etc/foxglove/agent/envfile or the file passed to docker run --env-file.
- Google Cloud Storage
- AWS
- Azure
- S3-compatible
The credentials need storage.objects.create and storage.multipartUploads.create on the upload bucket. Failed-upload cleanup also needs storage.multipartUploads.abort. Uploads at or above MULTIPART_PART_SIZE (8 MiB by default) use XML multipart uploads; an existing custom role that allows ordinary object creation may need updating. See Cloud Storage multipart upload permissions.
Install a service account key file (credentials.json) that authorizes writes to your upload bucket. Credential files with "type": "external_account" aren't supported.
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=google_cloud
# Must be set to a valid bucket name, excluding any `gs://` scheme
INBOX_BUCKET_NAME=...
# Set this to the absolute path of the credentials.json file
# If using Docker, use the path inside the container, not the host filesystem path
GOOGLE_APPLICATION_CREDENTIALS=...
With the .deb package, the foxglove user must be able to read the file. With the executable, the user that runs it must be able to read the file. With the Docker image, mount the file into the container.
Use static credentials or an external credential process. AWS_CREDENTIAL_PROCESS takes precedence over static keys. If you set neither, the default credential chain is used.
Before the first upload, the log shows which kind of AWS credentials is configured: Using static credentials for AWS, Using credential_process for AWS credentials, or Using default credential chain for AWS. This line doesn't mean the credentials work. They're first used for an upload, so a wrong key, secret, region, or permission shows up only then.
Static credentials
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=aws
# Must be set to a valid bucket name, excluding any `s3://` scheme
INBOX_BUCKET_NAME=...
# Set these according to your AWS deployment
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
# AWS_REGION also works, and takes precedence when set.
AWS_DEFAULT_REGION=...
# Optional: Only required when using temporary credentials (for example, from AWS STS or IAM Identity Center).
#AWS_SESSION_TOKEN=...
# Optional: Enable SHA-256 checksum-on-upload.
#AWS_UPLOAD_CHECKSUM=sha256
Credential process
Set AWS_CREDENTIAL_PROCESS to a command that prints temporary credentials in the AWS credential_process format. The command runs when an upload needs credentials.
The usual command is the AWS aws_signing_helper for IAM Roles Anywhere. The helper presents an X.509 certificate from a certificate authority (CA) that you registered with AWS as a trust anchor, and gets temporary credentials in return. Compared to static credentials, IAM Roles Anywhere has these advantages for a fleet of devices:
- Credentials expire automatically. This limits the damage if a device is compromised.
- There are no shared keys to rotate. To remove access for a device, revoke its certificate or remove its profile binding in AWS.
- You can use your existing device certificates, for example from a private CA that you use for mTLS.
- AWS audit logs record each device's role session separately, so you can identify the device that made an upload.
To use IAM Roles Anywhere:
-
Complete the AWS setup in Getting started with IAM Roles Anywhere: register a trust anchor for your CA, create a profile that allows your upload-bucket role, and issue a certificate and private key for the device.
-
Make the helper, the certificate, and the private key available.
The Docker image includes the helper at
/usr/local/bin/aws_signing_helper. It's built fromaws/rolesanywhere-credential-helperwith PKCS#11 support. The image doesn't include a PKCS#11 module. Bind-mount the certificate and private key into the container as read-only files. Add these options to yourdocker runcommand:--mount type=bind,src=/etc/foxglove/certs/device.crt,dst=/etc/foxglove/certs/device.crt,readonly \--mount type=bind,src=/etc/foxglove/certs/device.key,dst=/etc/foxglove/certs/device.key,readonly \With the
.debpackage or the executable, install the helper yourself and put the certificate and private key on disk. Use a statically linked build of the helper, so it doesn't depend on host libraries. The user that runs the process (thefoxgloveuser, with the.debpackage) must be able to read the certificate and private key, and run the helper. -
Configure the following environment variables:
PRIMARY_SITE_MODE=self-managedINBOX_STORAGE_PROVIDER=aws# Must be set to a valid bucket name, excluding any `s3://` schemeINBOX_BUCKET_NAME=...AWS_DEFAULT_REGION=...# Command that prints temporary AWS credentials as credential_process JSON.# Substitute the ARNs and file paths for your trust anchor, profile, role,# certificate, and private key. Keep the command on a single line: Docker# --env-file and systemd EnvironmentFile= before v249 don't support# backslash line continuations.AWS_CREDENTIAL_PROCESS=/usr/local/bin/aws_signing_helper credential-process --trust-anchor-arn arn:aws:rolesanywhere:...:trust-anchor/... --profile-arn arn:aws:rolesanywhere:...:profile/... --role-arn arn:aws:iam::...:role/... --certificate /etc/foxglove/certs/device.crt --private-key /etc/foxglove/certs/device.key# Optional: Enable SHA-256 checksum-on-upload.#AWS_UPLOAD_CHECKSUM=sha256
The command must write JSON in the AWS credential_process Version 1 format to stdout, for example:
{
"Version": 1,
"AccessKeyId": "...",
"SecretAccessKey": "...",
"SessionToken": "...",
"Expiration": "2030-01-01T00:00:00Z"
}
Credentials are cached in memory:
- With
Expiration, credentials are refreshed 5 minutes beforeExpiration, or 60 seconds after the fetch, whichever is later. - Without
Expiration, credentials are cached for 10 minutes, then the command runs again. If the AWS credentials expire in less than 10 minutes, uploads can use expired credentials. IncludeExpirationin the command output. - If a refresh fails, the cached credentials stay in use for up to 1 hour after the last successful fetch, but AWS rejects them after their
Expiration. The command runs again on the next upload that is at least 30 seconds later. After 1 hour, uploads fail until the command succeeds. - If there are no cached credentials, for example after a restart, an upload that can't get credentials fails. The next upload runs the command again.
The command must complete in 30 seconds. If it doesn't, the process is stopped and the attempt fails.
AWS_CREDENTIAL_PROCESS is split into words with shell rules, so quotes and escapes work. A shell doesn't run the command, so pipes (|), redirects (>), and command substitution ($(...)) don't work. To use them, run a shell explicitly, for example sh -c '...'.
Default credential chain
If you set neither static keys nor AWS_CREDENTIAL_PROCESS, the S3 client's default credential discovery is used. Examples are EC2 instance roles, ECS task roles, EKS Pod Identity, and IAM roles for service accounts (IRSA). This isn't the AWS SDK credential chain. It doesn't read ~/.aws/credentials or other profile files.
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=azure
# The container name, or <account>/<container>
INBOX_BUCKET_NAME=...
# The storage account that holds the container
STORAGE_AZURE_STORAGE_ACCOUNT_NAME=...
# Set these according to your Azure deployment
AZURE_TENANT_ID=...
AZURE_CLIENT_ID=...
AZURE_CLIENT_SECRET=...
# Optional: Override for storage endpoint.
#AZURE_STORAGE_ENDPOINT=https://{account}.blob.core.windows.net
Instead of setting STORAGE_AZURE_STORAGE_ACCOUNT_NAME, you can set INBOX_BUCKET_NAME to <account>/<container>. If you set neither, uploads fail.
For a self-hosted Primary Site whose inbox bucket uses an S3-compatible service like MinIO, configure the following environment variables:
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=s3_compatible
# Must be set to a valid bucket name
INBOX_BUCKET_NAME=...
# Set these according to your S3-compatible service deployment
S3_COMPATIBLE_ACCESS_KEY_ID=...
S3_COMPATIBLE_SECRET_ACCESS_KEY=...
S3_COMPATIBLE_SERVICE_REGION=...
S3_COMPATIBLE_SERVICE_URL=...
Object storage upload options
For self-hosted and BYOS uploads, MULTIPART_PART_SIZE controls the size of multipart upload parts, in bytes. Files smaller than this size use a single upload request; files at or above it use multipart uploads. Foxglove-hosted uploads don't use this setting.
MULTIPART_PART_SIZE=8388608
AWS and Google Cloud Storage allow at most 10,000 parts in one upload. At the default size of 8 MiB, the largest file is 80,000 MiB (about 78 GiB). To upload larger files, increase this value. Both providers require parts of 5 MiB or more, except for the last part.
Each upload sends up to 5 parts at the same time and keeps each part in memory until it uploads. Memory use for an upload is approximately 5 times the part size.
In Foxlet v1.8.0 and later, MULTIPART_UPLOAD_CONCURRENCY sets the number of parts that an upload sends at the same time, and each upload request must finish within 600 seconds. Memory use for an upload is approximately MULTIPART_UPLOAD_CONCURRENCY times the part size. The parts share the network link, so with the default part size and concurrency, uploads need a link of about 0.56 Mbit/s or faster. For slower links, set these optional variables with any storage provider.
# Optional: maximum number of parts to upload at the same time (default: 5).
# Lower this on slow links. Foxlet keeps each part in memory until it uploads.
#MULTIPART_UPLOAD_CONCURRENCY=5
# Optional: time limit for each upload request, in seconds (default: 600).
#OBJECT_STORE_READ_TIMEOUT_SECONDS=600
In Foxlet v1.9.0 and later, UPLOAD_CONCURRENCY sets the number of recordings that Foxlet uploads at the same time. Total memory use and the necessary link speed are approximately UPLOAD_CONCURRENCY times the values above. See Additional options.
By default, Foxlet uploads each recording under a recordingId=<id>/ directory. To upload each recording at its path relative to STORAGE_ROOT instead, set PRESERVE_UPLOAD_PATH=true. This option requires Foxlet v1.8.0 or later, and is supported only for an inbox that uses the index-in-place storage mode. Recording paths must be unique across all devices that share the bucket. Before each upload, Foxlet checks for an existing object at the destination; if one exists, Foxlet reports an error and does not replace it. This check needs permission to read objects in the bucket (on S3, s3:GetObject and s3:ListBucket).
# Optional: upload each recording at its path relative to STORAGE_ROOT,
# without the recordingId=<id>/ directory (default: false).
# Use only with an index-in-place inbox.
#PRESERVE_UPLOAD_PATH=false
Upload connection options
These settings control keepalive pings when an upload connection uses HTTP/2. Each value is a positive integer followed by a time unit (ms, s, m, or h). The values shown are the defaults.
UPLOAD_HTTP2_KEEP_ALIVE_INTERVAL=10s
UPLOAD_HTTP2_KEEP_ALIVE_TIMEOUT=30s
They apply only to connections that use HTTP/2. Google Cloud Storage uploads always use HTTP/1.1. S3-compatible uploads use HTTP/1.1 unless you set S3_COMPATIBLE_ALLOW_HTTP2=true. AWS and Azure uploads use HTTP/2 only if the storage endpoint supports it. If a Foxglove-hosted upload doesn't use HTTP/2, the log shows upload to foxglove-hosted storage used HTTP version ... that does not support keepalive pings once.