-
Couldn't load subscription status.
- Fork 1.7k
Description
Hello,
Why is the database name hardcoded? Even if you change it in the odoo.conf, the Docker container won't be compatible with a PostgreSQL database that doesn't have a database named 'postgres'. Multiple people have reported this issue and created PRs to address it, but none of them have been taken seriously. I'm currently creating a Helm chart for Odoo and have to jump through hoops to get it set up.
Obviously these PRs were neglected for so long but it would be nice if the Odoo team merge a solution once and for all to this issue.
Line 21 in 6b73961
| conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname='postgres') |
Lines 9 to 30 in 6b73961
| # set the postgres database host, port, user and password according to the environment | |
| # and pass them as arguments to the odoo process if not present in the config file | |
| : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} | |
| : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} | |
| : ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} | |
| : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} | |
| DB_ARGS=() | |
| function check_config() { | |
| param="$1" | |
| value="$2" | |
| if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then | |
| value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') | |
| fi; | |
| DB_ARGS+=("--${param}") | |
| DB_ARGS+=("${value}") | |
| } | |
| check_config "db_host" "$HOST" | |
| check_config "db_port" "$PORT" | |
| check_config "db_user" "$USER" | |
| check_config "db_password" "$PASSWORD" | |
Best Regards,
Mathias Beaulieu-Duncan