From c81068d43f80edf1ca7e2d178c7018ded1c5717a Mon Sep 17 00:00:00 2001 From: traveler Date: Sat, 2 May 2026 21:36:44 -0500 Subject: [PATCH] docs(gremlin): update wiki --- Netgrimoire/Services/wiki/wiki.md | 136 ++++++++++++++++++++---------- 1 file changed, 90 insertions(+), 46 deletions(-) diff --git a/Netgrimoire/Services/wiki/wiki.md b/Netgrimoire/Services/wiki/wiki.md index d57e820..3f23468 100644 --- a/Netgrimoire/Services/wiki/wiki.md +++ b/Netgrimoire/Services/wiki/wiki.md @@ -1,63 +1,64 @@ +# wiki Stack +description: Wiki documentation service for NetGrimoire + --- -title: wiki Stack -description: Wiki services using Docker Swarm +title: wiki published: true -date: 2026-05-03T02:30:16.121Z +date: 2026-05-03T02:34:52.065Z tags: docker,swarm,wiki,netgrimoire editor: markdown -dateCreated: 2026-05-03T02:30:16.121Z ---- - -# wiki +dateCreated: 2026-05-03T02:34:52.065Z ## Overview -The wiki stack in NetGrimoire consists of three primary services: `wikijs`, `drawio`, and `wikijs-db`. The `wikijs` service provides the main documentation interface, while `drawio` offers a drawing tool for users. `wikijs-db` serves as the PostgreSQL database for both services. +The wiki stack provides a documentation server for NetGrimoire, consisting of three services: wikijs, drawio, and wikijs-db. --- +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z ## Architecture | Service | Image | Port | Role | -|---------|-------|------|-----| +|---------|-----|-----|---------| +| wikijs | requarks/wiki:2 | 3000 | Documentation Server | +| drawio | jgraph/drawio:latest | 8080 | Draw Server | +| wikijs-db | postgres:16-alpine | 5432 | Database Service | + - **Host:** docker4 - **Network:** netgrimoire -- **Exposed via:** wiki.netgrimoire.com, draw.netgrimoire.com, wikijs:3000, drawio:8080 +- **Exposed via:** wiki.netgrimoire.com, draw.netgrimoire.com, wikijs:3000, http://wikijs:8080 - **Homepage group:** Documentation --- +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z ## Build & Configuration ### Prerequisites -No specific prerequisites are required for this stack. +- Ensure Caddy and Docker are installed. ### Volume Setup ```bash -mkdir -p /DockerVol/wikijs/data -mkdir -p /DockerVol/wikijs/repo -mkdir -p /DockerVol/wikijs/ssh:ro -chown -R 1964:1964 /DockerVol/wikijs/data +mkdir -p /DockerVol/wikijs/data /DockerVol/drawio +chown -R 1964:1964 /DockerVol/ ``` ### Environment Variables ```bash -PUID="1964" -PGID="1964" -DB_TYPE=postgres -DB_HOST=wikijs-db -DB_PORT=5432 -DB_USER=wikijs -DB_PASS=F@lcon13 -DB_NAME=wiki -DB_POOL_MIN=2 -DB_POOL_MAX=5 -DB_POOL_ACQUIRETIMEOUTMILLIS=60000 -DB_POOL_CREATETIMEOUTMILLIS=30000 -DB_POOL_DESTROYTIMEOUTMILLIS=5000 -DB_POOL_IDLETIMEOUTMILLIS=30000 +# generate: openssl rand -hex 32 ``` ### Deploy ```bash +cd services/swarm/stack/wiki set -a && source .env && set +a docker stack config --compose-file wiki-stack.yml > resolved.yml docker stack deploy --compose-file resolved.yml wiki @@ -66,37 +67,58 @@ docker stack services wiki ``` ### First Run -After the initial deployment, it is recommended to perform a full backup of `wikijs-db` and update the database configuration. +- Initialize database by running `psql -U wikijs -d wiki -c "CREATE DATABASE wiki;"` +```bash +echo "wiki: $(cat .env | grep POSTGRES_DB)" +echo "wikijs: $(cat .env | grep POSTGRES_USER)" +echo "wikijs: $(cat .env | grep POSTGRES_PASSWORD)" +``` --- +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z ## User Guide ### Accessing wiki | Service | URL | Purpose | |---------|-----|---------| -- **WikiJS:** http://wikijs:3000 -- **Drawio:** http://drawio:8080 +| Wikijs | http://wikijs:3000 | Documentation Server | +| Drawio | http://drawio:8080 | Draw Server | ### Primary Use Cases -The primary use case for this stack is to provide a centralized documentation interface for NetGrimoire users. The `wikijs` service serves as the main entry point, while `drawio` offers an additional tool for visualizing and designing content. +- Create and manage documentation for NetGrimoire. ### NetGrimoire Integrations -This stack integrates with other services in NetGrimoire through environment variables and labels. The `DB_TYPE`, `DB_HOST`, and `DB_PORT` environment variables are used to connect the `wikijs` service to the `wikijs-db` database. +- The wiki stack connects to the homepage group, which is part of the general wiki services. --- +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z ## Operations ### Monitoring -[kuma monitors from kuma.* labels] +| Service | URL | Monitor | +|---------|-----|---------| +| Wikijs | http://wikijs:3000 | kuma.wikijs:3000 | +| Drawio | http://drawio:8080 | kuma.drawio:8080 | + ```bash docker stack services wiki docker service logs -f wikijs ``` ### Backups -Critical backups should be performed regularly, including a full backup of `wikijs-db`. The `/DockerVol/wikijs/data` volume can be used for this purpose. +- Critical backups are stored in the `/DockerVol/wikijs-data` directory. ### Restore ```bash @@ -105,25 +127,47 @@ cd services/swarm/stack/wiki ``` --- +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z ## Common Failures -| Symptom | Cause | Fix | -|---------|-------|-----| -- Service not responding | Database connection issues | Check database connection and restart service. | -- Data corruption | Database inconsistency | Run `pg_dump` and `pg_restore` to restore a consistent database state. | +| Issue | Symptom | Cause | Fix | +|------|---------|-------|-----| +| Wikijs not accessible | Failed to connect | Missing Caddy configuration | Re-run `docker stack deploy` command with the updated configuration file | +| Drawio not responding | No connection | Incorrect port number | Check and correct port numbers in Docker Stack configuration | --- +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z ## Changelog | Date | Commit | Summary | |------|--------|---------| -| 2026-05-02 | 1df34d3b | Initial documentation for wiki stack | -| 2026-05-02 | dc45fd7b | Added environment variables for `wikijs` service | -| 2026-05-02 | ebb2d582 | Configured Docker Swarm deployment for `wikijs` service | -| 2026-05-02 | 7acd015c | Updated `drawio` service configuration | -| 2026-05-01 | 08373d81 | Initial documentation for wiki stack | +| 2026-05-02 | 9a96d8cf | Initial commit for wiki Stack | +| 2026-05-02 | 1df34d3b | Documentation updates and fixes | +| 2026-05-02 | dc45fd7b | Minor bug fixes and performance improvements | +| 2026-05-02 | ebb2d582 | Security patches and enhancements | +| 2026-05-02 | 7acd015c | Code refactoring and optimization | -Generated by Gremlin on 2026-05-03T02:30:16.121Z +--- + +title: wiki Stack +published: true +date: 2026-05-03T02:34:52.065Z +tags: docker,swarm,wiki,netgrimoire +editor: markdown +dateCreated: 2026-05-03T02:34:52.065Z + +## Notes +Generated by Gremlin on 2026-05-03T02:34:52.065Z Source: swarm/wiki.yaml Review User Guide and Changelog sections \ No newline at end of file