2022-04-03 23:58:18 +00:00
|
|
|
## Server configuration
|
|
|
|
[server]
|
2021-10-28 04:06:03 +00:00
|
|
|
## Optional: pict-rs binding address
|
2022-04-03 23:58:18 +00:00
|
|
|
# environment variable: PICTRS_ADDRESS
|
2021-10-28 04:06:03 +00:00
|
|
|
# default: 0.0.0.0:8080
|
2022-04-03 23:58:18 +00:00
|
|
|
address = '0.0.0.0:8080'
|
2021-10-28 04:06:03 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: pict-rs worker id
|
|
|
|
# environment variable PICTRS_WORKER_ID
|
|
|
|
# default: pict-rs-1
|
2021-10-28 04:06:03 +00:00
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# This is used for the internal job queue. It will have more meaning once a shared metadata
|
|
|
|
# repository (like postgres) can be defined.
|
|
|
|
worker_id = 'pict-rs-1'
|
2021-10-28 04:06:03 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: shared secret for internal endpoints
|
|
|
|
# environment variable: PICTRS_API_KEY
|
2021-10-28 04:06:03 +00:00
|
|
|
# default: empty
|
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# Not specifying api_key disables internal endpoints
|
|
|
|
api_key = 'API_KEY'
|
2021-10-28 04:06:03 +00:00
|
|
|
|
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Logging configuration
|
|
|
|
[tracing.logging]
|
|
|
|
## Optional: log format
|
|
|
|
# environment variable: PICTRS_TRACING__LOGGING__FORMAT
|
|
|
|
# default: normal
|
|
|
|
#
|
|
|
|
# available options: compact, json, normal, pretty
|
|
|
|
format = 'normal'
|
2021-10-28 05:17:37 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: log targets
|
|
|
|
# environment variable: PICTRS_TRACING__LOGGING__TARGETS
|
|
|
|
# default: warn,tracing_actix_web=info,actix_server=info,actix_web=info
|
2022-03-22 20:06:13 +00:00
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# Dictates which traces should print to stdout
|
|
|
|
# Follows the same format as RUST_LOG
|
|
|
|
targets = 'warn,tracing_actix_web=info,actix_server=info,actix_web=info'
|
|
|
|
|
|
|
|
|
|
|
|
## Console configuration
|
|
|
|
[tracing.console]
|
|
|
|
## Optional: console address
|
|
|
|
# environment variable: PICTRS_TRACING__CONSOLE__ADDRESS
|
|
|
|
# default: empty
|
2022-03-22 20:06:13 +00:00
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# Dictacts whether console should be enabled, and what address it should be exposed on.
|
|
|
|
|
|
|
|
# When set, tokio-console can connect to the pict-rs service
|
2022-03-22 20:06:13 +00:00
|
|
|
#
|
|
|
|
# Configure your container to expose the console port
|
|
|
|
# ```
|
|
|
|
# # docker-compose.yml
|
|
|
|
# version: '3.3'
|
|
|
|
#
|
|
|
|
# services:
|
|
|
|
# pictrs:
|
|
|
|
# image: asonix/pictrs:v0.3.0-beta.6
|
|
|
|
# ports:
|
|
|
|
# - "127.0.0.1:8080:8080"
|
|
|
|
# - "127.0.0.1:6669:6669" # this is the line that exposes console
|
|
|
|
# restart: always
|
|
|
|
# volumes:
|
|
|
|
# - ./volumes/pictrs:/mnt
|
|
|
|
# ```
|
|
|
|
#
|
|
|
|
# Connect from console
|
|
|
|
# ```
|
|
|
|
# $ tokio-console localhost 6669
|
|
|
|
# ```
|
2022-04-03 23:58:18 +00:00
|
|
|
address = '0.0.0.0:6669'
|
2022-03-22 20:06:13 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: console buffer capacity
|
|
|
|
# environment variable: PICTRS_TRACING__CONSOLE__BUFFER_CAPACITY
|
|
|
|
# default: 102400
|
2021-10-28 05:17:37 +00:00
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# This is the number of _events_ to buffer, not the number of bytes. In reality, the amount of
|
|
|
|
# RAM used will be significatnly larger (in bytes) than the buffer capacity (in events)
|
|
|
|
buffer_capacity = 102400
|
|
|
|
|
2021-10-28 04:06:03 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## OpenTelemetry configuration
|
|
|
|
[tracing.opentelemetry]
|
2021-10-28 04:06:03 +00:00
|
|
|
## Optional: url for exporting otlp traces
|
2022-04-03 23:58:18 +00:00
|
|
|
# environment variable: PICTRS_TRACING__OPENTELEMETRY__URL
|
2021-10-28 04:06:03 +00:00
|
|
|
# default: empty
|
|
|
|
#
|
2021-10-28 05:17:37 +00:00
|
|
|
# Not specifying opentelemetry_url means no traces will be exported
|
2022-04-03 23:58:18 +00:00
|
|
|
# When set, pict-rs will export OpenTelemetry traces to the provided URL. If the URL is
|
|
|
|
# inaccessible, this can cause performance degredation in pict-rs, so it is best left unset unless
|
|
|
|
# you have an OpenTelemetry collector
|
|
|
|
url = 'http://localhost:4317/'
|
|
|
|
|
|
|
|
## Optional: name to relate OpenTelemetry traces
|
|
|
|
# environment variable: PICTRS_TRACING__OPENTELEMETRY__SERVICE_NAME
|
|
|
|
# default: pict-rs
|
|
|
|
service_name = 'pict-rs'
|
|
|
|
|
|
|
|
## Optional: trace level to export
|
|
|
|
# environment variable: PICTRS_TRACING__OPENTELEMETRY__TARGETS
|
|
|
|
# default: info
|
|
|
|
#
|
|
|
|
# Follows the same format as RUST_LOG
|
|
|
|
targets = 'info'
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration for migrating from pict-rs 0.2
|
|
|
|
[old_db]
|
|
|
|
## Optional: path to old pict-rs directory
|
|
|
|
# environment variable: PICTRS_OLD_DB__PATH
|
|
|
|
# default: /mnt
|
|
|
|
path = '/mnt'
|
|
|
|
|
2021-10-28 04:06:03 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Media Processing Configuration
|
|
|
|
[media]
|
|
|
|
## Optional: max media width (in pixels)
|
|
|
|
# environment variable: PICTRS_MEDIA__MAX_WIDTH
|
|
|
|
# default: 10,000
|
|
|
|
max_width = 10000
|
|
|
|
|
|
|
|
## Optional: max media height (in pixels)
|
|
|
|
# environment variable: PICTRS_MEDIA__MAX_HEIGHT
|
|
|
|
# default: 10,000
|
|
|
|
max_height = 10000
|
2021-10-28 05:17:37 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: max media area (in pixels)
|
|
|
|
# environment variable: PICTRS_MEDIA__MAX_AREA
|
|
|
|
# default: 40,000,000
|
|
|
|
max_area = 40000000
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: max file size (in Megabytes)
|
|
|
|
# environment variable: PICTRS_MEDIA__MAX_FILE_SIZE
|
|
|
|
# default: 40
|
|
|
|
max_file_size = 40
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: enable GIF and MP4 uploads (without sound)
|
|
|
|
# environment variable: PICTRS_MEDIA__ENABLE_SILENT_VIDEO
|
|
|
|
# default: true
|
2021-10-28 05:17:37 +00:00
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# Set this to false to serve static images only
|
|
|
|
enable_silent_video = true
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: set allowed filters for image processing
|
|
|
|
# environment variable: PICTRS_MEDIA__FILTERS
|
|
|
|
# default: ['blur', 'crop', 'identity', 'resize', 'thumbnail']
|
|
|
|
filters = ['blur', 'crop', 'identity', 'resize', 'thumbnail']
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: whether to validate images uploaded through the `import` endpoint
|
|
|
|
# environment variable: PICTRS_MEDIA__SKIP_VALIDATE_IMPORTS
|
|
|
|
# default: false
|
|
|
|
#
|
|
|
|
# Set this to true if you want to avoid processing imported media
|
|
|
|
skip_validate_imports = false
|
|
|
|
|
|
|
|
|
|
|
|
## Database configuration
|
|
|
|
[repo]
|
|
|
|
## Optional: database backend to use
|
|
|
|
# environment variable: PICTRS_REPO__TYPE
|
|
|
|
# default: sled
|
|
|
|
#
|
|
|
|
# available options: sled
|
|
|
|
type = 'sled'
|
|
|
|
|
|
|
|
## Optional: path to sled repository
|
|
|
|
# environment variable: PICTRS_REPO__PATH
|
|
|
|
# default: /mnt/sled-repo
|
|
|
|
path = '/mnt/sled-repo'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: in-memory cache capacity for sled data (in bytes)
|
|
|
|
# environment variable: PICTRS_REPO__CACHE_CAPACITY
|
|
|
|
# default: 67,108,864 (1024 * 1024 * 64, or 64MB)
|
|
|
|
cache_capacity = 67108864
|
2022-03-27 01:45:12 +00:00
|
|
|
|
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Media storage configuration
|
|
|
|
[store]
|
|
|
|
## Optional: type of media storage to use
|
|
|
|
# environment variable: PICTRS_STORE__TYPE
|
|
|
|
# default: filesystem
|
2021-10-28 05:17:37 +00:00
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# available options: filesystem, object_storage
|
|
|
|
type = 'object_storage'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage bucket name
|
|
|
|
# environment variable: PICTRS_STORE__BUCKET_NAME
|
2022-03-27 01:45:12 +00:00
|
|
|
# default: empty
|
2022-04-03 23:58:18 +00:00
|
|
|
bucket_name = 'BUCKET_NAME'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage region
|
|
|
|
# environment variable: PICTRS_STORE__REGION
|
2022-03-27 01:45:12 +00:00
|
|
|
# default: empty
|
2022-04-03 23:58:18 +00:00
|
|
|
region = 'REGION'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage access key
|
|
|
|
# environment variable: PICTRS_STORE__ACCESS_KEY
|
2022-03-27 01:45:12 +00:00
|
|
|
# default: empty
|
2022-04-03 23:58:18 +00:00
|
|
|
access_key = 'ACCESS_KEY'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage secret key
|
|
|
|
# environment variable: PICTRS_STORE__SECRET_KEY
|
2022-03-27 01:45:12 +00:00
|
|
|
# default: empty
|
2022-04-03 23:58:18 +00:00
|
|
|
secret_key = 'SECRET_KEY'
|
|
|
|
|
|
|
|
## Optional: object storage security token
|
|
|
|
# environment variable: PICTRS_STORE__SECURITY_TOKEN
|
|
|
|
# default: empty
|
|
|
|
security_token = 'SECURITY_TOKEN'
|
|
|
|
|
|
|
|
## Optional: object storage session token
|
|
|
|
# environment variable: PICTRS_STORE__SESSION_TOKEN
|
|
|
|
# default: empty
|
|
|
|
session_token = 'SESSION_TOKEN'
|
|
|
|
|
|
|
|
## Filesystem media storage example
|
|
|
|
# ## Media storage configuration
|
|
|
|
# [store]
|
|
|
|
# ## Optional: type of media storage to use
|
|
|
|
# # environment variable: PICTRS_STORE__TYPE
|
|
|
|
# # default: filesystem
|
|
|
|
# #
|
|
|
|
# # available options: filesystem, object_storage
|
|
|
|
# type = 'filesystem'
|
|
|
|
#
|
|
|
|
# ## Optional: path to uploaded media
|
|
|
|
# # environment variable: PICTRS_STORE__PATH
|
|
|
|
# # default: /mnt/files
|
|
|
|
# path = '/mnt/files'
|