-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.example.toml
More file actions
145 lines (133 loc) · 4.03 KB
/
config.example.toml
File metadata and controls
145 lines (133 loc) · 4.03 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# NNTP Proxy Configuration
#
# Sections are ordered from general proxy behavior to concrete identities and
# backend endpoints. Keep authentication and [[servers]] at the bottom so the
# operational knobs are easy to scan first.
# Proxy Server Settings
[proxy]
# Host/IP to bind to (default: 0.0.0.0 - all interfaces)
host = "0.0.0.0"
# Port to listen on (default: 8119)
# Can be overridden with --port or NNTP_PROXY_PORT
port = 8119
# Worker threads (default: 1, use 0 for CPU cores)
threads = 1
# Validate yEnc structure and checksums (default: true)
# Disable for better performance if you trust your backends
validate_yenc = true
# Minimum log level for debug.log file (default: "warn")
# Options: "error", "warn", "info", "debug", "trace"
log_file_level = "warn"
# Optional stats persistence path used by the TUI dashboard
# stats_file = "/var/lib/nntp-proxy/stats.json"
# Routing Configuration
[routing]
# Routing mode: "hybrid" (default), "per-command", or "stateful"
mode = "hybrid"
# Backend selection strategy: "least-loaded" (default) or "weighted-round-robin"
backend_selection = "least-loaded"
# Enable adaptive availability prechecking for STAT/HEAD commands
adaptive_precheck = false
# Memory Configuration
# These settings affect transport buffers and buffer pools, not article storage.
[memory]
# TCP socket buffers for client and backend connections
socket_recv_buffer_size = 16777216
socket_send_buffer_size = 16777216
# Pooled streaming buffers
buffer_pool_size = 1048576
buffer_pool_count = 50
# Capture buffers used by cache ingest/response assembly
capture_pool_size = 1048576
capture_pool_count = 16
# Article Cache Configuration
[cache]
# Hot in-memory article cache capacity
# Supports: "1gb", "500mb", "64mb", or raw bytes
article_cache_capacity = "256mb"
# Time-to-live for the article cache, in seconds
article_cache_ttl_secs = 3600
# Default true: store article bodies in the in-memory cache when [cache] is present.
# Set false for availability-only caching without body storage.
store_article_bodies = true
# Optional persistence file for availability-only mode
# availability_index_path = "/var/cache/nntp-proxy/availability.idx"
# Disk Cache Configuration (optional)
# When configured, evicted articles spill from memory to disk.
# Use an SSD/NVMe device for the disk tier.
[cache.disk]
path = "/var/cache/nntp-proxy/articles"
capacity = "10gb"
# Options: "lz4" (default), "zstd", or "none"
compression = "lz4"
# Number of shards for concurrent disk access
shards = 4
# Health Check Configuration
[health_check]
# Interval and timeout are in seconds
interval = 30
timeout = 5
unhealthy_threshold = 3
# Client Authentication Configuration
# Place auth near the concrete server entries. It is optional.
#
# Custom greeting:
[client_auth]
greeting = "200 Hold On To Your Butts"
# Users:
[[client_auth.users]]
username = "clientusername"
password = "client password"
#
# [[client_auth.users]]
# username = "bob"
# password = "password456"
[[servers]]
host = "news.example.com"
port = 119
name = "Example News Server 1"
# Optional backend authentication
# username = "your_username"
# password = "your_password"
max_connections = 20
# Lower tier numbers are tried first. Higher tiers are fallback/archive servers.
tier = 0
# Optional keep-alive interval in seconds
# connection_keepalive = 60
use_tls = false
tls_verify_cert = true
[[servers]]
host = "nntp.example.org"
port = 119
name = "Example News Server 2"
username = "testuser"
password = "testpass"
max_connections = 10
tier = 1
connection_keepalive = 60
use_tls = false
tls_verify_cert = true
[[servers]]
host = "secure-news.example.com"
port = 563
name = "Secure News Server"
username = "premium_user"
password = "secure_password"
max_connections = 15
tier = 5
connection_keepalive = 120
use_tls = true
tls_verify_cert = true
# Optional custom CA certificate
# tls_cert_path = "/path/to/ca-cert.pem"
[[servers]]
host = "archive.example.com"
port = 563
name = "Archive Server"
username = "archive_user"
password = "archive_pass"
max_connections = 2
tier = 10
connection_keepalive = 120
use_tls = true
tls_verify_cert = true