synology-file-station

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Synology File Station

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.
  • 通过一个CLI脚本执行Synology File Station的主要文件操作。
  • 从环境变量读取连接凭证,而非硬编码敏感信息。
  • 返回适用于自动化流水线的JSON格式输出。

Workflow

工作流程

  1. Prepare env variables (see
    references/env.md
    and
    assets/config.example.env
    ).
  2. Validate config:
bash
python3 scripts/synology_file_station.py check-config
  1. Optional connection probe:
bash
python3 scripts/synology_file_station.py check-config --probe
  1. Run the required file operation command (see
    references/commands.md
    ).
  1. 准备环境变量(参考
    references/env.md
    assets/config.example.env
    )。
  2. 验证配置:
bash
python3 scripts/synology_file_station.py check-config
  1. 可选的连接探测:
bash
python3 scripts/synology_file_station.py check-config --probe
  1. 运行所需的文件操作命令(参考
    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
    (
    compress
    is temporarily unavailable)
  • Background task control:
    background-list
    ,
    task-status
    ,
    task-stop
  • 读取/浏览:
    info
    ,
    list-shares
    ,
    list
    ,
    get-info
  • 搜索:
    search-start
    ,
    search-list
    ,
    search-stop
    ,
    search-clean
  • 目录/文件修改:
    mkdir
    ,
    rename
    ,
    copy
    ,
    move
    ,
    delete
  • 传输:
    upload
    ,
    download
  • 归档工作流:
    extract
    compress
    暂时不可用)
  • 后台任务控制:
    background-list
    ,
    task-status
    ,
    task-stop

Environment Contract

环境变量约定

Required env:
  • SYNOLOGY_BASE_URL
  • SYNOLOGY_USERNAME
  • SYNOLOGY_PASSWORD
Optional env:
  • SYNOLOGY_VERIFY_SSL
  • SYNOLOGY_TIMEOUT
  • SYNOLOGY_SESSION
  • SYNOLOGY_READONLY
    (default
    false
    ; set
    true
    to block mutation commands)
  • SYNOLOGY_MUTATION_ALLOW_PATHS
    (optional mutation path allowlist)
必填环境变量:
  • SYNOLOGY_BASE_URL
  • SYNOLOGY_USERNAME
  • SYNOLOGY_PASSWORD
可选环境变量:
  • SYNOLOGY_VERIFY_SSL
  • SYNOLOGY_TIMEOUT
  • SYNOLOGY_SESSION
  • SYNOLOGY_READONLY
    (默认值
    false
    ;设置为
    true
    将阻止修改类命令)
  • SYNOLOGY_MUTATION_ALLOW_PATHS
    (可选的修改路径白名单)

Output Contract

输出约定

  • Success: JSON object with
    type=status
    and operation-specific fields.
  • Failure: JSON object with
    type=error
    and structured error metadata.
  • Exit code:
    • 0
      : success
    • 1
      : runtime/API error
    • 2
      : invalid env configuration
  • 成功:返回
    type=status
    的JSON对象,包含操作相关字段。
  • 失败:返回
    type=error
    的JSON对象,包含结构化错误元数据。
  • 退出码:
    • 0
      :成功
    • 1
      :运行时/API错误
    • 2
      :无效的环境配置

References

参考文档

  • references/env.md
  • references/commands.md
  • references/env.md
  • references/commands.md

Assets

资源文件

  • assets/config.example.env
  • assets/config.example.env

Scripts

脚本文件

  • scripts/synology_file_station.py
  • scripts/synology_file_station.py