26 Commits

Author SHA1 Message Date
1ed15423c3 fix: pass "-p" and use new lines
Some checks failed
continuous-integration/drone/pr Build is failing
Closes #13
2024-04-28 17:57:38 +02:00
0443ffc984 chore: remove tabs 2024-04-28 17:55:55 +02:00
e8f1186965 chore: publish 1.0.1+1.9.9 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-04-17 17:14:23 +02:00
66c5160812 fix backupbot label 2024-04-17 17:07:53 +02:00
c656afb176 chore: publish 1.0.0+1.9.9 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-13 07:49:46 -08:00
97f2d94079 chore: publish 0.6.0+1.9.9 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-26 11:14:40 -07:00
4846a09169 add timeout label
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-19 22:50:23 +02:00
210a37cd0c fix permissions for real
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-13 17:10:41 +02:00
3wc
914ef6b026 Spooky permissions fix?
All checks were successful
continuous-integration/drone/push Build is passing
See https://github.com/hedgedoc/container/issues/463
2023-10-02 19:11:13 +01:00
5f205c149f Merge pull request 'update outdated readme + add restore hook' (#10) from mayel-patch-1 into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #10
2023-07-29 11:37:09 +00:00
d2c8993fcc Update compose.yml
Some checks failed
continuous-integration/drone/pr Build is failing
2023-07-29 10:42:49 +00:00
1c93adcf21 add restore hook
Some checks failed
continuous-integration/drone/pr Build is failing
2023-07-29 10:42:21 +00:00
7970e7c61e typo
Some checks failed
continuous-integration/drone/pr Build is failing
2023-07-28 23:08:08 +00:00
e14f050ede update outdated readme based on docker compose file
Some checks failed
continuous-integration/drone/pr Build is failing
2023-07-28 22:55:38 +00:00
3wc
5fd556d358 chore: publish 0.5.1+1.9.8 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-08 19:39:01 +01:00
3wc
4c2417901e Switch to self-hosted stack-ssh-deploy image [mass update]
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-21 11:49:55 -08:00
3wc
6bc2679dee Fix CI by adding networks: [mass update]
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-20 11:58:41 -08:00
3wc
d2d5b8ceb1 Automatically generate catalogue on release [mass update]
Some checks failed
continuous-integration/drone/push Build is failing
Re: coop-cloud/recipes-catalogue-json#4
2023-01-20 10:27:11 -08:00
3wc
afd3b03b21 Update abra syntax in examples (finally) [mass update]
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-19 16:02:27 -08:00
b43724ecba Merge pull request 'Add configuration option for maximum note length' (#8) from wolcen/hedgedoc:main into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #8
2022-12-15 20:29:18 +00:00
8e973cbed1 Closing `'s seem not required when indented
Some checks failed
continuous-integration/drone/pr Build is failing
Otherwise, extra `` prints on README display.
2022-12-15 20:10:29 +00:00
7780eb9f13 Bump configuration version 2022-12-15 15:05:13 -05:00
9e88945b9b Corrections to get config updating and effective 2022-12-15 15:05:02 -05:00
6139cff626 Correct link 2022-12-15 14:39:19 -05:00
0c96d5a45f Add config file template for documentMaxLength setting 2022-12-15 14:39:14 -05:00
a896d27542 chore: publish 0.5.0+1.9.6 release
Some checks failed
continuous-integration/drone/push Build is failing
2022-12-02 16:04:10 +01:00
8 changed files with 85 additions and 45 deletions

View File

@ -3,10 +3,12 @@ kind: pipeline
name: deploy to swarm-test.autonomic.zone name: deploy to swarm-test.autonomic.zone
steps: steps:
- name: deployment - name: deployment
image: decentral1se/stack-ssh-deploy:latest image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings: settings:
host: swarm-test.autonomic.zone host: swarm-test.autonomic.zone
stack: hedgedoc stack: hedgedoc
networks:
- proxy
deploy_key: deploy_key:
from_secret: drone_ssh_swarm_test from_secret: drone_ssh_swarm_test
generate_secrets: true generate_secrets: true
@ -22,11 +24,17 @@ trigger:
- main - main
--- ---
kind: pipeline kind: pipeline
name: recipe release name: generate recipe catalogue
steps: steps:
- name: release a new version - name: release a new version
image: thecoopcloud/drone-abra:latest image: plugins/downstream
settings: settings:
command: recipe hedgedoc release server: https://build.coopcloud.tech
deploy_key: token:
from_secret: abra_bot_deploy_key from_secret: drone_abra-bot_token
fork: true
repositories:
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -1,4 +1,6 @@
TYPE=hedgedoc TYPE=hedgedoc
TIMEOUT=300
ENABLE_AUTO_UPDATE=true
DOMAIN=hedgedoc.example.com DOMAIN=hedgedoc.example.com
## Domain aliases ## Domain aliases
@ -41,3 +43,5 @@ COMPOSE_FILE="compose.yml"
# CMD_DEFAULT_PERMISSION=editable # CMD_DEFAULT_PERMISSION=editable
# CMD_EMAIL=true # CMD_EMAIL=true
# CMD_SESSION_LIFE=1209600000 # CMD_SESSION_LIFE=1209600000
# Only present in config.json (no equivalent env var):
# DOCUMENT_MAX_LENGTH=100000

View File

@ -7,9 +7,9 @@
<!-- metadata --> <!-- metadata -->
* **Category**: Apps * **Category**: Apps
* **Status**: 2, beta * **Status**: 2, beta
* **Image**: [`quay.io/hedgedoc/hedgedoc:1.8.2`](https://quay.io/hedgedoc/hedgedoc:1.8.2), 4, upstream * **Image**: [`quay.io/hedgedoc/hedgedoc`](https://quay.io/hedgedoc/hedgedoc), 4, upstream
* **Healthcheck**: Yes * **Healthcheck**: Yes
* **Backups**: No * **Backups**: Yes
* **Email**: No * **Email**: No
* **Tests**: 2 * **Tests**: 2
* **SSO**: 3 (OAuth) * **SSO**: 3 (OAuth)
@ -19,17 +19,16 @@
1. Set up Docker Swarm and [`abra`][abra] 1. Set up Docker Swarm and [`abra`][abra]
2. Deploy [`coop-cloud/traefik`][compose-traefik] 2. Deploy [`coop-cloud/traefik`][compose-traefik]
3. `abra app new hedegedoc` 3. `abra app new hedgedoc`
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to 4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy` 5. `abra app deploy YOURAPPDOMAIN`
6. Create initial user: 6. Create initial user:
``` ```
abra app YOURAPPDOMAIN run app bash abra app YOURAPPDOMAIN run app bash
. /docker-entrypoint2.sh -e . /docker-entrypoint2.sh -e
bin/manage_users bin/manage_users
```
[hedegedoc]: https://github.com/hackmdio/hedegedoc [hedegedoc]: https://github.com/hedgedoc/hedgedoc
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra [abra]: https://git.autonomic.zone/autonomic-cooperative/abra
[compose-traefik]: https://git.autonomic.zone/coop-cloud/traefik [compose-traefik]: https://git.autonomic.zone/coop-cloud/traefik

View File

@ -1,4 +1,4 @@
export ENTRYPOINT_CONF_VERSION=v5 export ENTRYPOINT_CONF_VERSION=v9
abra_backup_app() { abra_backup_app() {
_abra_backup_dir "app:/home/hackmd/app/public/uploads/" _abra_backup_dir "app:/home/hackmd/app/public/uploads/"

View File

@ -1,7 +1,7 @@
version: "3.8" version: "3.8"
services: services:
app: app:
image: quay.io/hedgedoc/hedgedoc:1.9.3 image: quay.io/hedgedoc/hedgedoc:1.9.9
environment: environment:
- CMD_USECDN=false - CMD_USECDN=false
- CMD_URL_ADDPORT=false - CMD_URL_ADDPORT=false
@ -26,6 +26,7 @@ services:
- CMD_DEFAULT_PERMISSION - CMD_DEFAULT_PERMISSION
- CMD_EMAIL - CMD_EMAIL
- CMD_SESSION_LIFE - CMD_SESSION_LIFE
- DOCUMENT_MAX_LENGTH
depends_on: depends_on:
- db - db
networks: networks:
@ -40,6 +41,9 @@ services:
- source: entrypoint_conf - source: entrypoint_conf
target: /docker-entrypoint.sh target: /docker-entrypoint.sh
mode: 0555 mode: 0555
- source: config_json
target: /files/config.json
mode: 0555
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -53,7 +57,8 @@ services:
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" - "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- coop-cloud.${STACK_NAME}.version=0.4.0+1.9.3 - "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
- "coop-cloud.${STACK_NAME}.version=1.0.1+1.9.9"
healthcheck: healthcheck:
test: "nodejs -e \"http.get('http://localhost:3000', (res) => { console.log('status: ', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });\"" test: "nodejs -e \"http.get('http://localhost:3000', (res) => { console.log('status: ', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });\""
interval: 30s interval: 30s
@ -61,7 +66,7 @@ services:
retries: 10 retries: 10
start_period: 1m start_period: 1m
db: db:
image: postgres:11.16-alpine image: postgres:16.1-alpine
environment: environment:
- POSTGRES_USER=codimd - POSTGRES_USER=codimd
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password - POSTGRES_PASSWORD_FILE=/run/secrets/db_password
@ -75,9 +80,11 @@ services:
deploy: deploy:
labels: labels:
backupbot.backup: "true" backupbot.backup: "true"
backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup/backup.sql" backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
backupbot.backup.post-hook: "rm -rf /tmp/backup" backupbot.backup.post-hook: "rm -f /var/lib/postgresql/data/backup.sql"
backupbot.backup.path: "/tmp/backup/" backupbot.backup.path: "/var/lib/postgresql/data/backup.sql"
backupbot.restore: "true"
backupbot.restore.post-hook: "sh -c 'psql -U $${POSTGRES_USER} -d $${POSTGRES_DB} < /var/lib/postgresql/data/backup.sql && rm -f /var/lib/postgresql/data/backup.sql'"
volumes: volumes:
postgres: postgres:
codimd_uploads: codimd_uploads:
@ -90,6 +97,10 @@ networks:
external: true external: true
internal: internal:
configs: configs:
config_json:
name: ${STACK_NAME}_config_${ENTRYPOINT_CONF_VERSION}
file: config.json.tmpl
template_driver: golang
entrypoint_conf: entrypoint_conf:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION} name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION}
file: entrypoint.sh.tmpl file: entrypoint.sh.tmpl

7
config.json.tmpl Normal file
View File

@ -0,0 +1,7 @@
{
{{ if (env "DOCUMENT_MAX_LENGTH") }}
"production": {
"documentMaxLength": {{ env "DOCUMENT_MAX_LENGTH" }}
}
{{ end }}
}

View File

@ -1,35 +1,38 @@
#!/usr/bin/env bash #!/usr/bin/env bash
file_env() { file_env() {
# 3wc: Load $VAR_FILE into $VAR - useful for secrets. See # 3wc: Load $VAR_FILE into $VAR - useful for secrets. See
# https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab # https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab
local var="$1" local var="$1"
local fileVar="${var}_FILE" local fileVar="${var}_FILE"
local def="${2:-}" local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)" echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1 exit 1
fi fi
local val="$def" local val="$def"
if [ "${!var:-}" ]; then if [ "${!var:-}" ]; then
val="${!var}" val="${!var}"
elif [ "${!fileVar:-}" ]; then elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")" val="$(< "${!fileVar}")"
fi fi
export "$var"="$val" export "$var"="$val"
unset "$fileVar" unset "$fileVar"
} }
load_vars() { load_vars() {
file_env "CMD_DB_PASSWORD" file_env "CMD_DB_PASSWORD"
file_env "CMD_OAUTH2_CLIENT_SECRET" file_env "CMD_OAUTH2_CLIENT_SECRET"
} }
main() { main() {
set -eu set -eu
load_vars load_vars
mkdir -p "/hedgedoc/.npm" && \
chown -R 10000:65534 "/hedgedoc/.npm" && \
chmod "u+rwx" "/hedgedoc/.npm"
} }
main main
@ -38,9 +41,10 @@ export CMD_DB_URL=postgres://$CMD_DB_USER:$CMD_DB_PASSWORD@$CMD_DB_HOST:5432/$CM
# 3wc: `source /docker-entrypoint2.sh -e` to load CMD_DB_URL for CLI scripts # 3wc: `source /docker-entrypoint2.sh -e` to load CMD_DB_URL for CLI scripts
if [ ! "${1-}" == "-e" ]; then if [ ! "${1-}" == "-e" ]; then
# 3wc: upstream ENTRYPOINT # 3wc: upstream ENTRYPOINT
# https://github.com/hedgedoc/container/blob/master/alpine/Dockerfile # https://github.com/hedgedoc/container/blob/master/alpine/Dockerfile
/usr/local/bin/docker-entrypoint.sh npm start mkdir -p "/hedgedoc/.npm" && chown -R 10000:65534 "/hedgedoc/.npm"
/usr/local/bin/docker-entrypoint.sh npm start
fi fi
set +eu set +eu

7
release/1.0.0+1.9 Normal file
View File

@ -0,0 +1,7 @@
WARNING WARNING WARNING 🚨
This release includes a major Postgres database upgrade, but does not yet include tools to automatically upgrade from older Postgres releases.
PLEASE DO NOT UPGRADE EXISTING INSTANCES TO THIS VERSION.
This should be fixed soon.