habppyar commited on
Commit
27debde
·
verified ·
1 Parent(s): b7a92a8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -14
README.md CHANGED
@@ -1,23 +1,21 @@
1
  ---
2
- title: OpenCode Web (HF Bucket Persistent)
3
  sdk: docker
4
  app_port: 7860
5
  ---
6
 
7
  This Space runs `opencode web` on port 7860.
8
 
9
- Persistence:
10
- - Mount a Hugging Face **Storage Bucket** to `/data` in Space Settings (Read & Write).
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
- Optional:
21
- - OPENCODE_SERVER_USERNAME
22
- - OPENCODE_CONFIG_CONTENT (inline JSON content)
23
- - BACKUP_INTERVAL_SECONDS (default 60)
 
 
 
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`)