Commit Graph
90 Commits
Author SHA1 Message Date
DL6ER d3e9365f53 Remove obsolete readGravityFiles() funtion
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-26 19:24:34 +02:00
DL6ER b6dd8ec47f Implement reading regex from file
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-19 17:21:56 +02:00
DL6ER decef2e5fd Remove special support for old type of wildcard lists as dnsmasq config file
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-19 14:46:21 +02:00
DL6ER 0da3046566 Outsource BLOCKINGMODE determination into its won function get_blocking_mode()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-13 11:44:33 +02:00
DL6ER e31d686d64 Implement method for having multiple regex + add timer output (to be removed after beta testing phase)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-25 11:43:15 +02:00
DL6ER 2f6e24045f Add regex blocking support
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-24 17:22:17 +02:00
DL6ER e2d0529993 Implement name resolving power back for FTLDNS. This re-implements lots of already extensively tested code that was present in pre-FTLDNS for over a year. This implementation is only slightly different by ensuring that name resolution is done in a specific non-blocking way.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-11 18:20:06 +02:00
DL6ER 1c191dd2c2 Read number of blocked domains from preEventHorizon. Solves #246
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-30 19:54:17 +02:00
DL6ER 74c8a19d5f Re-enable SIGINT and SIGSEGV handler. All other signals are handled by the resolver code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-25 00:06:12 +01:00
DL6ER ea3309e7b1 Initial commit for FTLDNS
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-22 20:21:06 +01:00
DL6ER ecde321632 Add custom macros for the memory-functions
- calloc,
- realloc,
- free, and
- strdup

These functions will not directly improve memory handling but they will log if something will go wrong *before* it actually goes wrong. This will ease debugging when user provide log snippets especially in ENOMEM (no memory available) situations.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-07 12:24:12 +01:00
DL6ER 6ccd43c648 Merge pull request #211 from pi-hole/tweak/no_pihole.log.1
Don't read pihole.log.1
2018-01-22 08:01:13 +01:00
Mcat12 590f1f97f7 Merge remote-tracking branch 'origin/development' into new/API
# Conflicts:
#	FTL.h
#	socket.c
2018-01-21 09:48:41 -05:00
DL6ER 1ca920310e Don't read pihole.log.1 to enhance startup speed of FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-21 14:41:22 +01:00
DL6ER d12726a01b Only listen on IPv4 and IPv6 telnet sockets if we successfully bound to the corresponding port
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-21 14:01:22 +01:00
DL6ER 0aee819dc2 Implement some of the review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-20 21:38:24 +01:00
Mcat12 232507a51e Merge remote-tracking branch 'origin/development' into new/API 2018-01-20 11:21:36 -05:00
DL6ER b58731d9f3 Import queries from long-term database (if available) on startup of FTL. Fall back to log interpretation if database is not available
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-20 14:03:41 +01:00
DL6ER 9060794ee7 Merge branch 'development' into new/save_to_DB_on_exit 2018-01-15 22:54:55 +01:00
DL6ER 98efb8dcd9 Save remaining queries to long-term database on exit
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-15 22:54:17 +01:00
DL6ER 6ae42424ee Add timers to FTL and measure time needed to save queries in database (only when running in debug mode)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-15 17:20:21 +01:00
Mcat12 d3d70983ad Merge remote-tracking branch 'origin/development' into new/API
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>

# Conflicts:
#	main.c
#	request.c
#	routines.h
#	socket.c
2018-01-14 17:48:37 -05:00
DL6ER 8f38a22d8f Merge pull request #202 from pi-hole/tweak/socket_creation
Create sockets in order
2018-01-14 23:14:24 +01:00
DL6ER 3bdf7c9844 Make sure sockets are created and bound to before continuing to launch other threads in main()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-14 20:00:24 +01:00
Mcat12 0013edb1c6 Merge remote-tracking branch 'origin/development' into new/API
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>

# Conflicts:
#	main.c
#	request.c
#	routines.h
#	socket.c
2018-01-12 17:12:08 -05:00
DL6ER d53371082f Replace sprintf() + swrite() by the new ssend() routine. This enhancement removes the fixed buffer we used before and allows for responses having arbitraty lengths
Signed-off-by: DL6ER <dl6er@dl6er.de>

Conflicts:
	request.c
	routines.h
2018-01-12 22:40:53 +01:00
DL6ER c6b23ffa15 Complete re-write of this feature. We create now two sockets (one for IPv4-only and one for IPv6-only) to be able to bind to the corresponding loopback interfaces. We listen independently, but handle incoming requests using the same code.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-10 18:02:45 +01:00
DL6ER a95f683711 Detect if the current machine has IPv6 capable interfaces and behave accordingly (don't try to bind to a dual-stack port if the machine isn't capable to handling IPv6, e.g. in docker)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-09 21:30:10 +01:00
Mcat12 616b10a599 Add swrite function
It will print a warning if an error happens, like the other s* functions
in socket.c

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-04 12:28:40 -05:00
Mcat12 e527985371 Implement getStats using MessagePack
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-04 12:04:04 -05:00
Mcat12 595ab259ca Remove HTTP API specific code so it can be replaced with a new protocol
Adjusted tests to fit the current lack of output on the unix socket.
Added TELNET enum and used it in place of the old SOCKET to better fit
with the rest of the code base.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-03 20:16:50 -05:00
Mcat12 8adb3d335e Merge remote-tracking branch 'origin/development' into new/API
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-03 14:35:42 -05:00
DL6ER 8a720b6f19 Fix spelling
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-01 17:24:54 +01:00
DL6ER 54487db5cf Close unix socket and unlink file handle on exit of FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-01 11:59:43 +01:00
DL6ER 3c39cb1fd2 Added Unix socket - it is listening!
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-12-31 22:44:08 +01:00
DL6ER e4cbe417a1 Rename existing telnet socket functions to contain "telnet" in their names to avoid confusion when adding Unix sockets
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-12-31 22:25:27 +01:00
Mcat12 604ad7ec39 Merge remote-tracking branch 'origin/development' into new/API
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>

# Conflicts:
#	request.c
#	test/test_suite.sh
2017-12-22 23:08:18 -05:00
DL6ER fbc5c6d914 Merge pull request #143 from pi-hole/new/pihole_status_stats
Detect pihole blocking status
2017-10-25 18:22:25 +02:00
DL6ER 95f76ad0e4 Detect pihole blocking status and return this on API request
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-05 17:48:00 +02:00
Mcat12 e5c4d19aaa Merge remote-tracking branch 'origin/development' into new/API 2017-09-26 00:37:38 -04:00
DL6ER 7a0ce6b2a2 Add overTime/clients data structure 2017-09-22 20:44:29 +02:00
DL6ER 4f1cfe1264 Add reresolveHostnames() routine
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-09-06 16:59:35 +02:00
Mcat12 fb574f7485 Perform better request endpoint checking
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2017-08-16 21:04:58 -04:00
Mcat12 ebe0631e5c Add dummy POST handling for whitelist and blacklist
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2017-08-08 23:08:54 -04:00
Mcat12 c9de13b492 Merge remote-tracking branch 'origin/development' into new/API 2017-07-17 22:13:12 -04:00
DL6ER 952024107f Improve crash message 2017-07-07 17:55:29 +02:00
DL6ER d8d526aff3 Use low-level mutex locks to ensure FTLs main datastructure can only be accessed by one thread at a time. 2017-07-01 18:39:19 +02:00
DL6ER 0dfb855605 Merge branch 'development' into new/API
Conflicts:
	request.c
2017-06-26 16:08:38 +02:00
DL6ER 01dc64cea4 Refactor DB thread to run exclusively either saving queries into the DB *or* deleting old queries (i.e. every hour at minute 59 no queries will be saved to the DB, but instead, two minutes of data will be saved at the full hour) 2017-06-22 23:14:13 +02:00
DL6ER b15f537d14 Clean socket routines, move detection of what the client is asking for into process_api_request() (request.c) much like we already do it for socket requests 2017-06-13 11:03:39 +02:00