mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
refactor(web-app-espocrm): improve config patching and container vars
- Replace `ESPOCRM_NAME` with `ESPOCRM_CONTAINER` for clarity and consistency. - Drop unused `ESPOCRM_CONFIG_FILE_PUBLIC`, rely only on `config-internal.php`. - Make DB credential patching idempotent using `grep` + `sed` checks. - Replace direct sed edits for maintenance/cron/cache with EspoCRM ConfigWriter. - Add fallback execution as root if www-data user cannot write config. - Clear EspoCRM cache only when config changes and in update mode. - Remove obsolete OIDC scopes inline task (now handled via env/vars). - Fix docker-compose template to use `ESPOCRM_CONTAINER`. This refactor makes the EspoCRM role more robust, idempotent, and aligned with EspoCRM’s official ConfigWriter mechanism. See conversation: https://chatgpt.com/share/68a87820-12f8-800f-90d6-01ba97a1b279
This commit is contained in:
@@ -13,9 +13,9 @@ vhost_flavour: "ws_generic"
|
||||
# Espocrm
|
||||
ESPOCRM_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.espocrm.version', True) }}"
|
||||
ESPOCRM_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.espocrm.image', True) }}"
|
||||
ESPOCRM_NAME: "{{ applications | get_app_conf(application_id, 'docker.services.espocrm.name', True) }}"
|
||||
ESPOCRM_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.espocrm.name', True) }}"
|
||||
ESPOCRM_VOLUME: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
|
||||
ESPOCRM_CONFIG_FILE_PRIVATE: "/var/www/html/data/config-internal.php"
|
||||
ESPOCRM_CONFIG_FILE_PUBLIC: "/var/www/html/data/config.php"
|
||||
ESPOCRM_URL: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
|
||||
ESPOCRM_OIDC_ENABLED: "{{ applications | get_app_conf(application_id, 'features.central_database', False) }}"
|
||||
ESPOCRM_OIDC_ENABLED: "{{ applications | get_app_conf(application_id, 'features.oidc', False) }}"
|
||||
ESPOCRM_USER: "www-data"
|
||||
|
Reference in New Issue
Block a user