diff --git a/etc-cron.daily-anonymize-pafal b/etc-cron.daily-anonymize-pafal new file mode 100755 index 0000000..181c3aa --- /dev/null +++ b/etc-cron.daily-anonymize-pafal @@ -0,0 +1,17 @@ +#!/bin/sh + +# simple cronjob to anonymize IPv4 and IPv6 addresses +# in pafakedaccesslog logfile entries +# on a Debian GNU/Linux default Apache2 and PHP installation +# placed in /etc/cron.daily/ . + +# config +readonly LOG="/var/www/html/pafal/faccess.log" + +# ipv4 +/bin/sed -i -E 's/^([[:digit:]]{1,3}\.)([[:digit:]]{1,3}\.)([^ ]*)(.*)/\1\20.0\4/' "${LOG}" + +# ipv6 +/bin/sed -i -E 's/^([[:xdigit:]]{1,4}:)([[:xdigit:]]{1,4}:)([[:xdigit:]]{1,4}:)([^ ]*)(.*)/\1\2\3:0\5/' "${LOG}" + +exit 0 \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..973e64e --- /dev/null +++ b/index.php @@ -0,0 +1,95 @@ + + + +
+ ++ ++
+ No access permissions to a "real" access.log are required. + - Logrotation with a maximum of 100 entries. + +
+ + +"; +$emsg .= "How to fix it: