Commit Graph

40 Commits

Author SHA1 Message Date
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
DL6ER
6bb6c6d29f Finished Teleporter 2.0
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-06 21:13:07 +02:00
DL6ER
7f33b102df Re-implement Teleporter with PharData. The advantage is that we don't have to rely on php-zip being installed.
This commit implements only the re-written Export. The import feature has still to be coded.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-08-06 17:56:59 +02:00
Mcat12
81727a36d0 Fix spelling mistake 2017-04-30 14:07:07 -04:00
Mcat12
a94412a914 Increase max domain length
Max length is 253 chars according to:
https://blogs.msdn.microsoft.com/oldnewthing/20120412-00/?p=7873/
2017-04-30 14:06:39 -04:00
DL6ER
31f368494a Codacy 2017-04-29 22:09:10 +02:00
DL6ER
4fa1cb6bac Clip too long domain names. Fixes #464 2017-04-29 20:52:58 +02:00
DL6ER
631f050440 Create temporary file with write/read permissions only for the PHP user 2017-04-29 13:10:53 +02:00
Mcat12
9454563123 Temporarily store the teleporter file
Store under /etc/pihole instead of the web server, and delete
after sending.
2017-04-24 21:29:44 -04:00
Mcat12
1e748446df Require CSRF token for Teleporter 2017-04-04 21:02:48 -04:00
DL6ER
39e76afd62 Allow generation of ZIP file via command line 2017-03-05 14:03:37 +01:00
DL6ER
c034798f61 Export also all files found in /etc/dnsmasq.d 2017-03-05 13:54:43 +01:00
DL6ER
e695f490c0 Add datetimestamp to downloaded filename (e.g. "pi-hole-teleporter_2017-03-05_01-37-52.zip") 2017-03-05 13:38:06 +01:00
DL6ER
276f2c1628 Allow usage of Teleporter and QueryAds backend only if a valid session is detected (#415) 2017-02-27 22:32:03 +01:00
DL6ER
4f70973cbc EUPL license (#402)
* Move whole project to EUPL, copy MIT license to scripts/vendor/ and style/vendor/

* Added header to main PHP files

* Modified scripts in scripts/pi-hole/php

* Added header to scripts/pi-hole/js files

* Added license header to our custom style script

* Slight reformulation
2017-02-18 14:20:51 +01:00
DL6ER
b8d6550096 Detect mime type of uploaded file on the server instead of relying on what the uploading OS tells us. Fixes #395 2017-02-09 16:21:21 +01:00
DL6ER
279ea1b18b Give some more details on teleporter failure 2017-02-09 15:25:25 +01:00
DL6ER
771c548a7f Renamed zip file 2017-01-27 22:11:02 +01:00
DL6ER
cd5f5bb936 Expanable box + renamed 2017-01-27 22:08:55 +01:00