Repository navigation
Expand file tree
/
Copy pathexample.config.toml
More file actions
80 lines (71 loc) · 2.88 KB
/
Copy pathexample.config.toml
File metadata and controls
80 lines (71 loc) · 2.88 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
[server]
hostname = "0.0.0.0"
port = 3555
[database]
# Storage / Database Provider:
# Options:
# - "postgres" : Standalone PostgreSQL table (stores deduplicated BYTEA blobs)
# - "mongodb" : MongoDB database (binary BSON blob storage with indexing)
# - "s3" : AWS S3 or compatible (MinIO, Cloudflare R2, Wasabi, Backblaze)
# - "hetzner_s3" : Hetzner Object Storage (S3-compatible bucket)
# - "hetzner_storage_box" : Hetzner Storage Box (WebDAV HTTP/HTTPS REST storage)
# - "cache_only" : High performance in-memory LRU cache only (no persistent DB)
provider = "postgres"
url = "postgresql://postgres:password@localhost:5432/image_db"
table_name = "images"
# --- MongoDB Provider Settings (used when database.provider = "mongodb") ---
[mongodb]
uri = "mongodb://localhost:27017"
database = "image_db"
collection = "images"
# --- S3 Provider Settings (used when database.provider = "s3") ---
[s3]
endpoint = "https://s3.amazonaws.com"
region = "us-east-1"
bucket = "my-image-bucket"
access_key_id = "YOUR_ACCESS_KEY_ID"
secret_access_key = "YOUR_SECRET_ACCESS_KEY"
prefix = "images/"
force_path_style = false
# --- Hetzner Storage Settings ---
# 1. Hetzner Storage Box (WebDAV / HTTPS)
[hetzner.storage_box]
endpoint = "https://u123456.your-storagebox.de"
username = "u123456"
password = "your_storage_box_password"
base_path = "/images"
# 2. Hetzner Object Storage (S3-compatible bucket)
[hetzner.object_storage]
region = "fsn1" # "fsn1" (Falkenstein), "hel1" (Helsinki), or "nbg1" (Nuremberg)
bucket = "my-hetzner-bucket"
access_key_id = "YOUR_HETZNER_ACCESS_KEY"
secret_access_key = "YOUR_HETZNER_SECRET_KEY"
prefix = "images/"
# --- Clever Image Compression & Storage Saving ---
[compression]
enabled = true
format = "webp" # "webp", "jpeg", "png", or "original"
quality = 80 # Quality from 1 to 100
max_width = 2048 # Downscale if exceeds max dimension
max_height = 2048
strip_metadata = true # Strips EXIF/GPS/device metadata
only_if_smaller = true # Keeps original if compressed is larger
min_bytes_threshold = 1024 # Skip tiny files (< 1 KB)
[app]
cache_size = 10000
# Default storage target for uploads: "both" (cache + db), "storage" (db only), or "cache" (cache only)
default_storage_target = "both"
max_upload_bytes = 52428800 # 50 MB
[auth]
# Web UI Authentication (HTTP Basic Auth for browser pages /upload and /explore)
web_auth_enabled = false
username = "admin"
password = "supersecret"
protect_upload = false
protect_explore = false
# Separate REST API Service Tokens:
# - cache_token : Token required to post into LRU cache (POST /api/cache or target=cache)
# - storage_token : Token required to post into DB storage (POST /api/storage or target=storage|both)
# Provide via header: Authorization: Bearer <token>, X-Cache-Token, X-Storage-Token, X-API-Token, or ?token=
cache_token = "cache-secret-token-123"
storage_token = "storage-secret-token-456"