Skip to content

Commit 1695d30

Browse files
authored
Merge pull request #36 from akretion/dec25
Add support for Odoo 19.0 Remove queue_job from default installation, Set bus_alt_connection for 18.0 Add server_env_ir_config_param in example Update sentry odoo.cfg is now different between odoo major version.
2 parents 6888412 + 9f84dfe commit 1695d30

File tree

11 files changed

+289
-20
lines changed

11 files changed

+289
-20
lines changed

copier.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ project_name:
2323
branch_name:
2424
type: str
2525
choices:
26+
- "19.0"
2627
- "18.0"
2728
- "17.0"
2829
- "16.0"

src/ci.docker-compose.yml.jinja

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ services:
1313
MAX_CRON_THREADS: 1
1414

1515
# SERVER_WIDE_MODULES is now managed from the copier template
16-
# when modules sentry, bus_alt_connection(pgbouncer) and queue_job
16+
# when modules sentry, bus_alt_connection(pgbouncer)
1717
# are migrated, they are automatically installed in the next `copier update`
1818
# if you need to install something else in SERVER_WIDE_MODULES please
1919
# let us know the use case.
2020
# sentry and bus_alt_connection don't require installation
2121
# bus_alt_connection is required for CI and prod
22-
# queue_job is present in case you need it
23-
{% if branch_name == "18.0" %}
22+
{% if branch_name == "19.0" %}
2423
# for the moment sentry and bus_alt_connection not migrated yet
2524
SERVER_WIDE_MODULES: web,queue_job
2625
{% else %}
27-
SERVER_WIDE_MODULES: web,sentry,bus_alt_connection,queue_job
26+
SERVER_WIDE_MODULES: web,sentry,bus_alt_connection
2827
{% endif %}
2928
SENTRY: "False"
3029
# on some project you may activate sentry for your ci
@@ -37,7 +36,7 @@ services:
3736
PGUSER: ${CI_PROJECT_NAME}
3837
DB_HOST:
3938
PGHOST:
40-
{% if branch_name != "18.0" %}
39+
{% if branch_name != "19.0" %}
4140
# use pgbouncer
4241
DB_PORT: 6432
4342
PGPORT: 6432
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# TODO see what can be move into base image
22
pyjwt # auth_oidc
33
python-jose[cryptography] # auth_oidc
4-
#sentry 1.9.0 fixé dans le manifest du module sentry pour le moment
4+
5+
{% if branch_name in ("18.0", "19.0") %}
6+
sentry-sdk>=2.0.0,<=2.22.0
7+
{% else %}
8+
#sentry 1.9.0 for 14.0 to 17.0
59
sentry-sdk<=1.9.0
10+
{% endif %}
611

712
#apispec #shopinvader
813
#boto3==1.20.32 # shopinvader

src/odoo/spec.yaml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ server-env:
1919
- data_encryption
2020
- server_environment
2121
- server_environment_data_encryption
22+
- server_environment_ir_config_parameter
2223
src: https://github.com/oca/server-env {{ odoo_version }}
2324

2425
server-tools:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
declare -x ADDONS_PATH="${ADDONS_PATH:-}"
2+
declare -x DB_TEMPLATE="${DB_TEMPLATE:-template1}"
3+
declare -x DB_HOST="${DB_HOST:-}"
4+
declare -x DB_PORT="${DB_PORT:-5432}"
5+
declare -x DB_REPLICA_HOST="${DB_REPLICA_HOST:-False}"
6+
declare -x DB_REPLICA_PORT="${DB_REPLICA_PORT:-False}"
7+
declare -x DB_NAME="${DB_NAME:-}"
8+
declare -x DB_USER="${DB_USER:-}"
9+
declare -x DB_PASSWORD="${DB_PASSWORD:-}"
10+
declare -x DB_SSLMODE="${DB_SSLMODE:-prefer}"
11+
declare -x DB_FILTER="${DB_FILTER:-^(${DB_NAME//,/|})$}"
12+
declare -x LIST_DB="${LIST_DB:-False}"
13+
declare -x ADMIN_PASSWD="${ADMIN_PASSWD:-}"
14+
declare -x DB_MAXCONN="${DB_MAXCONN:-64}"
15+
declare -x DB_MAXCONN_GEVENT="${DB_MAXCONN_GEVENT:-False}"
16+
declare -x LIMIT_MEMORY_SOFT="${LIMIT_MEMORY_SOFT:-2147483648}"
17+
declare -x LIMIT_MEMORY_SOFT_GEVENT="${LIMIT_MEMORY_SOFT_GEVENT:-False}"
18+
declare -x LIMIT_MEMORY_HARD="${LIMIT_MEMORY_HARD:-2684354560}"
19+
declare -x LIMIT_MEMORY_HARD_GEVENT="${LIMIT_MEMORY_HARD_GEVENT:-False}"
20+
declare -x LIMIT_REQUEST="${LIMIT_REQUEST:-8192}"
21+
declare -x LIMIT_TIME_CPU="${LIMIT_TIME_CPU:-60}"
22+
declare -x LIMIT_TIME_REAL="${LIMIT_TIME_REAL:-120}"
23+
declare -x LIMIT_TIME_REAL_CRON="${LIMIT_TIME_REAL_CRON:-120}"
24+
declare -x LOG_HANDLER="${LOG_HANDLER:-':INFO'}"
25+
declare -x LOG_LEVEL="${LOG_LEVEL:-info}"
26+
declare -x MAX_CRON_THREADS="${MAX_CRON_THREADS:-2}"
27+
declare -x WORKERS="${WORKERS:-4}"
28+
declare -x LOGFILE="${LOGFILE:-None}"
29+
declare -x LOG_DB="${LOG_DB:-False}"
30+
declare -x SYSLOG="${SYSLOG:-False}"
31+
declare -x RUNNING_ENV="${RUNNING_ENV:-dev}"
32+
declare -x WITHOUT_DEMO="${WITHOUT_DEMO:-True}"
33+
declare -x SERVER_WIDE_MODULES="${SERVER_WIDE_MODULES:-}"
34+
declare -x UNACCENT="${UNACCENT:-False}"
35+
declare -x ADDITIONAL_ODOO_RC="${ADDITIONAL_ODOO_RC:-}"
36+
# diff with upstream
37+
# we don't use PG vars because they should be explicitely
38+
# defined in docker compose files
39+
# the entrypoint is not run by docker exec
40+
#declare -x PGHOST=${DB_HOST}
41+
#declare -x PGPORT=${DB_PORT:-5432}
42+
#declare -x PGUSER=${DB_USER}
43+
#declare -x PGPASSWORD=${DB_PASSWORD}
44+
#declare -x PGDATABASE=${DB_NAME}
45+
declare -x SENTRY="${SENTRY:-False}"
46+
declare -x SENTRY_DSN="${SENTRY_DSN:-''}"
47+
declare -x SENTRY_RELEASE="${SENTRY_RELEASE:-}"
48+
declare -x SENTRY_TRACES_SAMPLE_RATE="${SENTRY_TRACES_SAMPLE_RATE:-}"
49+
declare -x ENCRYPTION_KEY_DEV="${ENCRYPTION_KEY_DEV:-}"
50+
declare -x ENCRYPTION_KEY_CI="${ENCRYPTION_KEY_CI:-}"
51+
declare -x ENCRYPTION_KEY_PROD="${ENCRYPTION_KEY_PROD:-}"
52+
declare -x AUTH_OAUTH_PROVIDER_CLIENT_ID="${AUTH_OAUTH_PROVIDER_CLIENT_ID:-}"
53+
declare -x AUTH_OAUTH_PROVIDER_CLIENT_SECRET="${AUTH_OAUTH_PROVIDER_CLIENT_SECRET:-}"

src/odoo/templates/odoo.cfg.tmpl renamed to src/odoo/{% if branch_name == '18.0' %}templates{% endif %}/odoo.cfg.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limit_memory_hard = ${LIMIT_MEMORY_HARD}
1818
limit_request = ${LIMIT_REQUEST}
1919
limit_time_cpu = ${LIMIT_TIME_CPU}
2020
limit_time_real = ${LIMIT_TIME_REAL}
21-
limit_time_real_cron = ${LIMIT_TIME_REAL}
21+
limit_time_real_cron = ${LIMIT_TIME_REAL_CRON}
2222
log_handler = ${LOG_HANDLER}
2323
log_level = ${LOG_LEVEL}
2424
max_cron_threads = ${MAX_CRON_THREADS}
@@ -39,7 +39,7 @@ proxy_mode = True
3939
; http_port = 8069
4040
; http_enable = True
4141
; http_interface =
42-
; longpolling_port = 8072
42+
; gevent_port = 8072
4343
; osv_memory_age_limit = 1.0
4444
; osv_memory_count_limit = False
4545
; smtp_password = False
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
declare -x ADDONS_PATH="${ADDONS_PATH:-}"
2+
declare -x DB_TEMPLATE="${DB_TEMPLATE:-template1}"
3+
declare -x DB_HOST="${DB_HOST:-}"
4+
declare -x DB_PORT="${DB_PORT:-5432}"
5+
declare -x DB_REPLICA_HOST="${DB_REPLICA_HOST:-None}"
6+
declare -x DB_REPLICA_PORT="${DB_REPLICA_PORT:-None}"
7+
declare -x DB_NAME="${DB_NAME:-}"
8+
declare -x DB_USER="${DB_USER:-}"
9+
declare -x DB_PASSWORD="${DB_PASSWORD:-}"
10+
declare -x DB_SSLMODE="${DB_SSLMODE:-prefer}"
11+
declare -x DB_FILTER="${DB_FILTER:-^(${DB_NAME//,/|})$}"
12+
declare -x LIST_DB="${LIST_DB:-False}"
13+
declare -x ADMIN_PASSWD="${ADMIN_PASSWD:-}"
14+
declare -x DB_MAXCONN="${DB_MAXCONN:-64}"
15+
declare -x DB_MAXCONN_GEVENT="${DB_MAXCONN_GEVENT:-None}"
16+
declare -x LIMIT_MEMORY_SOFT="${LIMIT_MEMORY_SOFT:-2147483648}"
17+
declare -x LIMIT_MEMORY_SOFT_GEVENT="${LIMIT_MEMORY_SOFT_GEVENT:-None}"
18+
declare -x LIMIT_MEMORY_HARD="${LIMIT_MEMORY_HARD:-2684354560}"
19+
declare -x LIMIT_MEMORY_HARD_GEVENT="${LIMIT_MEMORY_HARD_GEVENT:-None}"
20+
declare -x LIMIT_REQUEST="${LIMIT_REQUEST:-8192}"
21+
declare -x LIMIT_TIME_CPU="${LIMIT_TIME_CPU:-60}"
22+
declare -x LIMIT_TIME_REAL="${LIMIT_TIME_REAL:-120}"
23+
declare -x LIMIT_TIME_REAL_CRON="${LIMIT_TIME_REAL_CRON:-120}"
24+
declare -x LOG_HANDLER="${LOG_HANDLER:-':INFO'}"
25+
declare -x LOG_LEVEL="${LOG_LEVEL:-info}"
26+
declare -x MAX_CRON_THREADS="${MAX_CRON_THREADS:-2}"
27+
declare -x WORKERS="${WORKERS:-4}"
28+
declare -x LOGFILE="${LOGFILE:-None}"
29+
declare -x LOG_DB="${LOG_DB:-}"
30+
declare -x SYSLOG="${SYSLOG:-False}"
31+
declare -x RUNNING_ENV="${RUNNING_ENV:-dev}"
32+
if [ ! -z "${WITH_DEMO:-}" ]; then
33+
declare -x WITH_DEMO="${WITH_DEMO}"
34+
elif [ ! -z "${WITHOUT_DEMO:-}" ]; then
35+
# Fallback to WITHOUT_DEMO
36+
# But inversing the logic
37+
if [ "${WITHOUT_DEMO}" == "False" ]; then
38+
declare -x WITH_DEMO="True"
39+
else
40+
declare -x WITH_DEMO="False"
41+
fi
42+
else
43+
# nothing is set -> Default value
44+
declare -x WITH_DEMO="False"
45+
fi
46+
declare -x SERVER_WIDE_MODULES="${SERVER_WIDE_MODULES:-}"
47+
declare -x UNACCENT="${UNACCENT:-False}"
48+
declare -x ADDITIONAL_ODOO_RC="${ADDITIONAL_ODOO_RC:-}"
49+
# diff with upstream
50+
# we don't use PG vars because they should be explicitely
51+
# defined in docker compose files
52+
# the entrypoint is not run by docker exec
53+
#declare -x PGHOST=${DB_HOST}
54+
#declare -x PGPORT=${DB_PORT:-5432}
55+
#declare -x PGUSER=${DB_USER}
56+
#declare -x PGPASSWORD=${DB_PASSWORD}
57+
#declare -x PGDATABASE=${DB_NAME}
58+
declare -x SENTRY="${SENTRY:-False}"
59+
declare -x SENTRY_DSN="${SENTRY_DSN:-''}"
60+
declare -x SENTRY_RELEASE="${SENTRY_RELEASE:-}"
61+
declare -x SENTRY_TRACES_SAMPLE_RATE="${SENTRY_TRACES_SAMPLE_RATE:-}"
62+
declare -x ENCRYPTION_KEY_DEV="${ENCRYPTION_KEY_DEV:-}"
63+
declare -x ENCRYPTION_KEY_CI="${ENCRYPTION_KEY_CI:-}"
64+
declare -x ENCRYPTION_KEY_PROD="${ENCRYPTION_KEY_PROD:-}"
65+
declare -x AUTH_OAUTH_PROVIDER_CLIENT_ID="${AUTH_OAUTH_PROVIDER_CLIENT_ID:-}"
66+
declare -x AUTH_OAUTH_PROVIDER_CLIENT_SECRET="${AUTH_OAUTH_PROVIDER_CLIENT_SECRET:-}"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[options]
2+
addons_path = ${ADDONS_PATH}
3+
data_dir = /data/odoo
4+
db_template = ${DB_TEMPLATE}
5+
db_host = ${DB_HOST}
6+
db_port = ${DB_PORT}
7+
db_replica_host = ${DB_REPLICA_HOST}
8+
db_replica_port = ${DB_REPLICA_PORT}
9+
db_name = ${DB_NAME}
10+
db_user = ${DB_USER}
11+
db_password = ${DB_PASSWORD}
12+
db_sslmode = ${DB_SSLMODE}
13+
dbfilter = ${DB_FILTER}
14+
list_db = ${LIST_DB}
15+
admin_passwd = ${ADMIN_PASSWD}
16+
db_maxconn = ${DB_MAXCONN}
17+
db_maxconn_gevent = ${DB_MAXCONN_GEVENT}
18+
limit_memory_soft = ${LIMIT_MEMORY_SOFT}
19+
limit_memory_soft_gevent = ${LIMIT_MEMORY_SOFT_GEVENT}
20+
limit_memory_hard = ${LIMIT_MEMORY_HARD}
21+
limit_memory_hard_gevent = ${LIMIT_MEMORY_HARD_GEVENT}
22+
limit_request = ${LIMIT_REQUEST}
23+
limit_time_cpu = ${LIMIT_TIME_CPU}
24+
limit_time_real = ${LIMIT_TIME_REAL}
25+
limit_time_real_cron = ${LIMIT_TIME_REAL_CRON}
26+
log_handler = ${LOG_HANDLER}
27+
log_level = ${LOG_LEVEL}
28+
max_cron_threads = ${MAX_CRON_THREADS}
29+
workers = ${WORKERS}
30+
logfile = ${LOGFILE}
31+
log_db = ${LOG_DB}
32+
syslog = ${SYSLOG}
33+
with_demo = ${WITH_DEMO}
34+
server_wide_modules = ${SERVER_WIDE_MODULES}
35+
; We can activate proxy_mode even if we are not behind a proxy, because
36+
; it is used only if HTTP_X_FORWARDED_HOST is set in environ
37+
proxy_mode = True
38+
; csv_internal_sep = ,
39+
; debug_mode = False
40+
; email_from = False
41+
; http_port = 8069
42+
; http_enable = True
43+
http_interface = 0.0.0.0
44+
; gevent_port = 8072
45+
; osv_memory_age_limit = 1.0
46+
; osv_memory_count_limit = False
47+
; smtp_password = False
48+
; smtp_port = 25
49+
; smtp_server = localhost
50+
; smtp_ssl = False
51+
; smtp_user = False
52+
unaccent = ${UNACCENT}
53+
54+
sentry_enabled = ${SENTRY}
55+
sentry_environment = ${RUNNING_ENV}
56+
sentry_dsn = ${SENTRY_DSN}
57+
sentry_release = ${SENTRY_RELEASE}
58+
sentry_traces_sample_rate = ${SENTRY_TRACES_SAMPLE_RATE}
59+
60+
encryption_key_dev=${ENCRYPTION_KEY_DEV}
61+
encryption_key_ci=${ENCRYPTION_KEY_CI}
62+
encryption_key_prod=${ENCRYPTION_KEY_PROD}
63+
${ADDITIONAL_ODOO_RC}
64+
65+
66+
[auth_oauth_provider.Akretion]
67+
client_id=${AUTH_OAUTH_PROVIDER_CLIENT_ID}
68+
client_secret=${AUTH_OAUTH_PROVIDER_CLIENT_SECRET}

src/odoo/templates/answers.sh renamed to src/odoo/{% if branch_name in ('14.0','15.0','16.0','17.0') %}templates{% endif %}/answers.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ declare -x DB_NAME="${DB_NAME:-}"
66
declare -x DB_USER="${DB_USER:-}"
77
declare -x DB_PASSWORD="${DB_PASSWORD:-}"
88
declare -x DB_SSLMODE="${DB_SSLMODE:-prefer}"
9-
declare -x DB_FILTER="${DB_FILTER:-}"
9+
declare -x DB_FILTER="${DB_FILTER:-^(${DB_NAME//,/|})$}"
1010
declare -x LIST_DB="${LIST_DB:-False}"
1111
declare -x ADMIN_PASSWD="${ADMIN_PASSWD:-}"
1212
declare -x DB_MAXCONN="${DB_MAXCONN:-64}"
@@ -15,18 +15,28 @@ declare -x LIMIT_MEMORY_HARD="${LIMIT_MEMORY_HARD:-2684354560}"
1515
declare -x LIMIT_REQUEST="${LIMIT_REQUEST:-8192}"
1616
declare -x LIMIT_TIME_CPU="${LIMIT_TIME_CPU:-60}"
1717
declare -x LIMIT_TIME_REAL="${LIMIT_TIME_REAL:-120}"
18+
declare -x LIMIT_TIME_REAL_CRON="${LIMIT_TIME_REAL_CRON:-120}"
1819
declare -x LOG_HANDLER="${LOG_HANDLER:-':INFO'}"
1920
declare -x LOG_LEVEL="${LOG_LEVEL:-info}"
2021
declare -x MAX_CRON_THREADS="${MAX_CRON_THREADS:-2}"
2122
declare -x WORKERS="${WORKERS:-4}"
22-
declare -x LOGFILE="${LOGFILE:-}"
23+
declare -x LOGFILE="${LOGFILE:-None}"
2324
declare -x LOG_DB="${LOG_DB:-False}"
2425
declare -x SYSLOG="${SYSLOG:-False}"
2526
declare -x RUNNING_ENV="${RUNNING_ENV:-dev}"
2627
declare -x WITHOUT_DEMO="${WITHOUT_DEMO:-True}"
2728
declare -x SERVER_WIDE_MODULES="${SERVER_WIDE_MODULES:-}"
2829
declare -x UNACCENT="${UNACCENT:-False}"
2930
declare -x ADDITIONAL_ODOO_RC="${ADDITIONAL_ODOO_RC:-}"
31+
# diff with upstream
32+
# we don't use PG vars because they should be explicitely
33+
# defined in docker compose files
34+
# the entrypoint is not run by docker exec
35+
#declare -x PGHOST=${DB_HOST}
36+
#declare -x PGPORT=${DB_PORT:-5432}
37+
#declare -x PGUSER=${DB_USER}
38+
#declare -x PGPASSWORD=${DB_PASSWORD}
39+
#declare -x PGDATABASE=${DB_NAME}
3040
declare -x SENTRY="${SENTRY:-False}"
3141
declare -x SENTRY_DSN="${SENTRY_DSN:-''}"
3242
declare -x SENTRY_RELEASE="${SENTRY_RELEASE:-}"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[options]
2+
addons_path = ${ADDONS_PATH}
3+
data_dir = /data/odoo
4+
auto_reload = False
5+
db_template = ${DB_TEMPLATE}
6+
db_host = ${DB_HOST}
7+
db_port = ${DB_PORT}
8+
db_name = ${DB_NAME}
9+
db_user = ${DB_USER}
10+
db_password = ${DB_PASSWORD}
11+
db_sslmode = ${DB_SSLMODE}
12+
dbfilter = ${DB_FILTER}
13+
list_db = ${LIST_DB}
14+
admin_passwd = ${ADMIN_PASSWD}
15+
db_maxconn = ${DB_MAXCONN}
16+
limit_memory_soft = ${LIMIT_MEMORY_SOFT}
17+
limit_memory_hard = ${LIMIT_MEMORY_HARD}
18+
limit_request = ${LIMIT_REQUEST}
19+
limit_time_cpu = ${LIMIT_TIME_CPU}
20+
limit_time_real = ${LIMIT_TIME_REAL}
21+
limit_time_real_cron = ${LIMIT_TIME_REAL_CRON}
22+
log_handler = ${LOG_HANDLER}
23+
log_level = ${LOG_LEVEL}
24+
max_cron_threads = ${MAX_CRON_THREADS}
25+
workers = ${WORKERS}
26+
logfile = ${LOGFILE}
27+
log_db = ${LOG_DB}
28+
logrotate = True
29+
syslog = ${SYSLOG}
30+
running_env = ${RUNNING_ENV}
31+
without_demo = ${WITHOUT_DEMO}
32+
server_wide_modules = ${SERVER_WIDE_MODULES}
33+
; We can activate proxy_mode even if we are not behind a proxy, because
34+
; it is used only if HTTP_X_FORWARDED_HOST is set in environ
35+
proxy_mode = True
36+
; csv_internal_sep = ,
37+
; debug_mode = False
38+
; email_from = False
39+
; http_port = 8069
40+
; http_enable = True
41+
; http_interface =
42+
; gevent_port = 8072
43+
; osv_memory_age_limit = 1.0
44+
; osv_memory_count_limit = False
45+
; smtp_password = False
46+
; smtp_port = 25
47+
; smtp_server = localhost
48+
; smtp_ssl = False
49+
; smtp_user = False
50+
unaccent = ${UNACCENT}
51+
52+
sentry_enabled = ${SENTRY}
53+
sentry_environment = ${RUNNING_ENV}
54+
sentry_dsn = ${SENTRY_DSN}
55+
sentry_release = ${SENTRY_RELEASE}
56+
sentry_traces_sample_rate = ${SENTRY_TRACES_SAMPLE_RATE}
57+
58+
encryption_key_dev=${ENCRYPTION_KEY_DEV}
59+
encryption_key_ci=${ENCRYPTION_KEY_CI}
60+
encryption_key_prod=${ENCRYPTION_KEY_PROD}
61+
${ADDITIONAL_ODOO_RC}
62+
63+
64+
[auth_oauth_provider.Akretion]
65+
client_id=${AUTH_OAUTH_PROVIDER_CLIENT_ID}
66+
client_secret=${AUTH_OAUTH_PROVIDER_CLIENT_SECRET}

0 commit comments

Comments
 (0)