DL6ER
|
5d54d3412c
|
Compute average response times for used upstream destinations.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:42:18 +02:00 |
|
DL6ER
|
6a4040e8a5
|
Minor optimizations to domain list handling routines (reading, adding, and removing)
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:17 +02:00 |
|
DL6ER
|
5bdf2b96cc
|
Fix forwarded queries counting logic quirk.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:17 +02:00 |
|
DL6ER
|
4dacd1c759
|
Make JSON string macros robust against being called with NULL strings.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
ef5cfe0a17
|
Add /api/stats/database/upstreams
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
a7500f1d58
|
Add /api/stats/database/query_types
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
cb8131d9ac
|
Add /api/stats/database/overTime/clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
7c97cb6631
|
Add /api/stats/database/summary
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
76b72bf1b7
|
Add /api/stats/database/top_clients by generalizing the top-domains into a top-items function that can process both.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
429622d8e9
|
Add /api/stats/database/top_domains and /api/stats/database/top_blocked
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
4516ee5186
|
Relock shared memory before returning an error message.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
f2412873b8
|
Add /admin/api/stats/database/overTime/history - this allows users to select a different time interval on the dash board than only "last 24 hours".
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:37:16 +02:00 |
|
DL6ER
|
0f7ead8663
|
A few output optimizations for /api/dns/cacheinfo
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:36:13 +02:00 |
|
DL6ER
|
6871dbdd04
|
Add /api/dns/cacheinfo
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:36:13 +02:00 |
|
DL6ER
|
091e656de8
|
Only walk known IP addresses when SELECT query succeeded
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:34:23 +02:00 |
|
DL6ER
|
9d24bae8be
|
Add /api/ftl/network
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:34:23 +02:00 |
|
DL6ER
|
46c622f256
|
Keep up to 64 lines of dnsmasq messages in the FIFO buffer.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:34:23 +02:00 |
|
DL6ER
|
a6a7b9712e
|
Add API_PRETTY_JSON config option as run-time (instead of compile-time) option for human-friendy API output.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:34:23 +02:00 |
|
DL6ER
|
fdce5481f9
|
Send all details we have about a domain (excluding the database ID, because we don't need it). See PR web#440 for the necessary changes in NG web.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:34:23 +02:00 |
|
DL6ER
|
6bf7fb782e
|
Read directly from domainlist table instead of using the views. This allows us to read also disabled domains plus to get all the corresponding data: date_added, date_modified, comment, enabled. They are now available in FTL, however the JSON format expected by the web interface needs to be changed to be able to send this information over.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:34:23 +02:00 |
|
DL6ER
|
257fcbf695
|
Implement transition from individual domain lists into a unified domainlist (see core PR #3015).
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:31:54 +02:00 |
|
DL6ER
|
5d03136e39
|
Send 200 queries for the query log at once. With this, the clients will always have some pages of the table in their cache.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
c639cf9b6d
|
Actively free expired user sessions to make room for new ones.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
c38285461f
|
Automatically log in users when there is no (or an empty) password set in setupVars.conf
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
c389f06944
|
Make HTTP/API session timeout configurable through pihole-FTL.conf
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
8742e140c0
|
Update user cookie when session is still running.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
76bcef3771
|
Update timestamp of known client when we see them again.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
41a1da65cd
|
Refresh in-memory index.html on receipt of SIGHUP. This allows replacing the content of /admin without having to restart FTL.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
8ce1ac146e
|
/api/stats/history: Only use cursor when it is a numeric value, skip if "null".
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
5d61a0c22e
|
Add NULL cursor in history result when privacy level is too high.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
b9857664f5
|
Lock SHM during API access.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
2d8d706478
|
Lock SHM during FIFO buffer activity.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
149572c1a9
|
Move FIFO buffer into shared memory to ensure all spawned TCP children can add entries to it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:28:30 +02:00 |
|
DL6ER
|
a8eb1889ea
|
Remove unused variable.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:55 +02:00 |
|
DL6ER
|
9f8152e393
|
Don't send ID field, it is not neded by the client. And even if it would be, it could easily be computed from nextID.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:55 +02:00 |
|
DL6ER
|
f2aa1d25fb
|
Code around known gcc-arm bug.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:55 +02:00 |
|
DL6ER
|
bdbad7ef0c
|
Send correct frames if FIFO is not yet completely filled.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:55 +02:00 |
|
DL6ER
|
12434192b8
|
Do not send unused slots from the FIFO buffer.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:55 +02:00 |
|
DL6ER
|
2a07c992ab
|
Add option for whether authentication is needed for localhost requests. Defaults to false. (API_AUTH_FOR_LOCALHOST)
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:55 +02:00 |
|
DL6ER
|
e4c7cec349
|
Add FIFO buffer endpoint at /admin/api/ftl/dnsmasq_log. This is a FIFO buffer collecting and returning up to 32 messages from memory (compile-time option). The API endpoint can be continuously polled with the last returned ID to only show new messages that can be appended to a log on the web interface.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
637558f5aa
|
Rename send_http_error() to send_http_internal_error().
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
59025029de
|
Remove dead function http_send().
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
638ab2f933
|
Ensure minimum required data is sent by the API even when privacy levels are applied. Sending simply empty responses violates the expectations of the NG web interface.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
d59ac986d8
|
Improve additional headers as suggested by a security checker site.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
b6bf9bee20
|
Add Content-Security-Policy header to resolve CPS issues seen in Firefox when hosted on a machine different than localhost. The critical part is 'unsafe-inline' which is necessary for the inline Javascript found in index.html.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
b8ec63bf7e
|
Directly return without buffering in the API handler.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
440e4aaa84
|
Send JSON 404 error if an undefined path has been requested insode /api/... Elsewhere in the web interface we still send the usual 404 page.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
07285934cd
|
Add more convenience functions and return 400 Bad Request responses when invalid parameters are given to the /api/stats endpoints.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
fd96e3693f
|
Remove deprecated feature to return forward destinations without sorting. This was never offered for any other type of data so it is mroe consistent to completely remove it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:26:54 +02:00 |
|
DL6ER
|
5bb6a8e82d
|
Add send_json_success() as yet another short convenience function.
Signed-off-by: DL6ER <dl6er@dl6er.de>
|
2020-05-27 00:24:20 +02:00 |
|