Update README.md
Browse files
README.md
CHANGED
|
@@ -1,23 +1,21 @@
|
|
| 1 |
---
|
| 2 |
-
title: OpenCode Web (HF Bucket
|
| 3 |
sdk: docker
|
| 4 |
app_port: 7860
|
| 5 |
---
|
| 6 |
|
| 7 |
This Space runs `opencode web` on port 7860.
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
- We do NOT run SQLite directly on the mounted bucket.
|
| 12 |
-
Instead:
|
| 13 |
-
- OpenCode runs with its DB on the local (ephemeral) disk.
|
| 14 |
-
- A background job periodically performs a safe SQLite `.backup` to `/data/opencode-backup/`.
|
| 15 |
-
- On startup, if a backup exists, it restores the DB back to local disk.
|
| 16 |
|
| 17 |
-
Required Secrets
|
| 18 |
-
- OPENCODE_SERVER_PASSWORD (required)
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
-
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: OpenCode Web (Persistent via HF Bucket Backup)
|
| 3 |
sdk: docker
|
| 4 |
app_port: 7860
|
| 5 |
---
|
| 6 |
|
| 7 |
This Space runs `opencode web` on port 7860.
|
| 8 |
|
| 9 |
+
### Why not write to /data directly?
|
| 10 |
+
Even if a Storage Bucket is mounted to `/data`, it can be mounted via FUSE with permissions that are not writable by the runtime UID=1000 user. In that case, we persist by **uploading backups to the bucket via `hf buckets cp`** instead of writing to `/data`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
### Required Secrets (Space Settings -> Secrets)
|
| 13 |
+
- `OPENCODE_SERVER_PASSWORD` (required)
|
| 14 |
+
- `HF_TOKEN` (required for persistence; must have write access to your bucket)
|
| 15 |
|
| 16 |
+
### Required Variables (Space Settings -> Variables)
|
| 17 |
+
- `HF_BUCKET_ID` (example: `habppyar/ocweb-storage`)
|
| 18 |
+
|
| 19 |
+
### Optional Variables
|
| 20 |
+
- `BACKUP_INTERVAL_SECONDS` (default: 120)
|
| 21 |
+
- `BUCKET_PREFIX` (default: `opencode-backup`)
|