Files
telfax/deployment/config.production.toml
T
Warren 55bca92691 V1.0: Class 1 fax — real-world 4-page send to external number confirmed
Core features:
- Class 1 T.30 protocol: full send/receive implementation
- HDLC: DLE-stuffing, FCS strip, USR5637 bit-reversal handling
- T.4 MH encoder/decoder (1728px A4 standard)
- Document pipeline: PDF (Ghostscript), PNG, TIFF input
- Width clamping: US Letter 1734px → 1728px fax standard
- Cover page: CJK rasterization (TW/CN/JP/EN), TIFF + HTML output
- OCR verification: Tesseract 5 with eng+chi_tra, CJK space-tolerant
- API server (axum): health, send, jobs, cover, retry, cancel
- Background worker: auto-poll queue, speed fallback, retry policy
- Modem detection, pool management

Real-world test results (2026-07-23):
- V90 → 25153038: 4 pages, V.17 12000 bps, 2:33 ✅
- USR5637 → 25153038: 4 pages, V.17 12000 bps, 2:26 ✅
- Both faxes confirmed received on remote machine

Tested: loopback (100% pixel match), multi-page, all input formats,
cover pages, OCR verify, API endpoints, worker processing.
13 unit tests pass, 0 new clippy warnings.
2026-07-24 18:47:15 +08:00

74 lines
1.9 KiB
TOML

# Telfax Production Configuration - V90 Class 2 Primary
#
# This config is optimized for production use with V90 modem in Class 2 mode
[server]
listen = "0.0.0.0:3000"
log_level = "info"
# Production authentication tokens
# IMPORTANT: Change these tokens before deployment!
[auth]
rate_limit_per_ip = 100
rate_limit_per_token = 500
[[auth.tokens]]
token = "prod-admin-token-change-me-abc123xyz"
permissions = "admin"
description = "Production admin token"
[[auth.tokens]]
token = "prod-write-token-change-me-def456uvw"
permissions = "write"
description = "Production write token for sending faxes"
[[auth.tokens]]
token = "prod-read-token-change-me-ghi789rst"
permissions = "read"
description = "Production read token for status monitoring"
# Primary Modem: V90 (Class 2 only - proven stable)
[[modems]]
device = "/dev/cu.usbmodem123456781"
name = "V90-Primary"
class = 2
priority = 1
enabled = true
phone_number = "25289852"
description = "V90 modem for Class 2 operations (production)"
# Backup Modem: USR5637 (Class 1 - experimental)
[[modems]]
device = "/dev/cu.usbmodem00000021"
name = "USR5637-Backup"
class = 1
priority = 2
enabled = false # Disabled until Class 1 is stable
phone_number = "27486656"
description = "USR5637 modem for Class 1 operations (experimental)"
# Job queue configuration
[queue]
database = "/usr/local/var/lib/telfax/queue.db"
max_retries = 3
retry_intervals = [60, 300, 900] # 1min, 5min, 15min
# Fax settings
[fax]
station_id = "+886-2-25289852"
header = "Telfax Fax Server"
resolution = "fine"
speed_fallback = true
default_class = 2 # Use Class 2 for production
# Cover page settings (Chinese support)
[cover]
font_path = "/System/Library/AssetsV2/com_apple_MobileAsset_Font8/86ba2c91f017a3749571a82f2c6d890ac7ffb2fb.asset/AssetData/PingFang.ttc"
font_index = 10
default_from = "Telfax Enterprise"
# Monitoring settings
[monitoring]
metrics_port = 9090
enable_prometheus = true
health_check_interval = 60 # seconds