Files
telfax/deployment/config.enterprise.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

99 lines
2.2 KiB
TOML

# Telfax Enterprise Configuration - Complete Example
#
# Copy this file to /usr/local/etc/telfax/config.toml or use --config option
[server]
listen = "0.0.0.0:3000"
log_level = "info"
# Authentication tokens
[auth]
rate_limit_per_ip = 100
rate_limit_per_token = 500
[[auth.tokens]]
token = "admin-token-change-me-in-production"
permissions = "admin"
description = "Full administrative access"
[[auth.tokens]]
token = "write-token-change-me-in-production"
permissions = "write"
description = "Send faxes and manage jobs"
[[auth.tokens]]
token = "read-token-change-me-in-production"
permissions = "read"
description = "View status and history"
# Modem configuration
[[modems]]
device = "/dev/cu.usbmodem123456781"
name = "V90-Primary"
class = 2
priority = 1
enabled = true
[[modems]]
device = "/dev/cu.usbmodem00000021"
name = "USR5637-Backup"
class = 1
priority = 2
enabled = false # Class 1 is experimental
# Job queue
[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 Enterprise Fax Server"
resolution = "fine"
speed_fallback = true
default_class = 2
# Cover page
[cover]
font_path = "/System/Library/AssetsV2/com_apple_MobileAsset_Font8/86ba2c91f017a3749571a82f2c6d890ac7ffb2fb.asset/AssetData/PingFang.ttc"
font_index = 10 # TC-Semibold
default_from = "Telfax Enterprise"
# Address book
[address_book]
database = "/usr/local/var/lib/telfax/address_book.db"
# Email configuration (optional)
# Uncomment and configure for Email-to-Fax and notifications
#
# [email]
# smtp_host = "smtp.gmail.com"
# smtp_port = 587
# smtp_username = "your-email@gmail.com"
# smtp_password = "your-app-password"
# from_address = "telfax@yourdomain.com"
# from_name = "Telfax Fax Server"
# use_tls = true
#
# [notification]
# email = "admin@yourdomain.com"
# notify_on_success = true
# notify_on_failure = true
# notify_on_received = true
# Monitoring
[monitoring]
metrics_port = 9090
enable_prometheus = true
health_check_interval = 60
# Logging
[logging]
# Log file path (optional, defaults to stdout)
# file = "/usr/local/var/log/telfax/telfax.log"
# Maximum log file size in MB
# max_size = 100
# Number of rotated log files to keep
# max_files = 10