diff --git a/etherpad/README.org b/etherpad/README.org new file mode 100644 index 00000000..0d0101e4 --- /dev/null +++ b/etherpad/README.org @@ -0,0 +1,33 @@ +# -*- ispell-local-dictionary: "english" -*- + +#+TITLE: Etherpad Charm + +* Upgrade + +Based on https://github.com/ether/etherpad-lite , following: + +https://github.com/ether/etherpad-lite/blob/develop/doc/docker.md + +Used: + +#+begin_src sh +TAG=1.8.14 +git clone https://github.com/ether/etherpad-lite --depth 1 -b $TAG +docker build --build-arg INSTALL_SOFFICE=1 \ + --build-arg ETHERPAD_PLUGINS=" \ + ep_font_family ep_mammoth ep_comments_page ep_table_of_contents \ + ep_markdown ep_image_upload ep_spellcheck ep_headings2 ep_align \ + ep_who_did_what ep_what_have_i_missed ep_embedmedia \ + ep_openid_connect ep_rss ep_git_commit_saved_revision" \ + . -t docker.0k.io/etherpad:${TAG}-0k +docker push docker.0k.io/etherpad:${TAG}-0k +#+end_src + + +* Admin password + +We choose to NOT include admin panel as it allows to change settings +and install plugins but this will not allow to reproduce an install +easily. We can do this on the =compose.yml= side in a reproducible +manner. + diff --git a/etherpad/hooks/postgres_database-relation-joined b/etherpad/hooks/postgres_database-relation-joined new file mode 100755 index 00000000..9d725c93 --- /dev/null +++ b/etherpad/hooks/postgres_database-relation-joined @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +PASSWORD="$(relation-get password)" +USER="$(relation-get user)" +DBNAME="$(relation-get dbname)" + +control=$(echo -en "$USER\0$DBNAME\0$PASSWORD\0$ADMIN_PASSWORD" | md5_compat) + +config-add "\ +services: + $MASTER_BASE_SERVICE_NAME: + environment: + DB_TYPE: postgres + DB_HOST: \"$MASTER_TARGET_SERVICE_NAME\" + DB_NAME: \"$DBNAME\" + DB_PASS: \"$PASSWORD\" + DB_USER: \"$USER\" +" + +[ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0 + +relation-set control "$control" + +info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access." diff --git a/etherpad/metadata.yml b/etherpad/metadata.yml new file mode 100644 index 00000000..0963add5 --- /dev/null +++ b/etherpad/metadata.yml @@ -0,0 +1,34 @@ +name: etherpad +summary: "Etherpad-lite server" +maintainer: "Valentin Lab " +inherit: base-0k +## Custom built from git 1.8.14 https://github.com/ether/etherpad-lite with +## build arg --build-arg INSTALL_SOFFICE=1 +docker-image: docker.0k.io/etherpad:1.8.14-soffice ## custom built from git m etherpad/etherpad +description: | + Etherpad-lite service. + +docker-compose: + environment: + SOFFICE: '/usr/bin/soffice' + +uses: + postgres-database: + #constraint: required | recommended | optional + #auto: pair | summon | none ## default: pair + constraint: required + auto: summon + solves: + database: "main storage" + default-options: + extensions: + - unaccent + web-proxy: + #constraint: required | recommended | optional + #auto: pair | summon | none ## default: pair + constraint: recommended + auto: pair + solves: + proxy: "Public access" + default-options: + target: !var-expand ${MASTER_BASE_SERVICE_NAME}:9001