hedgedoc++

This commit is contained in:
Jeff Clement 2024-11-15 12:40:07 -07:00
parent d0773c0ac3
commit 5e5cea9dd6
Signed by: jeff
GPG key ID: 3BCB43A3F0E1D7DA
3 changed files with 62 additions and 0 deletions

12
hedgedoc_cloudflare/.env Normal file
View file

@ -0,0 +1,12 @@
# CloudFlare Tunnel Token
TUNNEL_TOKEN=
# Domain this is being hosted on
DOMAIN=docs.mydomain.com
# Unique database password
DB_PASSWORD= ##REQUIRED##
# Session secret. Pick a big random string. If this changes
# user sessions will be terminated.
SECRET= ##REQUIRED##

View file

@ -0,0 +1,14 @@
# HedgeDoc and Cloudflare
I use HedgeDoc all the time for proofing up blog posts, collaborative documentation, etc.
Very little setup required.
Requires:
* Cloudflare Tunnel
Steps:
1. Setup your Tunnel (pointing to `http://app:3000`)
2. Set Cloudflare Tunnel token and other secrets in in `.env`
4. `docker compose up -d`

View file

@ -0,0 +1,36 @@
services:
tunnel:
image: cloudflare/cloudflared
command: tunnel --no-autoupdate run
restart: unless-stopped
environment:
- TUNNEL_TOKEN=${TUNNEL_TOKEN}
database:
image: postgres:13.4-alpine
environment:
- POSTGRES_USER=hedgedoc
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=hedgedoc
volumes:
- ./data/database:/var/lib/postgresql/data
restart: always
app:
image: quay.io/hedgedoc/hedgedoc:latest
environment:
- CMD_DB_URL=postgres://hedgedoc:${DB_PASSWORD}@database:5432/hedgedoc
- CMD_DOMAIN=${DOMAIN}
- CMD_URL_ADDPORT=false
- TZ=America/Edmonton
- CMD_SESSION_SECRET=${SECRET}
# hint so that it knows it's being Cloudflare
- CMD_PROTOCOL_USESSL=true
volumes:
- ./data/uploads:/hedgedoc/public/uploads
restart: always
depends_on:
- database
volumes:
database:
uploads: