Commit Graph

68 Commits

Author SHA1 Message Date
Adam Warner c4691ac672 Merge pull request #1558 from pi-hole/master
master -> devel
2020-08-14 22:04:06 +01:00
DL6ER 8672c49b4b Replace "." by "_" in hostnames to work around a PHP Phar bug.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-20 21:43:44 +02:00
marank b597a0fcbb Merge branch 'devel' into devel 2020-06-21 12:20:33 +02:00
Adam Warner c949516ee1 make use of utils.escapeHtml on the JS side of things, and html_entity_decode/htmlentities in PHP
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-06-13 18:50:36 +01:00
Adam Warner ee89ab3131 Include hostname in backup filename. Will add nothing if no hostname detected.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-06-01 20:49:31 +01:00
Matthias rank 212da94228 Added token verification
Moved CNAME functions to func.php
Added teleporter support
Fixed CNAME and DNS file declaration (filename was declarated in seperate file, therefore trying to read those files from func.php failed)
Fixed error and success response functions in func.php (calling addCustomDNSEntry and addCustomCNAMEEntry repeatedly from teleporter failed because of error function defined inside of those functions)

Signed-off-by: Matthias Rank <development@m-rank.de>
2020-05-21 14:48:13 +02:00
V@no 70d2b62382 Fix teleporter to use the 24-hour format.
Split from #1305

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-17 16:35:51 +03:00
DL6ER 257f6ce55e Log number of imported group assignments.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-12 20:36:00 +02:00
DL6ER ac3c178ce9 Add import for Local DNS Records.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-12 20:23:26 +02:00
DL6ER 67b68b4400 Add pihole-FTL.conf ans custom.list (Local DNS Records) to Teleporter Backup
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-12 20:23:26 +02:00
DL6ER ad4a10c01e Add import for missing tables: group, client + the group linking tables.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-12 20:23:26 +02:00
DL6ER cb48efff19 Add export for missing tables: group, client + the group linking tables.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-12 20:23:26 +02:00
Samu Voutilainen 39ec67829b Execute pihole through wrapper
All different exec() calls basically just calls sudo pihole,
with various different syntaxes. Using a wrapper function
allows sanitization of arguments for better safety.

Signed-off-by: Samu Voutilainen <smar@smar.fi>
2020-04-17 07:55:16 +03:00
DL6ER 6ad2430f95 Import legacy adlist.list and fix/remove debugging output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-02-02 19:10:26 +01:00
DL6ER 870ab035fc Fix teleporter's ability to import v4.x archives.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-28 22:26:19 +01:00
DL6ER c81d690be4 Add /etc/hosts to teleporter export.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-28 13:30:57 +00:00
DL6ER 52f5be0c8f Merge pull request #992 from trimalcione/devel
Add DHCP leases export/import from teleporter
2019-12-16 11:22:28 +01:00
Adam Warner 258ea04432 Add a class for better readability of list type within the code
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2019-12-08 18:47:30 +00:00
DL6ER 3a0a596b11 Implement necessary changes due to switching from individual to a common domainlist.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-08 17:42:01 +00:00
trimalcione 6c04b8cb39 add DHCP static leases import from teleporter
Signed-off-by: trimalcione <okchtioui@gmail.com>
2019-12-02 16:21:19 +01:00
corbolais 61f02236eb add: dhcp.leases to teleporter exported tar.gz
Signed-off-by: corbolais <corbolais@gmail.com>
2019-11-25 16:05:04 +01:00
trimalcione 72af77eef9 Merge branch 'devel' into devel 2019-10-19 01:13:35 +02:00
DL6ER f3d8f0dfb5 Teleporter expects adlist.json during import, however, the file is called adlists.json during export. Fix this by using singular during export.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-18 00:36:03 +02:00
trimalcione 9d32aa6489 Add DHCP leases export/import from teleporter
Signed-off-by: trimalcione <okchtioui@gmail.com>
2019-08-20 18:12:16 +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 07af532b09 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-07 21:32: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 c53832c9d0 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-05 22:06:53 +02: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
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
DL6ER 78d262d7b0 Offer possibility to import auditlog.list from teleporter archive
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-10 18:25:12 +02:00
DL6ER 7c9f09db0e Directly write imported regex file to disk instead of useing bash callbacks
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-15 12:56:40 +02:00
DL6ER 65d0c7a1d9 Also try to import legacy wildcard list if found in imported teleporter archive
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-14 22:25:17 +02:00
DL6ER e67695d51a Add files backed up from /etc/dnsmasq.d into a separate directory to tidy up the generated archive
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-14 15:46:22 +02:00
DL6ER ed8dbfd10e Show number of processed items when importing whitelist, blacklist, and regex filters
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-14 15:34:42 +02:00
DL6ER 50885d092a Import regex.list if requested. Don't check validity of regex filters as they are not necessarily in valid domain format
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-14 15:33:52 +02:00
DL6ER 6dc8bf300c Export regex.list
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-14 15:27:54 +02:00
Mcat12 a2d9e7c1ac Add auditlog.list to the Teleporter
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-08 22:03:27 -05:00
DL6ER b6caf5878f Ensure we restart dnsmasq only once (at the end of importing stuff)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-07 17:34:10 +02:00
DL6ER bfad6d8fcb Add nuke option before importing new list to be sure the content is being replaced instead of appended
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-07 17:25:43 +02:00
DL6ER 02807730ee We don't have to test for the php-zip extension anymore. Instead, we test for "Phar" (which seems to be there by default on most systems)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-07 14:36:16 +02:00
DL6ER 5b47e9caa5 Fix a typo
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-06 23:49:04 +02:00
DL6ER d1d9d7faff Use htmlentities() to mitigate XSS (this function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-06 23:47:06 +02:00
DL6ER a50525d72b Clean up after import
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-06 23:43:19 +02:00
DL6ER 67855df5c5 Minor corrections
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-06 23:42:49 +02:00