Skip to content

Commit 13fba40

Browse files
committed
[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] a3d207f
1 parent a3d207f commit 13fba40

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

10.0/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -e
55
# set the postgres database host, port, user and password
66
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
77
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
8-
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}}
9-
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}}
8+
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
9+
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
1010
# pass them as arguments to the odoo process
1111
DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)
1212

8.0/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -e
55
# set the postgres database host, port, user and password
66
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
77
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
8-
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}}
9-
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}}
8+
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
9+
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
1010
# pass them as arguments to the odoo process
1111
DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)
1212

9.0/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -e
55
# set the postgres database host, port, user and password
66
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
77
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
8-
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}}
9-
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}}
8+
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
9+
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
1010
# pass them as arguments to the odoo process
1111
DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)
1212

0 commit comments

Comments
 (0)