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