fix(sys-ctl-hlth-csp): ensure '--' separator is added when passing ignore list to checkcsp

Updated README to reflect correct usage with '--', adjusted script.py to always append separator, and simplified task template handling for consistency.

Ref: https://chatgpt.com/share/68dfc69b-7c94-800f-871b-3525deb8e374
This commit is contained in:
2025-10-03 20:50:49 +02:00
parent 59b652958f
commit 4d9890406e
3 changed files with 2 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ HEALTH_CSP_IGNORE_NETWORK_BLOCKS_FROM:
This will run the CSP checker with: This will run the CSP checker with:
```bash ```bash
checkcsp start --short --ignore-network-blocks-from pxscdn.com cdn.example.org <domains...> checkcsp start --short --ignore-network-blocks-from pxscdn.com -- cdn.example.org <domains...>
``` ```
### Systemd Integration ### Systemd Integration

View File

@@ -31,6 +31,7 @@ def run_checkcsp(domains, ignore_network_blocks_from):
if ignore_network_blocks_from: if ignore_network_blocks_from:
cmd.append("--ignore-network-blocks-from") cmd.append("--ignore-network-blocks-from")
cmd.extend(ignore_network_blocks_from) cmd.extend(ignore_network_blocks_from)
cmd.append("--")
cmd += domains cmd += domains

View File

@@ -21,8 +21,6 @@
system_service_tpl_exec_start: >- system_service_tpl_exec_start: >-
{{ system_service_script_exec }} {{ system_service_script_exec }}
--nginx-config-dir={{ NGINX.DIRECTORIES.HTTP.SERVERS }} --nginx-config-dir={{ NGINX.DIRECTORIES.HTTP.SERVERS }}
{%- if HEALTH_CSP_IGNORE_NETWORK_BLOCKS_FROM | length > 0 -%}
--ignore-network-blocks-from {{ HEALTH_CSP_IGNORE_NETWORK_BLOCKS_FROM | join(' ') }} --ignore-network-blocks-from {{ HEALTH_CSP_IGNORE_NETWORK_BLOCKS_FROM | join(' ') }}
{%- endif -%}
- include_tasks: utils/run_once.yml - include_tasks: utils/run_once.yml