{"id":35133249,"url":"https://github.com/hamflx/pocket","last_synced_at":"2026-01-13T22:56:54.336Z","repository":{"id":330454370,"uuid":"1121542858","full_name":"hamflx/pocket","owner":"hamflx","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-05T16:46:05.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T22:56:22.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamflx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-23T06:47:48.000Z","updated_at":"2026-01-05T16:46:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hamflx/pocket","commit_stats":null,"previous_names":["hamflx/pocket"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hamflx/pocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamflx%2Fpocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamflx%2Fpocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamflx%2Fpocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamflx%2Fpocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamflx","download_url":"https://codeload.github.com/hamflx/pocket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamflx%2Fpocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-28T07:33:02.195Z","updated_at":"2026-01-13T22:56:54.330Z","avatar_url":"https://github.com/hamflx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pocket\n\nPocket is a Windows‑focused virtual filesystem built on top of WinFsp. It mounts one or more local directories and backs their contents by either an in‑memory store or an S3‑compatible object store, with a CRDT‑based index.\n\n## Features\n\n- WinFsp‑based user‑mode filesystem.\n- Multiple mount points, each with its own backend and optional S3 key prefix.\n- Pluggable storage backends:\n  - `memory` – ephemeral in‑process store for testing and development.\n  - `s3` – persists file contents and index in an S3 bucket (or compatible service).\n- Index metadata stored as a Loro (CRDT) document and snapshotted to the backend.\n- Encrypted S3 credentials on Windows using the Data Protection API (DPAPI).\n- Optional background service that auto‑starts with Windows.\n\n## Prerequisites\n\n1. Windows with [WinFsp](https://winfsp.dev/) installed.\n2. Administrator privileges (usually required to mount WinFsp filesystems).\n3. A Rust toolchain (if building from source).\n\n## Build\n\n```bash\ncargo build --release\n```\n\nOn Windows this produces `target\\release\\pocket.exe`.\n\n## Configuration (`config.toml`)\n\nPocket discovers configuration as follows:\n\n1. `config.toml` in the platform configuration directory from `directories::ProjectDirs` (for example on Windows: `%APPDATA%\\hamflx\\pocket\\config.toml`).\n2. Fallback: `config.toml` in the current working directory.\n\nThe configuration file has two main parts:\n\n- `storages` – named backends (memory or S3).\n- `mounts` – local directories to mount, each bound to a storage.\n\nPocket expands the following inside `mount_path`:\n- `~` – user's home directory\n- `$VAR` or `${VAR}` – any environment variable (e.g. `$APPDATA`, `${USERPROFILE}`)\n\n### Minimal in‑memory example\n\nThis example mounts `~/.pocket-tmp` using the built‑in `memory` backend:\n\n```toml\n[[mounts]]\nname = \"mem\"\nmount_path = \"~/.pocket-tmp\"\nstorage = \"memory\"\n```\n\nFiles created under the mount are kept purely in memory and disappear after the process exits.\n\n### S3 backend example\n\nFirst define an S3 storage named `default` and mount it at your SSH directory:\n\n```toml\n[storages.default]\nbackend = \"s3\"\n\n[storages.default.s3]\nbucket = \"your-bucket-name\"\nregion = \"cn-hangzhou\"                           # optional\nendpoint = \"https://oss-cn-hangzhou.aliyuncs.com\"  # optional, S3-compatible endpoint\ncredentials = \"default\"                          # base name (no extension) of encrypted credential file\n\n[[mounts]]\nname = \"ssh\"\nmount_path = \"~/.ssh\"\nstorage = \"default\"\nprefix = \"ssh/\"                                  # optional S3 key prefix for this mount\n```\n\nBehavior when using the S3 backend:\n\n- File contents are stored as objects under `data/\u003cobject-id\u003e` inside the bucket (with the configured prefix).\n- A CRDT‑based index is stored under `index/*`, with the latest snapshot referenced by `index/head`.\n- Existing files referenced by the index become visible under the mount at startup.\n- Deletes and renames update the index and are reflected in S3 on a best‑effort basis.\n\n## CLI: configure encrypted S3 credentials (Windows)\n\nInstead of putting S3 credentials directly into `config.toml`, use the built‑in CLI to store them encrypted with the Windows Data Protection API and update the config:\n\n```bash\npocket config-s3 \\\n  --bucket your-bucket-name \\\n  --region cn-hangzhou \\\n  --prefix optional/prefix \\\n  --endpoint https://oss-cn-hangzhou.aliyuncs.com \\\n  --credentials default \\\n  --access-key-id YOUR_ACCESS_KEY_ID \\\n  --secret-access-key YOUR_SECRET_ACCESS_KEY\n```\n\nThis command will:\n\n- Encrypt the access key ID and secret access key for the current Windows user and write them to a file named `\u003ccredentials\u003e.bin` under a `credentials` directory in the same configuration directory as `config.toml` (for example `%APPDATA%\\hamflx\\pocket\\credentials\\default.bin`).\n- Create or update `config.toml` to define `[storages.default]` with `backend = \"s3\"` and an S3 section referencing the encrypted credential profile via `[storages.default.s3].credentials`.\n\nYou still need to add at least one `[[mounts]]` entry manually to choose where the filesystem is mounted.\n\nOn non‑Windows platforms this command returns an error because DPAPI is not available.\n\n## Running (foreground)\n\nFrom the project root (with a valid `config.toml`):\n\n```bash\ncargo run\n```\n\nPocket will:\n\n- Load the configuration and initialize all configured mounts.\n- On Windows, mount each directory using WinFsp and block until you press ENTER in the console.\n- When exiting, unmount all filesystems so that the underlying real directories (for example your original `.ssh` folder) become visible again.\n\n## Installation as a Windows background service (auto‑start)\n\nTo install Pocket so it starts automatically when you log into Windows:\n\n```bash\npocket install\n```\n\nThis command will:\n\n- Copy the executable to `%LOCALAPPDATA%\\hamflx\\pocket\\bin\\pocket.exe`.\n- Register a `HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run` entry named `Pocket`.\n- Start `pocket.exe` in the background without a console window.\n\nTo uninstall:\n\n```bash\npocket uninstall\n```\n\nThis will:\n\n- Remove the Windows startup registry entry.\n- Stop any running `pocket.exe` processes.\n- Remove the installed binary from `%LOCALAPPDATA%\\hamflx\\pocket\\bin\\pocket.exe`.\n\nOn non‑Windows platforms `install` and `uninstall` currently return an error.\n\n## Notes and limitations\n\n- Pocket currently targets Windows and depends on WinFsp for mounting.\n- The `memory` backend does not persist any data across restarts.\n- File permissions on the virtual filesystem are based on a security descriptor that grants full control to the current user.\n- Logging goes to a file under the platform data directory (for example `%LOCALAPPDATA%\\hamflx\\pocket\\logs\\pocket.log` on Windows).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamflx%2Fpocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamflx%2Fpocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamflx%2Fpocket/lists"}