From 4833e01142447c544fbef5d025958a4494ec97b4 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sat, 21 Sep 2024 18:39:59 +0000 Subject: [PATCH] hedgedoc (#124) Closes #119. Co-authored-by: Alexey Skobkin Reviewed-on: https://git.skobk.in/skobkin/docker-stacks/pulls/124 --- README.md | 1 + hedgedoc/.env.dist | 31 +++++++++++++++++++++++++ hedgedoc/config/.gitignore | 2 ++ hedgedoc/docker-compose.yml | 32 ++++++++++++++++++++++++++ hedgedoc/nginx/hedgedoc.conf | 44 ++++++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 hedgedoc/.env.dist create mode 100644 hedgedoc/config/.gitignore create mode 100644 hedgedoc/docker-compose.yml create mode 100644 hedgedoc/nginx/hedgedoc.conf diff --git a/README.md b/README.md index 13a7878..29a164b 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Not every stack is tested to fully work. | Folding@Home | ✅ | `johnktims/folding-at-home` | Protein folding distributed computing platform. | [Website](https://foldingathome.org), [My guide](https://skobk.in/2020/06/folding-at-home-quick-start/) | | Forgejo | ✅ | `codeberg.org/forgejo/forgejo` | Lightweight Git hosting platform. | [Website](https://forgejo.org), [Github](https://codeberg.org/forgejo/forgejo) | | Gatus | ✅ | `twinproduction/gatus` | Advanced service(s) status page. | [Website](https://gatus.io), [Github](https://github.com/TwiN/gatus) | +| HedgeDoc | ✅ | `lscr.io/linuxserver/hedgedoc` | Collaborative text editor. | [Website](https://hedgedoc.org), [Github](https://github.com/hedgedoc/hedgedoc) | | Home Assistant | ✅ | `ghcr.io/home-assistant/home-assistant` | Home automation suite. | [Website](https://www.home-assistant.io/), [Github](https://github.com/home-assistant) | | Homer | ✅ | `b4bz/homer` | Server homepage generator. | [Github](https://github.com/bastienwirtz/homer), [Demo](https://homer-demo.netlify.app), [Configuration](https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md) | | I2PD | ✅ | `purplei2p/i2pd` | The Invisible Internet router. | [Website](https://i2pd.website), [Github](https://github.com/PurpleI2P/i2pd/), [I2P project](https://geti2p.net/) | diff --git a/hedgedoc/.env.dist b/hedgedoc/.env.dist new file mode 100644 index 0000000..92e6423 --- /dev/null +++ b/hedgedoc/.env.dist @@ -0,0 +1,31 @@ +# https://hub.docker.com/r/linuxserver/hedgedoc +# https://docs.hedgedoc.org/configuration/ + +#IMAGE_TAG=latest + +USER_ID=1000 +GROUP_ID=1000 + +WEB_ADDRESS=127.0.0.1 +WEB_PORT=8394 + +DOMAIN=hedgedoc.domain.tld + +DIR_CONFIG=./config + +DATABASE_HOST=host.docker.internal +DATABASE_PORT=3306 +#DATABASE_NAME=hedgedoc +#DATABASE_USER=hedgedoc +DATABASE_PASS=*ChangeMe* +#DATABASE_DIALECT=postgres + +TIMEZONE=Europe/Moscow + +#CMD_ALLOW_GRAVATAR=false + +# https://docs.hedgedoc.org/configuration/#login-methods + +# Github Login +#CMD_GITHUB_CLIENTID=123 +#CMD_GITHUB_CLIENTSECRET=456 diff --git a/hedgedoc/config/.gitignore b/hedgedoc/config/.gitignore new file mode 100644 index 0000000..a68d087 --- /dev/null +++ b/hedgedoc/config/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore diff --git a/hedgedoc/docker-compose.yml b/hedgedoc/docker-compose.yml new file mode 100644 index 0000000..be076e7 --- /dev/null +++ b/hedgedoc/docker-compose.yml @@ -0,0 +1,32 @@ +services: + hedgedoc: + image: 'lscr.io/linuxserver/hedgedoc:${IMAGE_TAG:-latest}' + container_name: 'hedgedoc' + env_file: '.env' + environment: + - 'PUID=${USER_ID:-1000}' + - 'PGID=${GROUP_ID:-1000}' + - 'TZ=${TIMEZONE:-Europe/Moscow}' + - 'DB_HOST=${DATABASE_HOST:-host.docker.internal}' + - 'DB_PORT=${DATABASE_PORT:-3306}' + - 'DB_USER=${DATABASE_USER:-hedgedoc}' + - 'DB_PASS=${DATABASE_PASS}' + - 'DB_NAME=${DATABASE_NAME:-hedgedoc}' + - 'CMD_DOMAIN=${DOMAIN}' + #- 'CMD_URL_ADDPORT=false' #optional + - 'CMD_PROTOCOL_USESSL=true' #optional + - 'CMD_PORT=${WEB_PORT:-8394}' #optional + - 'CMD_DB_DIALECT=${DATABASE_DIALECT:-mariadb}' #optional + - CMD_ALLOW_ORIGIN=['${DOMAIN}'] #optional + volumes: + - '${DIR_CONFIG:-./config}:/config' + extra_hosts: + - 'host.docker.internal:host-gateway' + ports: + - '${WEB_ADDRESS:-127.0.0.1}:${WEB_PORT:-8394}:${WEB_PORT:-8394}' + restart: unless-stopped + logging: + driver: 'json-file' + options: + max-size: '${LOG_MAX_SIZE:-5m}' + max-file: '${LOG_MAX_FILE:-5}' diff --git a/hedgedoc/nginx/hedgedoc.conf b/hedgedoc/nginx/hedgedoc.conf new file mode 100644 index 0000000..11a4480 --- /dev/null +++ b/hedgedoc/nginx/hedgedoc.conf @@ -0,0 +1,44 @@ +upstream hedgedoc { + server 127.0.0.1:8394; +} + +server { + listen 443 ssl http2; + server_name hedgedoc.domain.tld; + + access_log /var/log/nginx/hedgedoc.domain.tld.access; + error_log /var/log/nginx/hedgedoc.domain.tld.error; + + charset utf-8; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + + proxy_pass http://hedgedoc; + } + + location /socket.io/ { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_http_version 1.1; + + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + + proxy_pass http://hedgedoc; + } + + include config/gzip.conf; + + # Wildcard certificate config + include ssl/domain.tld.conf; +}