From b23acd5a1a36a9e30161202159d53efdab4b80f2 Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Tue, 10 Dec 2024 11:04:14 +0100 Subject: [PATCH 1/3] feat(nethcti-server): added new ENV to handle privacy numbers --- imageroot/actions/configure-module/20setenvs | 1 + imageroot/actions/configure-module/validate-input.json | 5 +++++ imageroot/actions/restore-module/20copyenv | 2 ++ nethcti-server/README.md | 1 + nethcti-server/entrypoint.sh | 2 +- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/imageroot/actions/configure-module/20setenvs b/imageroot/actions/configure-module/20setenvs index 8b5ad275f..ee5000ee8 100755 --- a/imageroot/actions/configure-module/20setenvs +++ b/imageroot/actions/configure-module/20setenvs @@ -38,6 +38,7 @@ getFromRequest(request, 'nethcti_cdr_script', 'NETHCTI_CDR_SCRIPT', '') getFromRequest(request, 'nethcti_cdr_script_timeout', 'NETHCTI_CDR_SCRIPT_TIMEOUT', '') getFromRequest(request, 'nethcti_cdr_script_call_in', 'NETHCTI_CDR_SCRIPT_CALL_IN', '') getFromRequest(request, 'nethcti_log_level', 'NETHCTI_LOG_LEVEL', 'warn') +getFromRequest(request, 'nethcti_privacy_numbers', 'NETHCTI_PRIVACY_NUMBERS', 'xxx') getFromRequest(request, 'conference_jitsi_url', 'CONFERENCE_JITSI_URL', 'https://jitsi.nethserver.net') getFromRequest(request, 'app_brand_id', 'BRAND_APPID', '') getFromRequest(request, 'timezone', 'TIMEZONE', 'UTC') diff --git a/imageroot/actions/configure-module/validate-input.json b/imageroot/actions/configure-module/validate-input.json index a67e727c0..0e089a083 100644 --- a/imageroot/actions/configure-module/validate-input.json +++ b/imageroot/actions/configure-module/validate-input.json @@ -21,6 +21,7 @@ } ], "nethcti_log_level": "info", + "nethcti_privacy_numbers": "xxx", "user_domain": "domain.ns8.local", "app_brand_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "reports_international_prefix": "0039" @@ -136,6 +137,10 @@ "warn" ] }, + "nethcti_privacy_numbers": { + "description": "Privacy number replace strings", + "type": "string" + }, "conference_jitsi_url": { "description": "Jitsi conference URL", "type": "string", diff --git a/imageroot/actions/restore-module/20copyenv b/imageroot/actions/restore-module/20copyenv index efb771dd6..82730b237 100755 --- a/imageroot/actions/restore-module/20copyenv +++ b/imageroot/actions/restore-module/20copyenv @@ -49,6 +49,7 @@ restore_envs = [ 'NETHCTI_JABBER_DOMAIN', 'NETHCTI_JABBER_URL', 'NETHCTI_LOG_LEVEL', + 'NETHCTI_PRIVACY_NUMBERS', 'NETHCTI_PREFIX', 'NETHCTI_TRUNKS_EVENTS', 'NETHCTI_UI_COMPANY_NAME', @@ -97,6 +98,7 @@ restore_envs = [ 'NETHCTI_CDR_SCRIPT_TIMEOUT', 'NETHCTI_CDR_SCRIPT_CALL_IN', 'NETHCTI_LOG_LEVEL', + 'NETHCTI_PRIVACY_NUMBERS', 'CONFERENCE_JITSI_URL', 'BRAND_APPID', 'NETHCTI_UI_PRODUCT_NAME', diff --git a/nethcti-server/README.md b/nethcti-server/README.md index affa56ea6..f311f13b4 100644 --- a/nethcti-server/README.md +++ b/nethcti-server/README.md @@ -26,6 +26,7 @@ NethCTI Server container for NethServer 8 - `NETHCTI_JABBER_DOMAIN` domain of the jabber server - `NETHCTI_JABBER_URL` url of the jabber server - `NETHCTI_LOG_LEVEL` log level of the server + - `NETHCTI_PRIVACY_NUMBERS` string replacement for server privacy numbers - `NETHCTI_PREFIX` telephone prefix - `NETHCTI_SERVER_API_PORT` port of the server api - `NETHCTI_SERVER_WS_PORT` port of the server websocket diff --git a/nethcti-server/entrypoint.sh b/nethcti-server/entrypoint.sh index e6ebbde68..cea6b9580 100755 --- a/nethcti-server/entrypoint.sh +++ b/nethcti-server/entrypoint.sh @@ -270,7 +270,7 @@ cat > $FILE < Date: Tue, 10 Dec 2024 17:30:26 +0100 Subject: [PATCH 2/3] feat(nethcti-server): added params in UI --- imageroot/actions/get-configuration/20read | 1 + ui/src/views/Settings.vue | 3 +++ 2 files changed, 4 insertions(+) diff --git a/imageroot/actions/get-configuration/20read b/imageroot/actions/get-configuration/20read index 2aa004119..369e3d861 100755 --- a/imageroot/actions/get-configuration/20read +++ b/imageroot/actions/get-configuration/20read @@ -20,6 +20,7 @@ config = { 'reports_international_prefix': os.getenv('REPORTS_INTERNATIONAL_PREFIX', ''), 'nethvoice_adm_username': os.getenv('NETHVOICE_USER_PORTAL_USERNAME', ''), 'nethvoice_adm_password': agent.read_envfile("passwords.env").get('NETHVOICE_USER_PORTAL_PASSWORD',""), + 'nethcti_privacy_numbers': os.getenv('NETHCTI_PRIVACY_NUMBERS', 'xxx'), } json.dump(config, fp=sys.stdout) diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index f91745824..db476db73 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -381,6 +381,7 @@ export default { rebranding_login_logo_dark_url: "", rebranding_login_people: false, nethvoice_adm: {}, + nethcti_privacy_numbers, }, isDarkMode: false, config: {}, @@ -548,6 +549,7 @@ export default { this.form.timezone = config.timezone; this.form.nethvoice_adm.username = config.nethvoice_adm_username; this.form.nethvoice_adm.password = config.nethvoice_adm_password; + this.form.nethcti_privacy_numbers = config.nethcti_privacy_numbers; this.focusElement("nethvoice_host"); }, @@ -789,6 +791,7 @@ export default { timezone: this.form.timezone, nethvoice_adm_username: this.form.nethvoice_adm.username, nethvoice_adm_password: this.form.nethvoice_adm.password, + nethcti_privacy_numbers: this.form.nethcti_privacy_numbers }, extra: { title: this.$t("settings.configure_instance", { From c542699171bec25042fc359ccd7364f705415fe2 Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Tue, 10 Dec 2024 17:41:09 +0100 Subject: [PATCH 3/3] fix: remove typo --- imageroot/actions/restore-module/20copyenv | 1 - 1 file changed, 1 deletion(-) diff --git a/imageroot/actions/restore-module/20copyenv b/imageroot/actions/restore-module/20copyenv index 82730b237..1a330811e 100755 --- a/imageroot/actions/restore-module/20copyenv +++ b/imageroot/actions/restore-module/20copyenv @@ -98,7 +98,6 @@ restore_envs = [ 'NETHCTI_CDR_SCRIPT_TIMEOUT', 'NETHCTI_CDR_SCRIPT_CALL_IN', 'NETHCTI_LOG_LEVEL', - 'NETHCTI_PRIVACY_NUMBERS', 'CONFERENCE_JITSI_URL', 'BRAND_APPID', 'NETHCTI_UI_PRODUCT_NAME',