warpgate/templates/config.toml.default
grabbit 5efef83a90 Add multi_thread_streams/cutoff support and Samba performance tuning
- Add multi_thread_streams (default 4) and multi_thread_cutoff (default "50M")
  fields to ReadConfig, wired into rclone mount args
- Expose both fields in Web UI config editor under Read Tuning section
- Add Samba performance options: TCP_NODELAY, large readwrite, max xmit
- Update config.toml.default with new fields and sftp_connections guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 14:15:23 +08:00

140 lines
3.6 KiB
Plaintext

# Warpgate Configuration
# See: https://github.com/user/warpgate for documentation
# --- NAS Connections ---
# Each connection defines an SFTP endpoint to a remote NAS.
# The "name" is used as the rclone remote identifier and must be unique.
[[connections]]
# Unique name for this connection (alphanumeric, hyphens, underscores)
name = "nas"
# Remote NAS Tailscale IP or hostname
nas_host = "100.x.x.x"
# SFTP username
nas_user = "admin"
# SFTP password (prefer key_file for security)
# nas_pass = "your-password"
# Path to SSH private key (recommended)
# nas_key_file = "/root/.ssh/id_ed25519"
# SFTP port
sftp_port = 22
# SFTP connection pool size (if multi_thread_streams=4, recommend >= 16)
sftp_connections = 8
# --- Additional NAS (uncomment to add) ---
# [[connections]]
# name = "office"
# nas_host = "192.168.1.100"
# nas_user = "photographer"
# nas_pass = "secret"
# sftp_port = 22
# sftp_connections = 8
[cache]
# Cache storage directory (should be on SSD, prefer btrfs/ZFS filesystem)
dir = "/mnt/ssd/warpgate"
# Max cache size (leave room for dirty files during offline writes)
max_size = "200G"
# Max cache retention time
max_age = "720h"
# Minimum free space on cache disk
min_free = "10G"
[read]
# Chunk size for large file reads
chunk_size = "256M"
# Max chunk auto-growth limit
chunk_limit = "1G"
# Read-ahead buffer for sequential reads
read_ahead = "512M"
# In-memory buffer size
buffer_size = "256M"
# Number of parallel SFTP streams for single-file downloads (improves cold-read speed)
# If using multi_thread_streams=4, set sftp_connections >= 16 for multi-file concurrency
multi_thread_streams = 4
# Minimum file size to trigger multi-thread download
multi_thread_cutoff = "50M"
[bandwidth]
# Upload (write-back) speed limit ("0" = unlimited)
limit_up = "0"
# Download (cache pull) speed limit ("0" = unlimited)
limit_down = "0"
# Enable adaptive write-back throttling (auto-reduce on congestion)
adaptive = true
[writeback]
# Delay before async write-back to NAS
write_back = "5s"
# Concurrent upload transfers
transfers = 4
[directory_cache]
# Directory listing cache TTL (lower = faster remote change detection)
cache_time = "1h"
[protocols]
# Enable SMB (Samba) sharing — primary for macOS/Windows
enable_smb = true
# Enable NFS export — for Linux clients
enable_nfs = false
# Enable WebDAV service — for mobile clients
enable_webdav = false
# NFS allowed network CIDR
nfs_allowed_network = "192.168.0.0/24"
# WebDAV listen port
webdav_port = 8080
# --- Optional: SMB user authentication ---
# By default, SMB shares use guest access (no password).
# Enable smb_auth for password-protected access.
#
# [smb_auth]
# enabled = true
# username = "photographer"
# smb_pass = "my-password"
# --- Shares ---
# Each share maps a remote NAS path to a local mount point.
# Each gets its own rclone mount process with independent FUSE mount.
# The "connection" field references a [[connections]] entry by name.
[[shares]]
name = "photos"
connection = "nas"
remote_path = "/volume1/photos"
mount_point = "/mnt/photos"
# [[shares]]
# name = "projects"
# connection = "nas"
# remote_path = "/volume1/projects"
# mount_point = "/mnt/projects"
#
# [[shares]]
# name = "backups"
# connection = "nas"
# remote_path = "/volume1/backups"
# mount_point = "/mnt/backups"
# read_only = true
#
# # Share from a different NAS:
# [[shares]]
# name = "office-docs"
# connection = "office"
# remote_path = "/data/documents"
# mount_point = "/mnt/office-docs"
[warmup]
# Auto-warmup configured paths on startup
auto = true
# [[warmup.rules]]
# share = "photos"
# path = "2024"
# newer_than = "30d"
#
# [[warmup.rules]]
# share = "photos"
# path = "Lightroom/Catalog"