Commit Graph

39 Commits

Author SHA1 Message Date
DL6ER 4bfe4a4fde Do not warn about query status 12 and 13 on import (retried queries)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-30 19:27:01 +01:00
DL6ER 6f6ae518d2 Merge branch 'development' into new/super-clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-15 08:47:44 +01:00
DL6ER 7b0ab09b74 Make FTL upstream destination port-aware
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-13 00:16:55 +01:00
DL6ER 036031e0ec Open database for history-reading
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-28 23:26:36 +02:00
DL6ER b7fe809467 Reopening the FTL database may lead to rare race-collisions in SQLite3. We avoid them by keeping the database connection open all the time.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-27 23:35:44 +02:00
DL6ER 196fca38ff Merge branch 'development' into new/super-clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-21 23:28:57 +02:00
DL6ER 3bb0fe98be Fix subdirectory include paths. This is only to be explicit, the relative search finds them otherwise as well
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-03 20:46:01 +02:00
DL6ER 2d90c17767 Merge branch 'development' into new/super-clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-31 19:05:59 +02:00
DL6ER d55d5b14bb Explicitly case time_t to (long long) before printing to address the musl-decision to make time_t 64 bit on 32 bit machines
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-12 22:03:24 +02:00
DL6ER 69c1181085 Change concept of super-clients from MAC-based to index-based. We append a new column to the network table which can be used to assign super-clients to multiple devices. This can both cover automatic grouping (whenever MAC addresses are available) and also situations where this is not possible (when MAC addresses are not available, e.g., due to network layer separation). Real-time signal 3 causes FTL to re-import super-clients from the database without affecting anything else.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-12 19:34:56 +02:00
DL6ER b422beb82a Implement client-based Query Log filtering for super-clients and ensure we always count both the normal and the super-client when there is a new query / garbage collection
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-11 21:13:36 +02:00
DL6ER 3a4d8e2e0d Add ;querytype=AAAA option
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:43:02 +02:00
DL6ER 8ee044d130 Do not try to bind a value when we should actually read one. This glitch was harmless, however, it prevented regex ID from being loaded from the database.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-03 19:34:47 +02:00
DL6ER 5f4582e436 Merge pull request #832 from pi-hole/new/cname_inspection_logging
Add logging for CNAME inspection
2020-07-23 06:19:17 +02:00
DL6ER 42e9ccc489 Store + import ID of regex used for blocking in additional_info field
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-14 18:56:35 +02:00
DL6ER e661bd5389 Load domain causing the blocking in a CNAME inspection from the database during import. This ensures restarting FTL does not mean we lost this information.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-13 23:12:47 +02:00
DL6ER 08b00d2b05 Add additional_info column to queries table. We fill it with the domain that caused blocking the entire CNAME chain.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-13 21:18:44 +02:00
DL6ER ee578627a9 Remove privacy level 4. Systems currently running level 4 will automatically pick up the highest available level (which is now 3). Also tidy up enums into a dedicated file.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-08 23:48:05 +02:00
DL6ER abe0c5bbab Merge branch 'release/v5.0' into tweak/sqlite_debugging
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-29 21:07:46 +00:00
DL6ER 2244adedb8 Inform user if queries are being hold in memory for later saving (due to database being locked).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-24 13:34:16 +01:00
DL6ER 80fbd889f9 Replace sqlite3_errmsg() by sqlite3_errstr() everywhere to ensure we always catch the right error.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-24 10:52:01 +01:00
DL6ER af8ab3ef2f Large-scale overhaul for the long-term database handling.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-24 10:44:27 +01:00
DL6ER 302dbaed84 Use IMMEDIATE transaction when adding to the database. This ensures we do not even try to collect queries when we cannot write to the database.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-23 16:15:29 +01:00
DL6ER 0be640e1e8 Clarify that busy timeout is not an error, just a warning.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-23 16:09:04 +01:00
DL6ER 2317c8998f Add all clients FTL knowns about to the network table. This requires a yet to be done modification to the web interface to hide the mock hardware addresses we generate for these devices.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-07 11:00:12 +01:00
DL6ER 1344c91d12 Merge pull request #697 from pi-hole/fix/incorrect_db_warning
Fix incorrect database warnings
2020-02-21 19:12:40 +01:00
DL6ER 0554597223 Fix incorrect database warning when imporint new CNAME blocked queries.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-02-20 21:54:06 +01:00
DL6ER 620daa7ee6 Remove UNKNOWN DNSSEC status and import queries with UNSPECIFIED DNSSEC status (this will not cause a text to be shown on the Query Log). We do not use the UNKNOWN status anywhere else, so we can now get rid of it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-02-20 19:33:46 +01:00
DL6ER 7ca81e3d59 Merge pull request #685 from pi-hole/new/CNAME_inspection_details
Improvements to deep CNAME inspection data processing
2020-02-12 19:36:36 +01:00
DL6ER acdd2253e6 Finish renaming "forward destionations" to "upstreams".
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-02-11 10:09:02 +01:00
DL6ER c32d790eba Rename "forwarded" counter to "upstreams" to avoid confusion in the future. We used sed to ensure to have caught every reference.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-02-11 09:35:07 +01:00
DL6ER 122a701f16 Add new CNAME-specific blocking modes [QUERY_GRAVITY_CNAME, QUERY_REGEX_CNAME, QUERY_BLACKLIST_CNAME] and store domain that was the reason for blocking during a CNAME inspection
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-29 21:58:58 +00:00
DL6ER 8752400609 Ensure domains encountered while following CNAME paths are not double-counted.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-25 13:44:23 +01:00
Mcat12 c07be92210 Remove dbquery macro in favor of just using the function
This avoids unused return value warnings.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-21 12:57:56 -07:00
DL6ER 812743c687 The boolean database should not be set to true at the end of delete_old_queries_in_DB(). The function can in any way not be called when database == false as this is an exit criterion for the database thread.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-07 09:48:41 +02:00
DL6ER 8280f454a8 Change type of get_FTL_db_filesize() from double to long int.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-05 12:05:32 +02:00
DL6ER 104ea1b86a Move database thread into dedicated module.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-04 16:52:17 +02:00
DL6ER a2961d14a4 Merge branch 'development' into new/modularize_headers
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-04 12:21:51 +02:00
DL6ER e365364f72 Move all source files into new subdirectory "src". Put compiled objects into new subdirectory "build".
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-02 00:18:56 +02:00