Skip to content

Commit

Permalink
local.d/maps.d rework
Browse files Browse the repository at this point in the history
in previous version  every file in $CUSTOM_CONF_BASE_DIR/local.d/maps.d were symlinked to rspamd local.d/maps.d folder. But if make changes to this files via Rspamd web UI they are removed and recreated not symlinked. Very problematic! Now the entire directory is symlinked leaving files to be recreated without issues
  • Loading branch information
feddar authored Apr 29, 2020
1 parent 8872bd2 commit 2e3fe9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PASSWORD=${PASSWORD:-"$PWCRYPT"}

# Check custom configuration files
CUSTOM_CONF_BASE_DIR="/data"
CUSTOM_CONF_DIRS="local.d local.d/maps.d override.d plugins.d"
CUSTOM_CONF_DIRS="local.d override.d plugins.d"
for DIR in $CUSTOM_CONF_DIRS; do
CUSTOM_CONF_DIR="$CUSTOM_CONF_BASE_DIR/$DIR"
if [ -d "$CUSTOM_CONF_DIR" ]; then
Expand All @@ -27,6 +27,11 @@ for DIR in $CUSTOM_CONF_DIRS; do
fi
done

if [ -d "$CUSTOM_CONF_BASE_DIR/local.d/maps.d" ]; then
mv "/etc/rspamd/local.d/maps.d" "/etc/rspamd/local.d/maps.d.orig"
ln -s "$CUSTOM_CONF_BASE_DIR/local.d/maps.d" "/etc/rspamd/local.d/maps.d"
fi

# Check for custom rspamd.conf config
GLOBAL_CUSTOM_CONF_FILE="$CUSTOM_CONF_BASE_DIR/local.d/rspamd.conf.local"
if [ -f $GLOBAL_CUSTOM_CONF_FILE ]; then
Expand Down

0 comments on commit 2e3fe9f

Please sign in to comment.