Synology File Station
Core Goal
- Run major Synology File Station file operations with one CLI script.
- Read connection credentials from env instead of hardcoding secrets.
- Return JSON output suitable for automation pipelines.
Workflow
- Prepare env variables (see
references/env.mdandassets/config.example.env). - Validate config:
python3 scripts/synology_file_station.py check-config
- Optional connection probe:
python3 scripts/synology_file_station.py check-config --probe
- Run the required file operation command (see
references/commands.md).
Major Operations
- Read/browse:
info,list-shares,list,get-info - Search:
search-start,search-list,search-stop,search-clean - Directory/file mutation:
mkdir,rename,copy,move,delete - Transfer:
upload,download - Archive workflows:
extract(compressis temporarily unavailable) - Background task control:
background-list,task-status,task-stop
Environment Contract
Required env:
SYNOLOGY_BASE_URLSYNOLOGY_USERNAMESYNOLOGY_PASSWORD
Optional env:
SYNOLOGY_VERIFY_SSLSYNOLOGY_TIMEOUTSYNOLOGY_SESSIONSYNOLOGY_READONLY(defaultfalse; settrueto block mutation commands)SYNOLOGY_MUTATION_ALLOW_PATHS(optional mutation path allowlist)
Output Contract
- Success: JSON object with
type=statusand operation-specific fields. - Failure: JSON object with
type=errorand structured error metadata. - Exit code:
0: success1: runtime/API error2: invalid env configuration
References
references/env.mdreferences/commands.md
Assets
assets/config.example.env
Scripts
scripts/synology_file_station.py