Provider: SFTP #11

Open
opened 2026-03-27 21:56:14 +00:00 by antialias · 0 comments
Owner

SFTP/SCP photo source provider for pulling photos from remote servers or NAS devices.

Config Schema

{
  "host": { "type": "string", "required": true },
  "port": { "type": "integer", "default": 22 },
  "username": { "type": "string", "required": true },
  "auth_method": { "type": "string", "enum": ["password", "key"], "default": "key" },
  "password": { "type": "string", "secret": true },
  "key_path": { "type": "string", "description": "Path to SSH private key" },
  "remote_path": { "type": "string", "required": true, "description": "Directory on remote host" },
  "recursive": { "type": "boolean", "default": true }
}

Implementation Notes

  • Use paramiko for SSH/SFTP connections
  • list_photos() does sftp.listdir_attr() recursively, filters by extension
  • get_photo() downloads the file to a temp buffer, opens with PIL
  • Connection pooling: keep the SFTP connection open between calls, reconnect on failure
  • PhotoRef.id = remote path relative to remote_path
  • PhotoRef.date = remote file mtime
  • Thumbnail cache is important here — avoid re-downloading full images just for gallery thumbnails

Dependencies

  • paramiko added to requirements.txt

Depends on #9 (core architecture).

SFTP/SCP photo source provider for pulling photos from remote servers or NAS devices. ## Config Schema ```json { "host": { "type": "string", "required": true }, "port": { "type": "integer", "default": 22 }, "username": { "type": "string", "required": true }, "auth_method": { "type": "string", "enum": ["password", "key"], "default": "key" }, "password": { "type": "string", "secret": true }, "key_path": { "type": "string", "description": "Path to SSH private key" }, "remote_path": { "type": "string", "required": true, "description": "Directory on remote host" }, "recursive": { "type": "boolean", "default": true } } ``` ## Implementation Notes - Use `paramiko` for SSH/SFTP connections - `list_photos()` does `sftp.listdir_attr()` recursively, filters by extension - `get_photo()` downloads the file to a temp buffer, opens with PIL - Connection pooling: keep the SFTP connection open between calls, reconnect on failure - `PhotoRef.id` = remote path relative to `remote_path` - `PhotoRef.date` = remote file mtime - Thumbnail cache is important here — avoid re-downloading full images just for gallery thumbnails ## Dependencies - `paramiko` added to `requirements.txt` Depends on #9 (core architecture).
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: antialias/eink-photo-frame#11