From 043d15f9e44d6de1f9fb4e0125048e4af9b0ccce Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 7 Aug 2026 15:56:35 +0000 Subject: [PATCH 1/2] Add docker_ignis for self-hosted Obsidian sync server - Add ignis.Dockerfile based on labnow/node with multi-stage build - Clone ignis source from Nystik-gh/ignis on git pull - Add work/start-ignis.sh for bootstrap and healthcheck - Add demo/docker-compose.yml with port 8080 and volume mounts - Add .env.example for configuration - Add README.md with documentation --- docker_ignis/README.md | 114 +++++++++++++++++++++++++++ docker_ignis/demo/.env.example | 23 ++++++ docker_ignis/demo/docker-compose.yml | 31 ++++++++ docker_ignis/ignis.Dockerfile | 48 +++++++++++ docker_ignis/work/start-ignis.sh | 31 ++++++++ 5 files changed, 247 insertions(+) create mode 100644 docker_ignis/README.md create mode 100644 docker_ignis/demo/.env.example create mode 100644 docker_ignis/demo/docker-compose.yml create mode 100644 docker_ignis/ignis.Dockerfile create mode 100644 docker_ignis/work/start-ignis.sh diff --git a/docker_ignis/README.md b/docker_ignis/README.md new file mode 100644 index 0000000..b89d842 --- /dev/null +++ b/docker_ignis/README.md @@ -0,0 +1,114 @@ +# Ignis Server + +`ignis` is a containerized Obsidian sync server based on the [Ignis](https://github.com/Nystik-gh/ignis) project. It enables self-hosted Obsidian vault synchronization. + +--- + +## 1. Port Configuration + +The Ignis container hosts services on the following port: +- **`8080` (HTTP)**: Web interface for vault management and synchronization. + +### Key Environment Variables: +- `PORT`: Server port (defaults to `8080`). +- `PUID`: User ID for file ownership (defaults to `1000`). +- `PGID`: Group ID for file ownership (defaults to `1000`). +- `VAULT_ROOT`: Path to vaults directory (defaults to `/vaults`). +- `OBSIDIAN_VERSION`: Obsidian version to download (defaults to `1.12.7`). +- `OBSIDIAN_ASSETS_PATH`: Path to Obsidian app cache (defaults to `/app/obsidian-app`). + +--- + +## 2. Data Persistence + +Ignis persists data in the following locations: + +- **`/vaults`**: Stores Obsidian vaults. Each subfolder represents a vault. +- **`/app/data`**: Stores Ignis state, server plugin settings, and sync configuration. +- **`/app/obsidian-app`**: Caches the Obsidian application (first run downloads it). + +### Important Notes: +- File ownership is controlled by `PUID` and `PGID` environment variables. +- On first run, Obsidian and the `obsidian-headless` CLI are downloaded automatically. +- For offline install, mount a manually downloaded Obsidian `.deb` at `/packages/obsidian.deb` and set `OBSIDIAN_PACKAGE=/packages/obsidian.deb`. + +--- + +## 3. Local Startup + +### Build Local Image + +Always build the image using `tool.sh` from the repository root to ensure internal base image dependencies (`BASE_NAMESPACE=quay.io/labnow`) are resolved correctly: + +```bash +export REGISTRY_SRC=quay.io +export REGISTRY_DST=quay.io +export CI_PROJECT_NAME=LabNow/lab-dev +source ./tool.sh +build_image_no_tag ignis local docker_ignis/ignis.Dockerfile +``` + +### Start with Docker Compose + +1. Navigate to the demo directory: + ```bash + cd docker_ignis/demo + ``` + +2. Launch the container: + ```bash + docker compose up -d + ``` + +### Access Ignis + +Visit `http://localhost:8080` to access the Ignis web interface. + +--- + +## 4. Vault Management + +### Add Vaults + +Place your Obsidian vault folders inside the `vaults` directory: +``` +vaults/ +├── MyVault/ +│ ├── .obsidian/ +│ └── notes/ +└── AnotherVault/ + └── notes/ +``` + +Ignis will automatically detect and load vaults on startup. + +### Network Access + +For LAN or internet access, configure TLS via a reverse proxy or set up authentication. See the official [Ignis documentation](https://ignis.thiefling.com/docs/server/deploy/) for details. + +--- + +## 5. Docker Run Example + +For one-off testing without Docker Compose: + +```bash +docker run -d \ + --name svc-ignis \ + --hostname svc-ignis \ + -p 8080:8080 \ + -v /path/to/vaults:/vaults \ + -v ignis-data:/app/data \ + -v ignis-obsidian:/app/obsidian-app \ + -e PUID=1000 \ + -e PGID=1000 \ + quay.io/labnow/ignis:latest +``` + +--- + +## 6. References + +- [Ignis GitHub Repository](https://github.com/Nystik-gh/ignis) +- [Official Deployment Guide](https://ignis.thiefling.com/docs/server/deploy/) +- [Environment Variables](https://ignis.thiefling.com/docs/server/environment/) diff --git a/docker_ignis/demo/.env.example b/docker_ignis/demo/.env.example new file mode 100644 index 0000000..d141a96 --- /dev/null +++ b/docker_ignis/demo/.env.example @@ -0,0 +1,23 @@ +# Ignis Service Configuration +# Copy this file to .env and modify as needed + +# Image configuration +IGNIS_IMAGE=quay.io/labnow/ignis:latest + +# Port configuration +IGNIS_PORT=8080 +IGNIS_PUBLISH_HOST=127.0.0.1 + +# User/Group ownership (run 'id' to check your UID/GID) +PUID=1000 +PGID=1000 + +# Obsidian version +OBSIDIAN_VERSION=1.12.7 + +# Data directories +IGNIS_VAULT_DIR=./vaults +IGNIS_DATA_DIR=./data + +# Timezone +TZ=Asia/Shanghai diff --git a/docker_ignis/demo/docker-compose.yml b/docker_ignis/demo/docker-compose.yml new file mode 100644 index 0000000..381a8c1 --- /dev/null +++ b/docker_ignis/demo/docker-compose.yml @@ -0,0 +1,31 @@ +name: "svc-ignis" + +services: + ignis: + container_name: svc-ignis + hostname: svc-ignis + image: "${IGNIS_IMAGE:-quay.io/labnow/ignis:latest}" + pull_policy: if_not_present + restart: unless-stopped + environment: + - TZ=${TZ:-Asia/Shanghai} + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} + - PORT=${IGNIS_PORT:-8080} + - VAULT_ROOT=/vaults + - OBSIDIAN_VERSION=${OBSIDIAN_VERSION:-1.12.7} + - OBSIDIAN_ASSETS_PATH=/app/obsidian-app + volumes: + - ${IGNIS_VAULT_DIR:-./vaults}:/vaults + - ${IGNIS_DATA_DIR:-./data}:/app/data + - ignis-obsidian:/app/obsidian-app + ports: + - "${IGNIS_PUBLISH_HOST:-127.0.0.1}:${IGNIS_PORT:-8080}:8080" + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + +volumes: + ignis-obsidian: diff --git a/docker_ignis/ignis.Dockerfile b/docker_ignis/ignis.Dockerfile new file mode 100644 index 0000000..18f08f9 --- /dev/null +++ b/docker_ignis/ignis.Dockerfile @@ -0,0 +1,48 @@ +# Distributed under the terms of the Modified BSD License. + +ARG BASE_NAMESPACE +ARG BASE_IMG="node" +FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG} + +LABEL maintainer="postmaster@labnow.ai" +LABEL com.thiefling.ignis.obsidian-version="1.12.7" + +ENV NODE_ENV=production +ENV PORT=8080 +ENV VAULT_ROOT=/vaults +ENV OBSIDIAN_VERSION=1.12.7 +ENV OBSIDIAN_ASSETS_PATH=/app/obsidian-app +ENV PUID=1000 +ENV PGID=1000 + +# Install runtime dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates curl gosu \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# Copy utility scripts +COPY work /opt/ignis/ + +# Clone and build ignis from source +RUN set -eux \ + && chmod +x /opt/ignis/*.sh \ + && git clone --depth 1 --branch main https://github.com/Nystik-gh/ignis.git . \ + && mv /opt/ignis/start-ignis.sh /app/ + +# Install Node.js dependencies and build +RUN set -eux \ + && npm install --prefer-offline --no-audit --fetch-retries=5 \ + && npm run build \ + && chmod +x /app/apps/ignis-server/scripts/entrypoint.sh \ + && ln -sf /app/start-ignis.sh /usr/local/bin/ignis-server \ + && npm cache clean --force \ + && install__clean + +# Data volumes +VOLUME ["/vaults", "/app/obsidian-app", "/app/data"] + +EXPOSE 8080 + +ENTRYPOINT ["/app/apps/ignis-server/scripts/entrypoint.sh"] diff --git a/docker_ignis/work/start-ignis.sh b/docker_ignis/work/start-ignis.sh new file mode 100644 index 0000000..12f9981 --- /dev/null +++ b/docker_ignis/work/start-ignis.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -eu + +# Ignis Server Startup Script +# This script handles bootstrap and health checks for the Ignis container + +IGNIS_HOME="${IGNIS_HOME:-/root/.ignis}" +mkdir -pv "$IGNIS_HOME" +mkdir -pv "/vaults" +mkdir -pv "/app/data" +mkdir -pv "/app/obsidian-app" + +# Set ownership for data directories +chown -R ${PUID:-1000}:${PGID:-1000} /vaults /app/data /app/obsidian-app 2>/dev/null || true + +# Healthcheck function +healthcheck() { + port="${PORT:-8080}" + if curl -fsS --max-time 3 "http://127.0.0.1:${port}" >/dev/null 2>&1; then + exit 0 + fi + exit 1 +} + +# Run healthcheck if requested +if [ "$1" = "healthcheck" ]; then + healthcheck +fi + +# Run the original entrypoint +exec /app/apps/ignis-server/scripts/entrypoint.sh "$@" From 9642df4f5de3769f6cd06ccce0f50554f364afec Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 7 Aug 2026 15:58:55 +0000 Subject: [PATCH 2/2] Add ignis build job to CI workflow - Add job-ignis for building ignis Docker image - Add job-ignis to job-sync-images needs list --- .github/workflows/build-docker.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 8987fcf..ef48f9c 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -158,6 +158,16 @@ jobs: source ./tool.sh build_image hermes latest docker_hermes/hermes.Dockerfile && push_image hermes + ## Ignis - Self-hosted Obsidian sync server + job-ignis: + name: "ignis" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - run: | + source ./tool.sh + build_image ignis latest docker_ignis/ignis.Dockerfile && push_image ignis + ## DevBox - base job-base-dev: name: "developer,base-dev" @@ -227,6 +237,7 @@ jobs: "job-nocobase", "job-openclaw", "job-hermes", + "job-ignis", "job-logent", "job-storebox", "job-searxng",