Pithos documentation
rclone ls s3d:my-drive
rclone copy ./photos s3d:my-drive/photos --progress
Environment variables for SDKs and tools: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION=us-east-1, AWS_ENDPOINT_URL=http://127.0.0.1:8000.
Storage for scripts, backups and AI agents
+A script, a backup tool or an AI agent uses your storage like any S3 app: an endpoint and an access key. Give each one its own key, so you can see what it does and switch it off alone.
+1. Give it its own user and key
+- Users & keys › New user, named after the job (
backup-agent,claude-notes). Pithos creates its key and a drive of the same name. - Optional: Drives › New drive for that user if you want a differently named drive.
- Open the key (Show secret & config) and press Export JSON…. Pick the drive and save the file.
The file looks like this:
+{
+ "endpoint": "http://127.0.0.1:8000",
+ "accessKey": "…",
+ "secretKey": "…",
+ "bucket": "backup-agent"
+}
+ - The key reaches every drive of that user;
bucketonly says which one to use. A user's keys cannot see other users' drives, which is why one user per job is the boundary. - The file is not encrypted. Keep it out of git, chats and shared folders. Save credentials… makes an encrypted copy instead (password or Theseus vault) for keeping.
- To stop the agent: Users & keys › Revoke on its key (or delete the user). Nothing else changes.
2. Use it
+Environment variables (most tools read these):
+export AWS_ACCESS_KEY_ID=$(jq -r .accessKey pithos-backup-agent.json)
+export AWS_SECRET_ACCESS_KEY=$(jq -r .secretKey pithos-backup-agent.json)
+export AWS_REGION=us-east-1
+export AWS_ENDPOINT_URL=$(jq -r .endpoint pithos-backup-agent.json)
+BUCKET=$(jq -r .bucket pithos-backup-agent.json)
+aws s3 cp report.pdf "s3://$BUCKET/reports/report.pdf"
+aws s3 ls "s3://$BUCKET/reports/"
+ Backups with restic (encrypted, deduplicated snapshots; restore any day):
+# the four exports above, then:
+export RESTIC_REPOSITORY="s3:$AWS_ENDPOINT_URL/$BUCKET/restic"
+export RESTIC_PASSWORD_FILE=~/.config/restic/password # keep this password: without it the backup cannot be read
+restic -o s3.bucket-lookup=path -o s3.region=us-east-1 init
+restic -o s3.bucket-lookup=path -o s3.region=us-east-1 backup ~/Documents
+restic -o s3.bucket-lookup=path -o s3.region=us-east-1 snapshots
+ rclone (sync, mount, serve): add a remote with the four values (provider = Other, force_path_style = true), as in "Using drives from other apps" above, then rclone sync ~/Projects backup:backup-agent/projects.
Python (boto3):
+import json, boto3
+from botocore.config import Config
+c = json.load(open("pithos-backup-agent.json"))
+s3 = boto3.client("s3", endpoint_url=c["endpoint"], aws_access_key_id=c["accessKey"],
+ aws_secret_access_key=c["secretKey"], region_name="us-east-1",
+ config=Config(s3={"addressing_style": "path"}))
+s3.upload_file("notes.md", c["bucket"], "notes/notes.md")
+print([o["Key"] for o in s3.list_objects_v2(Bucket=c["bucket"]).get("Contents", [])])
+ Node (AWS SDK v3): new S3Client({ endpoint: c.endpoint, region: "us-east-1", forcePathStyle: true, credentials: { accessKeyId: c.accessKey, secretAccessKey: c.secretKey } }).
3. Where the agent can reach it
+- On the same computer as s3d: the endpoint
http://127.0.0.1:8000works as is. Local agents (Claude Code, a cron job, a backup app) need nothing else. - From another machine or a cloud agent:
127.0.0.1points to that machine, so it fails. Either move the drives to Drives on Silent Mode (the endpoint becomeshttps://s3.silentmode.stand keeps working with your computer off) or put s3d behind your own server with TLS and write that address into the JSON asendpoint. - Narrower keys: on Drives on Silent Mode, ⋯ › Share… on a folder can make a key for one folder only: read, add new files (it can create files but never overwrite or delete one, good for an agent that drops reports or exports) or add, change and delete. restic needs the last one, because it removes its own lock files. A plain s3d only has whole-user keys.
- Files a tool uploads wait on this computer until a ~40 MB block fills; automatic upload sends leftovers after 10 quiet minutes, or press Upload now. Until then they are not on Sia yet.
SSH keys and SFTP
+s3d speaks only S3: there is no SSH login or SSH key to add. If a tool insists on SFTP, run rclone in front of it:
+rclone serve sftp backup:backup-agent --addr 127.0.0.1:2022 --authorized-keys ~/.ssh/authorized_keys
+ That gives SSH-key logins to one drive, but underneath it is the same S3 key, and rclone has to keep running. For agents and scripts, an S3 key per job (above) is simpler and easier to revoke; use SFTP only for tools that cannot do S3. rclone serve webdav and rclone mount work the same way for apps that want a network drive.
Telling an AI agent
+Give the agent the JSON file path, not the secret in the chat, and a short brief such as:
+> Use the S3 storage described in pithos-backup-agent.json (keys endpoint, accessKey, secretKey, bucket; region us-east-1; path-style addressing). Only read and write inside that bucket, under backups/. Never print the secret key. Do not delete objects unless I ask.
Common tasks
- Give an app its own key. Users & keys › create a user for the app (or use yours) › Create key. Revoke it later without touching your other keys.
- Share one file or folder with anyone. ⋯ › Share… › Create public link. The link reads only that file from your Sia account; nothing else in the account is exposed.
- Make a whole drive public. Keep the files in a drive of their own and set Access › Public read. Files are then at
http://<s3d address>/<drive>/<path>. On a default setup that address is reachable only from this computer; for other people s3d needs a public address (for example behind your own server and a TLS proxy). - Rename or move. ⋯ › Rename… on a file, folder or drive. Renaming a drive changes its name for S3 apps too.
- Back up. Keep the recovery phrase offline (or use the vault-derived phrase and back up the Theseus vault). Optionally
POST /snapshotsto keep a copy of s3d's database on Sia. - Move to another computer. Install s3d, run
s3d loginwith the same indexer login and the same phrase, then restore the database snapshot or recreate users and keys.
Troubleshooting
@@ -185,6 +233,7 @@ rclone copy ./photos s3d:my-drive/photos --progressFor AI assistants
You are helping someone run s3d (the Sia S3 gateway), optionally through Pithos. Facts to rely on:
- s3d v0.2.0+, S3 API on
127.0.0.1:8000, admin API on127.0.0.1:8001(Basic auth, empty user,adminPassword), regionus-east-1, path-style addressing. - Setup order:
s3d config→s3d login(indexer URL + 12-word phrase, approve the "S3d" app at the indexer) → runs3d→s3d users create→s3d keys create→ use any S3 client. - Small files wait locally until a ~40 MB block fills;
s3d flushorPOST /objects/flushuploads them now. - Buckets ("drives") can be private, public read, or public read + list; nothing finer.
- Config lookup:
S3D_CONFIG_FILE, else the OS default path listed above.
For an agent that should store files: ask the user to create a separate S3 user in Pithos and export its key as JSON (Users & keys › Show secret & config › Export JSON…), then read the file instead of having secrets pasted. See "Storage for scripts, backups and AI agents".
Rules: never ask the user to paste their recovery phrase or secret keys into the conversation; have them type secrets only into s3d or Pithos on their own machine. Prefer read-only checks (s3d status, s3d users list, aws s3 ls) before changing anything, and confirm before deleting users, keys, drives or files.