Files
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

65 lines
1.5 KiB
TOML

# Telfax Enterprise Fax Server Configuration
#
# Copy this file to /opt/telfax/config.toml and customize as needed
[server]
listen = "0.0.0.0:3000"
log_level = "info"
# Authentication tokens
# Each token has a permission level: "admin", "write", "read"
[auth]
rate_limit_per_ip = 100
rate_limit_per_token = 500
[[auth.tokens]]
token = "your-secret-admin-token-here"
permissions = "admin"
description = "Admin token for full access"
[[auth.tokens]]
token = "your-secret-write-token-here"
permissions = "write"
description = "Token for sending faxes"
[[auth.tokens]]
token = "your-secret-read-token-here"
permissions = "read"
description = "Token for viewing status"
# Modem configuration
# V90 modem - Primary (Class 2)
[[modems]]
device = "/dev/cu.usbmodem123456781"
name = "V90"
class = 2
priority = 1
enabled = true
# USR5637 modem - Fallback (Class 1)
[[modems]]
device = "/dev/cu.usbmodem00000021"
name = "USR5637"
class = 1
priority = 2
enabled = true
# Job queue configuration
[queue]
database = "/var/lib/telfax/queue.db"
max_retries = 3
retry_intervals = [60, 300, 900] # 1min, 5min, 15min
# Fax settings
[fax]
station_id = "+886-2-1234-5678"
header = "Your Company Name"
resolution = "fine"
speed_fallback = true
default_class = 2 # Prefer Class 2 for reliability
# Cover page settings
[cover]
font_path = "/System/Library/AssetsV2/com_apple_MobileAsset_Font8/86ba2c91f017a3749571a82f2c6d890ac7ffb2fb.asset/AssetData/PingFang.ttc"
font_index = 10
default_from = "Your Company Name"