Compare commits
merge into: 0k:master
0k:0k/dev/master
0k:backup
0k:bgallet/mattermost
0k:bgallet/nextcloud
0k:boris/smtp-extern
0k:charm-codimd-new
0k:cups_service_alpha
0k:dev
0k:dev1
0k:dhcp
0k:element
0k:etherpad-upd
0k:framadate
0k:get-version
0k:lokavaluto/dev/master
0k:master
0k:matomo
0k:new-mailhog-charms
0k:new-monujo-options
0k:nj-collabra-office
0k:nj-keycloak-17.0
0k:nj-organice-charm
0k:nj-vaulwarden-migrate
0k:ntfy-install
0k:odoo_fix_webhook_url
0k:postgres
0k:test
0k:upd-docker
0k:update-latest-synapse
0k:wip
pull from: 0k:upd-docker
0k:0k/dev/master
0k:backup
0k:bgallet/mattermost
0k:bgallet/nextcloud
0k:boris/smtp-extern
0k:charm-codimd-new
0k:cups_service_alpha
0k:dev
0k:dev1
0k:dhcp
0k:element
0k:etherpad-upd
0k:framadate
0k:get-version
0k:lokavaluto/dev/master
0k:master
0k:matomo
0k:new-mailhog-charms
0k:new-monujo-options
0k:nj-collabra-office
0k:nj-keycloak-17.0
0k:nj-organice-charm
0k:nj-vaulwarden-migrate
0k:ntfy-install
0k:odoo_fix_webhook_url
0k:postgres
0k:test
0k:upd-docker
0k:update-latest-synapse
0k:wip
3 Commits
master
...
upd-docker
Author | SHA1 | Message | Date |
---|---|---|---|
Nicolas JEUDY | 83cdac9773 |
fix: [docker-host] update docker version
|
3 years ago |
Valentin Lab | 73a74c63b5 |
fix: [etherpad] keep API key
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org> |
3 years ago |
Valentin Lab | 11fffe0610 |
new: [etherpad] new charm
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org> |
3 years ago |
5 changed files with 145 additions and 2 deletions
-
25etherpad/README.org
-
39etherpad/hooks/init
-
26etherpad/hooks/postgres_database-relation-joined
-
53etherpad/metadata.yml
-
2precise/host/hooks/install.d/60-docker.sh
@ -0,0 +1,25 @@ |
|||
# -*- 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 . -t docker.0k.io/etherpad:${TAG}-soffice |
|||
docker push docker.0k.io/etherpad:${TAG}-soffice |
|||
#+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. |
@ -0,0 +1,39 @@ |
|||
#!/bin/bash |
|||
|
|||
## Init is run on host |
|||
## For now it is run every time the script is launched, but |
|||
## it should be launched only once after build. |
|||
|
|||
## Accessible variables are: |
|||
## - SERVICE_NAME Name of current service |
|||
## - DOCKER_BASE_IMAGE Base image from which this service might be built if any |
|||
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service |
|||
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service |
|||
|
|||
|
|||
. lib/common |
|||
|
|||
set -e |
|||
|
|||
|
|||
dirs=( |
|||
"$SERVICE_DATASTORE/var/lib/etherpad" |
|||
) |
|||
|
|||
uid_gid=($(docker_get_uid_gid "$SERVICE_NAME" "etherpad" "etherpad")) || { |
|||
err "Could not fetch uid/gid on image of service ${DARKYELLOW}$SERVICE_NAME${NORMAL}." |
|||
return 1 |
|||
} |
|||
|
|||
uid="${uid_gid[0]}" |
|||
gid="${uid_gid[1]}" |
|||
for dir in "${dirs[@]}"; do |
|||
mkdir -p "$dir" |
|||
find "$dir" \! -uid "$uid" -print0 | while read-0 f; do |
|||
chown -v "$uid" "$f" || return 1 |
|||
done |
|||
find "$dir" \! -gid "$gid" -print0 | while read-0 f; do |
|||
chgrp -v "$gid" "$f" || return 1 |
|||
done |
|||
done |
|||
|
@ -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." |
@ -0,0 +1,53 @@ |
|||
name: etherpad |
|||
summary: "Etherpad-lite server" |
|||
maintainer: "Valentin Lab <valentin.lab@kalysto.org>" |
|||
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. |
|||
|
|||
data-resources: |
|||
- /var/lib/etherpad |
|||
|
|||
docker-compose: |
|||
command: node src/node/server.js --apikey /var/lib/etherpad/APIKEY.txt |
|||
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 |
|||
|
|||
backup: |
|||
constraint: recommended |
|||
auto: pair |
|||
solves: |
|||
backup: "Automatic regular backup" |
|||
default-options: |
|||
## First pattern matching wins, no pattern matching includes. |
|||
## include-patterns are checked first, then exclude-patterns |
|||
## Patterns rules: |
|||
## - ending / for directory |
|||
## - '*' authorized |
|||
## - must start with a '/', will start from $SERVICE_DATASTORE |
|||
#exclude-patterns: |
|||
# - "/var/lib/odoo/sessions/" |
Write
Preview
Loading…
Cancel
Save
Reference in new issue