Skip to content

Commit

Permalink
haraka: conditionally add geoip fs mount
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Mar 21, 2024
1 parent c4b71b8 commit 4124a17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
image: auchida/freebsd:latest
# timeout: 90

# Instructions for creating your own test runner:
# https://github.com/msimerson/Mail-Toaster-6/wiki/Develop-CI-Testing/
Expand All @@ -20,6 +19,7 @@ stages:

host_setup:
stage: host_setup
timeout: 5m
script:
- sh test/get_jail_ip.sh
- echo "export TOASTER_HOSTNAME=`hostname`" >> mail-toaster.conf
Expand All @@ -33,6 +33,7 @@ host_setup:

dns:
stage: dns
timeout: 5m
script:
- sh provision/dns.sh
# enabling caching doubles gitlab runner builds (~30 to 60m)
Expand All @@ -43,15 +44,18 @@ dns:

db:
stage: db
timeout: 5m
script:
- sh provision/mysql.sh
- sh provision/redis.sh
# - sh provision/geoip.sh
tags:
- freebsd
- ssh

mailstore:
stage: mailstore
timeout: 10m
script:
- sh provision/vpopmail.sh
- sh provision/dovecot.sh
Expand All @@ -61,6 +65,7 @@ mailstore:

mta:
stage: mta
timeout: 10m
script:
- sh provision/clamav.sh
- sh provision/dcc.sh
Expand All @@ -72,6 +77,7 @@ mta:

webmail:
stage: webmail
timeout: 10m
script:
- sh provision/haproxy.sh
- sh provision/webmail.sh
Expand All @@ -84,6 +90,7 @@ webmail:

extras:
stage: extras
timeout: 10m
script:
- sh provision/spamassassin.sh
# - sh provision/elasticsearch.sh
Expand All @@ -94,6 +101,7 @@ extras:

test:
stage: test
timeout: 5m
script:
- sh provision/mailtest.sh
tags:
Expand Down
10 changes: 9 additions & 1 deletion provision/haraka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e
export JAIL_START_EXTRA="devfs_ruleset=7"
export JAIL_CONF_EXTRA="
devfs_ruleset = 7;"
export JAIL_FSTAB="$ZFS_DATA_MNT/geoip/db $ZFS_JAIL_MNT/haraka/usr/local/share/GeoIP nullfs rw 0 0"
export JAIL_FSTAB=""

HARAKA_CONF="$ZFS_DATA_MNT/haraka/config"

Expand Down Expand Up @@ -45,6 +45,14 @@ install_geoip_dbs()
return
fi

local _fstab="$ZFS_DATA_MNT/haraka/etc/fstab"
if ! grep -qs GeoIP "$_fstab"; then
tell_status "adding GeoIP volumne to $_fstab"
tee -a "$_fstab" <<EO_GEOIP
$ZFS_DATA_MNT/geoip/db $ZFS_JAIL_MNT/haraka/usr/local/share/GeoIP nullfs rw 0 0"
EO_GEOIP
fi

if ! grep -qs ^geoip "$HARAKA_CONF/plugins"; then
tell_status "enabling Haraka geoip plugin"
sed -i.bak -e '/^# geoip/ s/# //' "$HARAKA_CONF/plugins"
Expand Down

0 comments on commit 4124a17

Please sign in to comment.