Skip to content

FUSE-based Archive & Remote Browsing Feature #8

Description

@efimsky

Summary

Add virtual filesystem browsing to tiny-commander using external FUSE tools. The app remains zero Python dependencies but extends functionality when system tools are available.

Supported tools:

  • archivemount - Browse archives (.tar.gz, .tar.bz2, .zip, etc.)
  • fuse-archive - Alternative archive mounter with broader format support
  • sshfs - Browse SFTP connections
  • rclone - FTP, AWS S3, Google Cloud Storage, Azure Blob, Dropbox, and 40+ other providers

Archive formats: .tar.gz, .tar.bz2, .tar.xz, .tgz, .zip, .7z, .rar (requires appropriate tools)

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         App (app.py)                            │
│  - Owns MountManager instance                                   │
│  - Intercepts Enter on archives                                 │
│  - Routes menu actions for remote connections                   │
│  - Calls unmount_all() on cleanup                               │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                   MountManager (mount.py)                       │
│  - Detects available tools on startup                           │
│  - Tracks active mounts in dict[Path, MountInfo]                │
│  - Handles mount/unmount via subprocess                         │
│  - Cleans up stale mounts from crashed sessions                 │
└─────────────────────────────────────────────────────────────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        ▼                     ▼                     ▼
  archivemount             sshfs                rclone
  (archives)               (SFTP)         (FTP, S3, GCS, Azure...)

Implementation Phases

  • Phase 1: Create tnc/mount.py with MountManager core infrastructure (tool detection, archive detection, mount hash generation)
  • Phase 2: Implement archive mounting operations (mount_archive, unmount, unmount_all, cleanup_stale_mounts)
  • Phase 3: Integrate MountManager with App (Enter key on archives, cleanup, [M] indicator in panel header)
  • Phase 4: SFTP remote connections (mount_sftp, SFTP menu item)
  • Phase 5: rclone integration (list_rclone_remotes, mount_rclone, setup_rclone_remote, Connect menu)
  • Phase 6: Unmount feature ("Unmount current" menu item)
  • Phase 7: Update documentation (CLAUDE.md, README.md)

Key Design Decisions

  1. Zero Python dependencies - Uses subprocess to call external FUSE tools
  2. Graceful degradation - Features enabled only when tools are available
  3. Mount tracking - All mounts tracked in active_mounts dict for cleanup
  4. Stale mount cleanup - On startup, clean up leftover mounts from crashed sessions
  5. Mount indicator - [M] prefix in panel header when inside mounted directory

Optional System Dependencies

Tool Purpose Install
archivemount Browse .tar.gz, .tar.bz2, .zip archives apt install archivemount / brew install archivemount
fuse-archive Alternative archive browser (more formats) apt install fuse-archive
sshfs Browse SFTP connections apt install sshfs / brew install sshfs
rclone Browse FTP, S3, GCS, Azure, Dropbox, etc. apt install rclone / brew install rclone
p7zip Browse .7z archives apt install p7zip-full / brew install p7zip
unrar Browse .rar archives apt install unrar / brew install unrar

macOS note: FUSE tools require macFUSE - approve kernel extension in System Settings > Privacy & Security.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions