summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormax.bra2021-02-01 13:12:49 +0100
committermax.bra2021-02-01 13:12:49 +0100
commite4c70bc5e14f75c089f983d5f89960d9c5a7a869 (patch)
tree6721ced393b7014bcf7bb6cc858a2b49959fcd23
parentb027b841290363dc50b9f7109dadadfc2eb17833 (diff)
downloadaur-e4c70bc5e14f75c089f983d5f89960d9c5a7a869.tar.gz
standard server log
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD18
-rw-r--r--dnsmasq.include4
-rw-r--r--pi-hole-logtruncate.service9
-rw-r--r--pi-hole-logtruncate.timer7
-rw-r--r--pi-hole.tmpfile3
6 files changed, 47 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fa20e1877a63..03891bc0a330 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pi-hole-standalone
pkgdesc = The Pi-hole is an advertising-aware DNS/Web server. Arch alteration for standalone PC.
pkgver = 5.2.4
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/pi-hole/pi-hole
install = pi-hole-standalone.install
arch = any
@@ -15,18 +15,24 @@ pkgbase = pi-hole-standalone
conflicts = pi-hole-server
backup = etc/dnsmasq.d/01-pihole.conf
source = pi-hole-standalone-core-5.2.4.tar.gz::https://github.com/pi-hole/pi-hole/archive/v5.2.4.tar.gz
- source = arch-server-core-5.2.4-535773328.patch::https://raw.githubusercontent.com/max72bra/pi-hole-standalone-archlinux-customization/master/arch-server-core-5.2.4.patch
+ source = arch-server-core-5.2.4-007072726.patch::https://raw.githubusercontent.com/max72bra/pi-hole-standalone-archlinux-customization/master/arch-server-core-5.2.4.patch
source = dnsmasq.include
+ source = pi-hole.tmpfile
source = pi-hole-gravity.service
source = pi-hole-gravity.timer
+ source = pi-hole-logtruncate.service
+ source = pi-hole-logtruncate.timer
source = mimic_setupVars.conf.sh
source = mimic_basic-install.sh
source = piholeDebug.sh
sha256sums = 550de24beae4d701c0486208083e06efa5476fb87a729fe39ddf7fc3cac83a75
sha256sums = 92aad8cd123d8509548843641e0c8c0b48bd0e7cbfd56bb9486be61239c8cc1c
- sha256sums = 2d0caa2d0c6a2d7b74da8456d6df9b15a104ab8c68a24403de2906d329ef2cd5
+ sha256sums = 96c1fb8b15e1d0e99c18dc768f5dc3d4991184fb2631af84c5e2111028bc5287
+ sha256sums = 6da6bba6cfac4e87a1f1e8e1488b71858ac6feb0a2e327470a58d8f1e9ad8cbf
sha256sums = 9b72d7769036f8f4bb7121968d2ae4bdba427e4b16787ce340205a5f62b45c7c
sha256sums = 5228b4f923eab7784952a0fd6da895e7bff2f80a7f91c4a7c6350491dfdbb2e8
+ sha256sums = 88e3c78bbeaf5dc1100df65202ded8207877954a96bdf1b0ab3d9990d9fa759f
+ sha256sums = ff507ce58c9492cce57e947696e1b814469fc2d856a1e303c6e68f98c62ebf46
sha256sums = 8119a46428bdbe00a312b14f3f0c364248b120f2569c9f2b6af2ef1a64fdfe94
sha256sums = fa8d91d07b75f21076e5334c46d323cbc3dcf9a33fe9b8b4e032dbc5c979a6d2
sha256sums = 73a8362f7a3eac91c77efbbcb4910ff079203bb5f829e32ecf3391d017117bb8
diff --git a/PKGBUILD b/PKGBUILD
index 3a4316753f65..efc4499d6ce5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=pi-hole-standalone
_pkgname=pi-hole
pkgver=5.2.4
-pkgrel=1
+pkgrel=2
_now=`date +%N`
pkgdesc='The Pi-hole is an advertising-aware DNS/Web server. Arch alteration for standalone PC.'
arch=('any')
@@ -17,17 +17,23 @@ backup=('etc/dnsmasq.d/01-pihole.conf')
source=($pkgname-core-$pkgver.tar.gz::https://github.com/$_pkgname/$_pkgname/archive/v$pkgver.tar.gz
arch-server-core-$pkgver-$_now.patch::"https://raw.githubusercontent.com/max72bra/pi-hole-standalone-archlinux-customization/master/arch-server-core-$pkgver.patch"
dnsmasq.include
+ $_pkgname.tmpfile
$_pkgname-gravity.service
$_pkgname-gravity.timer
+ $_pkgname-logtruncate.service
+ $_pkgname-logtruncate.timer
mimic_setupVars.conf.sh
mimic_basic-install.sh
piholeDebug.sh)
sha256sums=('550de24beae4d701c0486208083e06efa5476fb87a729fe39ddf7fc3cac83a75'
'92aad8cd123d8509548843641e0c8c0b48bd0e7cbfd56bb9486be61239c8cc1c'
- '2d0caa2d0c6a2d7b74da8456d6df9b15a104ab8c68a24403de2906d329ef2cd5'
+ '96c1fb8b15e1d0e99c18dc768f5dc3d4991184fb2631af84c5e2111028bc5287'
+ '6da6bba6cfac4e87a1f1e8e1488b71858ac6feb0a2e327470a58d8f1e9ad8cbf'
'9b72d7769036f8f4bb7121968d2ae4bdba427e4b16787ce340205a5f62b45c7c'
'5228b4f923eab7784952a0fd6da895e7bff2f80a7f91c4a7c6350491dfdbb2e8'
+ '88e3c78bbeaf5dc1100df65202ded8207877954a96bdf1b0ab3d9990d9fa759f'
+ 'ff507ce58c9492cce57e947696e1b814469fc2d856a1e303c6e68f98c62ebf46'
'8119a46428bdbe00a312b14f3f0c364248b120f2569c9f2b6af2ef1a64fdfe94'
'fa8d91d07b75f21076e5334c46d323cbc3dcf9a33fe9b8b4e032dbc5c979a6d2'
'73a8362f7a3eac91c77efbbcb4910ff079203bb5f829e32ecf3391d017117bb8')
@@ -43,6 +49,7 @@ package() {
install -dm755 "$pkgdir"/opt/pihole
install -Dm755 $_pkgname-$pkgver/gravity.sh "$pkgdir"/opt/pihole/gravity.sh
+ install -Dm755 $_pkgname-$pkgver/advanced/Scripts/piholeLogFlush.sh "$pkgdir"/opt/pihole/piholeLogFlush.sh
install -Dm755 $_pkgname-$pkgver/advanced/Scripts/list.sh "$pkgdir"/opt/pihole/list.sh
install -Dm755 $_pkgname-$pkgver/advanced/Scripts/webpage.sh "$pkgdir"/opt/pihole/webpage.sh
install -Dm755 $_pkgname-$pkgver/advanced/Scripts/wildcard_regex_converter.sh "$pkgdir"/opt/pihole/wildcard_regex_converter.sh
@@ -64,10 +71,15 @@ package() {
install -Dm644 $_pkgname-$pkgver/advanced/dnsmasq.conf.original "$pkgdir"/etc/dnsmasq.conf
install -Dm644 dnsmasq.include "$pkgdir"/etc/dnsmasq.d/01-pihole.conf
- install -dm755 "$pkgdir/usr/lib/systemd/system/multi-user.target.wants"
+ install -Dm644 pi-hole.tmpfile "$pkgdir"/usr/lib/tmpfiles.d/pi-hole.conf
+
install -Dm644 "$_pkgname-gravity.timer" "$pkgdir/usr/lib/systemd/system/$_pkgname-gravity.timer"
install -Dm644 "$_pkgname-gravity.service" $pkgdir/usr/lib/systemd/system/$_pkgname-gravity.service
+ install -Dm644 "$_pkgname-logtruncate.timer" "$pkgdir/usr/lib/systemd/system/$_pkgname-logtruncate.timer"
+ install -Dm644 "$_pkgname-logtruncate.service" $pkgdir/usr/lib/systemd/system/$_pkgname-logtruncate.service
+ install -dm755 "$pkgdir/usr/lib/systemd/system/multi-user.target.wants"
ln -s ../$_pkgname-gravity.timer "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/$_pkgname-gravity.timer"
+ ln -s ../$_pkgname-logtruncate.timer "$pkgdir/usr/lib/systemd/system/multi-user.target.wants/$_pkgname-logtruncate.timer"
install -dm775 "$pkgdir"/etc/pihole
install -dm755 "$pkgdir"/usr/share/pihole/configs
diff --git a/dnsmasq.include b/dnsmasq.include
index 58a23fc13a4e..83c276c28237 100644
--- a/dnsmasq.include
+++ b/dnsmasq.include
@@ -27,6 +27,10 @@ localise-queries
bogus-priv
no-resolv
cache-size=10000
+log-queries
+log-facility=/run/log/pihole/pihole.log
+local-ttl=2
+log-async
# If a DHCP client claims that its name is "wpad", ignore that.
# This fixes a security hole. see CERT Vulnerability VU#598349
dhcp-name-match=set:wpad-ignore,wpad
diff --git a/pi-hole-logtruncate.service b/pi-hole-logtruncate.service
new file mode 100644
index 000000000000..e6ecd1263ff8
--- /dev/null
+++ b/pi-hole-logtruncate.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Reset dnsmasq/pi-hole query log
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/pihole flush once quiet
+Nice=19
+IOSchedulingClass=best-effort
+IOSchedulingPriority=7
diff --git a/pi-hole-logtruncate.timer b/pi-hole-logtruncate.timer
new file mode 100644
index 000000000000..f676a33f1a81
--- /dev/null
+++ b/pi-hole-logtruncate.timer
@@ -0,0 +1,7 @@
+[Unit]
+Description=Daily reset of dnsmasq/pi-hole query log
+
+[Timer]
+OnCalendar=daily
+AccuracySec=5m
+Persistent=true
diff --git a/pi-hole.tmpfile b/pi-hole.tmpfile
new file mode 100644
index 000000000000..0d1030589b45
--- /dev/null
+++ b/pi-hole.tmpfile
@@ -0,0 +1,3 @@
+d /run/pihole 0755 http root - -
+d /run/log/pihole 0755 pihole pihole - -
+f /run/log/pihole/pihole.log 0644 pihole pihole - -