1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-10-18 13:59:15 +00:00
Commit Graph

32 Commits

Author SHA1 Message Date
Christian König
954a0c2a14
Remove read permission for others on senible log files
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-19 23:09:05 +02:00
Adam Warner
36dd533ef3 use directory /var/log/pihole/ for log storage
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-05-15 06:46:23 +02:00
Christian König
f4286a4d12
Fix log flush with new query database schema
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-02-12 23:33:19 +01: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
Faye Duxovni
aa5c15a728 give pihole its own logrotate state file
Signed-off-by: Faye Duxovni <duxovni@duxovni.org>

Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-07-09 20:00:10 -04:00
pvogt09
8a92fb24c4 Incorporates changes requested by @Mcat12
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>
2019-05-01 11:20:26 +02:00
pvogt09
5c575e73c7 Adds world readable attribute to files created by Pi-hole to circumvent #2724
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>
2019-04-30 22:41:12 +02:00
DL6ER
ca309d3b28
Restart pihole-FTL after log flushing to force reloading history. Fixes #2339
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-14 13:16:17 +02:00
Dan Schaper
a08ea28feb
Space/Tab piholeLogFlush.sh
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2018-07-20 13:07:54 -07:00
Ludovic Rousseau
7edab27e53 Stylistic change to use an explicit if/then/fi
Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
2018-04-13 12:19:55 +02:00
Ludovic Rousseau
9b3531f634 Fix stylistic issue
Expand variable using ${FTLconf}

Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
2018-04-13 11:48:34 +02:00
Ludovic Rousseau
d8f85a8981 Avoid a "No such file or directory" error
Check the file /etc/pihole/pihole-FTL.conf exists before trying to use
it.
without the patch I get, each day, in my logs:
sed: can't read /etc/pihole/pihole-FTL.conf: No such file or directory

I use a variable FTLconf to not repeat the file name twice.

Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
2018-04-13 11:16:58 +02:00
Ludovic Rousseau
3b229489c2 Fix regex to find DBFILE= from configuration file
The regex ^\s^.DBFILE\s*=\s* does not work to match "DBFILE="
I don't know what the second '^' is used for.

With the change I now have the results:

DBFILE=/foo/bar
-> /foo/bar

  DBFILE=/foo/bar
-> /foo/bar

 # DBFILE=/foo/bar
-> /etc/pihole/pihole-FTL.db

xDBFILE=/foo/bar
-> /etc/pihole/pihole-FTL.db

Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
2018-04-13 11:16:50 +02:00
DL6ER
b8eaa9a527
Use double quotes to precent globbing and word splitting
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-17 13:01:00 +01:00
DL6ER
5d274008db
Use possibly user-defined database location when flushing
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-17 12:58:57 +01:00
DL6ER
4c249a1186
Flush most recent 24 hours from FTL's database
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-21 13:48:13 +01:00
DL6ER
158ea1d43b
Add sqlite3 dependency
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-21 11:54:49 +01:00
Adam Warner
536585b846 Colourise Core Output Text (#1471)
* Define colours within COL_TABLE
* Do not output colours for non-terminal instances
* Removed ":::"
* Fixed indenting & spacing
* Made output consistent throughout project
* Reworded text to fit on standard 80 char wide Terminal screen
* Made 'sudo raspi-config' warning (insufficient disk space) only show on RPi
* Make "Installation/Update Complete" the final msg
* Remove redundant messages
* Simplify update available message
* Confirm user would like to begin uninstall
* If "git pull" string says "Already up-to-date.", place [i] before it
* Colour Temp/Interface output
* Made `pihole disable 5z` invalid
* Added error fallback if invalid argument (not s/m) is detected
* Quoted "$2" for consistency
* Updated help text
* L185/286: Replaced echo with redirect
* User agents for adblock.mahakala.is/adaway.org unnecessary 
* Print newline on confirmation of repository reset
* Add output to admin-related dnsmasq restarts
* Return error message for "pihole -q"
* Imply default checkout behaviour with y/N
* Fix uninstall failing to remove pihole user
* Print checkout 'git remote show origin' STDERR on new line
* Replaced checkout "AdminLTE" wording with "Web Admin"
2017-06-21 21:49:05 +10:00
DL6ER
42eb811910
Add "quiet" mode + update comments in the cron file 2017-05-17 12:54:43 +02:00
DL6ER
c9042ffedd
Print echos only when manual flushing is requested 2017-05-17 12:51:04 +02:00
DL6ER
4e2c6a7b8e
Fix logrotation: manual flushing should be done twice, but automated rotation at midnight should only be done *once*! 2017-05-17 12:44:35 +02:00
Hans Geiblinger
b166410cbf Solve piholeLogFlush.sh having to be issued 2 x to clear logs (#1460)
Simplified the command -v syntax, and added a sleep 3 timer to the first execution of the log rotation. The second execution was being issued while the first was still running, thus it would fail and you would have to issue the "Flush Logs" command a second time.
2017-05-12 22:39:55 +02:00
DL6ER
320c06e0a4
Flush twice to move data out-of-sight of FTL 2017-04-17 21:25:15 +02:00
Jacob Salmela
7a1a2dec67
update license to EUPL on core files 2017-02-22 11:55:20 -06:00
DL6ER
6fd7e0311c
Install customized version of logrotate script 2017-01-27 14:16:24 +01:00
DL6ER
3a8a936575
Corrected path 2017-01-12 21:01:52 +01:00
DL6ER
3fd2ffd466
Add logrotate for pihole.log 2017-01-12 20:39:25 +01:00
Adam Warner
8cb2f85a08 Replace truncate command with echo " " > 2016-09-02 16:39:34 +01:00
Promofaux
97d3aedba1 Add some output to the log flush 2016-04-03 18:27:18 +01:00
Mcat12
48f9a61ff0 Updated License 2016-01-30 15:12:40 -05:00
Dan Schaper
cb91b8f5fa Add copyright headers 2015-12-06 05:55:50 -08:00
Jacob Salmela
1b51b9ade3 for use as a cron job
The log will be flushed daily and stats will be stored in a DB for
displaying on the Web interface.
2015-11-05 14:31:38 -06:00