1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-04-01 21:27:22 +02:00

avoid using PYTHONPATH to enable setup mod hooks, which is problematic for managment command line tool use

- save the directory path to setup mods in /etc/mailinabox.conf
- dynamically add the path to python during hook initialization
This commit is contained in:
downtownallday
2022-10-24 16:24:44 -04:00
parent bb969f16ae
commit 7fa070aed8
5 changed files with 73 additions and 24 deletions

View File

@@ -103,7 +103,7 @@ tr -cd '[:xdigit:]' < /dev/urandom | head -c 32 > /var/lib/mailinabox/api.key
chmod 640 /var/lib/mailinabox/api.key
source $venv/bin/activate
export PYTHONPATH=$(pwd)/management:${LOCAL_MODS_DIR:-$(pwd)/local}
export PYTHONPATH=$(pwd)/management
exec gunicorn --log-level ${MGMT_LOG_LEVEL:-info} -b localhost:10222 -w 1 --timeout 630 wsgi:app
EOF
chmod +x $inst_dir/start