Add Hedgedoc

This commit is contained in:
Mo 2022-08-20 21:02:57 +02:00
parent 6cc1692d89
commit 3bdce816c2
3 changed files with 78 additions and 0 deletions
containers
volumes
hedgedoc
traefik

48
containers/hedgedoc.fish Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/fish
set -l container_name hedgedoc
set -l container_volumes_dir ~/volumes/$container_name
set -l hedgedoc_dir $container_volumes_dir/hedgedoc
set -l uploads_dir $hedgedoc_dir/uploads
set -l hedgedoc_env_file ~/sync/volumes/hedgedoc/.env
set -l private_hedgedoc_env_file $container_volumes_dir/.hedgedoc.env
mkdir -p $uploads_dir
set -l db_container_name hedgedoc-postgres
set -l db_container_dir $container_volumes_dir/postgres
set -l db_env_file $container_volumes_dir/.postgres.env
if not test -f $hedgedoc_env_file
echo "$hedgedoc_env_file missing"
exit 1
end
if not test -f $private_hedgedoc_env_file
echo "$private_hedgedoc_env_file missing"
exit 1
end
if not test -f $db_env_file
echo "$db_env_file missing"
exit 1
end
podman-default-create \
$db_container_name \
--network traefik \
-v $db_container_dir:/var/lib/postgresql/data:Z \
--env-file $db_env_file \
--label "io.containers.autoupdate=registry" \
docker.io/library/postgres:alpine
podman-default-create \
$container_name \
--network traefik \
-v $uploads_dir:/hedgedoc/public/uploads:Z \
--env-file $hedgedoc_env_file \
--env-file $private_hedgedoc_env_file \
--label "io.containers.autoupdate=registry" \
quay.io/hedgedoc/hedgedoc:alpine
podman exec -it $container_name chown -R hedgedoc /hedgedoc/public/uploads

21
volumes/hedgedoc/.env Normal file
View file

@ -0,0 +1,21 @@
# In private .env:
# CMD_DB_USERNAME
# CMD_DB_PASSWORD
# CMD_DOMAIN
NODE_ENV=production
DEBUG=false
CMD_DB_DATABASE=hedgedoc
CMD_DB_HOST=hedgedoc-postgres
CMD_DB_PORT=5432
CMD_DB_DIALECT=postgres
CMD_PROTOCOL_USESSL=true
CMD_CSP_ALLOW_FRAMING=false
CMD_CSP_ALLOW_PDF_EMBED=false
CMD_ALLOW_GRAVATAR=false
CMD_ALLOW_FREEURL=true

View file

@ -21,6 +21,11 @@ http:
service: nextcloud
tls:
certResolver: le
to_hedgedoc:
rule: Host(`pads.mo8it.xyz`)
service: hedgedoc
tls:
certResolver: le
{{ $max_ttyd_num := 1 }}
{{ range $index, $num := until $max_ttyd_num }}
to_ttyd{{ $num }}:
@ -47,6 +52,10 @@ http:
loadBalancer:
servers:
- url: http://nextcloud
hedgedoc:
loadBalancer:
servers:
- url: http://hedgedoc:3000
{{ range $index, $num := until $max_ttyd_num }}
ttyd{{ $num }}:
loadBalancer: