diff --git a/src/config/config.c b/src/config/config.c index 83747c031..a0452c57d 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -956,14 +956,14 @@ void initConfig(struct config *conf) conf->webserver.api.app_pwhash.d.s = (char*)""; conf->webserver.api.excludeClients.k = "webserver.api.excludeClients"; - conf->webserver.api.excludeClients.h = "Array of clients to be excluded from certain API responses (regex):\n - Query Log (/api/queries)\n - Top Clients (/api/stats/top_clients)\n Note that backslashes \"\\\" need to be escaped, i.e. \"\\\\\" in this setting\n Example: [ \"(^|\\\\.)\\\\.google\\\\.de$\", \"\\\\.pi-hole\\\\.net$\" ]\n\n Example: [ \"192.168.2.56\", \"fe80::341\", \"localhost\" ]"; - conf->webserver.api.excludeClients.a = cJSON_CreateStringReference("array of IP addresses and/or hostnames"); + conf->webserver.api.excludeClients.h = "Array of clients to be excluded from certain API responses (regex):\n - Query Log (/api/queries)\n - Top Clients (/api/stats/top_clients)\n This setting accepts both IP addresses (IPv4 and IPv6) as well as hostnames.\n Note that backslashes \"\\\" need to be escaped, i.e. \"\\\\\" in this setting\n\n Example: [ \"^192\\\\.168\\\\.2\\\\.56$\", \"^fe80::341:[0-9a-f]*$\", \"^localhost$\" ]"; + conf->webserver.api.excludeClients.a = cJSON_CreateStringReference("array of regular expressions describing clients"); conf->webserver.api.excludeClients.t = CONF_JSON_STRING_ARRAY; conf->webserver.api.excludeClients.d.json = cJSON_CreateArray(); conf->webserver.api.excludeDomains.k = "webserver.api.excludeDomains"; - conf->webserver.api.excludeDomains.h = "Array of domains to be excluded from certain API responses (regex):\n - Query Log (/api/queries)\n - Top Clients (/api/stats/top_domains)\n Note that backslashes \"\\\" need to be escaped, i.e. \"\\\\\" in this setting\n Example: [ \"(^|\\\\.)\\\\.google\\\\.de$\", \"\\\\.pi-hole\\\\.net$\" ]\n\n Example: [ \"google.de\", \"pi-hole.net\" ]"; - conf->webserver.api.excludeDomains.a = cJSON_CreateStringReference("array of domains"); + conf->webserver.api.excludeDomains.h = "Array of domains to be excluded from certain API responses (regex):\n - Query Log (/api/queries)\n - Top Clients (/api/stats/top_domains)\n Note that backslashes \"\\\" need to be escaped, i.e. \"\\\\\" in this setting\n\n Example: [ \"(^|\\\\.)\\\\.google\\\\.de$\", \"\\\\.pi-hole\\\\.net$\" ]"; + conf->webserver.api.excludeDomains.a = cJSON_CreateStringReference("array of regular expressions describing domains"); conf->webserver.api.excludeDomains.t = CONF_JSON_STRING_ARRAY; conf->webserver.api.excludeDomains.d.json = cJSON_CreateArray(); diff --git a/test/pihole.toml b/test/pihole.toml index 2a595d11e..25793c943 100644 --- a/test/pihole.toml +++ b/test/pihole.toml @@ -673,24 +673,29 @@ # app_pwhash = "" - # Array of clients to be excluded from certain API responses: + # Array of clients to be excluded from certain API responses (regex): # - Query Log (/api/queries) # - Top Clients (/api/stats/top_clients) - # Example: [ "192.168.2.56", "fe80::341", "localhost" ] + # This setting accepts both IP addresses (IPv4 and IPv6) as well as hostnames. + # Note that backslashes "\" need to be escaped, i.e. "\\" in this setting + # + # Example: [ "^192\\.168\\.2\\.56$", "^fe80::341:[0-9a-f]*$", "^localhost$" ] # # Possible values are: - # array of IP addresses and/or hostnames + # array of regular expressions describing clients excludeClients = [ - "1.2.3.4" + "^1\\.2\\.3\\.4$" ] ### CHANGED, default = [] - # Array of domains to be excluded from certain API responses: + # Array of domains to be excluded from certain API responses (regex): # - Query Log (/api/queries) # - Top Clients (/api/stats/top_domains) - # Example: [ "google.de", "pi-hole.net" ] + # Note that backslashes "\" need to be escaped, i.e. "\\" in this setting + # + # Example: [ "(^|\\.)\\.google\\.de$", "\\.pi-hole\\.net$" ] # # Possible values are: - # array of domains + # array of regular expressions describing domains excludeDomains = [] # How much history should be imported from the database [seconds]? (max 24*60*60 =