Browse Source

new: [odoo-tecnativa] do not require admin password and generate random password if not any.

framadate
Valentin Lab 6 years ago
parent
commit
b5d6ab1444
  1. 12
      odoo-tecnativa/hooks/postgres_database-relation-joined

12
odoo-tecnativa/hooks/postgres_database-relation-joined

@ -12,7 +12,17 @@ set -e
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
ADMIN_PASSWORD=$(relation-base-compose-get admin-password)
ADMIN_PASSWORD=$(relation-base-compose-get admin-password 2>/dev/null) || {
if [ -e "$CONFIG" ]; then
ADMIN_PASSWORD=$(grep ^admin_passwd "$CONFIG" | sed -r 's/^admin_passwd\s+=\s+(.+)$/\1/g')
fi
if [ -z "$ADMIN_PASSWORD" ]; then
info "Generating odoo admin password"
ADMIN_PASSWORD=$(gen_password)
fi
}
control=$(echo -en "$USER\0$DBNAME\0$PASSWORD\0$ADMIN_PASSWORD" | md5_compat)

Loading…
Cancel
Save