fix(backend): resolve 4 deployment blockers (requirements.lock, imports, DB perms) #1

Merged
Ghost merged 1 commit from fix/backend-deployment-blockers into main 2026-07-01 20:52:16 +02:00

Fixes walletpress backend deployment blockers

The walletpress backend was unable to start due to 4 issues. This PR fixes all of them.

#1 — requirements.lock incomplete

Problem: requirements.lock was missing deps. The Dockerfile used requirements.lock for pip install, so the runtime couldn't import python-multipart (FastAPI Form data), mcp (MCP SDK), and various chain-specific deps.

Fix: Switched Dockerfile to use requirements.txt (which has all loose pins) instead of the incomplete lock. Also added python-multipart>=0.0.9 and mcp>=1.25.0 to requirements.txt.

#2 — main.py wrong import name (AuditTrail)

Problem: from core.audit import AuditTrail — class doesn't exist; only AuditLog does.

Fix: Changed import and usage to AuditLog.

#3 — main.py wrong import path (PersistentStore)

Problem: from routers.chain_vault import _PersistentStore — neither _PersistentStore nor _persistent_store exists in chain_vault.py. The actual class is PersistentStore (no underscore prefix) in routers/_persistent_store.py.

Fix: Changed import to from routers._persistent_store import PersistentStore.

#4 — DB volume permissions

Problem: /data/walletpress/walletpress.db couldn't be opened. The mounted volume had wrong ownership and the previous Dockerfile chown'd /data at build time only.

Fix: Added entrypoint.sh that runs as root on container start, ensures /data exists, chowns to walletpress:walletpress, then execs the CMD. Also fixed Dockerfile ordering (COPY entrypoint + chmod must happen before USER directive).

Verification

After all fixes:

{"status":"ok","version":"1.1.0","service":"walletpress","checks":{"vault":"ok","key_store":"ok","proof":"ok","webhooks":"ok"}}
  • Container: walletpress-backend Up (healthy)
  • API: 112 endpoints exposed at /backend/* via nginx
  • Tailscale access works (no auth)
  • Direct IP requires basic auth (401 without)

Files changed

  • backend/Dockerfile — switched to requirements.txt, fixed ordering, added entrypoint
  • backend/entrypoint.sh — new file, chowns /data on container start
  • backend/main.py — fixed 2 wrong imports
  • backend/requirements.txt — added python-multipart + mcp
## Fixes walletpress backend deployment blockers The walletpress backend was unable to start due to 4 issues. This PR fixes all of them. ### #1 — requirements.lock incomplete **Problem:** `requirements.lock` was missing deps. The Dockerfile used `requirements.lock` for `pip install`, so the runtime couldn't import `python-multipart` (FastAPI Form data), `mcp` (MCP SDK), and various chain-specific deps. **Fix:** Switched Dockerfile to use `requirements.txt` (which has all loose pins) instead of the incomplete lock. Also added `python-multipart>=0.0.9` and `mcp>=1.25.0` to `requirements.txt`. ### #2 — main.py wrong import name (AuditTrail) **Problem:** `from core.audit import AuditTrail` — class doesn't exist; only `AuditLog` does. **Fix:** Changed import and usage to `AuditLog`. ### #3 — main.py wrong import path (PersistentStore) **Problem:** `from routers.chain_vault import _PersistentStore` — neither `_PersistentStore` nor `_persistent_store` exists in `chain_vault.py`. The actual class is `PersistentStore` (no underscore prefix) in `routers/_persistent_store.py`. **Fix:** Changed import to `from routers._persistent_store import PersistentStore`. ### #4 — DB volume permissions **Problem:** `/data/walletpress/walletpress.db` couldn't be opened. The mounted volume had wrong ownership and the previous Dockerfile chown'd `/data` at build time only. **Fix:** Added `entrypoint.sh` that runs as root on container start, ensures `/data` exists, chowns to `walletpress:walletpress`, then `exec`s the CMD. Also fixed Dockerfile ordering (COPY entrypoint + chmod must happen before USER directive). ### Verification After all fixes: ``` {"status":"ok","version":"1.1.0","service":"walletpress","checks":{"vault":"ok","key_store":"ok","proof":"ok","webhooks":"ok"}} ``` - Container: `walletpress-backend` Up (healthy) - API: 112 endpoints exposed at `/backend/*` via nginx - Tailscale access works (no auth) - Direct IP requires basic auth (401 without) ### Files changed - `backend/Dockerfile` — switched to requirements.txt, fixed ordering, added entrypoint - `backend/entrypoint.sh` — new file, chowns /data on container start - `backend/main.py` — fixed 2 wrong imports - `backend/requirements.txt` — added python-multipart + mcp
Ghost added 1 commit 2026-07-01 20:51:55 +02:00
fix(backend): resolve 4 deployment blockers
Some checks are pending
AI PR Review / ai-review (pull_request) Waiting to run
CI / lint (pull_request) Waiting to run
CI / test (pull_request) Waiting to run
CI / security (pull_request) Waiting to run
CI / pre-commit (pull_request) Waiting to run
CI / license (pull_request) Waiting to run
CI / ai-review (pull_request) Waiting to run
fbbe8db260
#1 requirements.lock was incomplete (missing python-multipart, mcp, chain deps)
   - Switch Dockerfile to use requirements.txt (loose pins)
   - Add python-multipart>=0.0.9 and mcp>=1.25.0 to requirements.txt

#2 main.py wrong import: AuditTrail does not exist
   - core/audit.py defines AuditLog, not AuditTrail
   - Updated import + usage

#3 main.py wrong import path: _PersistentStore doesn't exist
   - Actual class is PersistentStore (no underscore prefix)
   - Lives in routers/_persistent_store.py (not routers/chain_vault.py)
   - Updated import path + name

#4 DB volume permissions broken
   - Added entrypoint.sh that chowns /data to walletpress:walletpress as root
   - Reordered Dockerfile: COPY entrypoint + chmod before USER directive
   - Added /data mkdir + chown in Dockerfile for build-time setup

After fixes:
- walletpress-backend container Up (healthy)
- 112 API endpoints accessible at /backend/*
- Tailscale access works, direct IP requires basic auth
Ghost merged commit 2488cd4c08 into main 2026-07-01 20:52:16 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: RugMunchMedia/walletpress#1
No description provided.