Commit Graph

2898 Commits

Author SHA1 Message Date
DL6ER
965f2083a6 Remove special handling for audited domains and just add them separately to both lists.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 22:20:00 +02:00
DL6ER
586224fde2 Replace PREG_SPLIT_NO_EMPTY by using trim().
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:57:59 +02:00
DL6ER
3770556732 Use database.php:add_to_table() in teleporter.php:archive_insert_into_table().
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:49:51 +02:00
DL6ER
838516e558 Ensure preg does not output empty array elements.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:44:01 +02:00
DL6ER
07af532b09 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:32:49 +02:00
DL6ER
d568b49fb1 Add busy timeout so adding/removing domains does not immediately fail in case the database is busy.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:24:05 +02:00
DL6ER
71fc7a4791 Use preg_split() instead of explode() for better space handling. Skip empty domains in add_to_table() and remove_from_table().
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:23:29 +02:00
DL6ER
7807f12d65 Fix codefactor complaints.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 22:08:18 +02:00
DL6ER
7fdafb2dcc Update comment and code in sub.php
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 22:06:44 +02:00
DL6ER
424fe7636b Call "sudo pihole restartdns reload" after having added or removed domains to notify FTL of the updated lists.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 22:02:36 +02:00
DL6ER
98e5f21373 Move add_to_table() to database.php.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 20:49:49 +02:00
DL6ER
5b9ccecd11 Limit max length for a domain entry to 253 chars when importing from teleoprter archives, skip longer entries without importing them.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 20:40:20 +02:00
DL6ER
6ca35b0b76 Update comment and change require() to require_once().
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 20:32:49 +02:00
DL6ER
464e55461d Fix indentation.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-06 20:29:32 +02:00
DL6ER
c53832c9d0 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-05 22:06:53 +02:00
DL6ER
c9f5c9500a Directly modify gravity tables from the lists pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-05 21:55:08 +02:00
DL6ER
bc7aef744c "pihole --whiteregex" has been renamed to "pihole --white-regex". Similar for "--whitewild" -> "--white-wild".
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-05 21:13:53 +02:00
TheME
5ea4e6d185 fix broken Icons
Signed-off-by: Th3M3 <the_me@hotmail.de>
2019-08-04 21:11:32 +02:00
denny0754
8991605f04 Fixed Issue#983 2019-08-01 18:14:32 +01:00
DL6ER
13f07f9d87 Switch the teleporter to only interact with gravity.db directly. This avoids any need for escaping regexes and just seems to be the right thing to do. Ensure that we flush a table only once (in case multiple files add to the same table).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 23:15:19 +02:00
DL6ER
eac87f139f pihole-FTL only needs to be reloaded not restarted when the lists have been updated. This is much faster than a hard restart.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 22:19:28 +02:00
DL6ER
3cfb226757 Reload only ONCE not after EACH imported file.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 22:14:48 +02:00
DL6ER
72057cfa26 Close database connection at the end of a table recovery.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 22:14:07 +02:00
DL6ER
72c0233436 Add option to flush tables during import (defaults to true). By unchecking this box, users can import (= only add) other lists without loosing the present content. Conflict management is done through INSERT OR IGNORE which will silently skip entries that violate the UNIQUE constraint.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 21:15:32 +02:00
DL6ER
1ddf36a752 Archive and restore full tables instead of only domains. Use JSON as backup file format.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 21:10:19 +02:00
DL6ER
cd2daa3239 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 19:41:04 +02:00
DL6ER
3ebf766240 Simplify add() in list.js.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-22 21:43:12 +02:00
DL6ER
b7fe518159 Remove heading when list goes empty.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-22 21:38:58 +02:00
DL6ER
31d0b32103 Only show headings when we have domains for the respective list (regex / exact).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-22 21:35:42 +02:00
DL6ER
dfcfafd6d9 Implement whitelist regex support to web interface.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-22 21:15:50 +02:00
Mcat12
c5b25f23e5 Add missing break
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-09 20:37:05 -07:00
Mcat12
bc85bcda7b Prevent static DHCP leases from having duplicate hostnames
Fixes #979

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-09 20:35:15 -07:00
Mark Drobnak
77845474d8 Merge pull request #968 from pi-hole/new/domain_groups_enabled_status
Lists: Highlight if domains are disabled
2019-07-07 17:18:42 -04:00
DL6ER
eeb4598925 Fix hardcoded table name.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-07 22:40:34 +02:00
Mark Drobnak
f18e287150 Merge pull request #977 from lightswitch05/feature/batch-audit-requests
Feature: Batch audit requests
2019-07-07 14:58:02 -04:00
DL6ER
8698ce1b9c Do not return query string in get.php.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-07 10:19:20 +02:00
Mark Drobnak
7470119396 Merge pull request #978 from pi-hole/fix/audit_log
Audit log: Should use $domains
2019-07-06 19:46:29 -04:00
DL6ER
dab155c2bf We need to use \$domains instead of \$domain when addin domains to the audit log.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-05 17:14:24 +02:00
Daniel
12e0ce2f4c Improve audit logic to batch requests.
Signed-off-by: Daniel <daniel@developerdan.com>
2019-07-05 10:23:27 -04:00
DL6ER
e3f76a46d2 Use GROUP BY instead of DISTINCT as we pairs or(domain,1) and (domain,0) are distinct as well where we actually want to only GROUP BY domain.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-05 11:49:44 +02:00
DL6ER
4cc54ee407 Group assignment has changed in the database. Adapt the code accordignly.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-05 11:24:22 +02:00
DL6ER
f407edfb6d Merge pull request #972 from pi-hole/fix/query-log-filtering-when-disabled
Don't show the "Click to ..." tooltip when filtering is disabled
2019-07-04 22:14:09 +02:00
DL6ER
7d9206c2cd Merge pull request #975 from pi-hole/fix/settings-page-adlists
Use the renamed adlist table when getting adlists
2019-07-04 22:13:20 +02:00
Mcat12
8819825dc8 Upgrade the exporter/importer (teleporter) to use the gravity database
Also fixed the content type of the tar.gz archive from zip to gzip.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-04 12:31:02 -07:00
Mcat12
86ba703ef5 Use the renamed adlist table when getting adlists
This fixes an error shown on the settings page.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-04 11:28:01 -07:00
Mark Drobnak
4e1df1664c Merge pull request #951 from pi-hole/new/arp-flush
Add button for pihole arpflush on Pi-hole settings page
2019-07-04 14:10:29 -04:00
DL6ER
2e2896add3 Merge pull request #964 from pi-hole/new/networktable_ip_neigh
Add IPv6 support for network table
2019-07-04 11:44:10 +02:00
Mcat12
f7905167c0 Prevent command injection via admin email
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-07-01 20:17:10 -07:00
WaLLy3K
ca4130743a Remove updateQueryTypesOverTime call
Remove call as per #915, which may cause issues with the dashboard not loading stats.

Signed off by WaLLy3K <w3k@pm.me>
2019-06-30 22:17:13 +10:00
Mcat12
8157fa5c8e Don't show the "Click to ..." tooltip when filtering is disabled
Fixes #971

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-06-28 20:14:05 -07:00