mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-04 15:54:48 +01:00
Initial commit of a log capture and reporting feature
This adds a new section to the admin panel called "Activity", that supplies charts, graphs and details about messages entering and leaving the host. A new daemon captures details of system mail activity by monitoring the /var/log/mail.log file, summarizing it into a sqllite database that's kept in user-data.
This commit is contained in:
12
tests/bin/m-debug.sh
Executable file
12
tests/bin/m-debug.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")/../../management" || exit 1
|
||||
systemctl stop mailinabox
|
||||
source /usr/local/lib/mailinabox/env/bin/activate
|
||||
export DEBUG=1
|
||||
export FLASK_ENV=development
|
||||
if ! systemctl is-active --quiet miabldap-capture; then
|
||||
export CAPTURE_STORAGE_ROOT=/mailinabox/management/reporting/capture/tests
|
||||
fi
|
||||
python3 --version
|
||||
python3 ./daemon.py
|
||||
@@ -159,10 +159,21 @@ installed_state_compare() {
|
||||
for zone in $(cd "$s1/zones"; ls *.signed); do
|
||||
if [ -e "$s2/zones/$zone" ]; then
|
||||
# all the signatures change if we're using self-signed certs
|
||||
# ignore ttl changes
|
||||
local t1="/tmp/s1.$$.txt"
|
||||
local t2="/tmp/s2.$$.txt"
|
||||
awk '$4 == "RRSIG" || $4 == "NSEC3" { next; } $4 == "SOA" { print $1" "$2" "$3" "$4" "$5" "$6" "$8" "$9" "$10" "$11" "$12; next } { print $0 }' "$s1/zones/$zone" > "$t1"
|
||||
awk '$4 == "RRSIG" || $4 == "NSEC3" { next; } $4 == "SOA" { print $1" "$2" "$3" "$4" "$5" "$6" "$8" "$9" "$10" "$11" "$12; next } { print $0 }' "$s2/zones/$zone" > "$t2"
|
||||
awk '\
|
||||
$4 == "RRSIG" || $4 == "NSEC3" { next; } \
|
||||
$4 == "SOA" { print $1" "$3" "$4" "$5" "$6" "$8" "$10" "$12; next } \
|
||||
{ for(i=1;i<=NF;i++) if (i!=2) printf("%s ",$i); print ""; }' \
|
||||
"$s1/zones/$zone" > "$t1"
|
||||
|
||||
awk '\
|
||||
$4 == "RRSIG" || $4 == "NSEC3" { next; } \
|
||||
$4 == "SOA" { print $1" "$3" "$4" "$5" "$6" "$8" "$10" "$12; next } \
|
||||
{ for(i=1;i<=NF;i++) if (i!=2) printf("%s ",$i); print ""; }' \
|
||||
"$s2/zones/$zone" > "$t2"
|
||||
|
||||
output="$(diff "$t1" "$t2" 2>&1)"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "CHANGED zone: $zone"
|
||||
|
||||
2
tests/vagrant/vanilla/Vagrantfile
vendored
2
tests/vagrant/vanilla/Vagrantfile
vendored
@@ -3,12 +3,12 @@ load '../funcs.rb'
|
||||
Vagrant.configure("2") do |config|
|
||||
|
||||
config.vm.synced_folder "../../..", "/mailinabox", id: "mailinabox", automount: false
|
||||
config.vm.network "public_network"
|
||||
use_preloaded_box config, "ubuntu/bionic64", ".."
|
||||
|
||||
# vanilla install
|
||||
|
||||
config.vm.define "vanilla" do |m1|
|
||||
m1.vm.network "forwarded_port", guest:443, host:8443, protocol:"tcp"
|
||||
m1.vm.provision :shell, :inline => <<-SH
|
||||
cd /mailinabox
|
||||
source tests/vagrant/globals.sh || exit 1
|
||||
|
||||
Reference in New Issue
Block a user