fix: read settings from directadmin plugin directory

This commit is contained in:
Marek Miklewicz
2026-06-30 18:51:52 +02:00
parent 42afc5853c
commit 227c16410c
7 changed files with 25 additions and 13 deletions
+5 -6
View File
@@ -4,15 +4,14 @@ set -eu
BASE_DIR="/usr/local/hitme_plugins/mail-login"
PLUGIN_DIR="/usr/local/directadmin/plugins/mail-login"
mkdir -p "$BASE_DIR/config" "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state/rate-limit"
chmod 700 "$BASE_DIR/config" "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state" "$BASE_DIR/state/rate-limit"
mkdir -p "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state/rate-limit"
chmod 700 "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state" "$BASE_DIR/state/rate-limit"
if [ ! -f "$BASE_DIR/config/plugin-settings.conf" ]; then
cp "$PLUGIN_DIR/plugin-settings.conf" "$BASE_DIR/config/plugin-settings.conf"
chmod 600 "$BASE_DIR/config/plugin-settings.conf"
if [ -f "$PLUGIN_DIR/plugin-settings.conf" ]; then
chmod 600 "$PLUGIN_DIR/plugin-settings.conf"
fi
touch "$BASE_DIR/logs/audit.log"
chmod 600 "$BASE_DIR/logs/audit.log"
echo "mail-login installed"
echo "mail-login installed; configuration is read from $PLUGIN_DIR/plugin-settings.conf"
+8 -3
View File
@@ -2,9 +2,14 @@
set -eu
BASE_DIR="/usr/local/hitme_plugins/mail-login"
mkdir -p "$BASE_DIR/config" "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state/rate-limit"
chmod 700 "$BASE_DIR/config" "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state" "$BASE_DIR/state/rate-limit"
PLUGIN_DIR="/usr/local/directadmin/plugins/mail-login"
mkdir -p "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state/rate-limit"
chmod 700 "$BASE_DIR/secrets" "$BASE_DIR/logs" "$BASE_DIR/state" "$BASE_DIR/state/rate-limit"
if [ -f "$PLUGIN_DIR/plugin-settings.conf" ]; then
chmod 600 "$PLUGIN_DIR/plugin-settings.conf"
fi
touch "$BASE_DIR/logs/audit.log"
chmod 600 "$BASE_DIR/logs/audit.log"
echo "mail-login updated; external configuration preserved"
echo "mail-login updated; configuration is read from $PLUGIN_DIR/plugin-settings.conf"