Commit graph

1527 commits

Author SHA1 Message Date
yubiuser
2529fbeacd
Treat FTL return data as strings (#5509) 2023-12-09 18:35:14 +01:00
Christian König
2681835f94
Treat FTL return data as strings
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-12-06 00:23:15 +01:00
DL6ER
32a741b5c7
We do not follow 308 but FTL also doesn't suggest it
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-02 22:42:36 +01:00
DL6ER
96bf07863f
Use CHAOS TXT local.api.txt instead of trying to parse pihole-FTL --config webserver.ports
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-01 09:10:06 +01:00
DL6ER
6016131280
Ensure we also check the last port
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-28 22:59:49 +01:00
DL6ER
974fea592d
Iterate over ports, skip redirected ports
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-28 00:05:55 +01:00
DL6ER
a6565bf9a1
Support special webserver.port ports ending in "s" (secure) and "r" (redirect)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-23 22:07:31 +01:00
Christian König
b61e8be3b4
Address reviewer's comment
Co-authored-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
54ab71d817
Don't use hardcoded ports to check for
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
e7c89ce25f
No need to pass a default value to get_ftl_conf_value()
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
d3813c4be5
Update check for required ports
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
86aa6b1df6
Improve v6 debug log and remove leftovers
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 23:04:44 +01:00
Christian König
f65b126433
Move custom.list to /hosts/custom.list
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-13 21:37:41 +01:00
Christian König
de6e61705e
Remove local.list and openVPN traces
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-06 21:40:32 +01:00
DL6ER
72c972175d
Remove left-over parts of setupVars processing and only include pihole.toml once
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-11-06 13:53:08 +01:00
DL6ER
395110f92f
When setting a blank password, use webserver.api.password instead of webserver.api.pwhash (#5465) 2023-11-04 17:43:09 +01:00
yubiuser
758ace57c0
Check for valid OS via IPv4 and IPv6 (#5305) 2023-11-04 08:02:38 +01:00
Christian König
ced1c5d50b Start counting at postion 1
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-01 21:57:36 +01:00
Christian König
480a8c8d7f
Remove idn2 as punycode conversion is handled by FTL
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-31 21:02:26 +01:00
Adam Warner
ab3b6dfa67
No need to >/dev/null because setFTLConfigValue already does this
adjust output of setFTLConfigValue to test for the exit code of `pihole-FTL --config`
2023-10-28 19:46:45 +01:00
DL6ER
d377cfbc3e
Extract the first entry in the answer section from dig's output, replacing any multiple spaces and tabs with a single space
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:34:30 +02:00
DL6ER
15be8eeffa
Remove lighttpd config test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:21:08 +02:00
DL6ER
635b4e952f
Add NOERROR/NXDOMAIN support in the DNS resolution test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:20:31 +02:00
DL6ER
c86e7b3f96
Generalize CPU check to a short hardware information output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:13:31 +02:00
DL6ER
dcc7e96d2f
Remove detection of addresses of PIHOLE_INTERFACE as it is gone, too
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:07:11 +02:00
DL6ER
ccd8c470a5
check_x_headers is no more
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:03:37 +02:00
DL6ER
00d7e998b4
setupVars.conf and pihole-FTL.conf are no more - use pihole.toml instead
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-10-28 08:03:09 +02:00
yubiuser
aaa9acc0b9
Update query.sh to use FTL's API instead of directly interacting with the database (#5361) 2023-10-16 21:00:42 +02:00
Christian König
2005d04625
Exact search is the new default
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-14 21:50:57 +02:00
Christian König
f7ba059b94
Query directly and authenticate only if required
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-14 14:03:56 +02:00
Christian König
e374950915 Merge branch 'development-v6' into query_list_v6 2023-10-13 21:49:09 +02:00
Christian König
46ff257344
Remove Chronometer
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-12 13:44:51 +02:00
Adam Warner
71357ecae7
adminlte->web
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-08 14:12:02 +01:00
Adam Warner
7886dc0172
adminlte->web
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-08 14:09:47 +01:00
Christian König
afa688e3a0
Yu vs uh
(https://www.theguardian.com/guardian-observer-style-guide-r#:~:text=re/re%2D,re%2Dsign/resign)

Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-07 00:21:06 +02:00
Christian König
edf0060acf
Fix spellcheck errors
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-10-06 22:26:08 +02:00
Adam Warner
885b626a68
Some unrelated spelling mistakes that spellcheck is grumbling about
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-10-04 16:22:01 +01:00
Adam Warner
69a264a3c2
Add antigravity support to gravity (#5330) 2023-09-29 19:09:24 +01:00
DL6ER
ea23c8364d
Move antigravity-related changed to gravits database migration step 16->17
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-09-16 10:04:29 +02:00
DL6ER
df92b8ac14
Add missing creation of view vw_antigravity as well as schema change to vw_adlist
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-09-12 20:43:34 +02:00
DL6ER
f19a56cf87
Merge branch 'development-v6' into new/antigravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-09-11 11:43:56 +02:00
Christian König
52268f0155 Ignore ABP style entries in debug log dig test
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-09-07 22:32:09 +02:00
Christian König
843f57399c
Ignore ABP style entries in debug log dig test
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-09-07 22:27:49 +02:00
Christian König
c33963b250
Check for valid OS via IPv4 and IPv6
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-27 15:11:47 +02:00
Christian König
ee4eb8db20
chmod +x
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-13 22:26:44 +02:00
Christian König
8e0a40e717
Use api.sh within query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-13 22:24:05 +02:00
Christian König
2227a2c569
Add API functions
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-09 21:25:50 +02:00
Christian König
8ef8a27583
Remove webpage.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-04 20:04:45 +02:00
DL6ER
00cbb8bc8a
Add antigravity support to gravity
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-07-18 08:13:36 +01:00
DL6ER
5459daa03d
Add abp_entries column (default 0) to the adlist table for newly created gravity databases. This updates the gravity database version to 16
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-06-15 09:36:17 +02:00
Christian König
088b2c2920
Do not remove -all|excat when not sourrounded by space in query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 22:57:31 +02:00
Christian König
ba3e290915
Fix shellcheck errors
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-04 21:21:48 +02:00
Christian König
7351a4d3b1
Merge branch 'development' into development-v6
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-06-01 15:45:05 +02:00
Adam Warner
11679a5188
@MrDuck2742 dropped a ] on the floor without me seeing. I picked it up and put it back again
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-28 23:31:51 +01:00
DL6ER
137e6dc184
Remove all the undocumented now useless stuff from pihole -a
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-05-28 09:01:02 +02:00
yubiuser
f59610081e
remove outdated comments (#5227) 2023-05-27 22:41:11 +02:00
Christian König
b5800ef718
Remove getFTLAPIPort() function and fix pihole status
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-27 11:53:00 +01:00
Christian König
44bfb8ebf0
Remove the ability to reboot/shutdown via webpage.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-27 11:53:00 +01:00
Adam Warner
c0e352094d
REVISIT: Remove some references to setupVars (some files can probably go entirely...)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
7cbe713873
REVISIT: Don't rely on existence of setupVars.conf
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
0e8f285f4f
Always assume that the web interface will be installed.
We could revist this again in future if we decide that there should still be a choice to install the interface or not

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
2784b267ec
pihole command: read values from pihole-FTL instead of setupvars.conf
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Christian König
3cb3adc5ca
Fix setting webpassword via pihole -a -p
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-27 11:51:16 +01:00
Adam Warner
019be067d9
Convert SetWebPassword to use new FTL config
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
632aead691
add wrappers to utils.sh for setting FTL config & add tests
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:16 +01:00
Adam Warner
c520b29326
some more lighttpd refs (tests can come later)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
9f31ab8a6f
Debug log does not need to check php/lighttpd
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-05-27 11:51:15 +01:00
Adam Warner
82b60b09d4
Fix issue with Adding Local DNS Records does not add to /etc/pihole/custom.list when using grep 3.10 (#5269) 2023-05-27 11:28:19 +01:00
yubiuser
19d50b9669
Don't source the install script in webpage.sh (#5270) 2023-05-10 19:55:51 +02:00
MrDuck2742
b8c3f6d999
Adding Local DNS Records does not add to /etc/pihole/custom.list
Fixes #5268

Signed-off-by: MrDuck2742 <jim@datachord.co.uk>
2023-05-08 04:41:53 +01:00
Christian König
e6ae2e98cc
Don't source the install script in webpage.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-07 13:21:23 +02:00
Christian König
fd4e8766e4
Remove unused code from query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-05-02 22:50:51 +02:00
ipitio
fa116389c2
remove old comments
Signed-off-by: ipitio <21136719+ipitio@users.noreply.github.com>
2023-03-23 01:23:35 +00:00
Adam Warner
58275ecd13
Revert "Ignore commented lines when reading PRIVACYLEVEL from config file" 2023-03-22 21:52:39 +00:00
Dan Schaper
fb032ea6e7
Ignore commented lines when reading PRIVACYLEVEL from config file (#5177) 2023-03-22 12:23:40 -07:00
RD WebDesign
66ed7c9ea3
Declaring all local variables under the function declaration line
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-21 16:34:50 -03:00
Adam Warner
ac2f13adef
Allow pihole -q to match subdomains using ABP style domains (#5210) 2023-03-21 15:39:11 +00:00
RD WebDesign
6b919f3a2e
Removing unnecessary commas
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-21 12:27:20 -03:00
William Blew
3c91b6558d
restore the addKey comment, reworded for anchors
Per @dschaper, restore the addKey clarifying comment. It has
been reworded to describe the use of anchors where before it
referenced using grep's  'match only an entire line' argument.

Signed-off-by: William Blew <william@kulian.org>
2023-03-17 11:50:53 -07:00
William Blew
b9a6970bfd
Fix addKey to handle substrings of existing keys
Fix addKey to handle the case where a key is being added, and that key
is the leading substring of an already existing key within that file.

For example: add "server=192.168.1.1", when "server=192.168.1.178"
already exists within the /etc/dnsmasq.d/01-pihole.conf file.

Check pihole docker with PIHOLE_DNS="192.168.1.178;192.168.1.1". Its
/etc/dnsmasq/01-pihole.conf will be missing its second server= entry.

Add the test_key_addition_substr, to test addKey when
its adding a substring key of an existing key in the file.

Signed-off-by: William Blew <william@kulian.org>
2023-03-17 11:50:52 -07:00
RD WebDesign
20f8c6af3c
Search for ABP entries only if they exist in gravity.db
and use `abp_domains` property.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-17 14:17:53 -03:00
RD WebDesign
c35ed68051
Allow pihole -q matching ABP subdomains
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-03-14 17:31:39 -03:00
Dan Schaper
75a32d22a3
Allow limited parsing of ABP style adlists (#5179) 2023-03-14 13:23:03 -07:00
Christian König
71e262c37f
Revert "Allow final dot (root zone)"
This reverts commit 0b5da9f0da.

Signed-off-by: Christian König <ckoenig@posteo.de>
2023-03-14 19:50:53 +01:00
Christian König
309ee78903
Use distinct variabled
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-03-07 20:40:16 +01:00
Christian König
d6f5552ccf
Convert domain to lowercase in pihole -q
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-03-06 21:52:54 +01:00
Adam Warner
c5faf3d174
Use ',' as the separator char in query rather than the default '|' as we now expect some valid results to contain '|'
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2023-02-22 21:21:38 +01:00
Christian König
4fd0f15d90
Ignore commented lines when reding PRIVACYLEVEL from config file
Create dedicated getVal function in utils.sh as it might be useful somewhere else
Account for tailing comments and $key not being on the first line

Signed-off-by: Christian König <ckoenig@posteo.de>
2023-02-21 21:03:55 +01:00
Christian König
18ab94135f
Show all files (not their content) of the lighttpd config dirs
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-01-24 23:02:38 +01:00
Christian König
be0efa2332
Add lighttpd selftest
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-01-24 22:19:24 +01:00
Christian König
9bde5de601
Use conf-enabled instead of conf-available
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-01-24 21:59:13 +01:00
Christian König
e59f5db145
Add pihole-admin.conf to debug log
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-01-22 22:37:19 +01:00
Christian König
d349a4640f
Remoce leftover from query.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-01-12 20:24:08 +01:00
Adam Warner
fc83883934
Apply suggestions from code review
Co-authored-by: yubiuser <ckoenig@posteo.de>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
2022-12-11 17:48:45 +00:00
RD WebDesign
1550f29f06
Use GREEN if dig was successful
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-12-11 14:42:47 -03:00
RD WebDesign
a206980242
Fix parenthesis color
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-12-11 14:42:47 -03:00
RD WebDesign
8c2f56b0e6
Imporving the output from os_check() function
- add red color to dig errors
- reorder some output lines
- add "Distro and version supported" on success

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-12-11 14:42:46 -03:00
RD WebDesign
b4349b41ce
Use the correct variable digReturnCode
also use INFO instead of CROSS, because it's not an error.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-12-11 14:42:46 -03:00
RD WebDesign
67f04787d6
Only compare OS versions if dig was successful
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-12-11 14:42:35 -03:00
Adam Warner
38775cffdf
Ensure local hash is always of length 8, for consistency.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-11-14 22:51:39 +00:00