warpgate/templates/config.toml.default
grabbit d2b9f46b1a feat: add Apply Config progress modal and fix stale PENDING health after reload
- Add 4-step progress modal to config apply flow (validate, write, reload, services ready)
- Poll SSE-updated data-share-health attributes to detect when services finish restarting
- Fix stale health bug: recalculate health for affected shares based on actual mount
  success instead of preserving old health from before reload
- Add modal overlay/card/step CSS matching the dark theme
- Include connection refactor (multi-protocol support) and probe helpers from prior work

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 01:11:50 +08:00

160 lines
4.3 KiB
Plaintext

# Warpgate Configuration
# See: https://github.com/user/warpgate for documentation
# --- NAS Connections ---
# Each connection defines an endpoint to a remote NAS.
# Supported protocols: sftp, smb
# 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
host = "100.x.x.x"
# Protocol: "sftp" or "smb"
protocol = "sftp"
# Username
user = "admin"
# Password (prefer key_file for SFTP)
# pass = "your-password"
# Path to SSH private key (SFTP only, recommended)
# key_file = "/root/.ssh/id_ed25519"
# Port (SFTP default: 22, SMB default: 445)
port = 22
# SFTP connection pool size (if multi_thread_streams=4, recommend >= 16)
connections = 8
# --- Additional NAS via SFTP (uncomment to add) ---
# [[connections]]
# name = "office"
# host = "192.168.1.100"
# protocol = "sftp"
# user = "photographer"
# pass = "secret"
# port = 22
# connections = 8
# --- SMB connection example (uncomment to add) ---
# [[connections]]
# name = "smb-nas"
# host = "192.168.1.200"
# protocol = "smb"
# user = "admin"
# pass = "password" # Required for SMB
# share = "photos" # Windows share name
# # domain = "WORKGROUP" # Optional domain
# # port = 445 # Default: 445
[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 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.
#
# remote_path semantics differ by protocol:
# SFTP: absolute path on the NAS, e.g. "/volume1/photos"
# SMB: path relative to the share defined in the connection, e.g. "/" or "/subfolder"
# (the SMB share name itself is set in [[connections]])
[[shares]]
name = "photos"
connection = "nas"
remote_path = "/volume1/photos" # SFTP absolute path; for SMB use "/" or "/subfolder"
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"