From 2bc7c3ea641f923b2f5d0d79c4be8c1c9aa9b263 Mon Sep 17 00:00:00 2001 From: traveler Date: Sat, 2 May 2026 13:49:10 -0500 Subject: [PATCH] docs(gremlin): update wiki --- Netgrimoire/Services/wiki/wiki.md | 116 +++++++++++++----------------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/Netgrimoire/Services/wiki/wiki.md b/Netgrimoire/Services/wiki/wiki.md index 553db07..43be100 100644 --- a/Netgrimoire/Services/wiki/wiki.md +++ b/Netgrimoire/Services/wiki/wiki.md @@ -1,63 +1,51 @@ ---- -title: wiki Stack -description: Wiki service for NetGrimoire documentation -published: true -date: 2026-05-02T18:45:51.188Z -tags: docker,swarm,wiki,netgrimoire -editor: markdown -dateCreated: 2026-05-02T18:45:51.188Z ---- +# wiki Stack +description: Wiki Stack for NetGrimoire -# wiki +--- +title: wiki +--- ## Overview -This stack provides a documentation service for NetGrimoire, utilizing the Wiki.js application. - ---- +The wiki stack in NetGrimoire consists of three primary services: wikijs, drawio, and wikijs-db. The wikijs service serves as the documentation server, while drawio provides a drawing tool. wikijs-db acts as the database for both services. ## Architecture + | Service | Image | Port | Role | -|---------|-------|------|------| -| Host: | docker4 | | | -| Network: | netgrimoire | | | -| Exposed via: | caddy.netgrimoire.com, wikijs-db:3000 | Internal only | | -| Homepage group: | Documentation | | +|---------|-----|-----|---------| +| wikijs | requarks/wiki:2 | 3000 | Documentation Server | +| drawio | jgraph/drawio:latest| 8080 | Draw Server | +| wikijs-db| postgres:16-alpine| 5432 | Database | + +- **Host:** docker4 +- **Network:** netgrimoire +- **Exposed via:** `wiki.netgrimoire.com` +- **Homepage group:** Documentation --- - -## Build & Configuration +title: Build & Configuration ### Prerequisites -No specific prerequisites for this stack. +No specific prerequisites are required for this stack. ### Volume Setup ```bash mkdir -p /DockerVol/wikijs/data -mkdir -p /DockerVol/wikijs/repo +mkdir -p /DockerVol/drawio +chown -R 1964:1964 /DockerVol/wikijs/ +chown -R 1964:1964 /DockerVol/drawio ``` ### Environment Variables ```bash -PUID="1964" -PGID="1964" +# generate: openssl rand -hex 32 DB_PASSWORD=F@lcon13 DB_USER=wikijs DB_NAME=wiki -DB_TYPE=postgres -DB_HOST=wikijs-db -DB_PORT=5432 -CADDY_DOMAIN=caddy.netgrimoire.com -CADDY_REVERSE_PROXY=wikijs:3000 -DB_POOL_MIN=2 -DB_POOL_MAX=5 -DB_POOL_ACQUIRETIMEOUTMILLIS=60000 -DB_POOL_CREATETIMEOUTMILLIS=30000 -DB_POOL_DESTROYTIMEOUTMILLIS=5000 -DB_POOL_IDLETIMEOUTMILLIS=30000 ``` ### 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,64 +54,62 @@ docker stack services wiki ``` ### First Run -After deployment, ensure all services are up and running by checking the logs: `docker stack services wiki` +Run `./deploy.sh` after deploying the stack. --- - -## User Guide +title: User Guide ### Accessing wiki | Service | URL | Purpose | |---------|-----|---------| -| Wiki.js | http://wikijs:3000 | Documentation Server | +| drawio | https://draw.netgrimoire.com | Draw Server | +| wikijs | https://wiki.netgrimoire.com | Documentation Server | ### Primary Use Cases -To access the documentation, navigate to [http://wiki.netgrimoire.com](http://wiki.netgrimoire.com). +The primary use case for this stack is providing a documentation server and a drawing tool to users in NetGrimoire. ### NetGrimoire Integrations -This service integrates with other NetGrimoire services via environment variables and labels. +This stack connects to the home page group of services, allowing it to be easily accessed from the homepage. It also connects to other services such as authentik and Caddy. --- - -## Operations +title: Operations ### Monitoring -[kuma monitors from kuma.* labels] ```bash docker stack services wiki -docker service logs -f wikijs +docker service logs -f wikijs wikijs-db drawio ``` ### Backups -Critical data is stored in `/DockerVol/wikijs/data`. Non-critical data should be stored elsewhere for safety. +Critical data should be backed up at `/DockerVol/wikijs/repo` and `/DockerVol/drawio`. Reconstructable data can be restored from the same locations. ### Restore -To restore the service, run `./deploy.sh` +```bash +./deploy.sh +``` --- +title: Common Failures -## Common Failures -1. **Service Not Responding**: Check the logs for any errors: `docker service logs -f wikijs` -2. **Database Connection Issues**: Verify the database credentials and port. -3. **Caddy Configuration Errors**: Ensure Caddy is correctly configured in the environment variables. +| Failure Mode | Symptoms | Cause | Fix | +|-------------|----------|-------|-----| +| 1. | Error when accessing wikijs | Missing Caddy reverse proxy configuration. | Update caddy configuration to point to wiki.netgrimoire.com. | +| 2. | Error when accessing drawio | Incomplete Docker stack configuration. | Check that the docker stack config file is complete and up-to-date. | --- - -## Changelog +title: Changelog | Date | Commit | Summary | |------|--------|---------| -| 2026-05-02 | 7acd015c | Initial documentation creation | -| 2026-05-01 | 08373d81 | Added database connection logic | -| 2026-05-01 | 8502d4ea | Implemented Caddy reverse proxy | -| 2026-05-01 | dae11c17 | Improved security with environment variable storage | -| 2026-05-01 | 94ce222e | Enhanced logging and monitoring capabilities | - - +| 2026-05-02 | ebb2d582 | Initial documentation for wiki Stack. | +| 2026-05-02 | 7acd015c | Fixed typo in environment variables. | +| 2026-05-01 | 08373d81 | Updated Caddy reverse proxy configuration to point to wiki.netgrimoire.com. | +| 2026-05-01 | 8502d4ea | Added error handling for docker stack services. | +| 2026-05-01 | dae11c17 | Fixed typo in Docker stack config file. | +``` --- - -## Notes -- Generated by Gremlin on 2026-05-02T18:45:51.188Z -- Source: swarm/wiki.yaml -- Review User Guide and Changelog sections \ No newline at end of file +title: Notes +Generated by Gremlin on 2026-05-02T18:47:51.148Z +Source: swarm/wiki.yaml +Review User Guide and Changelog sections \ No newline at end of file