Commit Graph
68 Commits
Author SHA1 Message Date
DL6ER 79e63dd63e Merge branch 'development' into new/regex-lists 2018-05-27 10:37:15 +02:00
Mark Drobnak a662c6dadd Change -Wl,-pie to -pie
Signed-off-by: Mark Drobnak <newtoncat12@yahoo.com>
2018-05-26 17:38:12 -04:00
DL6ER d52482168a Switch to compiling on GNU-C11 standard. According to https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/C-Dialect-Options.html#C-Dialect-Options this dialect will become standard in a future gcc.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-26 23:12:12 +02:00
DL6ER 76924b9425 Merge pull request #260 from pi-hole/new/regex
Add regex blocking support to FTLDNS
2018-04-29 17:57:09 +02:00
DL6ER 2f6e24045f Add regex blocking support
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-24 17:22:17 +02:00
DL6ER 959af6789b Remove -DNO_FORK compile time flag, undo dnsmasq code modifications, make sure that "-k" is always passed to dnsmasq
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-19 07:32:40 +02:00
DL6ER 410075cd34 Add setcap to make install target (we don't do it in the init.d/systemd script anymore, so we have to do it after the binary is copied to its final location)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-17 10:53:30 +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 392a23d5e7 Remove disbaled sanitizer options
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-21 20:42:34 +01:00
DL6ER 9ea9a53859 Use -fstack-protector-strong only if compiler is not arm-linux-gnueabihf-gcc
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-21 20:38:15 +01:00
DL6ER 734b2559d5 Update CFLAGS with recommended gcc flags (hardening, performance, etc.)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-21 20:28:23 +01:00
DL6ER 5de6e5dec1 Prefer locally compiled libhogweed (if available)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-21 20:16:42 +01:00
DL6ER dcc89f6423 Change dnsmasq version to 2.78. Use locally compiled libnettle if available to be able to compile on Raspbian
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-18 20:28:20 +01:00
DL6ER 25e95c35e9 Apply dnsmasq patch v2.78 -> v2.79
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-18 19:47:22 +01:00
DL6ER cd5ccc44ed Re-enable "make install" target
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-13 21:42:00 +01:00
DL6ER e20af6b90e Actually compile the DNSSEC libraries statically
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-06 15:48:01 +01:00
DL6ER 2ae4b52bb3 A number of improvements:
- use "extern" for the glibal variable specifications in the header files (and clarif where the variables are actually defined)
- record number of failed requests to forward destinations
- Add dnsmasq_interface.h to DTLDEPS
- Add new request type ">cacheinfo" to get information about cache usage in the resolver

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-26 17:24:09 +01:00
DL6ER 41afe2aa56 Fix Makefile
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-23 17:02:34 +01:00
DL6ER b74a0290ac Update CI instructions, try to build only x86_64 at this time
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-22 20:29:43 +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
Mcat12 700a21b0e1 Update the Makefile with new API file structure
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-12 14:57:08 -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 900a3fa5cb Add "socket-test" target in Makefile
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-01 00:59:10 +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 86d370e46a Return special version if compiled on a branch != master
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-11-03 18:31:04 +01:00
Mcat12 9ec7bd8722 Implement simple JSON parsing for addList
Uses cJSON to parse, but output will still be handled directly.
I implemented different API response methods to allow for different HTTP
response codes to be sent.
The addList code is still dumb and doesn't do anything, but it's getting
there.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2017-08-09 21:28:38 -04:00
Mcat12 4762b8a55c Reorganize to split up API functions
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2017-08-06 19:06:12 -04: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 94c7f39d6c Merge branch 'development' into new/db
Conflicts:
	Makefile
2017-06-12 12:07:04 +02:00
Mcat12 a7ca42ab12 Remove need for empty obj directory in repo 2017-06-11 19:21:25 -04:00
DL6ER 838585e254 Add optimization flags for SQLite3's building process 2017-06-09 14:11:50 +02:00
DL6ER d6dde2d09b Don't recompile the sqlite object file when switching branches 2017-06-09 12:02:10 +02:00
DL6ER a51501e56c Compile SQLite3 w/o debugging options 2017-06-09 10:53:07 +02:00
DL6ER 692d69947e Add FTL SQLite3 implementation, we compile SQLite3 on-the-fly to become independent of installed libraries
Limit DB filesize, configureable via config file, if set to zero, the DB functionality is disabled altogether
Add ">dbstats" to the telnet interface
2017-06-09 09:47:13 +02:00
DL6ER 97f285a1a3 Remove necessity to use libmath routines 2017-04-14 18:59:39 +02:00
DL6ER 40823c9989 Add fno-omit-frame-pointer which may or not improve future stacktraces 2017-04-12 15:00:31 +02:00
DL6ER a33dba3194 Add -Wextra which enables some extra warning flags that are not enabled by -Wall 2017-04-09 20:48:59 +02:00
DL6ER 371b7a0f32 Use stat() and don't keep pihole.log open forever. Fixes #16 2017-04-09 20:41:25 +02:00
DL6ER 28caa6c2fe Remove flag that is not needed according to gcc's man page 2017-04-03 00:06:58 +02:00
DL6ER 384384bb9e Remove non-standard flag from makefile 2017-03-31 19:46:00 +02:00
DL6ER 7f9229ae5a Add application self-debugging. Also, don't silently get killed on SIGSEGV. Furthermore, try to automatically attach to the debugger on crashing (only if running in debug mode) 2017-03-31 13:18:47 +02:00
DL6ER d8a17cdc7a Enhance debugging compiler flag to -g3 (maximum debug information), includes extra information such as macro definitions 2017-03-25 17:25:55 +01:00
DL6ER a8a55a3857 Implement rolling 24h as standard behavior of FTL. Can be set to static views of up to 24h (analyzing pihole.log) and up to 48h (analyzing pihole.log.1 in addition) 2017-03-14 18:46:17 +01:00
DL6ER 7c9b1b4195 Add config file parser. First config arguments are
SOCKET_LISTENING=all|local
INCLUDE_YESTERDAY=true|false

If FTL we cannot find or interpret a config variable value, it will skip it and use the default value
2017-03-14 12:20:07 +01:00
DL6ER e70be89073 Remove moving time frame altogether 2017-03-14 10:38:16 +01:00