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-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__SERVER__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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable PICTRS__SERVER__WORKER_ID
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__SERVER__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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__TRACING__LOGGING__FORMAT
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__TRACING__LOGGING__TARGETS
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__TRACING__CONSOLE__ADDRESS
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: empty
|
2022-03-22 20:06:13 +00:00
|
|
|
#
|
2022-04-11 20:17:54 +00:00
|
|
|
# Dictates whether console should be enabled, and what address it should be exposed on.
|
|
|
|
#
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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:
|
2022-04-04 00:12:28 +00:00
|
|
|
# image: asonix/pictrs:v0.4.0-alpha.1
|
2022-03-22 20:06:13 +00:00
|
|
|
# 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
|
|
|
|
# ```
|
2022-04-11 20:39:11 +00:00
|
|
|
# $ tokio-console http://localhost:6669
|
2022-03-22 20:06:13 +00:00
|
|
|
# ```
|
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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__TRACING__CONSOLE__BUFFER_CAPACITY
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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-07 02:40:49 +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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__TRACING__OPENTELEMETRY__SERVICE_NAME
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: pict-rs
|
|
|
|
service_name = 'pict-rs'
|
|
|
|
|
|
|
|
## Optional: trace level to export
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__TRACING__OPENTELEMETRY__TARGETS
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__OLD_DB__PATH
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: /mnt
|
|
|
|
path = '/mnt'
|
|
|
|
|
2021-10-28 04:06:03 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Media Processing Configuration
|
|
|
|
[media]
|
2022-09-25 20:17:33 +00:00
|
|
|
## Optional: preprocessing steps for uploaded images
|
|
|
|
# environment variable: PICTRS__MEDIA__PREPROCESS_STEPS
|
|
|
|
# default: empty
|
|
|
|
#
|
|
|
|
# This configuration is the same format as the process endpoint's query arguments
|
|
|
|
preprocess_steps = 'crop=16x9&resize=1200&blur=0.2'
|
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: max media width (in pixels)
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__MAX_WIDTH
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: 10,000
|
|
|
|
max_width = 10000
|
|
|
|
|
|
|
|
## Optional: max media height (in pixels)
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__MAX_HEIGHT
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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)
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__MAX_AREA
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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)
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__MAX_FILE_SIZE
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: 40
|
|
|
|
max_file_size = 40
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-09-25 23:16:37 +00:00
|
|
|
## Optional: max frame count
|
|
|
|
# environment variable: PICTRS__MEDIA__MAX_FRAME_COUNT
|
|
|
|
# default: # 900
|
|
|
|
max_frame_count = 900
|
|
|
|
|
|
|
|
## Optional: enable GIF, MP4, and WEBM uploads (without sound)
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__ENABLE_SILENT_VIDEO
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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-09-25 23:16:37 +00:00
|
|
|
## Optional: enable MP4, and WEBM uploads (with sound) and GIF (without sound)
|
|
|
|
# environment variable: PICTRS__MEDIA__ENABLE_FULL_VIDEO
|
|
|
|
# default: false
|
|
|
|
enable_full_video = false
|
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Optional: set allowed filters for image processing
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__FILTERS
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__SKIP_VALIDATE_IMPORTS
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: false
|
|
|
|
#
|
|
|
|
# Set this to true if you want to avoid processing imported media
|
|
|
|
skip_validate_imports = false
|
|
|
|
|
2022-04-06 01:29:30 +00:00
|
|
|
## Optional: The duration, in hours, to keep media ingested through the "cache" endpoint
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__MEDIA__CACHE_DURATION
|
2022-04-06 01:29:30 +00:00
|
|
|
# default: 168 (1 week)
|
|
|
|
cache_duration = 168
|
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
|
|
|
|
## Database configuration
|
|
|
|
[repo]
|
|
|
|
## Optional: database backend to use
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__REPO__TYPE
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: sled
|
|
|
|
#
|
|
|
|
# available options: sled
|
|
|
|
type = 'sled'
|
|
|
|
|
|
|
|
## Optional: path to sled repository
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__REPO__PATH
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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)
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__REPO__CACHE_CAPACITY
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__STORE__TYPE
|
2022-04-03 23:58:18 +00:00
|
|
|
# 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-09-25 20:17:33 +00:00
|
|
|
## Required: endpoint at which the object storage exists
|
|
|
|
# environment variable: PICTRS__STORE__ENDPOINT
|
|
|
|
# default: empty
|
|
|
|
#
|
|
|
|
# examples:
|
|
|
|
# - `http://localhost:9000` # minio
|
|
|
|
# - `https://s3.dualstack.eu-west-1.amazonaws.com` # s3
|
|
|
|
endpoint = 'http://minio:9000'
|
|
|
|
|
|
|
|
## Optional: How to format object storage requests
|
|
|
|
# environment variable: PICTRS__STORE__USE_PATH_STYLE
|
|
|
|
# default: false
|
|
|
|
#
|
|
|
|
# When this is true, objects will be fetched from http{s}://{endpoint}:{port}/{bucket_name}/{object}
|
|
|
|
# When false, objects will be fetched from http{s}://{bucket_name}.{endpoint}:{port}/{object}
|
|
|
|
#
|
|
|
|
# Set to true when using minio
|
|
|
|
use_path_style = false
|
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage bucket name
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__STORE__BUCKET_NAME
|
2022-03-27 01:45:12 +00:00
|
|
|
# default: empty
|
2022-09-25 20:17:33 +00:00
|
|
|
bucket_name = 'pict-rs'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage region
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__STORE__REGION
|
2022-03-27 01:45:12 +00:00
|
|
|
# default: empty
|
2022-09-25 20:17:33 +00:00
|
|
|
#
|
|
|
|
# When using minio, this can be set to `minio`
|
|
|
|
region = 'minio'
|
2022-03-27 01:45:12 +00:00
|
|
|
|
2022-04-03 23:58:18 +00:00
|
|
|
## Required: object storage access key
|
2022-04-07 02:40:49 +00:00
|
|
|
# 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
|
2022-04-07 02:40:49 +00:00
|
|
|
# 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 session token
|
2022-04-07 02:40:49 +00:00
|
|
|
# environment variable: PICTRS__STORE__SESSION_TOKEN
|
2022-04-03 23:58:18 +00:00
|
|
|
# default: empty
|
|
|
|
session_token = 'SESSION_TOKEN'
|
|
|
|
|
|
|
|
## Filesystem media storage example
|
|
|
|
# ## Media storage configuration
|
|
|
|
# [store]
|
|
|
|
# ## Optional: type of media storage to use
|
2022-04-07 02:40:49 +00:00
|
|
|
# # environment variable: PICTRS__STORE__TYPE
|
2022-04-03 23:58:18 +00:00
|
|
|
# # default: filesystem
|
|
|
|
# #
|
|
|
|
# # available options: filesystem, object_storage
|
|
|
|
# type = 'filesystem'
|
|
|
|
#
|
|
|
|
# ## Optional: path to uploaded media
|
2022-04-07 02:40:49 +00:00
|
|
|
# # environment variable: PICTRS__STORE__PATH
|
2022-04-03 23:58:18 +00:00
|
|
|
# # default: /mnt/files
|
|
|
|
# path = '/mnt/files'
|