new: [codimd] add charm #1

Closed
njeudy wants to merge 1 commits from charm-codimd-new into lokavaluto/dev/master
  1. 11
      codimd/hooks/init
  2. 24
      codimd/hooks/postgres_database-relation-joined
  3. 63
      codimd/metadata.yml

11
codimd/hooks/init

@ -0,0 +1,11 @@
#!/bin/bash
init-config-add "\
$SERVICE_NAME:
environment:
CMD_USECDN: \"false\"
"
# codimd create uploads folder with wrong permission
mkdir -p "$SERVICE_DATASTORE/home/hackmd/app/public/uploads"
chown -R 1500:1500 "$SERVICE_DATASTORE/home/hackmd/app/public/"

24
codimd/hooks/postgres_database-relation-joined

@ -0,0 +1,24 @@
#!/bin/bash
## XXXvlab: this hook should go into a generic odoo image
Review

mention about 'odoo', bad copy paste

mention about 'odoo', bad copy paste
## XXXvlab: should get location of code
CONFIG=$SERVICE_CONFIGSTORE/etc/odoo-server.conf
Review

same on both line

same on both line
. lib/common
Review

no lib/common provided

no `lib/common` provided
set -e
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
CMD_DB_URL: postgres://$USER:$PASSWORD@$TARGET_SERVICE_NAME/$DBNAME
"
info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access."

63
codimd/metadata.yml

@ -0,0 +1,63 @@
docker-image: nabo.codimd.dev/hackmdio/hackmd:2.2.0
Review

need to push the image to docker.0k.io just to be sure that we have a copy.

need to push the image to ``docker.0k.io`` just to be sure that we have a copy.
data-resources:
- /home/hackmd/app/public/uploads
# config-resources:
# ## XXXvlab: should this be there or declared dynamically in the relation that
# ## create/update this file ?
# # - /etc/odoo-server.conf
# docker-compose:
# command:
# - odoo
# - --config=/opt/odoo/auto/odoo.conf
## YYYvlab: useful ?
# tty: true
# environment:
# INITIAL_LANG: fr_FR
# LIST_DB: 'true'
Review

lot of commented code that should not be committed

lot of commented code that should not be committed
default-options:
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
Review

do we need unaccent ?

do we need `unaccent` ?
log-rotate:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: recommended
auto: pair
solves:
unmanaged-logs: "in docker logs"
#default-options:
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}:3000
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/"
Loading…
Cancel
Save