-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.toml
More file actions
80 lines (62 loc) · 2.92 KB
/
config.example.toml
File metadata and controls
80 lines (62 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Example configuration for Akkoproxy
# Copy this file to config.toml and adjust the settings
[upstream]
# Upstream Akkoma/Pleroma server URL (required)
url = "https://akkoma.example.com"
# Timeout for upstream requests in seconds (default: 30)
timeout = 30
[server]
# Address to bind the server to (default: 0.0.0.0:3000)
bind = "0.0.0.0:3000"
# Custom Via header value (default: akkoproxy/{version})
via_header = "akkoproxy/0.1.1"
# Preserve all headers from upstream when responding (default: true)
preserve_upstream_headers = true
# Enable Cloudflare Free plan compatibility mode (default: false)
# When enabled, the proxy will look for a 'format' query parameter to determine
# output format (avif/webp), then strip it from the upstream request.
# This is useful with Cloudflare's Transform Rules to add format based on Accept header.
# Example Cloudflare Transform Rule:
# - If: Accept header contains "image/avif"
# - Then: Add query parameter "format=avif"
behind_cloudflare_free = false
# Enable forwarding of X-Forwarded-* headers to upstream (default: false)
# When enabled, X-Forwarded-Proto, X-Forwarded-For, and X-Forwarded-Host headers
# will be forwarded to the upstream server based on the trusted_proxies configuration.
# This is essential for proper SSL/TLS detection when Akkoma has force_ssl enabled.
forward_headers_enabled = false
# List of trusted proxy IP addresses or CIDR ranges (default: empty)
# Only requests from these IPs will have their X-Forwarded-* headers honored.
# If empty and forward_headers_enabled is true, no headers will be forwarded (secure default).
# For untrusted sources, X-Forwarded-For will be set to the actual client IP.
# Examples:
# trusted_proxies = ["192.168.1.1", "10.0.0.0/8", "172.16.0.0/12"]
# trusted_proxies = ["127.0.0.1", "::1"] # localhost only
trusted_proxies = []
[cache]
# Maximum number of cached items (default: 10000)
max_capacity = 10000
# Time to live for cached items in seconds (default: 3600)
ttl = 3600
# Maximum size of a cached item in bytes (default: 10485760, 10MiB)
# Supports human-readable formats: "10M", "10MB", "10MiB", "1G", "1GB", "1GiB", etc.
# Note: M/MB uses base 10 (1000^2), MiB uses base 2 (1024^2)
max_item_size = "10MiB"
# Enable disk-based cache (default: false)
# When enabled, cached media will be stored on disk for persistence across restarts
disk_cache_enabled = false
# Path to disk cache directory (default: ./cache)
disk_cache_path = "./cache"
# Maximum disk cache size in bytes (default: 1073741824, 1GB)
# Supports human-readable formats: "10M", "10MB", "10MiB", "1G", "1GB", "1GiB", etc.
# Note: G/GB uses base 10 (1000^3), GiB uses base 2 (1024^3)
disk_cache_max_size = "1GiB"
[image]
# Enable AVIF conversion (default: true)
enable_avif = true
# Enable WebP conversion (default: true)
enable_webp = true
# JPEG quality for conversions, 1-100 (default: 85)
quality = 85
# Maximum image dimensions for processing (default: 4096)
max_dimension = 4096