From 7b3b84fbdb6d7584d83e6a16b1eaa68fb671e20e Mon Sep 17 00:00:00 2001 From: Fabio Tielen // Code Agency Date: Mon, 4 Sep 2023 23:38:51 +0200 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20chore(requirements.t?= =?UTF-8?q?xt):=20add=20redis=20package=20to=20the=20requirements=20The=20?= =?UTF-8?q?redis=20package=20is=20added=20to=20the=20requirements.txt=20fi?= =?UTF-8?q?le=20to=20ensure=20that=20the=20application=20has=20the=20neces?= =?UTF-8?q?sary=20dependencies=20installed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odoo/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/requirements.txt b/odoo/requirements.txt index fb6626a..066fba9 100644 --- a/odoo/requirements.txt +++ b/odoo/requirements.txt @@ -1,2 +1,3 @@ debugpy websocket-client +redis \ No newline at end of file From dddafd862f6ff962ce5677f9fb8e4455ccf021b4 Mon Sep 17 00:00:00 2001 From: Fabio Tielen // Code Agency Date: Mon, 4 Sep 2023 23:54:39 +0200 Subject: [PATCH 02/11] =?UTF-8?q?=E2=9C=A8=20feat(.env.example):=20add=20c?= =?UTF-8?q?onfiguration=20options=20for=20Redis=20caching=20in=20the=20.en?= =?UTF-8?q?v.example=20file=20=E2=9C=A8=20feat(docker-compose.yml):=20add?= =?UTF-8?q?=20keydb=20service=20for=20Redis=20caching=20with=201GB=20share?= =?UTF-8?q?d=20memory=20size=20=E2=9C=A8=20feat(odoo.example.conf):=20add?= =?UTF-8?q?=20configuration=20options=20for=20Redis=20caching=20in=20the?= =?UTF-8?q?=20odoo.example.conf=20file=20The=20changes=20were=20made=20to?= =?UTF-8?q?=20add=20support=20for=20Redis=20caching=20in=20the=20applicati?= =?UTF-8?q?on.=20The=20.env.example=20file=20now=20includes=20configuratio?= =?UTF-8?q?n=20options=20for=20Redis=20caching,=20such=20as=20Redis=20host?= =?UTF-8?q?,=20port,=20password,=20URL,=20prefix,=20expiration=20time,=20a?= =?UTF-8?q?nd=20expiration=20time=20for=20anonymous=20sessions.=20The=20do?= =?UTF-8?q?cker-compose.yml=20file=20now=20includes=20a=20keydb=20service?= =?UTF-8?q?=20with=201GB=20shared=20memory=20size=20for=20Redis=20caching.?= =?UTF-8?q?=20The=20odoo.example.conf=20file=20now=20includes=20configurat?= =?UTF-8?q?ion=20options=20for=20Redis=20caching,=20such=20as=20enabling?= =?UTF-8?q?=20Redis=20caching,=20Redis=20host,=20port,=20password,=20URL,?= =?UTF-8?q?=20prefix,=20expiration=20time,=20and=20expiration=20time=20for?= =?UTF-8?q?=20anonymous=20sessions.=20These=20changes=20allow=20the=20appl?= =?UTF-8?q?ication=20to=20utilize=20Redis=20for=20caching,=20improving=20p?= =?UTF-8?q?erformance=20and=20scalability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 14 +++++++++++++- docker-compose.yml | 15 +++++++++++++++ odoo/odoo.example.conf | 20 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 3974d52..a08ab2f 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ APP_ENV=local INIT= UPDATE= -LOAD=base,web +LOAD=base,web,session_redis WORKERS=2 DEV_MODE=reload,qweb DOMAIN=erp.odoocker.test @@ -235,3 +235,15 @@ CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN} # ACME Companion # #----------------------# DEFAULT_EMAIL=${SUPPORT_EMAIL} + +#----------------------# +# REDIS Caching # +#----------------------# +ODOO_SESSION_REDIS = ${ODOO_SESSION_REDIS} +ODOO_SESSION_REDIS_HOST = ${ODOO_SESSION_REDIS_HOST} +ODOO_SESSION_REDIS_PORT = ${ODOO_SESSION_REDIS_PORT} +ODOO_SESSION_REDIS_PASSWORD = ${ODOO_SESSION_REDIS_PASSWORD} +ODOO_SESSION_REDIS_URL = ${ODOO_SESSION_REDIS_URL} +ODOO_SESSION_REDIS_PREFIX = ${ODOO_SESSION_REDIS_PREFIX} +ODOO_SESSION_REDIS_EXPIRATION = ${ODOO_SESSION_REDIS_EXPIRATION} +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = ${ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 171320c..3f9aec0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,7 @@ services: args: - POSTGRES_TAG restart: unless-stopped + shm_size: 1GB tty: true volumes: - pg-data:${PGDATA} @@ -82,12 +83,26 @@ services: networks: - internal + keydb: + image: eqalpha/keydb:latest + platform: linux/amd64 + shm_size: 1GB + restart: unless-stopped + networks: + - internal + # command: keydb-server /etc/keydb/keydb.conf + volumes: + #- ./keydb.conf:/etc/keydb/keydb.conf:ro + - cache-db-data:/var/lib/keydb + volumes: data-dir: pg-data: certs: vhost: html: + cache-db-data: + networks: internal: diff --git a/odoo/odoo.example.conf b/odoo/odoo.example.conf index 30d8ee5..e935a0d 100644 --- a/odoo/odoo.example.conf +++ b/odoo/odoo.example.conf @@ -259,3 +259,23 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} + +;------------------------------------------; +; Options not exposed on the command line. ; +;------------------------------------------; +; --ODOO_SESSION_REDIS +ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} ;has to be 1 or true +; --ODOO_SESSION_REDIS_HOST +ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} ;is the redis hostname (default is localhost) +; --ODOO_SESSION_REDIS_PORT +ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} ;is the redis port (default is 6379) +; --ODOO_SESSION_REDIS_PASSWORD +ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} ;is the password for the AUTH command (optional) +; -- ODOO_SESSION_REDIS_URL +ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} ;is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. +; -- ODOO_SESSION_REDIS_PREFIX +ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} ;is the prefix for the session keys (optional) +; -- ODOO_SESSION_REDIS_EXPIRATION +ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} ;is the time in seconds before expiration of the sessions (default is 7 days) +; -- ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} ;the time in seconds before expiration of the anonymous sessions (default is 3 hours) From fc0d0c98750ead08be1a91c0a8aead7019bfb942 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Wed, 27 Sep 2023 22:47:22 -0500 Subject: [PATCH 03/11] integrate keydb to odoocker --- .env.example | 150 +++++++++++++----- .gitignore | 3 + docker-compose.override.local.yml | 2 +- docker-compose.pgadmin.yml | 32 +++- docker-compose.yml | 27 ++-- nginx/default.conf | 13 +- odoo/Dockerfile | 14 +- .../__manifest__.py | 6 +- .../data/ir_config_parameter.xml | 0 ...ifest__.example.py => manifest.example.py} | 5 + odoo/odoo.example.conf | 50 +++--- odoo/odoorc.sh | 45 +++++- odoo/requirements.txt | 2 +- odoo/third-party-addons.sh | 2 + pgadmin/Dockerfile | 32 ++++ pgadmin/start_pgadmin.sh | 89 +++++++++++ postgres/Dockerfile | 5 +- postgres/entrypoint.sh | 35 +++- 18 files changed, 415 insertions(+), 97 deletions(-) rename odoo/extra-addons/{report_url => odoocker_base}/__manifest__.py (67%) rename odoo/extra-addons/{report_url => odoocker_base}/data/ir_config_parameter.xml (100%) rename odoo/{__manifest__.example.py => manifest.example.py} (91%) create mode 100755 odoo/third-party-addons.sh create mode 100644 pgadmin/Dockerfile create mode 100755 pgadmin/start_pgadmin.sh diff --git a/.env.example b/.env.example index a08ab2f..749d956 100644 --- a/.env.example +++ b/.env.example @@ -4,11 +4,11 @@ # Odoo APP_ENV=local INIT= -UPDATE= +UPDATE=custom_core LOAD=base,web,session_redis WORKERS=2 -DEV_MODE=reload,qweb -DOMAIN=erp.odoocker.test +DEV_MODE=reload,xml +DOMAIN=erp.j8c.test # Enterprise GITHUB_USER= @@ -18,7 +18,7 @@ GITHUB_ACCESS_TOKEN= ADMIN_PASSWD=odoo DB_HOST=postgres DB_PORT=5432 -DB_NAME=odoo +DB_NAME=j8c DB_USER=odoo DB_PASSWORD=odoo LOAD_LANGUAGE= @@ -31,12 +31,12 @@ LIST_DB=True DBFILTER=.* # Logging -LOG_LEVEL=debug +LOG_LEVEL=info # Additional logs LOG_HANDLER_LEVEL=INFO # Nginx -CORS_ALLOWED_DOMAIN="'http://external-domain.test'" +CORS_ALLOWED_DOMAIN="'https://odoo.j8c.com.mx'" # Testing TEST_ENABLE=False @@ -52,20 +52,46 @@ SMTP_PASSWORD= EMAIL_FROM= FROM_FILTER= +# Redis +SESSION_REDIS=true +REDIS_HOST=redis +REDIS_PORT=6379 +REDIS_PASSWORD= +# REDIS_URL= +REDIS_PREFIX=odoo +REDIS_EXPIRATION=604800 +REDIS_EXPIRATION_ANONYMOUS=10800 + +# Postgres +POSTGRES_MAIN_HOST=${DB_HOST} +POSTGRES_MAIN_PORT=${DB_PORT} +POSTGRES_MAIN_DB=postgres +POSTGRES_MAIN_USER=postgres +POSTGRES_MAIN_PASSWORD=${DB_PASSWORD} + # PgAdmin -PGADMIN_DOMAIN=pgadmin.odoocker.test +PGADMIN_DOMAIN=pgadmin.j8c.test +PGADMING_DB_NAME=pgadmin +PGADMING_DB_USER=pgadmin +PGADMIN_DB_PASSWORD=${DB_PASSWORD} +PGADMIN_DB_HOST="'postgresql://${PGADMING_DB_USER}:${PGADMIN_DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${PGADMING_DB_NAME}'" + +PGADMIN_EMAIL=contacto@juarezsoft.com.mx PGADMIN_PASSWORD=odoo +PGADMIN_SERVERS_JSON= +PGADMIN_CONFIG_SERVER_MODE=True + #------------------------------# # Project Configurations # #------------------------------# # Docker -PROJECT_NAME=odoocker -SUPPORT_EMAIL=mail@example.com +PROJECT_NAME=j8c +SUPPORT_EMAIL=contacto@juarezsoft.com.mx # Containers' Tags -ODOO_TAG=16.0 -POSTGRES_TAG=15.4 +ODOO_TAG=15.0 +POSTGRES_TAG=16.0 NGINX_TAG=1.25.2 NGINX_PROXY_TAG=1.3.1 ACME_COMPANION_TAG=2.2.8 @@ -87,6 +113,7 @@ WEBSOCKET_RATE_LIMIT_DELAY=0.2 # Custom paths COMMUNITY_ADDONS=${ROOT_PATH}/addons ENTERPRISE_ADDONS=${ROOT_PATH}/enterprise +THIRD_PARTY_ADDONS=${ROOT_PATH}/third-party-addons EXTRA_ADDONS=${ROOT_PATH}/extra-addons CUSTOM_ADDONS=${ROOT_PATH}/custom-addons LOG_PATH=/var/log/odoo/odoo.log @@ -101,7 +128,7 @@ DEMO=False WITHOUT_DEMO=all IMPORT_PARTIAL=False PIDFILE= -ADDONS_PATH=${COMMUNITY_ADDONS},${ENTERPRISE_ADDONS},${EXTRA_ADDONS},${CUSTOM_ADDONS} +ADDONS_PATH=${COMMUNITY_ADDONS},${ENTERPRISE_ADDONS},${THIRD_PARTY_ADDONS},${EXTRA_ADDONS},${CUSTOM_ADDONS} UPGRADE_PATH= SERVER_WIDE_MODULES=${LOAD} DATA_DIR=/var/lib/odoo @@ -113,7 +140,7 @@ DEBUG_INTERFACE=${HTTP_INTERFACE} HTTP_PORT=8069 DEBUG_PORT=8070 XMLRPCS_PORT=8071 -GEVENT_PORT=8072 +LONGPOLLING_PORT=8072 HTTP_ENABLE=True XMLRPCS=True PROXY_MODE=True @@ -172,7 +199,7 @@ SHELL_INTERFACE=ptpython STOP_AFTER_INIT=False OSV_MEMORY_COUNT_LIMIT=False TRANSIENT_AGE_LIMIT=1.0 -MAX_CRON_THREADS=2 +MAX_CRON_THREADS=1 UNACCENT=${UNACCENT} GEOIP_DATABASE=/usr/share/GeoIP/GeoLite2-City.mmdb WORKERS=${WORKERS} @@ -193,11 +220,11 @@ TEMP_DOCKER_SOCK=/tmp/docker.sock #----------------# # Postgres # #----------------# -POSTGRES_HOST=${DB_HOST} -POSTGRES_PORT=${DB_PORT} -POSTGRES_DB=postgres -POSTGRES_USER=${DB_USER} -POSTGRES_PASSWORD=${DB_PASSWORD} +POSTGRES_HOST=${POSTGRES_MAIN_HOST} +POSTGRES_PORT=${POSTGRES_MAIN_PORT} +POSTGRES_DB=${POSTGRES_MAIN_DB} +POSTGRES_USER=${POSTGRES_MAIN_USER} +POSTGRES_PASSWORD=${POSTGRES_MAIN_PASSWORD} PGDATA=/var/lib/postgresql/data/${PROJECT_NAME} #-------------# @@ -210,16 +237,6 @@ LETSENCRYPT_HOST=${DOMAIN} LETSENCRYPT_EMAIL=${SUPPORT_EMAIL} CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN} -#-------------# -# PgAdmin # -#-------------# -PGADMIN_DATA=/var/lib/pgadmin -PGADMIN_VIRTUAL_HOST=${PGADMIN_DOMAIN} -PGADMIN_DEFAULT_EMAIL=${SUPPORT_EMAIL} -PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD} -PGADMIN_LETSENCRYPT_HOST=${PGADMIN_DOMAIN} -LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} - #-------------------# # Nginx Proxy # #-------------------# @@ -236,14 +253,67 @@ CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN} #----------------------# DEFAULT_EMAIL=${SUPPORT_EMAIL} -#----------------------# -# REDIS Caching # -#----------------------# -ODOO_SESSION_REDIS = ${ODOO_SESSION_REDIS} -ODOO_SESSION_REDIS_HOST = ${ODOO_SESSION_REDIS_HOST} -ODOO_SESSION_REDIS_PORT = ${ODOO_SESSION_REDIS_PORT} -ODOO_SESSION_REDIS_PASSWORD = ${ODOO_SESSION_REDIS_PASSWORD} -ODOO_SESSION_REDIS_URL = ${ODOO_SESSION_REDIS_URL} -ODOO_SESSION_REDIS_PREFIX = ${ODOO_SESSION_REDIS_PREFIX} -ODOO_SESSION_REDIS_EXPIRATION = ${ODOO_SESSION_REDIS_EXPIRATION} -ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = ${ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} \ No newline at end of file +#-------------# +# Redis # +#-------------# +ODOO_SESSION_REDIS=${SESSION_REDIS} +ODOO_SESSION_REDIS_HOST=${REDIS_HOST} +ODOO_SESSION_REDIS_PORT=${REDIS_PORT} +ODOO_SESSION_REDIS_PASSWORD=${REDIS_PASSWORD} +# ODOO_SESSION_REDIS_URL= +ODOO_SESSION_REDIS_PREFIX=${REDIS_PREFIX} +ODOO_SESSION_REDIS_EXPIRATION=${REDIS_EXPIRATION} +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS=${REDIS_EXPIRATION_ANONYMOUS} + +#-------------# +# PgAdmin # +#-------------# +# Container +PGADMIN_DATA=/var/lib/pgadmin + +PGADMIN_SERVERS_JSON=${PGADMIN_SERVERS_JSON} + +PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL} +PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD} + +PGADMIN_VIRTUAL_HOST=${PGADMIN_DOMAIN} +PGADMIN_LETSENCRYPT_HOST=${PGADMIN_DOMAIN} +PGADMIN_LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} + +# PgAdmin Configuration +PGADMIN_CONFIG_APP_NAME="'pgAdmin 4'" +PGADMIN_CONFIG_SERVER_MODE=${PGADMIN_CONFIG_SERVER_MODE} +PGADMIN_CONFIG_CONFIG_DATABASE_CONNECTION_POOL_SIZE=5 +PGADMIN_CONFIG_DEFAULT_SERVER="'127.0.0.1'" +PGADMIN_CONFIG_DEFAULT_SERVER_PORT=5050 +PGADMIN_CONFIG_MAX_SESSION_IDLE_TIME=120 +PGADMIN_CONFIG_CONFIG_DATABASE_URI=${PGADMIN_DB_HOST} + +# Password Settings +PGADMIN_CONFIG_PASSWORD_LENGTH_MIN=6 +PGADMIN_CONFIG_ALLOW_SAVE_PASSWORD=True +PGADMIN_CONFIG_ALLOW_SAVE_TUNNEL_PASSWORD=True +PGADMIN_CONFIG_MAX_LOGIN_ATTEMPTS=10 + +# Query History +PGADMIN_CONFIG_MAX_QUERY_HIST_STORED=20 + +# SMTP Server +PGADMIN_CONFIG_MAIL_SERVER="'localhost'" +PGADMIN_CONFIG_MAIL_PORT=25 +PGADMIN_CONFIG_MAIL_USE_SSL=False +PGADMIN_CONFIG_MAIL_USE_TLS=False +PGADMIN_CONFIG_MAIL_USERNAME="''" +PGADMIN_CONFIG_MAIL_PASSWORD="''" +PGADMIN_CONFIG_MAIL_DEBUG=False +PGADMIN_CONFIG_SECURITY_EMAIL_SENDER="'$PGADMIN_DEFAULT_EMAIL'" + +# Dynamic PgAdmin Servers +PGADMIN_DB1_NAME=Odoocker +PGADMIN_DB1_HOST=localhost +PGADMIN_DB1_PORT=5432 +PGADMIN_DB1_MAINTENANCE_DB=odoocker +PGADMIN_DB1_USERNAME=odoo +PGADMIN_DB1_TUNNEL_HOST=erp.odoocker.test +PGADMIN_DB1_TUNNEL_PORT=22 +PGADMIN_DB1_TUNNEL_USERNAME=ubuntu diff --git a/.gitignore b/.gitignore index d65093e..fbfe9ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Ignores the main configuration file. /.env +# Ignores the pgadmin private key +pgadmin/private_key + # Ignores the docker compose local or production environment. docker-compose.override.yml diff --git a/docker-compose.override.local.yml b/docker-compose.override.local.yml index 6c6c3d8..8a9c1a6 100644 --- a/docker-compose.override.local.yml +++ b/docker-compose.override.local.yml @@ -11,7 +11,7 @@ services: restart: 'no' ports: - 5432:5432 - + nginx: restart: 'no' diff --git a/docker-compose.pgadmin.yml b/docker-compose.pgadmin.yml index 2d55e15..7fccf84 100644 --- a/docker-compose.pgadmin.yml +++ b/docker-compose.pgadmin.yml @@ -1,7 +1,13 @@ services: pgadmin: - image: dpage/pgadmin4:${PGADMIN_TAG} - restart: unless-stopped + build: + context: ./ + dockerfile: ./pgadmin/Dockerfile + args: + - PGADMIN_TAG + depends_on: + - postgres + restart: 'no' expose: - 80 volumes: @@ -11,7 +17,27 @@ services: - PGADMIN_DEFAULT_PASSWORD - VIRTUAL_HOST=${PGADMIN_VIRTUAL_HOST} - LETSENCRYPT_HOST=${PGADMIN_LETSENCRYPT_HOST} - - LETSENCRYPT_EMAIL + - LETSENCRYPT_EMAIL=${PGADMIN_LETSENCRYPT_EMAIL} + - PGADMIN_CONFIG_APP_NAME + - PGADMIN_CONFIG_CONFIG_DATABASE_CONNECTION_POOL_SIZE + - PGADMIN_CONFIG_SERVER_MODE + - PGADMIN_CONFIG_DEFAULT_SERVER + - PGADMIN_CONFIG_DEFAULT_SERVER_PORT + - PGADMIN_CONFIG_PASSWORD_LENGTH_MIN + - PGADMIN_CONFIG_MAX_SESSION_IDLE_TIME + - PGADMIN_CONFIG_CONFIG_DATABASE_URI + - PGADMIN_CONFIG_ALLOW_SAVE_PASSWORD + - PGADMIN_CONFIG_MAX_QUERY_HIST_STORED + - PGADMIN_CONFIG_MAIL_SERVER + - PGADMIN_CONFIG_MAIL_PORT + - PGADMIN_CONFIG_MAIL_USE_SSL + - PGADMIN_CONFIG_MAIL_USE_TLS + - PGADMIN_CONFIG_MAIL_USERNAME + - PGADMIN_CONFIG_MAIL_PASSWORD + - PGADMIN_CONFIG_MAIL_DEBUG + - PGADMIN_CONFIG_SECURITY_EMAIL_SENDER + - PGADMIN_CONFIG_ALLOW_SAVE_TUNNEL_PASSWORD + - PGADMIN_CONFIG_MAX_LOGIN_ATTEMPTS networks: - internal diff --git a/docker-compose.yml b/docker-compose.yml index 3f9aec0..f11a09a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - GITHUB_USER - GITHUB_ACCESS_TOKEN - ENTERPRISE_ADDONS + - THIRD_PARTY_ADDONS - LOG_PATH depends_on: - postgres @@ -20,6 +21,7 @@ services: - ./odoo/custom-addons:${CUSTOM_ADDONS} - ./odoo/entrypoint.sh:/entrypoint.sh - ./odoo/odoorc.sh:/odoorc.sh + - ./odoo/third-party-addons.sh:/third-party-addons.sh env_file: - ./.env networks: @@ -27,12 +29,11 @@ services: postgres: build: - context: ./postgres - dockerfile: Dockerfile + context: ./ + dockerfile: ./postgres/Dockerfile args: - POSTGRES_TAG restart: unless-stopped - shm_size: 1GB tty: true volumes: - pg-data:${PGDATA} @@ -42,6 +43,12 @@ services: - POSTGRES_USER - POSTGRES_PASSWORD - PGDATA + - DB_USER + - DB_TEMPLATE + - UNACCENT_TEMPLATE + - PGADMING_DB_NAME + - PGADMING_DB_USER + - PGADMIN_DB_PASSWORD networks: - internal @@ -83,17 +90,16 @@ services: networks: - internal - keydb: + redis: image: eqalpha/keydb:latest - platform: linux/amd64 - shm_size: 1GB + platform: linux/amd64 + ports: + - 6379:6379 restart: unless-stopped networks: - internal - # command: keydb-server /etc/keydb/keydb.conf volumes: - #- ./keydb.conf:/etc/keydb/keydb.conf:ro - - cache-db-data:/var/lib/keydb + - redis-data:/var/lib/keydb volumes: data-dir: @@ -101,8 +107,7 @@ volumes: certs: vhost: html: - cache-db-data: - + redis-data: networks: internal: diff --git a/nginx/default.conf b/nginx/default.conf index dcd7604..8e3467f 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -23,7 +23,7 @@ server { location / { proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; proxy_pass http://odoo:8069; @@ -39,19 +39,12 @@ server { } } - location ~* /web/static/ { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host $host; - proxy_pass http://odoo:8069; - } - location /websocket { proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; + proxy_set_header Host $host; proxy_pass http://odoo:8072; } } diff --git a/odoo/Dockerfile b/odoo/Dockerfile index 2b7724a..225809e 100644 --- a/odoo/Dockerfile +++ b/odoo/Dockerfile @@ -14,6 +14,7 @@ ARG LOG_PATH ARG GITHUB_USER ARG GITHUB_ACCESS_TOKEN ARG ENTERPRISE_ADDONS +ARG THIRD_PARTY_ADDONS ARG ODOO_RC ENV ODOO_TAG=${ODOO_TAG} \ @@ -21,6 +22,7 @@ ENV ODOO_TAG=${ODOO_TAG} \ GITHUB_USER=${GITHUB_USER} \ GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN} \ ENTERPRISE_ADDONS=${ENTERPRISE_ADDONS} \ + THIRD_PARTY_ADDONS=${THIRD_PARTY_ADDONS} \ ODOO_RC=${ODOO_RC} #------------------------# @@ -55,6 +57,16 @@ RUN if [ -n "$GITHUB_USER" ] && [ -n "$GITHUB_ACCESS_TOKEN" ]; then \ git clone https://${GITHUB_USER}:${GITHUB_ACCESS_TOKEN}@github.com/odoo/enterprise.git ${ENTERPRISE_ADDONS} --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; \ fi +#-------------------------# +# Odoo Extra Addons # +#-------------------------# + +RUN mkdir -p ${THIRD_PARTY_ADDONS} && \ + chown odoo:odoo -R ${THIRD_PARTY_ADDONS} + +COPY --chown=odoo:odoo ./odoo/third-party-addons.sh / +RUN /third-party-addons.sh && chown odoo:odoo ${THIRD_PARTY_ADDONS} + #---------------------# # PIP Dependecies # #---------------------# @@ -64,7 +76,7 @@ RUN pip3 install --upgrade pip # Copy & Install PIP requirements COPY --chown=odoo:odoo ./odoo/requirements.txt /tmp/requirements.txt -RUN python3 -m pip install --upgrade -r /tmp/requirements.txt && \ +RUN python3 -m pip install -r /tmp/requirements.txt && \ rm /tmp/requirements.txt #---------------------# diff --git a/odoo/extra-addons/report_url/__manifest__.py b/odoo/extra-addons/odoocker_base/__manifest__.py similarity index 67% rename from odoo/extra-addons/report_url/__manifest__.py rename to odoo/extra-addons/odoocker_base/__manifest__.py index 061038e..4628660 100644 --- a/odoo/extra-addons/report_url/__manifest__.py +++ b/odoo/extra-addons/odoocker_base/__manifest__.py @@ -1,8 +1,8 @@ { - 'name': 'Report URL', - 'summary': 'Adds Report URL to Odoo Container', + 'name': 'Odoocker Base', + 'summary': 'Supercharge Odoo with Odoocker', 'description': ''' - Odoo Containers doesn't come with report.url param out of the box, so we add it for you to work with Odoocker. + Some Odoocker dependencies require to some custom values that we cover with this Addon for you. ''', 'version': '1.0.0', 'category': 'Technical', diff --git a/odoo/extra-addons/report_url/data/ir_config_parameter.xml b/odoo/extra-addons/odoocker_base/data/ir_config_parameter.xml similarity index 100% rename from odoo/extra-addons/report_url/data/ir_config_parameter.xml rename to odoo/extra-addons/odoocker_base/data/ir_config_parameter.xml diff --git a/odoo/__manifest__.example.py b/odoo/manifest.example.py similarity index 91% rename from odoo/__manifest__.example.py rename to odoo/manifest.example.py index d514518..edc1080 100644 --- a/odoo/__manifest__.example.py +++ b/odoo/manifest.example.py @@ -48,6 +48,11 @@ # ... other qweb templates ], 'assets': { + 'web.assets_frontend': [ + 'module_name/static/src/js/file.js', + 'module_name/static/src/css/style.css' + # ... other assets + ], 'web.assets_backend': [ 'module_name/static/src/js/file.js', 'module_name/static/src/css/style.css' diff --git a/odoo/odoo.example.conf b/odoo/odoo.example.conf index e935a0d..53affd4 100644 --- a/odoo/odoo.example.conf +++ b/odoo/odoo.example.conf @@ -64,9 +64,8 @@ xmlrpcs_interface = {XMLRPCS_INTERFACE} ; --xmlrpcs-port xmlrpcs_port = {XMLRPCS_PORT} -; --gevent-port | --longpolling_port (deprecated) +; --longpolling_port gevent_port = {GEVENT_PORT} -longpolling_port = False ; --no-http | --no-xmlrpc http_enable = {HTTP_ENABLE} @@ -215,7 +214,7 @@ dbfilter = {DBFILTER} ;------------------; ; Advanced options ; ;------------------; -; --dev (all, reload, qweb, werkzeug, sql, shell, assets, tests) +; --dev dev_mode = {DEV_MODE} ; --shell-interface @@ -260,22 +259,29 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} -;------------------------------------------; -; Options not exposed on the command line. ; -;------------------------------------------; -; --ODOO_SESSION_REDIS -ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} ;has to be 1 or true -; --ODOO_SESSION_REDIS_HOST -ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} ;is the redis hostname (default is localhost) -; --ODOO_SESSION_REDIS_PORT -ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} ;is the redis port (default is 6379) -; --ODOO_SESSION_REDIS_PASSWORD -ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} ;is the password for the AUTH command (optional) -; -- ODOO_SESSION_REDIS_URL -ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} ;is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. -; -- ODOO_SESSION_REDIS_PREFIX -ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} ;is the prefix for the session keys (optional) -; -- ODOO_SESSION_REDIS_EXPIRATION -ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} ;is the time in seconds before expiration of the sessions (default is 7 days) -; -- ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS -ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} ;the time in seconds before expiration of the anonymous sessions (default is 3 hours) +;-------------; +; Redis ; +;-------------; +; has to be 1 or true +ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} + +; is the redis hostname (default is localhost) +ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} + +; is the redis port (default is 6379) +ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} + +; is the password for the AUTH command (optional) +ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} + +; is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. +ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} + +; is the prefix for the session keys (optional) +ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} + +; is the time in seconds before expiration of the sessions (default is 7 days) +ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} + +; the time in seconds before expiration of the anonymous sessions (default is 3 hours) +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index 4358e4f..f14b7ba 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -100,6 +100,22 @@ defaults=( [LIMIT_TIME_REAL]=${LIMIT_TIME_REAL} [LIMIT_TIME_REAL_CRON]=${LIMIT_TIME_REAL_CRON} [LIMIT_REQUEST]=${LIMIT_REQUEST} + + [ODOO_SESSION_REDIS]=${ODOO_SESSION_REDIS} + [ODOO_SESSION_REDIS_HOST]=${ODOO_SESSION_REDIS_HOST} + [ODOO_SESSION_REDIS_PORT]=${ODOO_SESSION_REDIS_PORT} + [ODOO_SESSION_REDIS_PASSWORD]=${ODOO_SESSION_REDIS_PASSWORD} + [ODOO_SESSION_REDIS_URL]=${ODOO_SESSION_REDIS_URL} + [ODOO_SESSION_REDIS_PREFIX]=${ODOO_SESSION_REDIS_PREFIX} + [ODOO_SESSION_REDIS_EXPIRATION]=${ODOO_SESSION_REDIS_EXPIRATION} + [ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS]=${ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} + + [DISABLE_ATTACHMENT_STORAGE]=${DISABLE_ATTACHMENT_STORAGE} + [AWS_HOST]=${AWS_HOST} + [AWS_REGION]=${AWS_REGION} + [AWS_ACCESS_KEY_ID]=${AWS_ACCESS_KEY_ID} + [AWS_SECRET_ACCESS_KEY]=${AWS_SECRET_ACCESS_KEY} + [AWS_BUCKETNAME]=${AWS_BUCKETNAME} ) # Define the template @@ -172,7 +188,6 @@ xmlrpcs_port = {XMLRPCS_PORT} ; --gevent-port | --longpolling_port (deprecated) gevent_port = {GEVENT_PORT} -longpolling_port = False ; --no-http | --no-xmlrpc http_enable = {HTTP_ENABLE} @@ -365,6 +380,34 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} + +;-------------; +; Redis ; +;-------------; +; has to be 1 or true +ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} + +; is the redis hostname (default is localhost) +ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} + +; is the redis port (default is 6379) +ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} + +; is the password for the AUTH command (optional) +ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} + +; is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. +ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} + +; is the prefix for the session keys (optional) +ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} + +; is the time in seconds before expiration of the sessions (default is 7 days) +ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} + +; the time in seconds before expiration of the anonymous sessions (default is 3 hours) +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} + EOF ) diff --git a/odoo/requirements.txt b/odoo/requirements.txt index 066fba9..759b3e9 100644 --- a/odoo/requirements.txt +++ b/odoo/requirements.txt @@ -1,3 +1,3 @@ debugpy websocket-client -redis \ No newline at end of file +redis diff --git a/odoo/third-party-addons.sh b/odoo/third-party-addons.sh new file mode 100755 index 0000000..a5d82d9 --- /dev/null +++ b/odoo/third-party-addons.sh @@ -0,0 +1,2 @@ +git clone https://github.com/camptocamp/odoo-cloud-platform.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; +cp -r odoo-cloud-platform/session_redis ${THIRD_PARTY_ADDONS}/session_redis diff --git a/pgadmin/Dockerfile b/pgadmin/Dockerfile new file mode 100644 index 0000000..7ad3adc --- /dev/null +++ b/pgadmin/Dockerfile @@ -0,0 +1,32 @@ +#------------------------# +# PGAdmin Server # +#------------------------# +ARG PGADMIN_TAG +FROM dpage/pgadmin4:${PGADMIN_TAG} + +# Receive ARGs from docker-compose.yml & convert them into ENVs +ARG PGADMIN_DEFAULT_EMAIL + +ENV PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL} + +# Switch to root user +USER root + +# Install bash +RUN apk add --no-cache bash jq sqlite + +# Conditionally copy the private key if it exists +COPY --chown=pgadmin:root ./pgadmin/private_key /pgadmin4/private_key +# Set permissions for the private key + +# Copy your script file into the Docker image +COPY --chown=pgadmin:root ./.env / +COPY ./pgadmin/start_pgadmin.sh /var/lib/pgadmin/start_pgadmin.sh + +# Make the script executable +RUN chmod +x /var/lib/pgadmin/start_pgadmin.sh +# Run your script +RUN /var/lib/pgadmin/start_pgadmin.sh + +# Expose the necessary port +EXPOSE 80 diff --git a/pgadmin/start_pgadmin.sh b/pgadmin/start_pgadmin.sh new file mode 100755 index 0000000..3a0d7fe --- /dev/null +++ b/pgadmin/start_pgadmin.sh @@ -0,0 +1,89 @@ +#!/bin/bash + +set -e + +# Source environment variables +set -a +source /.env +set +a + +# Check if PGADMIN_DEFAULT_EMAIL is set +if [[ -z $PGADMIN_DEFAULT_EMAIL ]]; then + echo "PGADMIN_DEFAULT_EMAIL is not set. Exiting..." + exit 1 +fi + +# Modify the email to replace @ with _ +DIR_NAME="/var/lib/pgadmin/storage/${PGADMIN_DEFAULT_EMAIL//@/_}" + +# Create the directory using the modified name +mkdir -p "$DIR_NAME" + +cp /pgadmin4/private_key "$DIR_NAME/private_key" +chown -R pgadmin:root "$DIR_NAME/private_key" + +# Generate JSON for each matching variable +DB_PATH="/var/lib/pgadmin/pgadmin4.db" +json_output="{\"Servers\":{" +index=1 +while true; do + name_var="PGADMIN_DB${index}_NAME" + if [[ -z ${!name_var} ]]; then + break + fi + + host_var="PGADMIN_DB${index}_HOST" + port_var="PGADMIN_DB${index}_PORT" + maintenance_db_var="PGADMIN_DB${index}_MAINTENANCE_DB" + username_var="PGADMIN_DB${index}_USERNAME" + tunnel_host_var="PGADMIN_DB${index}_TUNNEL_HOST" + tunnel_port_var="PGADMIN_DB${index}_TUNNEL_PORT" + tunnel_username_var="PGADMIN_DB${index}_TUNNEL_USERNAME" + + json_output+="\"$index\":$(jq -n \ + --arg name "${!name_var}" \ + --arg host "${!host_var:-localhost}" \ + --arg port "${!port_var:-5432}" \ + --arg db "${!maintenance_db_var:-${!name_var}}" \ + --arg username "${!username_var:-odoo}" \ + --arg thost "${!tunnel_host_var}" \ + --arg tport "${!tunnel_port_var:-22}" \ + --arg tuser "${!tunnel_username_var:-ubuntu}" \ + '{ + "Name": $name, + "Group": "Servers", + "Host": $host, + "Port": $port|tonumber, + "MaintenanceDB": $db, + "Username": $username, + "UseSSHTunnel": 1, + "TunnelHost": $thost, + "TunnelPort": $tport, + "TunnelUsername": $tuser, + "TunnelAuthentication": 1, + "KerberosAuthentication": false, + "ConnectionParameters": { + "sslmode": "prefer", + "connect_timeout": 10, + "sslcert": "'"$DIR_NAME"'/.postgresql/postgresql.crt", + "sslkey": "'"$DIR_NAME"'/.postgresql/postgresql.key" + }, + "Shared": true + }')," + + index=$((index + 1)) +done + +# Remove trailing comma and close JSON braces +json_output=${json_output%,} +json_output+="}}" + +# Save the well-formatted JSON to a file using jq +if [[ $PGADMIN_SERVERS_JSON ]]; then + echo $json_output | jq '.' > "$PGADMIN_SERVERS_JSON" + + # Make the Servers.json file readable for all users + chmod 755 "/pgadmin4/servers.json" + + echo "JSON configuration saved to $DIR_NAME/servers.json" +fi diff --git a/postgres/Dockerfile b/postgres/Dockerfile index 94227e6..3eb39ed 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -8,8 +8,11 @@ FROM postgres:${POSTGRES_TAG} RUN apt-get update && apt-get install -y \ # Unaccent extension dependencies postgresql-contrib \ + apt-utils \ # Clean up the apt cache to reduce the image size && rm -rf /var/lib/apt/lists/* +COPY --chown=postgres:postgres ./.env / + # Copy the script to create the unaccent template -COPY ./entrypoint.sh /docker-entrypoint-initdb.d/entrypoint.sh +COPY ./postgres/entrypoint.sh /docker-entrypoint-initdb.d/entrypoint.sh diff --git a/postgres/entrypoint.sh b/postgres/entrypoint.sh index de38ff1..b232538 100755 --- a/postgres/entrypoint.sh +++ b/postgres/entrypoint.sh @@ -1,3 +1,32 @@ -psql -p 5432 -U odoo -d postgres -c "CREATE DATABASE unaccent_template WITH TEMPLATE = template0" -psql -p 5432 -U odoo -d postgres -c "\\c unaccent_template" -psql -p 5432 -U odoo -d postgres -c "CREATE EXTENSION IF NOT EXISTS unaccent;" +#!/bin/bash + +set -e + +# Source environment variables +set -a +source /.env +set +a + +# Create the $DB_TEMPLATE database +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE DATABASE $DB_TEMPLATE WITH TEMPLATE = template0;" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "\\c $DB_TEMPLATE;" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE EXTENSION IF NOT EXISTS unaccent;" + +# Create Odoo user and give proper privileges +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE USER $DB_USER WITH PASSWORD '$DB_PASSWORD';" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "ALTER USER $DB_USER CREATEDB;" + +# Give Odoo user access to copy $DB_TEMPLATE +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "GRANT ALL PRIVILEGES ON DATABASE $DB_TEMPLATE TO $DB_USER;" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $DB_TEMPLATE -c "ALTER DATABASE $DB_TEMPLATE OWNER TO $DB_USER;" + +# Create PgAdmin user and give proper privileges +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE DATABASE $PGADMING_DB_NAME;" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE USER $PGADMING_DB_USER WITH PASSWORD '$PGADMIN_DB_PASSWORD';" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "GRANT ALL PRIVILEGES ON DATABASE $PGADMING_DB_NAME TO $PGADMING_DB_USER;" +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $PGADMING_DB_NAME -c "GRANT ALL PRIVILEGES ON SCHEMA public TO $PGADMING_DB_USER;" + +# Revoke Odoo user's access to pgadmin database +psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "REVOKE CONNECT ON DATABASE $PGADMING_DB_NAME FROM $DB_USER;" + +echo "Setup completed." From 6176399594aba4d8f5b4638af0da7010d96a706e Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 13:43:49 -0500 Subject: [PATCH 04/11] changed volume names --- docker-compose.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f11a09a..cda6f9d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: - postgres tty: true volumes: - - data-dir:${DATA_DIR} + - odoo-data:${DATA_DIR} - ./odoo/extra-addons:${EXTRA_ADDONS} - ./odoo/custom-addons:${CUSTOM_ADDONS} - ./odoo/entrypoint.sh:/entrypoint.sh @@ -52,6 +52,17 @@ services: networks: - internal + redis: + image: eqalpha/keydb:latest + platform: linux/amd64 + ports: + - 6379:6379 + restart: unless-stopped + networks: + - internal + volumes: + - redis-data:/var/lib/keydb + nginx: image: nginx:${NGINX_TAG} depends_on: @@ -90,24 +101,13 @@ services: networks: - internal - redis: - image: eqalpha/keydb:latest - platform: linux/amd64 - ports: - - 6379:6379 - restart: unless-stopped - networks: - - internal - volumes: - - redis-data:/var/lib/keydb - volumes: - data-dir: + odoo-data: pg-data: + redis-data: certs: vhost: html: - redis-data: networks: internal: From 4255e2f1cc2bf7dfe2db7b4b226dacb231125c26 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 14:11:43 -0500 Subject: [PATCH 05/11] cleanup --- .env.example | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 749d956..44fceb6 100644 --- a/.env.example +++ b/.env.example @@ -4,11 +4,11 @@ # Odoo APP_ENV=local INIT= -UPDATE=custom_core +UPDATE= LOAD=base,web,session_redis WORKERS=2 DEV_MODE=reload,xml -DOMAIN=erp.j8c.test +DOMAIN=erp.odoocker.test # Enterprise GITHUB_USER= @@ -18,7 +18,7 @@ GITHUB_ACCESS_TOKEN= ADMIN_PASSWD=odoo DB_HOST=postgres DB_PORT=5432 -DB_NAME=j8c +DB_NAME=odoocker DB_USER=odoo DB_PASSWORD=odoo LOAD_LANGUAGE= @@ -36,7 +36,7 @@ LOG_LEVEL=info LOG_HANDLER_LEVEL=INFO # Nginx -CORS_ALLOWED_DOMAIN="'https://odoo.j8c.com.mx'" +CORS_ALLOWED_DOMAIN="'https://odoo.odoocker.com.mx'" # Testing TEST_ENABLE=False @@ -70,7 +70,7 @@ POSTGRES_MAIN_USER=postgres POSTGRES_MAIN_PASSWORD=${DB_PASSWORD} # PgAdmin -PGADMIN_DOMAIN=pgadmin.j8c.test +PGADMIN_DOMAIN=pgadmin.odoocker.test PGADMING_DB_NAME=pgadmin PGADMING_DB_USER=pgadmin PGADMIN_DB_PASSWORD=${DB_PASSWORD} @@ -86,7 +86,7 @@ PGADMIN_CONFIG_SERVER_MODE=True # Project Configurations # #------------------------------# # Docker -PROJECT_NAME=j8c +PROJECT_NAME=odoocker SUPPORT_EMAIL=contacto@juarezsoft.com.mx # Containers' Tags From cef72366c23368850d7a59c845c38e0f3cb1a610 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 14:24:42 -0500 Subject: [PATCH 06/11] cleanup --- .env.example | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.env.example b/.env.example index 44fceb6..b792f77 100644 --- a/.env.example +++ b/.env.example @@ -36,7 +36,7 @@ LOG_LEVEL=info LOG_HANDLER_LEVEL=INFO # Nginx -CORS_ALLOWED_DOMAIN="'https://odoo.odoocker.com.mx'" +CORS_ALLOWED_DOMAIN="'http://external-domain.test'" # Testing TEST_ENABLE=False @@ -52,6 +52,13 @@ SMTP_PASSWORD= EMAIL_FROM= FROM_FILTER= +# Postgres +POSTGRES_MAIN_HOST=${DB_HOST} +POSTGRES_MAIN_PORT=${DB_PORT} +POSTGRES_MAIN_DB=postgres +POSTGRES_MAIN_USER=postgres +POSTGRES_MAIN_PASSWORD=${DB_PASSWORD} + # Redis SESSION_REDIS=true REDIS_HOST=redis @@ -62,13 +69,6 @@ REDIS_PREFIX=odoo REDIS_EXPIRATION=604800 REDIS_EXPIRATION_ANONYMOUS=10800 -# Postgres -POSTGRES_MAIN_HOST=${DB_HOST} -POSTGRES_MAIN_PORT=${DB_PORT} -POSTGRES_MAIN_DB=postgres -POSTGRES_MAIN_USER=postgres -POSTGRES_MAIN_PASSWORD=${DB_PASSWORD} - # PgAdmin PGADMIN_DOMAIN=pgadmin.odoocker.test PGADMING_DB_NAME=pgadmin @@ -87,7 +87,7 @@ PGADMIN_CONFIG_SERVER_MODE=True #------------------------------# # Docker PROJECT_NAME=odoocker -SUPPORT_EMAIL=contacto@juarezsoft.com.mx +SUPPORT_EMAIL=mail@example.com # Containers' Tags ODOO_TAG=15.0 @@ -199,7 +199,7 @@ SHELL_INTERFACE=ptpython STOP_AFTER_INIT=False OSV_MEMORY_COUNT_LIMIT=False TRANSIENT_AGE_LIMIT=1.0 -MAX_CRON_THREADS=1 +MAX_CRON_THREADS=2 UNACCENT=${UNACCENT} GEOIP_DATABASE=/usr/share/GeoIP/GeoLite2-City.mmdb WORKERS=${WORKERS} @@ -260,7 +260,7 @@ ODOO_SESSION_REDIS=${SESSION_REDIS} ODOO_SESSION_REDIS_HOST=${REDIS_HOST} ODOO_SESSION_REDIS_PORT=${REDIS_PORT} ODOO_SESSION_REDIS_PASSWORD=${REDIS_PASSWORD} -# ODOO_SESSION_REDIS_URL= +ODOO_SESSION_REDIS_URL= ODOO_SESSION_REDIS_PREFIX=${REDIS_PREFIX} ODOO_SESSION_REDIS_EXPIRATION=${REDIS_EXPIRATION} ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS=${REDIS_EXPIRATION_ANONYMOUS} @@ -268,14 +268,10 @@ ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS=${REDIS_EXPIRATION_ANONYMOUS} #-------------# # PgAdmin # #-------------# -# Container +# Volume path PGADMIN_DATA=/var/lib/pgadmin -PGADMIN_SERVERS_JSON=${PGADMIN_SERVERS_JSON} - -PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL} -PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD} - +# Nginx Proxy Configuration PGADMIN_VIRTUAL_HOST=${PGADMIN_DOMAIN} PGADMIN_LETSENCRYPT_HOST=${PGADMIN_DOMAIN} PGADMIN_LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} @@ -283,22 +279,26 @@ PGADMIN_LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL} # PgAdmin Configuration PGADMIN_CONFIG_APP_NAME="'pgAdmin 4'" PGADMIN_CONFIG_SERVER_MODE=${PGADMIN_CONFIG_SERVER_MODE} -PGADMIN_CONFIG_CONFIG_DATABASE_CONNECTION_POOL_SIZE=5 PGADMIN_CONFIG_DEFAULT_SERVER="'127.0.0.1'" PGADMIN_CONFIG_DEFAULT_SERVER_PORT=5050 PGADMIN_CONFIG_MAX_SESSION_IDLE_TIME=120 -PGADMIN_CONFIG_CONFIG_DATABASE_URI=${PGADMIN_DB_HOST} - -# Password Settings +PGADMIN_CONFIG_MAX_QUERY_HIST_STORED=20 +# Security Settings PGADMIN_CONFIG_PASSWORD_LENGTH_MIN=6 PGADMIN_CONFIG_ALLOW_SAVE_PASSWORD=True PGADMIN_CONFIG_ALLOW_SAVE_TUNNEL_PASSWORD=True PGADMIN_CONFIG_MAX_LOGIN_ATTEMPTS=10 +# DB Configuration +PGADMIN_CONFIG_CONFIG_DATABASE_URI=${PGADMIN_DB_HOST} +PGADMIN_CONFIG_CONFIG_DATABASE_CONNECTION_POOL_SIZE=5 +# Load Shared Servers Configuration into DB +PGADMIN_SERVERS_JSON=${PGADMIN_SERVERS_JSON} -# Query History -PGADMIN_CONFIG_MAX_QUERY_HIST_STORED=20 +# Authentication +PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL} +PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD} -# SMTP Server +# PgAdmin SMTP Server PGADMIN_CONFIG_MAIL_SERVER="'localhost'" PGADMIN_CONFIG_MAIL_PORT=25 PGADMIN_CONFIG_MAIL_USE_SSL=False @@ -308,7 +308,7 @@ PGADMIN_CONFIG_MAIL_PASSWORD="''" PGADMIN_CONFIG_MAIL_DEBUG=False PGADMIN_CONFIG_SECURITY_EMAIL_SENDER="'$PGADMIN_DEFAULT_EMAIL'" -# Dynamic PgAdmin Servers +# Dynamic PgAdmin Servers (Add as many as you need following copying these variables like {DB1}, {DB2}, DB3) PGADMIN_DB1_NAME=Odoocker PGADMIN_DB1_HOST=localhost PGADMIN_DB1_PORT=5432 From 36a2d5d0ca47e50794602ccbbd3552a860f5a8bc Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 14:25:20 -0500 Subject: [PATCH 07/11] cleanup --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index b792f77..bbe829f 100644 --- a/.env.example +++ b/.env.example @@ -64,7 +64,7 @@ SESSION_REDIS=true REDIS_HOST=redis REDIS_PORT=6379 REDIS_PASSWORD= -# REDIS_URL= +REDIS_URL= REDIS_PREFIX=odoo REDIS_EXPIRATION=604800 REDIS_EXPIRATION_ANONYMOUS=10800 @@ -260,7 +260,7 @@ ODOO_SESSION_REDIS=${SESSION_REDIS} ODOO_SESSION_REDIS_HOST=${REDIS_HOST} ODOO_SESSION_REDIS_PORT=${REDIS_PORT} ODOO_SESSION_REDIS_PASSWORD=${REDIS_PASSWORD} -ODOO_SESSION_REDIS_URL= +ODOO_SESSION_REDIS_URL=${REDIS_URL} ODOO_SESSION_REDIS_PREFIX=${REDIS_PREFIX} ODOO_SESSION_REDIS_EXPIRATION=${REDIS_EXPIRATION} ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS=${REDIS_EXPIRATION_ANONYMOUS} From e6fa71769f60c78665a120c64f313276a693b976 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 14:26:18 -0500 Subject: [PATCH 08/11] cleanup --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index bbe829f..74e1cbe 100644 --- a/.env.example +++ b/.env.example @@ -76,8 +76,8 @@ PGADMING_DB_USER=pgadmin PGADMIN_DB_PASSWORD=${DB_PASSWORD} PGADMIN_DB_HOST="'postgresql://${PGADMING_DB_USER}:${PGADMIN_DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${PGADMING_DB_NAME}'" -PGADMIN_EMAIL=contacto@juarezsoft.com.mx -PGADMIN_PASSWORD=odoo +PGADMIN_EMAIL=pgadmin@example.com +PGADMIN_PASSWORD=pgadmin PGADMIN_SERVERS_JSON= PGADMIN_CONFIG_SERVER_MODE=True From 22c1be3e40bded7ceb643ce1c18849404ff2ff1b Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 14:36:18 -0500 Subject: [PATCH 09/11] cleanup --- .env.example | 4 ++-- odoo/odoo.example.conf | 22 +++++++++++----------- odoo/odoorc.sh | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.env.example b/.env.example index 74e1cbe..78b2152 100644 --- a/.env.example +++ b/.env.example @@ -90,7 +90,7 @@ PROJECT_NAME=odoocker SUPPORT_EMAIL=mail@example.com # Containers' Tags -ODOO_TAG=15.0 +ODOO_TAG=16.0 POSTGRES_TAG=16.0 NGINX_TAG=1.25.2 NGINX_PROXY_TAG=1.3.1 @@ -140,7 +140,7 @@ DEBUG_INTERFACE=${HTTP_INTERFACE} HTTP_PORT=8069 DEBUG_PORT=8070 XMLRPCS_PORT=8071 -LONGPOLLING_PORT=8072 +GEVENT_PORT=8072 HTTP_ENABLE=True XMLRPCS=True PROXY_MODE=True diff --git a/odoo/odoo.example.conf b/odoo/odoo.example.conf index 53affd4..bfea948 100644 --- a/odoo/odoo.example.conf +++ b/odoo/odoo.example.conf @@ -1,4 +1,4 @@ -[options] +options] ;------------------------------------------; ; Options not exposed on the command line. ; ;------------------------------------------; @@ -64,7 +64,7 @@ xmlrpcs_interface = {XMLRPCS_INTERFACE} ; --xmlrpcs-port xmlrpcs_port = {XMLRPCS_PORT} -; --longpolling_port +; --gevent-port | --longpolling_port (deprecated) gevent_port = {GEVENT_PORT} ; --no-http | --no-xmlrpc @@ -214,7 +214,7 @@ dbfilter = {DBFILTER} ;------------------; ; Advanced options ; ;------------------; -; --dev +; --dev (all, reload, xml, qweb, werkzeug, sql, shell, assets, tests) dev_mode = {DEV_MODE} ; --shell-interface @@ -262,26 +262,26 @@ limit_request = {LIMIT_REQUEST} ;-------------; ; Redis ; ;-------------; -; has to be 1 or true +; Possible values: 1 or true ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} -; is the redis hostname (default is localhost) +; Defaults to is localhost ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} -; is the redis port (default is 6379) +; Defaults to 6379 ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} -; is the password for the AUTH command (optional) +; Sets the password for the AUTH command (optional) ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} -; is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. +; Alternative way to define the Redis server address like rediss:// protocol. ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} -; is the prefix for the session keys (optional) +; Prefix for the session keys (optional) ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} -; is the time in seconds before expiration of the sessions (default is 7 days) +; Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} -; the time in seconds before expiration of the anonymous sessions (default is 3 hours) +; Time in seconds before expiration of the anonymous sessions (default is 3 hours) ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index f14b7ba..f14f03f 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -336,7 +336,7 @@ dbfilter = {DBFILTER} ;------------------; ; Advanced options ; ;------------------; -; --dev +; --dev (all, reload, xml, qweb, werkzeug, sql, shell, assets, tests) dev_mode = {DEV_MODE} ; --shell-interface @@ -384,25 +384,25 @@ limit_request = {LIMIT_REQUEST} ;-------------; ; Redis ; ;-------------; -; has to be 1 or true +; Possible values: 1 or true ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} -; is the redis hostname (default is localhost) +; Defaults to is localhost ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} -; is the redis port (default is 6379) +; Defaults to 6379 ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} -; is the password for the AUTH command (optional) +; Sets the password for the AUTH command (optional) ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} -; is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. +; Alternative way to define the Redis server address like rediss:// protocol. ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} -; is the prefix for the session keys (optional) +; Prefix for the session keys (optional) ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} -; is the time in seconds before expiration of the sessions (default is 7 days) +; Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} ; the time in seconds before expiration of the anonymous sessions (default is 3 hours) From ae92bbb36af5d52a1818e718052cdb4c4a2e0307 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 28 Sep 2023 14:38:50 -0500 Subject: [PATCH 10/11] cleanup --- odoo/odoorc.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index f14f03f..56a2477 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -109,13 +109,6 @@ defaults=( [ODOO_SESSION_REDIS_PREFIX]=${ODOO_SESSION_REDIS_PREFIX} [ODOO_SESSION_REDIS_EXPIRATION]=${ODOO_SESSION_REDIS_EXPIRATION} [ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS]=${ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} - - [DISABLE_ATTACHMENT_STORAGE]=${DISABLE_ATTACHMENT_STORAGE} - [AWS_HOST]=${AWS_HOST} - [AWS_REGION]=${AWS_REGION} - [AWS_ACCESS_KEY_ID]=${AWS_ACCESS_KEY_ID} - [AWS_SECRET_ACCESS_KEY]=${AWS_SECRET_ACCESS_KEY} - [AWS_BUCKETNAME]=${AWS_BUCKETNAME} ) # Define the template @@ -405,7 +398,7 @@ ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} ; Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} -; the time in seconds before expiration of the anonymous sessions (default is 3 hours) +; Time in seconds before expiration of the anonymous sessions (default is 3 hours) ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} EOF From a2219d371b3e2bb5b70c217a3710c99c442bfa64 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Sat, 30 Sep 2023 04:24:38 -0500 Subject: [PATCH 11/11] fixed nginx for websocket --- nginx/default.conf | 15 +++++++++------ odoo/odoo.example.conf | 20 ++++++++++++-------- odoo/odoorc.sh | 20 ++++++++++++-------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/nginx/default.conf b/nginx/default.conf index 8e3467f..3d17cb8 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -22,11 +22,12 @@ server { } location / { + proxy_pass http://odoo:8069; + proxy_redirect off; + proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host $host; - proxy_pass http://odoo:8069; # Add CORS headers add_header 'Access-Control-Allow-Origin' $CORS_ALLOWED_DOMAIN; @@ -40,11 +41,13 @@ server { } location /websocket { - proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://odoo:8072; + proxy_redirect off; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header Host $host; - proxy_pass http://odoo:8072; } } diff --git a/odoo/odoo.example.conf b/odoo/odoo.example.conf index bfea948..bca84c4 100644 --- a/odoo/odoo.example.conf +++ b/odoo/odoo.example.conf @@ -259,29 +259,33 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} +;-----------------------------; +; External Integrations ; +;-----------------------------; + ;-------------; ; Redis ; ;-------------; -; Possible values: 1 or true +; -- Possible values: 1 or true ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} -; Defaults to is localhost +; -- Defaults to is localhost ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} -; Defaults to 6379 +; -- Defaults to 6379 ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} -; Sets the password for the AUTH command (optional) +; -- Sets the password for the AUTH command (optional) ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} -; Alternative way to define the Redis server address like rediss:// protocol. +; -- Alternative way to define the Redis server address like rediss:// protocol. ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} -; Prefix for the session keys (optional) +; -- Prefix for the session keys (optional) ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} -; Time in seconds before expiration of the sessions (default is 7 days) +; -- Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} -; Time in seconds before expiration of the anonymous sessions (default is 3 hours) +; -- Time in seconds before expiration of the anonymous sessions (default is 3 hours) ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index 56a2477..db971c8 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -374,31 +374,35 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} +;-----------------------------; +; External Integrations ; +;-----------------------------; + ;-------------; ; Redis ; ;-------------; -; Possible values: 1 or true +; -- Possible values: 1 or true ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} -; Defaults to is localhost +; -- Defaults to is localhost ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} -; Defaults to 6379 +; -- Defaults to 6379 ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} -; Sets the password for the AUTH command (optional) +; -- Sets the password for the AUTH command (optional) ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} -; Alternative way to define the Redis server address like rediss:// protocol. +; -- Alternative way to define the Redis server address like rediss:// protocol. ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} -; Prefix for the session keys (optional) +; -- Prefix for the session keys (optional) ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} -; Time in seconds before expiration of the sessions (default is 7 days) +; -- Time in seconds before expiration of the sessions (default is 7 days) ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} -; Time in seconds before expiration of the anonymous sessions (default is 3 hours) +; -- Time in seconds before expiration of the anonymous sessions (default is 3 hours) ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} EOF