feat: add setup

This commit is contained in:
h
2026-05-21 23:54:13 +02:00
commit 99af700ff2
15 changed files with 2754 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
FROM node:22-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g obsidian-headless@latest
WORKDIR /vault
COPY <<'EOF' /usr/local/bin/entrypoint.sh
#!/bin/sh
set -e
CONFIG_DIR=/root/.config/obsidian-headless
if [ ! -f "$CONFIG_DIR/auth_token" ]; then
echo "[obsidian-headless] not logged in — run:"
echo " docker exec -it beaver-obsidian ob login"
echo "then restart this container."
exec sleep infinity
fi
if ! ls "$CONFIG_DIR"/sync/*/config.json >/dev/null 2>&1; then
echo "[obsidian-headless] vault not configured — run:"
echo " docker exec -it beaver-obsidian ob sync-setup --vault '<vault name>'"
echo "then restart this container."
exec sleep infinity
fi
exec ob sync --continuous
EOF
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]