From b167f266e6da3dbed965dcb47c29453e76e7f68d Mon Sep 17 00:00:00 2001 From: whitney Date: Fri, 17 Apr 2026 17:00:35 -0700 Subject: [PATCH] Add docmost --- .../documentation/docmost/.env.example | 5 ++ .../documentation/docmost/.gitignore | 1 + .../documentation/docmost/README.md | 56 +++++++++++++++++++ .../documentation/docmost/docker-compose.yml | 51 +++++++++++++++++ start-all-containers.sh | 1 + 5 files changed, 114 insertions(+) create mode 100644 software-development/documentation/docmost/.env.example create mode 100644 software-development/documentation/docmost/.gitignore create mode 100644 software-development/documentation/docmost/README.md create mode 100644 software-development/documentation/docmost/docker-compose.yml diff --git a/software-development/documentation/docmost/.env.example b/software-development/documentation/docmost/.env.example new file mode 100644 index 0000000..93d964e --- /dev/null +++ b/software-development/documentation/docmost/.env.example @@ -0,0 +1,5 @@ +# Generate with: openssl rand -hex 32 +APP_SECRET=replace_with_long_random_secret + +# PostgreSQL password (used by both the db container and Docmost's DATABASE_URL) +POSTGRES_PASSWORD=replace_with_strong_password diff --git a/software-development/documentation/docmost/.gitignore b/software-development/documentation/docmost/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/software-development/documentation/docmost/.gitignore @@ -0,0 +1 @@ +.env diff --git a/software-development/documentation/docmost/README.md b/software-development/documentation/docmost/README.md new file mode 100644 index 0000000..ebbd3da --- /dev/null +++ b/software-development/documentation/docmost/README.md @@ -0,0 +1,56 @@ +# Docmost + +[Docmost](https://docmost.com/) is an open-source collaborative documentation and wiki software. + +Accessible at **https://documentation.whitney.rip**. + +## Setup + +1. Copy the example env file and fill in real values: + + ```bash + cp .env.example .env + ``` + +2. Generate secrets: + + ```bash + # App secret (32+ characters) + openssl rand -hex 32 + + # Postgres password + openssl rand -hex 16 + ``` + +3. Start the stack: + + ```bash + docker compose up -d + ``` + + +## Health Check + +``` +https://documentation.whitney.rip/api/health +``` + +## Creating Users +Cannot be created manually, have to do manually via db insert. +1. Exec to container +```bash +docker exec -it docmost-db-1 psql -U docmost -d docmost +``` +2. Obtain WORKSPACE_ID from the users table. +Generate random password +```bash +select workspace_id from users; +``` +3. Exit psql and generate random passord. +``` +docker exec docmost-docmost-1 node -e "console.log(require('bcrypt').hashSync('REPLACE_PASSWORD', 12))" +``` +3. Insert +```bash +INSERT INTO users (name, email, password, role, workspace_id, email_verified_at) VALUES ('Jake', 'jake@runyan.dev', '$2b$10$BEiObFC7osNTuY9GcQvV6eCU6vHKQjwohrr/uPPBFzlO27jLvQCHy', 'admin', '019d9dbf-daf5-7652-90d6-33ee72c883a1', now()); +``` diff --git a/software-development/documentation/docmost/docker-compose.yml b/software-development/documentation/docmost/docker-compose.yml new file mode 100644 index 0000000..83417cd --- /dev/null +++ b/software-development/documentation/docmost/docker-compose.yml @@ -0,0 +1,51 @@ +networks: + traefik: + external: true + docmost: + driver: bridge + +services: + docmost: + image: docmost/docmost:latest + depends_on: + - db + - redis + environment: + APP_URL: "https://documentation.whitney.rip" + APP_SECRET: "${APP_SECRET}" + DATABASE_URL: "postgresql://docmost:${POSTGRES_PASSWORD}@db:5432/docmost" + REDIS_URL: "redis://redis:6379" + restart: unless-stopped + volumes: + - /pwspool/software/docmost/storage:/app/data/storage + networks: + - traefik + - docmost + labels: + - "traefik.enable=true" + - "traefik.http.routers.docmost.rule=Host(`documentation.whitney.rip`)" + - "traefik.http.routers.docmost.entrypoints=websecure" + - "traefik.http.routers.docmost.tls.certresolver=letsencrypt" + - "traefik.http.services.docmost.loadbalancer.server.port=3000" + + db: + image: postgres:18 + environment: + POSTGRES_DB: docmost + POSTGRES_USER: docmost + POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}" + restart: unless-stopped + volumes: + - /pwspool/software/docmost/postgresql:/var/lib/postgresql + networks: + - docmost + + redis: + image: redis:8 + command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"] + restart: unless-stopped + volumes: + - /pwspool/software/docmost/redis:/data + networks: + - docmost + diff --git a/start-all-containers.sh b/start-all-containers.sh index 54cb555..3ac9e67 100755 --- a/start-all-containers.sh +++ b/start-all-containers.sh @@ -10,6 +10,7 @@ declare -a CONTAINERS=( "software-development/design/excalidraw" "software-development/project-management/planka" "software-development/documentation/code-server" + "software-development/documentation/docmost" "software-development/infrastructure/gitea" "software-development/infrastructure/grafana" "software-development/infrastructure/traefik"