From dbe9f65940f9c1e923374ea0a881f84644babf83 Mon Sep 17 00:00:00 2001 From: Jeff Clement Date: Mon, 18 Nov 2024 00:13:19 -0700 Subject: [PATCH] wikijs --- wikijs_tailscale/.env | 9 ++++++ wikijs_tailscale/README.md | 5 ++++ wikijs_tailscale/docker-compose.yml | 44 +++++++++++++++++++++++++++++ wikijs_tailscale/ts-serve.json | 16 +++++++++++ 4 files changed, 74 insertions(+) create mode 100644 wikijs_tailscale/.env create mode 100644 wikijs_tailscale/README.md create mode 100644 wikijs_tailscale/docker-compose.yml create mode 100644 wikijs_tailscale/ts-serve.json diff --git a/wikijs_tailscale/.env b/wikijs_tailscale/.env new file mode 100644 index 0000000..ee1219f --- /dev/null +++ b/wikijs_tailscale/.env @@ -0,0 +1,9 @@ +# Tailscale authorization key +TS_AUTHKEY= ##REQUIRED## + +# Tailscale tailnet node name +TAILNET_NAME=wiki +TAILNET_SUFFIX=????.ts.net + +# strong password for the database +DB_PASSWORD= ##REQUIRED## \ No newline at end of file diff --git a/wikijs_tailscale/README.md b/wikijs_tailscale/README.md new file mode 100644 index 0000000..3c36263 --- /dev/null +++ b/wikijs_tailscale/README.md @@ -0,0 +1,5 @@ +# Wiki.js via. Tailscale + +Wikis are a great place to capture documentation, and Wiki.js is a great Wiki. This project configures an internal copy of Wiki.js on your Tailnet. + +Just update the values in `.env` and `docker compose up -d`. \ No newline at end of file diff --git a/wikijs_tailscale/docker-compose.yml b/wikijs_tailscale/docker-compose.yml new file mode 100644 index 0000000..0f8117b --- /dev/null +++ b/wikijs_tailscale/docker-compose.yml @@ -0,0 +1,44 @@ +services: + + tailscale: + hostname: ${TAILNET_NAME} + image: tailscale/tailscale + volumes: + - ./data/tailscale:/var/lib/tailscale + - ./ts-serve.json:/config/ts-serve.json:ro + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + - sys_module + environment: + TS_AUTHKEY: ${TS_AUTHKEY} + TS_SERVE_CONFIG: /config/ts-serve.json + TS_AUTH_ONCE: true + TS_STATE_DIR: /var/lib/tailscale + TS_HOST: ${TAILNET_NAME} + restart: unless-stopped + + db: + image: postgres:15-alpine + environment: + POSTGRES_DB: wiki + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_USER: wikijs + logging: + driver: "none" + restart: unless-stopped + volumes: + - ./data/db:/var/lib/postgresql/data + + server: + image: ghcr.io/requarks/wiki:2 + depends_on: + - db + environment: + DB_TYPE: postgres + DB_HOST: db + DB_PORT: 5432 + DB_USER: wikijs + DB_PASS: ${DB_PASSWORD} + DB_NAME: wiki + restart: unless-stopped \ No newline at end of file diff --git a/wikijs_tailscale/ts-serve.json b/wikijs_tailscale/ts-serve.json new file mode 100644 index 0000000..3b535cd --- /dev/null +++ b/wikijs_tailscale/ts-serve.json @@ -0,0 +1,16 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "http://server:3000" + } + } + } + } +} \ No newline at end of file