Fix silverbullet-git push failing with "No user exists for uid 1000"
Deploy with Docker Compose / deploy (push) Successful in 28s

The sidecar runs as uid 1000 so its commits match the vault's ownership on
the host, but alpine/git has no passwd entry for that uid. ssh resolves the
calling uid before it does anything else and aborts when it cannot, so every
push failed at "No user exists for uid 1000" without reaching the deploy key.

Mount a minimal passwd file that defines the uid. SilverBullet's own entrypoint
creates the user at boot for the same reason; this container has no entrypoint
of its own, so the entry is supplied as a file.

Verified on the Pi: with the mount, ssh authenticates as the silverbullet-git
deploy key; without it, the uid error reproduces.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BCQFvkvorAw1xwhd5gL2qZ
This commit is contained in:
2026-09-21 15:37:27 +01:00
co-authored by Claude Opus 5
parent fdf76f75e9
commit 85ab27d241
2 changed files with 13 additions and 0 deletions
+2
View File
@@ -388,6 +388,8 @@ services:
- ${OBSIDIAN_DIR}:/space - ${OBSIDIAN_DIR}:/space
- ./silverbullet/git-sync.sh:/git-sync.sh:ro - ./silverbullet/git-sync.sh:/git-sync.sh:ro
- ./silverbullet/ssh:/ssh:ro - ./silverbullet/ssh:/ssh:ro
# ssh will not run for a uid with no passwd entry; see the file's comment.
- ./silverbullet/passwd:/etc/passwd:ro
# FastAPI side-service, proxied at /py/ with the prefix stripped by nginx. # FastAPI side-service, proxied at /py/ with the prefix stripped by nginx.
# ROOT_PATH=/py tells FastAPI it is mounted under a prefix so the generated # ROOT_PATH=/py tells FastAPI it is mounted under a prefix so the generated
+11
View File
@@ -0,0 +1,11 @@
# Minimal /etc/passwd for the silverbullet-git container.
#
# The container runs as uid 1000 (matching the vault's owner on the host) so its
# commits don't leave root-owned objects in .git. But alpine/git has no passwd
# entry for that uid, and ssh refuses to start for a uid it cannot resolve --
# it fails with "No user exists for uid 1000" before it ever tries the key, so
# every push fails. Mounting this file over /etc/passwd gives ssh something to
# resolve. SilverBullet's own entrypoint solves the same problem by creating the
# user at boot; this container has no entrypoint of its own to do that in.
root:x:0:0:root:/root:/bin/sh
sbgit:x:1000:1000:sbgit:/tmp:/bin/sh