diff --git a/hedgedoc/data/db/.gitkeep b/hedgedoc/data/db/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/hedgedoc/data/uploads/.gitkeep b/hedgedoc/data/uploads/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/hedgedoc/docker-compose.yml b/hedgedoc/docker-compose.yml new file mode 100644 index 000000000..261f772f1 --- /dev/null +++ b/hedgedoc/docker-compose.yml @@ -0,0 +1,56 @@ +services: + app_proxy: + environment: + APP_HOST: hedgedoc_app_1 + APP_PORT: 3000 + + app: + image: quay.io/hedgedoc/hedgedoc:1.12.3@sha256:9e5b57ef05b476d2e849042d7915872410a667380c1c29231ff17456e78897a2 + restart: on-failure + depends_on: + db: + condition: service_healthy + # HedgeDoc builds upload links and its CSP script/style sources from + # CMD_DOMAIN, which would pin the app to one hostname. Without it, image + # upload throws and browsers reject the CSP paths, so patch both to work on + # any hostname. Stop with an error if upstream changes these lines. + command: + - sh + - -c + - | + set -e + U=lib/web/imageRouter/filesystem.js + grep -qF "new URL(fileName, config.serverURL + '/uploads/')" "$$U" || grep -qF "config.serverURL + '/uploads/' + fileName" "$$U" || { echo "Upload patch no longer matches" >&2; exit 1; } + grep -qF "config.serverURL + '/build/'" lib/csp.js || grep -qF "\"'self'\"" lib/csp.js || { echo "CSP patch no longer matches" >&2; exit 1; } + sed -i "s|(new URL(fileName, config.serverURL + '/uploads/')).href|config.serverURL + '/uploads/' + fileName|" "$$U" + sed -i -e "s|config.serverURL + '/build/'|\"'self'\"|g" -e "s|config.serverURL + '/js/'|\"'self'\"|" -e "s|config.serverURL + '/css/'|\"'self'\"|" -e "s|config.serverURL + '/config'|\"'self'\"|" lib/csp.js + exec node app.js + environment: + CMD_DB_URL: postgres://hedgedoc:${APP_HEDGEDOC_DB_PASSWORD}@hedgedoc_db_1:5432/hedgedoc + CMD_SESSION_SECRET: ${APP_HEDGEDOC_SESSION_SECRET} + CMD_IMAGE_UPLOAD_TYPE: filesystem + # umbrelOS serves the app on a port of the device hostname, so an HSTS header + # over HTTPS would force HTTPS for every other app on that hostname. + CMD_HSTS_ENABLE: "false" + # Don't send a hash of each user's email to libravatar.org for avatars. + CMD_ALLOW_GRAVATAR: "false" + volumes: + - ${APP_DATA_DIR}/data/uploads:/hedgedoc/public/uploads + + db: + image: postgres:18.7-alpine@sha256:0115267ab5a509022df9319c77be365cef335adb71556c75f60f5360ee247e71 + restart: on-failure + stop_grace_period: 1m + environment: + POSTGRES_DB: hedgedoc + POSTGRES_USER: hedgedoc + POSTGRES_PASSWORD: ${APP_HEDGEDOC_DB_PASSWORD} + PGDATA: /data/pgdata + healthcheck: + test: "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\"" + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + volumes: + - ${APP_DATA_DIR}/data/db:/data diff --git a/hedgedoc/exports.sh b/hedgedoc/exports.sh new file mode 100644 index 000000000..cd4938d93 --- /dev/null +++ b/hedgedoc/exports.sh @@ -0,0 +1,2 @@ +export APP_HEDGEDOC_DB_PASSWORD="$(derive_entropy "${app_entropy_identifier}-db-password")" +export APP_HEDGEDOC_SESSION_SECRET="$(derive_entropy "${app_entropy_identifier}-session-secret")" diff --git a/hedgedoc/umbrel-app.yml b/hedgedoc/umbrel-app.yml new file mode 100644 index 000000000..ffa5bfea6 --- /dev/null +++ b/hedgedoc/umbrel-app.yml @@ -0,0 +1,45 @@ +manifestVersion: 1 +id: hedgedoc +storage: + dataRoot: data +category: files +name: HedgeDoc +version: "1.12.3" +tagline: Write and edit Markdown notes together in real time +description: >- + HedgeDoc is a real-time, collaborative Markdown editor. Open a note in your browser and write together with others, with a live preview right next to the text. + + + Create an account with your email address and a password on the HedgeDoc start page, or start writing straight away as a guest. Notes created as a guest are not tied to an account, so sign in first if you want to find them again later. + + + Features: + + - Live collaboration with several people editing the same note at once + + - Markdown preview with code highlighting, tables, task lists, math and diagrams such as Mermaid and Graphviz + + - Turn a note into a slide presentation + + - Upload images straight into your notes + + - Share notes as a read-only page and control who can view or edit each note + + - Note history, tags and a personal overview of your notes +releaseNotes: "" +developer: HedgeDoc +website: https://hedgedoc.org +dependencies: [] +repo: https://github.com/hedgedoc/hedgedoc +support: https://community.hedgedoc.org +port: 3035 +gallery: + - 1.webp + - 2.webp + - 3.webp + - 4.webp +path: "" +defaultUsername: "" +defaultPassword: "" +submitter: Umbrel +submission: https://github.com/getumbrel/umbrel-apps/pull/6366