Commit Graph

111 Commits (c6d1137eb0948ed14a8b0b8895eb44736449eca3)

Author SHA1 Message Date
DL6ER 10c2dad48a Improve gravity performance (#3100)
4 years ago
Adam Warner ec09b5843c
Merge branch 'development' into fix/do_not_force_local_resolver
5 years ago
DL6ER 620e1e9c73
Do not force nameserver 127.0.0.1 through resolvconf in pihole-FTL.service
5 years ago
DL6ER 8a119d72e2
Ensure database permissions are set up correctly by the service script.
5 years ago
chrunchyjesus 476975540a
make some shebangs comply to posix standard
5 years ago
DL6ER 3cb4f6d9d4
We cannot create vw_gravity before having created vw_whitelist as the former depends onthe later. This commit changes the order in which the tables are created.
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 0405aaa3da
Review comments and fixing stickler complaints.
5 years ago
DL6ER 2fb4256f84
Rename table to "auditlist"
5 years ago
DL6ER 1dbe6c83c3
Add database upgrading mechanism for adding the audit table.
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
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
DL6ER 87c115fc86
Change implementation to use linking tables (domain_groups, adlists_groups). This allows adding domains to multiple lists conveniently.
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 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 f6213d4f4d
Use last PID in case pidof returns multiple PIDs for pihole-FTL
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 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
DL6ER 2180531a84
Add trigger for automatic updates of the date_modified column and improve formating in the gravity.db template
5 years ago
DL6ER a932209143
Set default for date_modified to be the current time
5 years ago
DL6ER 126f7101ff
Add (optional) date_modified field and use vw_whitelist view in vw_blacklist
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 61cfd2f9f9
Add adlists table
5 years ago
DL6ER 0e14d11a20
Merge branch 'development' into new/gravitydb
5 years ago
DL6ER 5ca1bfc11c
Delete /dev/shm/FTL-* files on (re)start of pihole-FTL
5 years ago
DL6ER 644ec36e64
Review comments
5 years ago
DL6ER 9984647ebb
After renaming column in regex, it also needs to be renamed in vw_regex
5 years ago
DL6ER c3c60e10f1
Rename regex field from domain to filter because this described better what it is
5 years ago
DL6ER 8a2363621d
Rename fields from DateAdded to dateadded
5 years ago
DL6ER dbbf21071b
Invert logic to use ENABLED instead of DISABLED. We make sure to set "enabled = 1 WHERE enabled IS NULL" in gravity_store_in_database()
5 years ago
DL6ER 93f1859bab
Store regex in gravity.db as well
5 years ago
DL6ER dcf0a605cf
Use views for all tables and set disabled column to false for those tables that support it
5 years ago
DL6ER 710036adae
Add DISABLED field to white- and blacklist defaulting to false. The two views respect the DISABLED fields for both lists.
5 years ago
DL6ER 09c4c88a6d
Create and fill gravity.db during pihole -g
5 years ago
DL6ER d0125d5aad
Suppress warning if Pi-hole is not used as DHCP server (/etc/pihole/dhcp.leases is not present in this case)
6 years ago
jeremysherriff d3ac8bb6f8 Silence updateGravity job unless errors occur
6 years ago
DL6ER b043000044
Improve template by removing it. PHP cannot digest comments starting in "#" as of v7.0.0
6 years ago
DL6ER c338eab3c6
According to the PHP documentation, PHP 7.0.0+ does not longer recognize hash marks (#) as comments. As FTL has been trained to understand PHP-style (comment lines start with ";") as well, we switch to using them.
6 years ago
DL6ER b9d47d0dd2
Merge pull request #2378 from pi-hole/fix/pihole-FTL-no-caps
6 years ago
DL6ER ec2426b24d
Add clarifying comments
6 years ago
DL6ER 5cd3b11391
Start pihole-FTL as root if capabilities are not supported by the system
6 years ago
DL6ER d30b565d98
Touch dhcp.leases to ensure it exists. There are some systems out there where the installer didn't finish on the first run and some users don't have this file being created. Although /etc/pihole should be owned by pihole:pihole, pihole-FTL sometimes fails to open this file and - if this is the case and DHCP is enabled - refuses to start altogether.
6 years ago
Dan Schaper af2ec61965
Convert [] to ()
6 years ago
Dan Schaper 94b7c8eb59
Added header for file. Not using standard Pi-hole copyright header.
6 years ago
Dan Schaper f2c675cff6
Formatted pihole-FTL.conf for readability.
6 years ago
Dan Schaper b79ff05e29
Move template files to own subdir. Include pihole-FTL.conf in templates.
6 years ago