mirror of
https://github.com/craigerl/aprsd.git
synced 2024-09-28 16:16:51 -04:00
Hemna
89576a3c43
This patch starts the work to replace flask-socketio with python-socketio so that uwsgi can be used instead of gunicorn. uwsgi can support websockets. Have to rework webchat command next
36 lines
1.1 KiB
Bash
Executable File
36 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -x
|
|
|
|
if [ ! -z "${APRSD_PLUGINS}" ]; then
|
|
OLDIFS=$IFS
|
|
IFS=','
|
|
echo "Installing pypi plugins '$APRSD_PLUGINS'";
|
|
for plugin in ${APRSD_PLUGINS}; do
|
|
IFS=$OLDIFS
|
|
# call your procedure/other scripts here below
|
|
echo "Installing '$plugin'"
|
|
pip3 install --user $plugin
|
|
done
|
|
fi
|
|
|
|
pip3 install gevent uwsgi
|
|
|
|
if [ -z "${LOG_LEVEL}" ] || [[ ! "${LOG_LEVEL}" =~ ^(CRITICAL|ERROR|WARNING|INFO)$ ]]; then
|
|
LOG_LEVEL="DEBUG"
|
|
fi
|
|
|
|
echo "Log level is set to ${LOG_LEVEL}";
|
|
|
|
# check to see if there is a config file
|
|
APRSD_CONFIG="/config/aprsd.conf"
|
|
if [ ! -e "$APRSD_CONFIG" ]; then
|
|
echo "'$APRSD_CONFIG' File does not exist. Creating."
|
|
aprsd sample-config > $APRSD_CONFIG
|
|
fi
|
|
|
|
export COLUMNS=200
|
|
#exec gunicorn -b :8000 --workers 4 "aprsd.admin_web:create_app(config_file='$APRSD_CONFIG', log_level='$LOG_LEVEL')"
|
|
# exec gunicorn -b :8000 --workers 4 "aprsd.wsgi:app"
|
|
exec uwsgi --http :8000 --gevent 1000 --http-websockets --master -w aprsd.wsgi --callable app
|
|
#exec aprsd listen -c $APRSD_CONFIG --loglevel ${LOG_LEVEL} ${APRSD_LOAD_PLUGINS} ${APRSD_LISTEN_FILTER}
|