Skip to content

Commit 1b4bc90

Browse files
committed
v1.0.1
1 parent 35cb7ae commit 1b4bc90

15 files changed

Lines changed: 566 additions & 24 deletions

README.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ services:
102102
- "4096:4096"
103103
volumes:
104104
- ./data/opencode:/home/opencode
105+
- ./local-cache/opencode:/home/opencode/.cache/opencode
105106
- ./workspace:/workspace
106107
environment:
107108
- PUID=1000
@@ -119,6 +120,8 @@ Open http://localhost:4096. You're in.
119120

120121
> The shipped `docker-compose.yaml` uses `${ANTHROPIC_API_KEY}` syntax which reads from your shell environment or a `.env` file. Copy `.env.example` to `.env` and fill in your API key.
121122
123+
> Keep `./local-cache/opencode` on local disk. If this project folder lives on NAS/CIFS/SMB storage, change that cache mount to an absolute local host path instead.
124+
122125
<p align="right">
123126
<a href="#top">back to top</a>
124127
</p>
@@ -226,6 +229,7 @@ services:
226229
- "4096:4096" # OpenCode web UI
227230
volumes:
228231
- ./data/opencode:/home/opencode
232+
- ./local-cache/opencode:/home/opencode/.cache/opencode
229233
- ./workspace:/workspace # Your project files
230234
environment:
231235
- PUID=1000
@@ -260,7 +264,10 @@ services:
260264
261265
volumes:
262266
# --- Persistent state (all OpenCode data under home dir) ---
263-
- ./data/opencode:/home/opencode # Config, sessions, plugins, cache, all XDG paths
267+
- ./data/opencode:/home/opencode # Config, sessions, plugins, all XDG paths
268+
269+
# --- Cache path (keep this on local disk; if this folder lives on NAS/CIFS, replace with an absolute local path) ---
270+
- ./local-cache/opencode:/home/opencode/.cache/opencode
264271
265272
# --- Workspace ---
266273
- ./workspace:/workspace # Your project files
@@ -549,19 +556,27 @@ docker exec -it holycode bash -c "opencode providers login"
549556

550557
## 💾 Data and Persistence
551558

552-
All OpenCode state lives in a single bind mount at `./data/opencode`. The container is stateless. The bind mount holds everything that matters.
559+
Most OpenCode state lives in `./data/opencode`. Plugin cache is mounted separately at `./local-cache/opencode` by default so you can keep that path on local disk.
553560

554561
| Host Path | Container Path | What's in it |
555562
|-----------|---------------|-------------|
556563
| `./data/opencode/.config/opencode` | `/home/opencode/.config/opencode` | Settings, agents, MCP configs, themes, plugins |
557564
| `./data/opencode/.local/share/opencode` | `/home/opencode/.local/share/opencode` | SQLite sessions database, MCP OAuth tokens |
558565
| `./data/opencode/.local/state/opencode` | `/home/opencode/.local/state/opencode` | Frecency data, model cache, key-value store |
559-
| `./data/opencode/.cache/opencode` | `/home/opencode/.cache/opencode` | Plugin node_modules, auto-installed dependencies |
566+
| `./local-cache/opencode` | `/home/opencode/.cache/opencode` | Plugin node_modules, auto-installed dependencies |
560567

561568
Rebuild the container anytime. Run `docker compose pull && docker compose up -d` and your sessions, settings, and configs come back automatically.
562569

563570
**SQLite WAL note.** The sessions database uses Write-Ahead Logging. Don't copy the `.db` file while the container is running. Stop the container first if you need to back up or migrate the database file.
564571

572+
**Network storage note.** If `./data/opencode` is on a CIFS/SMB network mount (NAS, Synology, TrueNAS), you need two mount options:
573+
- `nobrl` — SQLite WAL mode requires this (byte-range locking workaround)
574+
- `mfsymlinks` — plugin installation requires this (symlink support for node_modules)
575+
576+
Keep `./local-cache/opencode` on local disk. If your whole HolyCode folder lives on network storage, change that cache mount to an absolute local host path such as `/var/lib/holycode-cache/opencode:/home/opencode/.cache/opencode`.
577+
578+
See the Troubleshooting section below.
579+
565580
<p align="right">
566581
<a href="#top">back to top</a>
567582
</p>
@@ -703,6 +718,42 @@ security_opt:
703718

704719
</details>
705720

721+
<details>
722+
<summary><strong>SQLite WAL or plugins fail on CIFS/SMB network mounts (NAS)</strong></summary>
723+
724+
If your `./data/opencode` directory lives on a CIFS/SMB network share (e.g. NAS, Synology, TrueNAS), OpenCode may fail with:
725+
726+
```
727+
Failed to run the query 'PRAGMA journal_mode = WAL'
728+
```
729+
730+
OpenCode uses SQLite with Write-Ahead Logging (WAL) for its sessions database. WAL requires byte-range locking, which CIFS/SMB doesn't support by default.
731+
732+
HolyCode detects this at startup and prints a warning with the fix instructions.
733+
734+
**Fix:** Add `nobrl,mfsymlinks` to your CIFS mount options in `/etc/fstab`:
735+
736+
```
737+
# Before
738+
//192.168.1.100/share /mnt/share cifs credentials=/etc/smbcreds,uid=1000,gid=1000 0 0
739+
740+
# After — add nobrl and mfsymlinks
741+
//192.168.1.100/share /mnt/share cifs credentials=/etc/smbcreds,uid=1000,gid=1000,nobrl,mfsymlinks 0 0
742+
```
743+
744+
Then remount:
745+
746+
```bash
747+
sudo umount /mnt/share
748+
sudo mount /mnt/share
749+
```
750+
751+
Restart HolyCode: `docker compose up -d --force-recreate`
752+
753+
If you are using the default HolyCode Compose files, the cache mount is `./local-cache/opencode:/home/opencode/.cache/opencode`. Keep that path on local disk. If your entire HolyCode folder lives on network storage, replace it with an absolute local host path.
754+
755+
</details>
756+
706757
<p align="right">
707758
<a href="#top">back to top</a>
708759
</p>

docker-compose.full.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ services:
1414

1515
volumes:
1616
# --- Persistent state (all OpenCode data under home dir) ---
17-
- ./data/opencode:/home/opencode # Config, sessions, plugins, cache, all XDG paths
17+
- ./data/opencode:/home/opencode # Config, sessions, plugins, all XDG paths
18+
19+
# --- Cache path (keep this on local disk; if this folder lives on NAS/CIFS, replace with an absolute local path) ---
20+
- ./local-cache/opencode:/home/opencode/.cache/opencode
1821

1922
# --- Workspace ---
2023
- ./workspace:/workspace # Your project files

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
- "4096:4096"
1313
volumes:
1414
- ./data/opencode:/home/opencode
15+
- ./local-cache/opencode:/home/opencode/.cache/opencode
1516
- ./workspace:/workspace
1617
environment:
1718
- PUID=1000

docs/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to HolyCode will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
66

7+
## [1.0.1] - 03/31/2026
8+
9+
### Fixed
10+
11+
- Detect CIFS/SMB network mounts and warn about SQLite WAL incompatibility
12+
- Add `nobrl,mfsymlinks` mount option documentation for README Troubleshooting section
13+
14+
### Changed
15+
16+
- Expand SQLite WAL note with network storage guidance
17+
- Add startup check in entrypoint.sh for CIFS/SMB detection
18+
- Replace the `holycode-cache` named volume guidance with an explicit local-path cache bind mount for CIFS/SMB setups
19+
720
## [1.0.0] - 03/30/2026
821

922
### Added

docs/translations/README.de.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ services:
9797
- "4096:4096"
9898
volumes:
9999
- ./data/opencode:/home/opencode
100+
- ./local-cache/opencode:/home/opencode/.cache/opencode
100101
- ./workspace:/workspace
101102
environment:
102103
- PUID=1000
103104
- PGID=1000
104105
- ANTHROPIC_API_KEY=your-key-here
106+
105107
```
106108

107109
**Schritt 3.** Starte es.
@@ -221,11 +223,13 @@ services:
221223
- "4096:4096" # OpenCode Web-UI
222224
volumes:
223225
- ./data/opencode:/home/opencode
226+
- ./local-cache/opencode:/home/opencode/.cache/opencode
224227
- ./workspace:/workspace # Deine Projektdateien
225228
environment:
226229
- PUID=1000
227230
- PGID=1000
228231
- ANTHROPIC_API_KEY=your-key-here # Oder durch beliebigen Anbieterschlüssel ersetzen
232+
229233
```
230234

231235
<p align="right">
@@ -255,7 +259,10 @@ services:
255259

256260
volumes:
257261
# --- Persistent state (all OpenCode data under home dir) ---
258-
- ./data/opencode:/home/opencode # Config, sessions, plugins, cache, all XDG paths
262+
- ./data/opencode:/home/opencode # Config, sessions, plugins, all XDG paths
263+
264+
# --- Cache isolation (keeps plugin cache on local disk, avoids CIFS/SMB symlink issues) ---
265+
- ./local-cache/opencode:/home/opencode/.cache/opencode
259266

260267
# --- Workspace ---
261268
- ./workspace:/workspace # Your project files
@@ -309,6 +316,7 @@ services:
309316
# Installs automatically on first boot when enabled
310317
# Toggle on/off with docker compose down && up -d
311318
# - ENABLE_OH_MY_OPENAGENT=true
319+
312320
```
313321

314322
<p align="right">
@@ -551,12 +559,14 @@ Der gesamte OpenCode-Zustand lebt in einem einzigen Bind-Mount unter `./data/ope
551559
| `./data/opencode/.config/opencode` | `/home/opencode/.config/opencode` | Einstellungen, Agenten, MCP-Konfigurationen, Themes, Plugins |
552560
| `./data/opencode/.local/share/opencode` | `/home/opencode/.local/share/opencode` | SQLite-Sitzungsdatenbank, MCP-OAuth-Tokens |
553561
| `./data/opencode/.local/state/opencode` | `/home/opencode/.local/state/opencode` | Häufigkeitsdaten, Modell-Cache, Schlüssel-Wert-Speicher |
554-
| `./data/opencode/.cache/opencode` | `/home/opencode/.cache/opencode` | Plugin-node_modules, automatisch installierte Abhängigkeiten |
562+
| `./local-cache/opencode` | `/home/opencode/.cache/opencode` | Plugin-node_modules, automatisch installierte Abhängigkeiten |
555563

556564
Den Container jederzeit neu erstellen. `docker compose pull && docker compose up -d` ausführen und Sitzungen, Einstellungen und Konfigurationen kommen automatisch zurück.
557565

558566
**SQLite WAL-Hinweis.** Die Sitzungsdatenbank verwendet Write-Ahead Logging. Die `.db`-Datei nicht kopieren, während der Container läuft. Den Container zuerst stoppen, wenn die Datenbankdatei gesichert oder migriert werden muss.
559567

568+
**Netzwerkspeicher-Hinweis.** Wenn sich `./data/opencode` auf einem CIFS/SMB-Netzwerk-Mount (NAS, Synology, TrueNAS) befindet, kann der SQLite WAL-Modus fehlschlagen, da SMB standardmäßig kein Byte-Range-Locking unterstützt. HolyCode erkennt dies beim Start und gibt eine Warnung mit dem Fix aus. Siehe den Abschnitt Fehlerbehebung unten.
569+
560570
<p align="right">
561571
<a href="#top">nach oben</a>
562572
</p>
@@ -698,6 +708,40 @@ security_opt:
698708

699709
</details>
700710

711+
<details>
712+
<summary><strong>SQLite WAL schlägt auf CIFS/SMB-Netzwerk-Mounts fehl (NAS)</strong></summary>
713+
714+
Wenn sich das Verzeichnis `./data/opencode` auf einer CIFS/SMB-Netzwerkfreigabe befindet, schlägt OpenCode
715+
möglicherweise mit folgendem Fehler fehl:
716+
717+
```
718+
Failed to run the query 'PRAGMA journal_mode = WAL'
719+
```
720+
721+
OpenCode verwendet SQLite mit Write-Ahead Logging (WAL) für die Sitzungsdatenbank.
722+
WAL erfordert Byte-Range-Locking, das CIFS/SMB standardmäßig nicht unterstützt. HolyCode erkennt dies beim Start.
723+
724+
**Fix:** Fügen Sie `nobrl,mfsymlinks` zu den CIFS-Mount-Optionen in `/etc/fstab` hinzu:
725+
726+
```
727+
# Vorher
728+
//192.168.1.100/share /mnt/share cifs credentials=/etc/smbcreds,uid=1000,gid=1000 0 0
729+
730+
# Nachher (nobrl,mfsymlinks hinzufügen)
731+
//192.168.1.100/share /mnt/share cifs credentials=/etc/smbcreds,uid=1000,gid=1000,nobrl,mfsymlinks 0 0
732+
```
733+
734+
Dann neu einhängen:
735+
736+
```bash
737+
sudo umount /mnt/share
738+
sudo mount /mnt/share
739+
```
740+
741+
HolyCode neu starten: `docker compose up -d --force-recreate`
742+
743+
</details>
744+
701745
<p align="right">
702746
<a href="#top">nach oben</a>
703747
</p>

docs/translations/README.es.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ services:
9797
- "4096:4096"
9898
volumes:
9999
- ./data/opencode:/home/opencode
100+
- ./local-cache/opencode:/home/opencode/.cache/opencode
100101
- ./workspace:/workspace
101102
environment:
102103
- PUID=1000
103104
- PGID=1000
104105
- ANTHROPIC_API_KEY=your-key-here
106+
105107
```
106108

107109
**Paso 3.** Inícialo.
@@ -221,11 +223,13 @@ services:
221223
- "4096:4096" # Interfaz web de OpenCode
222224
volumes:
223225
- ./data/opencode:/home/opencode
226+
- ./local-cache/opencode:/home/opencode/.cache/opencode
224227
- ./workspace:/workspace # Los archivos de tu proyecto
225228
environment:
226229
- PUID=1000
227230
- PGID=1000
228231
- ANTHROPIC_API_KEY=your-key-here # O cambia por cualquier clave de proveedor
232+
229233
```
230234

231235
<p align="right">
@@ -255,7 +259,10 @@ services:
255259

256260
volumes:
257261
# --- Persistent state (all OpenCode data under home dir) ---
258-
- ./data/opencode:/home/opencode # Config, sessions, plugins, cache, all XDG paths
262+
- ./data/opencode:/home/opencode # Config, sessions, plugins, all XDG paths
263+
264+
# --- Cache isolation (keeps plugin cache on local disk, avoids CIFS/SMB symlink issues) ---
265+
- ./local-cache/opencode:/home/opencode/.cache/opencode
259266

260267
# --- Workspace ---
261268
- ./workspace:/workspace # Your project files
@@ -309,6 +316,7 @@ services:
309316
# Installs automatically on first boot when enabled
310317
# Toggle on/off with docker compose down && up -d
311318
# - ENABLE_OH_MY_OPENAGENT=true
319+
312320
```
313321

314322
<p align="right">
@@ -551,12 +559,14 @@ Todo el estado de OpenCode vive en un único bind mount en `./data/opencode`. El
551559
| `./data/opencode/.config/opencode` | `/home/opencode/.config/opencode` | Ajustes, agentes, configuraciones MCP, temas, plugins |
552560
| `./data/opencode/.local/share/opencode` | `/home/opencode/.local/share/opencode` | Base de datos SQLite de sesiones, tokens OAuth de MCP |
553561
| `./data/opencode/.local/state/opencode` | `/home/opencode/.local/state/opencode` | Datos de frecuencia, caché de modelos, almacén clave-valor |
554-
| `./data/opencode/.cache/opencode` | `/home/opencode/.cache/opencode` | node_modules de plugins, dependencias instaladas automáticamente |
562+
| `./local-cache/opencode` | `/home/opencode/.cache/opencode` | node_modules de plugins, dependencias instaladas automáticamente |
555563

556564
Reconstruye el contenedor cuando quieras. Ejecuta `docker compose pull && docker compose up -d` y tus sesiones, ajustes y configuraciones vuelven automáticamente.
557565

558566
**Nota sobre SQLite WAL.** La base de datos de sesiones usa Write-Ahead Logging. No copies el archivo `.db` mientras el contenedor esté en ejecución. Detén el contenedor primero si necesitas hacer copia de seguridad o migrar el archivo de base de datos.
559567

568+
**Nota sobre almacenamiento en red.** Si `./data/opencode` está en un montaje de red CIFS/SMB (NAS, Synology, TrueNAS), el modo WAL de SQLite puede fallar porque SMB no soporta bloqueo de rango de bytes por defecto. HolyCode detecta esto al inicio y muestra una advertencia con la solución. Consulta la sección de Solución de problemas a continuación.
569+
560570
<p align="right">
561571
<a href="#top">volver arriba</a>
562572
</p>
@@ -698,6 +708,40 @@ security_opt:
698708

699709
</details>
700710

711+
<details>
712+
<summary><strong>El modo WAL de SQLite falla en montajes de red CIFS/SMB (NAS)</strong></summary>
713+
714+
Si tu directorio `./data/opencode` está en un recurso compartido de red CIFS/SMB (p. ej. NAS, Synology, TrueNAS), OpenCode puede fallar con:
715+
716+
```
717+
Failed to run the query 'PRAGMA journal_mode = WAL'
718+
```
719+
720+
OpenCode usa SQLite con Write-Ahead Logging (WAL) para su base de datos de sesiones. WAL requiere bloqueo de rango de bytes, lo cual CIFS/SMB no soporta por defecto.
721+
722+
HolyCode detecta esto al inicio y muestra una advertencia con las instrucciones de solución.
723+
724+
**Solución:** Añade `nobrl,mfsymlinks` a las opciones de montaje CIFS en `/etc/fstab`:
725+
726+
```
727+
# Antes
728+
//192.168.1.100/share /mnt/share cifs credentials=/etc/smbcreds,uid=1000,gid=1000 0 0
729+
730+
# Después — añade nobrl,mfsymlinks
731+
//192.168.1.100/share /mnt/share cifs credentials=/etc/smbcreds,uid=1000,gid=1000,nobrl,mfsymlinks 0 0
732+
```
733+
734+
Luego vuelve a montar:
735+
736+
```bash
737+
sudo umount /mnt/share
738+
sudo mount /mnt/share
739+
```
740+
741+
Reinicia HolyCode: `docker compose up -d --force-recreate`
742+
743+
</details>
744+
701745
<p align="right">
702746
<a href="#top">volver arriba</a>
703747
</p>

0 commit comments

Comments
 (0)