Skip to content

Commit

Permalink
Merge pull request #94 from coopdevs/feature/dbfilter_from_header
Browse files Browse the repository at this point in the history
Flag to enable dbfilter_from_header
  • Loading branch information
cesarlr authored Dec 11, 2020
2 parents 503fc98 + 8ab0d83 commit 6410c0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ odoo_role_enabled_rest_framework: false

# Support for Queue Job https://github.com/OCA/queue/blob/12.0/queue_job
odoo_role_enable_queue_job: false
# Support for Dbfilter From Header https://github.com/OCA/server-tools/tree/12.0/dbfilter_from_header
odoo_role_enable_dbfilter_from_header: false
8 changes: 6 additions & 2 deletions templates/odoo.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
logfile = {{ odoo_role_odoo_log_path }}/odoo.log
{% endif %}
log_level = {{ odoo_role_odoo_log_level }}
{% if odoo_role_enable_queue_job %}
{% if odoo_role_enable_queue_job and not odoo_role_enable_dbfilter_from_header %}
server_wide_modules = web,queue_job
{% elif not odoo_role_enable_queue_job and odoo_role_enable_dbfilter_from_header %}
server_wide_modules = web,dbfilter_from_header
{% elif odoo_role_enable_queue_job and odoo_role_enable_dbfilter_from_header %}
server_wide_modules = web,dbfilter_from_header,queue_job
{% endif %}
; Custom Modules
addons_path = {{ odoo_role_odoo_path }}/addons,{{ odoo_role_odoo_modules_path }}
Expand All @@ -17,7 +21,7 @@ admin_passwd = {{ odoo_role_odoo_db_admin_password }}
http_interface = {{ odoo_role_odoo_http_interface }}
proxy_mode = {{ odoo_role_odoo_proxy_mode }}

{% if ( odoo_role_odoo_dbs | count ) > 1 and odoo_role_dbfilter_enabled %}
{% if not odoo_role_enable_dbfilter_from_header and ( odoo_role_odoo_dbs | count ) > 1 and odoo_role_dbfilter_enabled %}
{# We found troubles filtering by %h. It implies creating databases with dots in the name,
and ansible resists to create dbs with such names, even though postgres suppports it #}
{#; Before login, use only the database that matches full domain of Host header
Expand Down

0 comments on commit 6410c0a

Please sign in to comment.