New apache2 module to mask IP's in the logs

This commit is contained in:
2020-12-22 12:04:44 +01:00
parent 40a62ef9b4
commit 8574d1e9c8

View File

@@ -0,0 +1,46 @@
Name: mod_log_ipmask
Version: 1.0.0
Release: 1%{?dist}
Summary: mod_log_ipmask module for the Apache HTTP Server
License: ASL 2.0
URL: https://github.com/openstreetmap/mod_tile
Source0: %{name}-%{version}.tar.gz
Source1: 10-log_ipmask.conf
Source2: log_ipmask.conf
%define debug_package %{nil}
BuildRequires: httpd-devel, apr
%description
The mod_log_ipmask module is designed to work with version 2.4 of the Apache HTTP Server.
It extends the mod_log_config module by overriding the %a and %h format strings in
order to limit the number of IP address bits that are included in log files.
This is intended for applications where partial logging of IP addresses is desired,
but full IP addresses may not be logged due to privacy concerns.
%prep
%setup -q -n %{name}-%{version}
%build
apxs -c mod_log_ipmask.c
%install
%{__install} -D .libs/%{name}.so %{buildroot}%{_libdir}/httpd/modules/%{name}.so
%{__install} -D %{S:1} %{buildroot}%{_sysconfdir}/httpd/conf.modules.d/10-log_ipmask.conf
%{__install} -D %{S:2} %{buildroot}%{_sysconfdir}/httpd/conf.d/log_ipmask.conf
%clean
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/*
%files
%doc README.md LICENSE.txt
%config(noreplace) %{_sysconfdir}/httpd/conf.d/log_ipmask.conf
%config %{_sysconfdir}/httpd/conf.modules.d/10-log_ipmask.conf
%{_libdir}/httpd/modules/%{name}.so
%changelog
* Tue Dec 22 2020 Daniel Steiner <daniel.steiner@threema.ch>
- First build.