You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
529 B

#!/bin/bash
set -e
. lib/common
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
HOST="$(relation-get host)"
PORT="$(relation-get port)"
control=$(p0 "$USER" "$DBNAME" "$PASSWORD" "$HOST" "$PORT" | md5_compat)
cfg-merge "
database:
name: psycopg2
args:
user: $USER
password: $PASSWORD
database: $DBNAME
host: $HOST
port: $PORT
cp_min: 5
cp_max: 10
"
relation-set control "$control"
info "Configured $SERVICE_NAME code for $HOST:$PORT access."