From 13fba407e1e2cbd192760298f160f8f0f6f5665d Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Thu, 3 Nov 2016 11:42:54 +0100 Subject: [PATCH] [REF] Odoo 8.0-10.0: default USER and PASSWORD to odoo Defaulting USER to postgres does not make sense as odoo prevents creating a database with the user `postgres` (however, there's a bug that allows it when set by environment variable, but still it does not work later because Odoo does not use the environment variable to find the databases in the `list_dbs` method). Defaulting PASSWORD to odoo makes sense because it's what we set in the documentationm and is even mandatory since we chose to pass the pg connections parameters[1] and we did not set a default value for it. [1] a3d207f2d49c3a0eb0e959fbf2cb33909c382a3f --- 10.0/entrypoint.sh | 4 ++-- 8.0/entrypoint.sh | 4 ++-- 9.0/entrypoint.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/10.0/entrypoint.sh b/10.0/entrypoint.sh index 208c93d..3878702 100755 --- a/10.0/entrypoint.sh +++ b/10.0/entrypoint.sh @@ -5,8 +5,8 @@ set -e # set the postgres database host, port, user and password : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} -: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}} -: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}} +: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} +: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} # pass them as arguments to the odoo process DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT) diff --git a/8.0/entrypoint.sh b/8.0/entrypoint.sh index 85bc49b..9765824 100755 --- a/8.0/entrypoint.sh +++ b/8.0/entrypoint.sh @@ -5,8 +5,8 @@ set -e # set the postgres database host, port, user and password : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} -: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}} -: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}} +: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} +: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} # pass them as arguments to the odoo process DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT) diff --git a/9.0/entrypoint.sh b/9.0/entrypoint.sh index 85bc49b..9765824 100755 --- a/9.0/entrypoint.sh +++ b/9.0/entrypoint.sh @@ -5,8 +5,8 @@ set -e # set the postgres database host, port, user and password : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}} -: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}} -: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}} +: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}} +: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} # pass them as arguments to the odoo process DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)