fix(odoo) fix odoo configmap (#12691)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [X] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [X] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [X] ⬆️ I increased versions for any altered app according to semantic
versioning

**➕ App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Xstar97TheNoob
2023-09-23 01:45:08 +03:00
committed by GitHub
parent abf16ea643
commit e1172d630d
4 changed files with 75 additions and 158 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/odoo - https://github.com/truecharts/charts/tree/master/charts/incubator/odoo
- https://github.com/odoo/docker - https://github.com/odoo/docker
type: application type: application
version: 14.0.1 version: 14.0.2
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - media
+23 -97
View File
@@ -21,61 +21,31 @@ questions:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: admin - variable: additionalConf
label: Admin Credentials label: Additional File Configuration Options
description: |
Configure additional file configuration options for Odoo.</br>
Options are appended to the end of the configuration file.</br>
After the predefined configuration options.</br>
schema: schema:
additional_attrs: true type: list
type: dict default: []
attrs: items:
- variable: passwd - variable: conf
label: Admin Password label: Configuration Option
schema: schema:
type: string type: dict
required: true attrs:
private: true - variable: key
default: "" label: Key
- variable: smtp schema:
label: SMTP Configuration type: string
schema: required: true
additional_attrs: true - variable: value
type: dict label: Value
attrs: schema:
- variable: server type: string
label: Server required: true
schema:
type: string
default: ""
- variable: port
label: Port
schema:
type: int
default: 587
- variable: user
label: User
schema:
type: string
default: ""
- variable: password
label: Password
schema:
type: string
private: true
default: ""
- variable: from
label: Email From
schema:
type: string
default: ""
- variable: ssl
label: SSL
schema:
type: string
default: "False"
enum:
- value: "False"
description: "False"
- value: "True"
description: "True"
# Include{containerConfig} # Include{containerConfig}
# Include{podOptions} # Include{podOptions}
@@ -96,50 +66,6 @@ questions:
type: int type: int
default: 8069 default: 8069
required: true required: true
- variable: xmlrpcs
label: "XMLR PCS Service"
description: "XMLR PCS Service"
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: xmlrpcs
label: "XMLR PCS Service Port Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 8071
required: true
- variable: longpolling
label: "Long Polling Service"
description: "Long Polling Service"
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: longpolling
label: "Long Polling Service Port Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 8072
required: true
# Include{serviceExpertRoot} # Include{serviceExpertRoot}
# Include{serviceExpert} # Include{serviceExpert}
# Include{serviceList} # Include{serviceList}
+34 -34
View File
@@ -5,48 +5,48 @@
{{- $admin := .Values.odoo.admin -}} {{- $admin := .Values.odoo.admin -}}
{{- $smtp := .Values.odoo.smtp -}} {{- $smtp := .Values.odoo.smtp -}}
{{- $mainPort := .Values.service.main.ports.main.port -}}
{{- $odooPath := .Values.persistence.odoo.mountPath -}}
{{- $addonsPath := .Values.persistence.addons.mountPath -}}
{{- $pgdb := .Values.cnpg.main.database -}} {{- $pgdb := .Values.cnpg.main.database -}}
{{- $pguser := .Values.cnpg.main.user -}} {{- $pguser := .Values.cnpg.main.user -}}
{{- $pgpassword := .Values.cnpg.main.creds.password | trimAll "\"" -}} {{- $pgpassword := .Values.cnpg.main.creds.password | trimAll "\"" -}}
{{- $pghost := .Values.cnpg.main.creds.host -}} {{- $pghost := .Values.cnpg.main.creds.host -}}
{{/* xmlrpc* keys are deprecated and http* keys are used in their place */}}
{{- $reservedKeys := (list "data_dir" "addons_path" "http_enable" "http_interface"
"http_port" "xmlrpc" "xmlrpc_port" "xmlrpc_interface"
"db_port" "db_host" "db_name" "db_user" "db_sslmode"
"db_password") -}}
{{- $userKeys := list -}}
odoo-config: odoo-config:
enabled: true enabled: true
data: data:
odoo.conf: | odoo.conf: |
[options] [options]
addons_path = {{ .Values.persistence.addons.mountPath }} ; Paths
data_dir = {{ .Values.persistence.odoo.mountPath }} data_dir = {{ $odooPath }}
admin_passwd = {{ $admin.passwd }} addons_path = {{ $addonsPath }}
longpolling_port = {{ .Values.service.longpolling.ports.longpolling.port }} ; Network Details
xmlrpc = True http_enable = True
xmlrpc_interface = http_port = {{ $mainPort }}
xmlrpc_port = {{ .Values.service.main.ports.main.port }} ; Database Details
xmlrpcs = True db_port = 5432
xmlrpcs_interface = db_host = {{ $pghost }}
xmlrpcs_port = {{ .Values.service.xmlrpcs.ports.xmlrpcs.port }} db_name = {{ $pgdb }}
csv_internal_sep = , db_user = {{ $pguser }}
db_maxconn = 64 db_sslmode = disable
debug_mode = False db_password = {{ $pgpassword }}
limit_memory_hard = 2684354560 {{- range $opt := .Values.odoo.additionalConf -}}
limit_memory_soft = 2147483648 {{- if (mustHas $opt.key $reservedKeys) -}}
limit_request = 8192 {{- fail (printf "Odoo - Key [%v] is not allowed to be modified") -}}
limit_time_cpu = 60 {{- end -}}
limit_time_real = 120 {{- $userKeys = mustAppend $userKeys $opt.key -}}
list_db = True {{- printf "%s = %s" $opt.key $opt.value | nindent 8 -}}
log_db = False {{- end -}}
log_handler = [':INFO'] {{- if not (deepEqual $userKeys (uniq $userKeys)) -}}
log_level = info {{- fail (printf "Odoo - Additional configuration keys must be unique, but got [%v]" (join ", " $userKeys)) -}}
logfile = None {{- end -}}
max_cron_threads = 2
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
smtp_server = {{ $smtp.server }}
smtp_port = {{ $smtp.port }}
smtp_user = {{ $smtp.user }}
smtp_password = {{ $smtp.password }}
smtp_ssl = {{ $smtp.ssl }}
email_from = {{ $smtp.from }}
workers = 0
{{- end -}} {{- end -}}
+17 -26
View File
@@ -8,35 +8,28 @@ service:
ports: ports:
main: main:
port: 8069 port: 8069
xmlrpcs:
enabled: true
ports:
xmlrpcs:
enabled: true
port: 8071
longpolling:
enabled: true
ports:
longpolling:
enabled: true
port: 8072
odoo: odoo:
admin: additionalConf: []
passwd: admin
smtp:
server: ""
port: 587
user: ""
password: ""
ssl: "False"
from: ""
workload: workload:
main: main:
podSpec: podSpec:
containers: containers:
main: main:
probes:
liveness:
enabled: true
type: http
path: /web/health
readiness:
enabled: true
type: http
path: /web/health
startup:
enabled: true
type: http
path: /web/health
env: env:
USER: "{{ .Values.cnpg.main.user }}" USER: "{{ .Values.cnpg.main.user }}"
PORT: 5432 PORT: 5432
@@ -60,11 +53,9 @@ persistence:
enabled: true enabled: true
type: configmap type: configmap
objectName: odoo-config objectName: odoo-config
targetSelector: mountPath: /etc/odoo/odoo.conf
main: subPath: odoo.conf
main: readOnly: true
mountPath: /etc/odoo/odoo.conf
subPath: odoo.conf
# Enabled postgres # Enabled postgres
cnpg: cnpg: