Commit Graph

1402 Commits (ebbb7168a4c288e61eac30da1c0fe3df71386b22)

Author SHA1 Message Date
DL6ER e27f50b8e5
Try to obtain PID from PIDFILE. If this fails (file does not exist or is empty), fall back to using pidof + awk
5 years ago
DL6ER 484f618685
Use last PID in case pidof returns multiple PIDs for pihole-FTL
5 years ago
Jeroen Baert d3d45a8776
Fix 404 error when browsing to pi.hole (without /admin) (for fedora)
5 years ago
Jeroen Baert 9f86fd0cb4
Fix for 404 error when browsing to pi.hole (without /admin)
5 years ago
DL6ER 3e78ed95d4
Fix displaying options for table "group" in the debugger.
5 years ago
snapsl 20a839fef5 fixed local declaration before assignment
5 years ago
snapsl b2d8c4374b tweaked code style of webpage.sh
5 years ago
DL6ER dc93462d42
Group table has only two columns
5 years ago
DL6ER 6e2e825a5f
Rename options "pihole --whiteregex" to "pihole --white-regex" for the sake of readability. The same applied for "whitewild" -> "white-wild"
5 years ago
DL6ER af754e3fc4
Rearrange group tables directly next to the tables they refer to.
5 years ago
DL6ER 06860ed5b4
Group tables have only two columns.
5 years ago
DL6ER 09190c1735
Only check once for if this is a regex list or not.
5 years ago
DL6ER a95b473417
Rearranage if statements to ensure the proper output is shown for wildcard-style filters.
5 years ago
DL6ER 6f58d58cae
Add --whitewild to help texts and man pages.
5 years ago
DL6ER 40d0caa70b
Add undocumented --whitewild option that does the same --wild does for the whitelist.
5 years ago
DL6ER 0692be9bae
Fix small mistake in 2->3 upgrade script.
5 years ago
DL6ER 0d28dce326
Print group table contents in debug log.
5 years ago
DL6ER 96031214c6
Add support for whitelist regex filter management via CLI.
5 years ago
Mark Drobnak ab3f6dfcc6
Merge pull request #2831 from pi-hole/fix/block-page-adlists
5 years ago
Mcat12 3ebd43ebf0
Remove outdated adlists.list check and fix empty adlists error message
5 years ago
Mark Drobnak 445127accc
Merge pull request #2832 from pi-hole/new/audit_database
5 years ago
DL6ER 420f60b5c7
Add timeout to migration script (1->2).
5 years ago
DL6ER 65fdbc85d5
Add timeout to migration script (2->3).
5 years ago
DL6ER 87f75c737a
Review comments.
5 years ago
DL6ER 5ff9052200
Review comments
5 years ago
Mcat12 b154dd5f07
Quote calls to read FTL config
5 years ago
DL6ER 0683842ec3
Fix typo in 2->3 migration script.
5 years ago
DL6ER 054c7a2c05
Create new table + view regex_whitelist + rename old regex table to regex_blacklist. This updates the gravity.db version to 3.
5 years ago
DL6ER 3d3fc2947e
Review comments
5 years ago
Mcat12 e8e5d4afda
Get file locations of FTL files from the config
5 years ago
DL6ER 8382f4d727
Rename table to domain_audit and simplify subroutine addAudit().
5 years ago
DL6ER be3e198f9a
Address linting errors.
5 years ago
DL6ER acc50b709e
Only migrate files once (domain and adlist lists druing initial creation of gravity.db auditlog.list on database upgrade from version 1 to 2.
5 years ago
DL6ER efe8216445
Fix further stickler complaint.
5 years ago
DL6ER 0405aaa3da
Review comments and fixing stickler complaints.
5 years ago
Mark Drobnak 6bb213e56f
Merge pull request #2826 from Forceflow/development
5 years ago
DL6ER 2fb4256f84
Rename table to "auditlist"
5 years ago
DL6ER 82476138c1
Instead of calling sqlite3 multiple times within a loop, we use the ability to add multiple rows within one INSERT clause. This is supported since sqlite3 3.7.11 (2012-03-20) and should be available on all systems.
5 years ago
DL6ER 5293beeb77
Update audit script to store domains in new database table.
5 years ago
DL6ER 0c8f5f1221
Remove comment field from audit table
5 years ago
DL6ER 4f4a12bb40
Upgrade database if necessary and store audit domains therein.
5 years ago
DL6ER 1dbe6c83c3
Add database upgrading mechanism for adding the audit table.
5 years ago
Mcat12 2b5033e732
Add missing spaces found by linter
5 years ago
Mcat12 8d9ff550d4
Fix blockpage error if whitelisted, blacklisted, or regex filtered
5 years ago
Mcat12 f1733f9c5d
Fetch adlists for the block page from gravity.db
5 years ago
Mark Drobnak 92c3c86be4
Merge pull request #2769 from pi-hole/new/arp-flush
5 years ago
DL6ER 7a1b6fd205
Merge branch 'development' into new/gravity.db_domain_groups
5 years ago
MMotti 04abcb71f6 Fix potential invalid result for pihole -q
5 years ago
DL6ER 1fe3507bc5
Adlists table was renamed to Adlist. Adapt further places in the code to match the new name.
5 years ago
Jeroen Baert 9fedafed15 Fix 404 error when browsing to pi.hole (without /admin) (for fedora)
5 years ago
DL6ER 23b3a9a650
Add DISTINCT to the view\'s SELECT queries to avoid domain duplication in case they are enabled in multiple groups at the same time.
5 years ago
Jeroen Baert 7b2ac25a52 Fix for 404 error when browsing to pi.hole (without /admin)
5 years ago
DL6ER f91421418a
Rename adlists -> adlist table.
5 years ago
DL6ER 3a14e8b013
Check whitelist_by_group.group_id instead of group.enabled against NULL.
5 years ago
DL6ER ad97e95f2f
Add required name column in group table.
5 years ago
DL6ER 5b01facd73
Fix logix on the views: AND ( OR )
5 years ago
DL6ER 6fe637b9ee
Rename groups -> group
5 years ago
DL6ER 94d83dbb2d
Unify the two group tables into a single "groups" table. This allows managing adlists and domains together.
5 years ago
Mark Drobnak c9a843b417
Merge pull request #2823 from pi-hole/fix/lighttpd-mime
5 years ago
DL6ER 87c115fc86
Change implementation to use linking tables (domain_groups, adlists_groups). This allows adding domains to multiple lists conveniently.
5 years ago
RamSet b5af125be6 Removed line
5 years ago
RamSet ecc49318f0 Fixed MIME related issue present in lighttpd/1.4.53
5 years ago
DL6ER 0774c4e5ca
vw_gravity should actually filter using vw_whitelist.
5 years ago
DL6ER 01850c2128
Automatically recreate standard group after deletion to avoid violating foreign key constraints even if foreign key enforcing is disabled (SQLite's default behavior)
5 years ago
DL6ER cbc210b014
Add adlist_groups and mark group_id columns as NOT NULL.
5 years ago
DL6ER c53ee4202b
Add filtering by domain groups to gravity database.
5 years ago
DL6ER 6996ffa451
Also flush network_addresses table
5 years ago
DL6ER 4947350ca5
Add arpflush to help and bash autocompletion
5 years ago
DL6ER c1495b0fa8
Merge branch 'development' into new/arp-flush
5 years ago
MMotti bcf03647ef Add comment and remove blankspace
5 years ago
MMotti a9d0690f4d Change the case of some variables
5 years ago
MMotti 10fbed50f3 Shellcheck
5 years ago
MMotti 785f1fedd9 Tidy regexp queries
5 years ago
MMotti cf21efa103 Minor grammar changes
5 years ago
MMotti 7613e94ef6 Minor tweaks
5 years ago
MMotti b49c702f33 Consistency tweak
5 years ago
MMotti 09532638d5 Read from DB instead of regex.list
5 years ago
MMotti 97df6d7415 Stickler fix
5 years ago
MMotti 54bfaa28c1 Fix for regexp queries through pihole -q
5 years ago
Mark Drobnak afd28fab03
Merge pull request #2767 from pi-hole/fix/multiple_pihole-FTL_PIDs
5 years ago
Mark Drobnak d92ced6fb6
Merge pull request #2734 from pi-hole/fix/query_black_and_whitelists_database
5 years ago
DL6ER ae98fde321
Try to obtain PID from PIDFILE. If this fails (file does not exist or is empty), fall back to using pidof + awk
5 years ago
DL6ER 9ddce88092
Review comments
5 years ago
DL6ER 44f8fcb600
We can print the table name without any extra check as we already returned early in case there are no results.
5 years ago
Mark Drobnak 814fdcf9b6
Merge pull request #2768 from pi-hole/fix/dhcp-ignore-names
5 years ago
DL6ER 5060605626
Print table name before entering the loop for the sake of simplicity
5 years ago
DL6ER 285e6fe090
Address lint complaints
5 years ago
DL6ER c3023fe681
Add new "pihole arpflush" command to flush both the ARP cache as well as the network table in pihole-FTL.db
5 years ago
DL6ER c5df104a66
Add dhcp-ignore-names option when enabling DHCP service. We currently remove anything that starts with "dhcp-" to have a clean configuration and removed these lines without noticing when enabling the DHCP server.
5 years ago
DL6ER f6213d4f4d
Use last PID in case pidof returns multiple PIDs for pihole-FTL
5 years ago
Mcat12 bfb99c361c
Note that the gravity size does not include the blacklist entries
5 years ago
Mcat12 5796054305
Increase ID column width to 4
5 years ago
Mcat12 a3e1473ac1
Set explicit column widths to prevent text from getting cut off
5 years ago
Mcat12 7b5fc60e00
Improve table formatting
5 years ago
Mcat12 807ce0af4e
Show whitelist, blacklist, and regexlist details
5 years ago
Mcat12 3f05efd60f
Add extra newline
5 years ago
Mcat12 03d93aa19a
Update debug script with gravity DB changes
5 years ago
Dan Schaper 7de6bbca61
Merge branch 'development' into release/v4.3
5 years ago
Mcat12 8e1bf6e3d4
Merge branch 'development' into new/gravitydb
5 years ago
mpiederiet 3220e2b978
Fix for preventing git error message in cron logs
5 years ago
DL6ER a904c183df
Use printf to escape domain content. This prevents possible SQL injection issues
5 years ago
DL6ER 5246b3e496
Explicitly escape backslash in ESCAPE clause. This has been suggested by Stickler bot.
5 years ago
DL6ER f80fdd7e83
Improve comments
5 years ago
DL6ER 6ba58896d2
Simplify code
5 years ago
DL6ER 3aa838bbe4
Implement black- and whitelist searching with SQL statements. We use the ESCAPE clause in the LIKE query as the underscore "_" wildcard matches any single character but we want to suppress this behavior (underscores can be legitimate part of domains)
5 years ago
Dan Schaper 5532df24e4
Pi-hole Debug - tricorder upload function calls
5 years ago
DL6ER 0bc112ce52
Query only those columns we actually use when showing domains on the CLI. Show date of last modification instead of addition date for domains.
5 years ago
DL6ER d46ff1d2d7
Remove UNIQUE on gravity table as the only column is already PRIMARY KEY. Primary keys must contain UNIQUE values, and cannot contain NULL values
5 years ago
DL6ER 2f698904e4
Use PRIMARY KEY instead of NOT NULL also in gravity and info tables
5 years ago
DL6ER 106f079afc
Improve indentation (single tab) in SQLite template
5 years ago
DL6ER 6c1e3a17f7
Remove NOT NULL constraint on list ids as this is implied by PRIMARY KEY (even though most, if not all, examples on the web still use both attributes at the same time)
5 years ago
DL6ER 5e26e8245b
Order results of queries to list views by id key
5 years ago
DL6ER 983117d788
Add id (primary key, autoincrement) field to lists tables
5 years ago
DL6ER b372f808dd
Fix lint errors
5 years ago
DL6ER bc9b623638
Modify query.sh to use the gravity database
5 years ago
DL6ER d5781fb110
Fix extra space in front on END statement in CREATE TRIGGER commands
5 years ago
DL6ER 487718512d
Remove DISTINCT attribute from views. They are not needed as the corresponding data is obtained from fields with UNIQUE attribute so duplications are already prevented at domain insertion. The elimination of the duplication check on imort through the views slightly reduces the load during import (I observed about 8 percent time saved on my NanoPi NEO).
5 years ago
pvogt09 8a92fb24c4 Incorporates changes requested by @Mcat12
5 years ago
pvogt09 5c575e73c7 Adds world readable attribute to files created by Pi-hole to circumvent #2724
5 years ago
DL6ER 2180531a84
Add trigger for automatic updates of the date_modified column and improve formating in the gravity.db template
5 years ago
Mark Drobnak 6812e8880e
Merge pull request #2705 from pi-hole/fix/chronometer-refresh-arg
5 years ago
DL6ER a932209143
Set default for date_modified to be the current time
5 years ago
DL6ER efeba594ae
Add support for manipulating adlists from the CLI
5 years ago
DL6ER 126f7101ff
Add (optional) date_modified field and use vw_whitelist view in vw_blacklist
5 years ago
Mcat12 b320e74921
Improve argument handling
5 years ago
Mcat12 add5e4ca5e
Explicitly allow only -r and --refresh in argument handler
5 years ago
DL6ER b4ae142149
Remove printf escaping (we will realize it differently) and ensure we're using single quotes for strings (although double quotes are possible, too)
5 years ago
DL6ER 3fe43ce1d9
Rely on default value (database provided) for date_added when adding a new domain
5 years ago
DL6ER e04dc9d2bb
Remove sqlitekey variable as the first column of the regex table is now called domain as well
5 years ago
DL6ER bd0215524b
Add vw_adlists view which returns only enabled adlists
5 years ago
DL6ER 5bb8163674
Change type of whitelist, blacklist, regex, and adlists time column to INTEGER and insert a DEFAULT clause that returns the current Unix time as such an integer
5 years ago
DL6ER a891d64395
We should always exit after displaying a list, even if it is empty
5 years ago
DL6ER 6b1d2523e8
Also print datetime a domain was added when listing the domains on the CLI
5 years ago
DL6ER 08ee9526ad
Review comments
5 years ago
DL6ER a2a7e80007
Add --web for sending a confirmation string when executed from the web interface. This is necessary as the "Reloading DNS service" message does not always propagate through to the web interface when reloading pihole-FTL takes a while.
5 years ago
DL6ER cce66a13b6
Fix output in list.sh when adding a domain that is already present in the target list
5 years ago
DL6ER 43bced7997
Add more comments
5 years ago
DL6ER 788cd78321
Reduce code duplication and add special handling of | character as it might appear in regex filter string
5 years ago
DL6ER e5d1cb5a2e
Rewrite list.sh to operate on database-based lists
5 years ago
DL6ER 61cfd2f9f9
Add adlists table
5 years ago
DL6ER ee4dabeca6
Merge branch 'development' into new/gravitydb
5 years ago
DL6ER de44563301
Remove addn-hosts from 01-pihole.conf
5 years ago
Mark Drobnak d2c7c426de
Fix teleporter backup file extension
5 years ago
DL6ER 84244b7cd5
Fix indentation in display of branches available during pihole checkout
5 years ago
Mcat12 422680ee9f
Fix chronometer refresh incorrectly reading the long argument sleep time
5 years ago
Adam Warner a7f6c9b3a0
Ignore matches that start `# ` using negative lookbehind
5 years ago
Mark Drobnak 204a4e459b
Merge pull request #2637 from TheNoim/patch-1
5 years ago
DL6ER 2e17c23333
Don't warn if user is on development as this branch is constantly updated
5 years ago
DL6ER 63f3381a2b
Warn user if FTL is not on branch master
5 years ago
Dan Schaper 71cd6c137b Use `curl` instead of `openssl` for transmission of unmodified
5 years ago