DL6ER
d2828310f2
Modify DELETE triggers to delete BEFORE instead of AFTER to prevent possible foreign key constraint violations
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-28 11:12:20 +01:00
DL6ER
1b87ec067e
Exit early if the database does not exist (e.g. in some CI tests)
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-25 06:12:18 +01:00
DL6ER
0066c6fbff
Make IDs of anti-/gravity lists available in vw_(anti)gravity
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-25 05:29:29 +01:00
DL6ER
c90a27c509
Add "-ni" to all sqlite3 invocations
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2023-12-09 23:06:50 +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
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
73d5902bed
Add editorconfig-checker workflow
...
Add yml style to editorconfig
Add markdown styling to editorconfig
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-02 09:36:52 +02:00
DL6ER
8cbffa179d
Replace remaining sqlite3 calls by calls to our embedded pihole-FTL sqlite3 engine and remove sqlite3 as dependency in the installer.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-01-30 11:18:17 +01:00
jbzdarkid
bc8150adfa
Clean up bash script formatting
...
Done with the help of beautysh (a python-based bash formatter)
Signed-off-by: jbzdarkid <jbzdarkid@gmail.com>
2021-11-25 14:12:09 -08:00
Christian König
b30d729aa4
Simplify vw_adlist
...
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-10-08 21:08:10 +02:00
Adam Warner
55dce14655
Add execution bit accidentally dropped in #4106 ( #4368 )
...
Add some smoke tests for the repository.
- Add x bit to piholeCheckout.sh. Possibly not needed, but consistency is no bad thing
- Ensure all files in script directorys have executable bit set
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-10-05 19:34:51 +01:00
DL6ER
6b33b8b4c0
Store status of downloaded list (downloaded, using cache, some error, ...) and number of (in-)valid domains on this list in the gravity database. This updates the gravity databaes to version 14.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-12-28 08:08:49 +01:00
Adam Warner
0445559610
Accidentally a number ( #3788 )
...
Co-authored-by: MichaIng <micha@dietpi.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: MichaIng <micha@dietpi.com>
2020-10-09 17:24:42 +02:00
DL6ER
12b9748c43
Fine-tune adlist:adte_modified trigger and don't default new date_updated column to now but use NULL instead
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-07 21:11:57 +02:00
DL6ER
4fd412d7c3
Add date_updated field in adlist table set when a list changes.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-09-07 20:59:23 +02:00
DL6ER
7cc35d3b04
Add update to gravity database version 12, renaming the Unassociated group to Default group.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-07 18:01:37 +02:00
DL6ER
92aa510bda
Add timestamps and comment fields to clients. This updates the gravity database to version 11.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-27 10:36:16 +00:00
DL6ER
633e56e8a9
Add gravity database 9->10 update script.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-20 17:59:24 +01:00
DL6ER
bb30c818ab
Update database version during migration.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-30 09:21:30 +00:00
Adam Warner
c944f6a320
Add a new migration script to fix the previous one
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2019-12-29 23:32:31 +00:00
Adam Warner
aa4c0ff329
Don't create trigger with duplicate name until after old table is deleted
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2019-12-29 20:35:11 +00:00
DL6ER
eda7f40fef
Reinstall trigger that prevents group zero from being deleted.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-20 00:42:59 +00:00
DL6ER
e589e665a7
Also add date_added and date_modified fields to group table.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-20 00:21:25 +00:00
DL6ER
b32b5ad6e9
Update gravity database to version 8. This enforces uniqueness on the group name.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-20 00:09:10 +00:00
DL6ER
a720fe1789
Add client trigger.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 22:49:21 +00:00
DL6ER
f0439c8d12
Add special group zero to gravity database.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 16:39:02 +00:00
DL6ER
f482156cca
Merge branch 'development' into new/internal-blocking
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-09 16:49:16 +00:00
DL6ER
a1f120b2ff
Address stickler's complaint
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-30 12:43:07 +00:00
DL6ER
185319d560
Unite four domain tables into a single domainlist table.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-30 12:33:51 +00:00
DL6ER
037d52104a
New command "pihole -g -r" recreates gravity.db based on files backed up in /etc/pihole/migration_update. This is useful to restore a working version of the database when the user destroyed the original database. Also, update gravity.db to version 5 because of a fix we needed to implement.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-26 10:58:39 +01:00
DL6ER
d883854aad
Use constant for long path.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-10-03 12:12:32 +02:00
DL6ER
756c99653e
Merge branch 'development' into new/internal-blocking
2019-10-03 12:01:27 +02:00
DL6ER
2e0370367c
Print when we upgrade gravity database version. This will make possibly failed upgrades easier to debug.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-26 14:02:20 +02:00
DL6ER
a27c7b1398
regex white- and blacklist views need to be re-created as well as we need the ID for storing internally whether or not we try to match a given regex for a specific client.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-18 20:58:44 +02:00
DL6ER
7b48431917
Add client_by_group table like we have for the other lists. It stores associations between individual clients and list groups.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-09 00:03:57 +02:00
DL6ER
ff08add7c0
Update vw_whitelist and vw_blacklist to return group_id alongside domain so we can filter if the current client wants to get this domain blocked or not.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-07 13:01:36 +02:00
DL6ER
ffc91a6c81
Update view vw_gravity to only return domains from enabled adlists.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-07 11:17:53 +02:00
DL6ER
a8af2e1837
Store domains without sorting and unifying them first. This allows us to preserve the relationship of the individual domains to the lists they came from.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-04 23:14:29 +02:00
DL6ER
1820c2c598
Merge branch 'development' into new/whitelist-regex-support
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-22 14:19:51 +02:00
DL6ER
cc40c18f49
Wrap upgrade script commands in a transaction.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-22 13:54:46 +02:00
DL6ER
0692be9bae
Fix small mistake in 2->3 upgrade script.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-22 20:59:52 +02:00
DL6ER
96031214c6
Add support for whitelist regex filter management via CLI.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-22 19:36:11 +02:00
DL6ER
420f60b5c7
Add timeout to migration script (1->2).
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-10 12:02:07 +02:00
DL6ER
65fdbc85d5
Add timeout to migration script (2->3).
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-10 12:01:38 +02:00
DL6ER
5ff9052200
Review comments
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-09 11:41:44 +02:00
DL6ER
0683842ec3
Fix typo in 2->3 migration script.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-08 21:43:49 +02:00
DL6ER
054c7a2c05
Create new table + view regex_whitelist + rename old regex table to regex_blacklist. This updates the gravity.db version to 3.
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-08 21:35:31 +02:00
DL6ER
8382f4d727
Rename table to domain_audit and simplify subroutine addAudit().
...
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-07 21:21:56 +02:00