Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -227,6 +237,7 @@ jobs:
"job-nocobase",
"job-openclaw",
"job-hermes",
"job-ignis",
"job-logent",
"job-storebox",
"job-searxng",
Expand Down
114 changes: 114 additions & 0 deletions docker_ignis/README.md
Original file line number Diff line number Diff line change
@@ -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/)
23 changes: 23 additions & 0 deletions docker_ignis/demo/.env.example
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions docker_ignis/demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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:
48 changes: 48 additions & 0 deletions docker_ignis/ignis.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
31 changes: 31 additions & 0 deletions docker_ignis/work/start-ignis.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"