Sign inSign up

gravadigital/jiku-docs

By gravadigital

•Updated 2 days ago

Documentation module for Jiku

Image
0

283

gravadigital/jiku-docs repository overview

⁠jiku-docs

The documentation module for Jiku⁠: markdown documents with visibility-based permissions (internal, public for external clients, restricted for admins only), version history, relations to Jiku clients, projects, requirements and tasks, full-text search, edit locks, real-time notifications, read-only public links and attachments.

It has no business HTTP API. It serves request/reply on Jiku's NATS bus (jiku-docs-commands and jiku-docs-queries micro services), takes the caller's identity from the subject and publishes its events to JetStream. The only HTTP it exposes is for operations.

⁠Tags

TagWhat it is
X.Y.ZA specific release
X.YThe latest patch of a minor version
latestThe latest release
devThe current state of the dev branch; not for production

The image is a static Go binary on distroless/static running as nonroot. jiku-docs version prints the release it was built from.

⁠Requirements

  • Jiku 1.7.0 or later, with the docs auth-callout rule, a machine user jiku_docs (Access Token Type JWT, roles internal-app and docs) and the JIKU_MODULES KV. The details are in the installation guide⁠.
  • PostgreSQL 16, a database of its own.
  • An S3-compatible bucket (DigitalOcean Spaces, MinIO, Garage…).

⁠Quick start

# Create the bucket without versioning and apply the lifecycle rules (once)
docker run --rm --env-file .env gravadigital/jiku-docs storage init

# Run the service (migrations run on startup)
docker run -d --name jiku-docs --env-file .env \
  -v /path/to/sentinel.creds:/run/secrets/nats.creds:ro \
  -e NATS_CREDS=/run/secrets/nats.creds \
  -p 8080:8080 \
  gravadigital/jiku-docs

Once ready, the logs show jiku-docs ready and module registered, and curl localhost:8080/readyz answers.

⁠Configuration

Every variable is documented in .env.dist⁠. Required for serve:

VariablePurpose
NATS_URL, NATS_CREDS, NATS_INSTANCEJiku's bus and the sentinel creds that trigger the auth-callout
ZITADEL_PROJECT_ID, DOCS_SERVICE_USER_KEY_B64 (or DOCS_SERVICE_USER_KEY_FILE)Identity of the jiku_docs machine user
JIKU_API_USER_ID, JIKU_WEB_URL, JIKU_PUBLIC_URLIntegration with the Jiku api and web
DATABASE_URLPostgreSQL DSN
DOCS_S3_ENDPOINT, DOCS_S3_BUCKET, DOCS_S3_ACCESS_KEY, DOCS_S3_SECRET_KEYContent bucket
DOCS_SECRET_KEY32 random bytes in base64 (openssl rand -base64 32)

⁠Subcommands

CommandWhat it does
serve (default)Migrates, registers the micro services, runs the outbox, indexer and janitor, and registers the module in JIKU_MODULES
migrateApplies the database migrations
reindexRebuilds the search index
storage initCreates the bucket and applies the lifecycle rules
storage restore-from-trashReturns a deleted object (and optionally its version) from trash/
history compactCompacts the version history now (--dry-run to preview)
module deregisterRemoves the module from the registry (uninstall)
import hedgedocImports notes from a HedgeDoc database
healthcheckQueries /readyz (used by the image's HEALTHCHECK)

⁠Operations

  • Port 8080 (DOCS_HTTP_ADDR): /healthz, /readyz (database and NATS) and /metrics (Prometheus).
  • Logs: JSON on stderr. Content, tokens and presigned URLs are never logged.
  • Replicas: safe to run several. Requests are spread by queue group; the outbox and periodic tasks elect a leader with PostgreSQL advisory locks.

See documentation/operations.md⁠ for metrics, alerts, backups and recovering deleted versions.

⁠License

Apache-2.0⁠ © Grava Digital.

Tag summary

Content type

Image

Digest

sha256:e7f0ba7a0…

Size

7.3 MB

Last updated

2 days ago

docker pull gravadigital/jiku-docs