Compare commits

...

1 Commits

Author SHA1 Message Date
Boris Gallet 91d601ad36 new: [rallly] new charm 1 year ago
  1. 33
      rallly/README.org
  2. 21
      rallly/hooks/init
  3. 18
      rallly/hooks/postgres_database-relation-joined
  4. 20
      rallly/hooks/smtp_server-relation-joined
  5. 13
      rallly/hooks/web_proxy-relation-joined
  6. 32
      rallly/metadata.yml

33
rallly/README.org

@ -0,0 +1,33 @@
# -*- ispell-local-dictionary: "english" -*-
* Info
From: https://github.com/lukevella/rallly
* Usage
Config info : https://support.rallly.co/self-hosting/configuration-options
Need a complete SMTP config to be functionnal
#+begin_src yaml
rallly:
charm: rallly
docker-compose:
options:
secret: <>
support_email: # email used for support
# OPTIONAL
allowed_emails: "*@example.coop, test@example2.com" # All by default if not set
smtp-extern:
charm: smtp-extern
options:
host: <smtp.host>
port: <465>
secure: "true"
user: <smtp user>
password: <smtp password>
#+end_src

21
rallly/hooks/init

@ -0,0 +1,21 @@
#!/bin/bash
set -e
secret=$(options-get secret) || exit 1
support_email=$(options-get support_email) || exit 1
allowed_emails=$(options-get allowed_emails) || true
if [[ -z "$allowed_emails" ]]; then
allowed_emails=*
fi
init-config-add "\
$MASTER_BASE_SERVICE_NAME:
environment:
SECRET_PASSWORD: \"$secret\"
SUPPORT_EMAIL: \"$support_email\"
ALLOWED_EMAILS: \"$allowed_emails\"
NEXT_PUBLIC_BASE_URL: http://localhost:8082/
"

18
rallly/hooks/postgres_database-relation-joined

@ -0,0 +1,18 @@
#!/bin/bash
set -e
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
DATABASE_URL: \"postgres://$USER:$PASSWORD@$TARGET_SERVICE_NAME/$DBNAME\"
"
info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access."

20
rallly/hooks/smtp_server-relation-joined

@ -0,0 +1,20 @@
#!/bin/bash
host=$(relation-get host) || exit 1
port=$(relation-get port) || exit 1
secure=$(relation-get secure) || exit 1
user=$(relation-get user) || exit 1
password=$(relation-get password) || exit 1
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
SMTP_HOST: \"$host\"
SMTP_PORT: \"$port\"
SMTP_SECURE: \"${secure,,}\"
SMTP_USER: \"${user//\$/\$\$}\"
SMTP_PWD: \"${password//\$/\$\$}\"
"

13
rallly/hooks/web_proxy-relation-joined

@ -0,0 +1,13 @@
#!/bin/bash
set -e
DOMAIN=$(relation-get domain) || exit 1
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
NEXT_PUBLIC_BASE_URL: https://$DOMAIN
"

32
rallly/metadata.yml

@ -0,0 +1,32 @@
docker-image: docker.0k.io/rallly:3.3.0
uses:
postgres-database:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: required
auto: summon
solves:
database: "main storage"
default-options:
extensions:
- pgcrypto
- citext
web-proxy:
constraint: recommended
auto: pair
solves:
proxy: "Public access"
default-options:
target: !var-expand ${MASTER_BASE_SERVICE_NAME}:3000
smtp-server:
constraint: required
auto: pair
solves:
proxy: "Public access"
backup:
constraint: recommended
auto: pair
solves:
backup: "Automatic regular backup"
default-options:
Loading…
Cancel
Save