Skip to content

[Feature]allow Feishu to config where to save recived files #2030

@szyhf

Description

@szyhf

🎯 The Goal / Use Case

Refactor Feishu channel file download mechanism with improved organization and intelligent deduplication.

💡 Proposed Solution

Directory Structure Simplification:

  • Changed from hash-based paths to human-readable structure: {download_dir}/{year}/{month}/{filename}
  • Files are now organized by time (e.g., downloads/2026/03/report.pdf)
  • Preserves original filenames with comprehensive character sanitization

Intelligent Deduplication:

  • Smart hash-based deduplication only checks when same-month + same-filename conflicts occur
  • Same hash + size → reuse existing file (avoid duplicate downloads)
  • Different hash/size → auto-generate suffix (file-1.pdf, file-2.pdf)

Lightweight Directory Indexing:

  • Each directory has its own .feishu_index.json for metadata tracking
  • Records file hash, size, Feishu file_key, message_id, and download time
  • Enables file re-downloading if local files are lost
  • Independent indexes minimize impact of corruption

Configurable Read-Only Protection:

  • New config field download_readonly_disable (default: false)
  • When disabled (default), downloaded files are set to read-only (0o444) to prevent accidental modification
  • Users can enable editing by setting download_readonly_disable: true

🛠 Potential Implementation (Optional)

I already make it done, and I'll make a PR

🚦 Impact & Roadmap Alignment

  • This is a Core Feature
  • This is a Nice-to-Have / Enhancement
  • This aligns with the current Roadmap

🔄 Alternatives Considered

💬 Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions