From 09a39a770ed64ba3901265bcbc638d3319c7ca97 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Wed, 15 Nov 2023 16:10:11 +0100 Subject: [PATCH] new: [docuseal] new charm --- docuseal/README.org | 5 +++ .../hooks/postgres_database-relation-joined | 17 +++++++++ docuseal/metadata.yml | 35 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 docuseal/README.org create mode 100755 docuseal/hooks/postgres_database-relation-joined create mode 100644 docuseal/metadata.yml diff --git a/docuseal/README.org b/docuseal/README.org new file mode 100644 index 0000000..28f8f89 --- /dev/null +++ b/docuseal/README.org @@ -0,0 +1,5 @@ +# -*- ispell-local-dictionary: "english" -*- + +* Info + +From: https://github.com/docusealco/docuseal diff --git a/docuseal/hooks/postgres_database-relation-joined b/docuseal/hooks/postgres_database-relation-joined new file mode 100755 index 0000000..ca195f3 --- /dev/null +++ b/docuseal/hooks/postgres_database-relation-joined @@ -0,0 +1,17 @@ +#!/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." diff --git a/docuseal/metadata.yml b/docuseal/metadata.yml new file mode 100644 index 0000000..ff190ad --- /dev/null +++ b/docuseal/metadata.yml @@ -0,0 +1,35 @@ +docker-image: docuseal/docuseal:latest +data-resources: + - /data + +uses: + postgres-database: + #constraint: required | recommended | optional + #auto: pair | summon | none ## default: pair + constraint: required + auto: summon + solves: + database: "main storage" + 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: optional + 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/" \ No newline at end of file