aboutsummaryrefslogtreecommitdiff
path: root/hex-zero.wsgi
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-12-09 20:30:40 -0500
committerB Stack <bgstack15@gmail.com>2020-12-09 20:30:40 -0500
commit260c70e3173f3595fa183612c8641c6da36de572 (patch)
tree150f97296c0ee28bc846c3a81ce124186901c38b /hex-zero.wsgi
parentadd some example files, and experimental logging (diff)
downloadhex-zero-260c70e3173f3595fa183612c8641c6da36de572.tar.gz
hex-zero-260c70e3173f3595fa183612c8641c6da36de572.tar.bz2
hex-zero-260c70e3173f3595fa183612c8641c6da36de572.zip
use uwsgi!
apparently uwsgi_python3 is the useful binary in Devuan
Diffstat (limited to 'hex-zero.wsgi')
-rwxr-xr-xhex-zero.wsgi19
1 files changed, 19 insertions, 0 deletions
diff --git a/hex-zero.wsgi b/hex-zero.wsgi
new file mode 100755
index 0000000..7f10e20
--- /dev/null
+++ b/hex-zero.wsgi
@@ -0,0 +1,19 @@
+#!/bin/sh
+test -f /etc/default/hex-zero && . /etc/default/hex-zero
+test -z "${UWSGI_USER}" && export UWSGI_USER=hex-zero
+test -z "${UWSGI_BIN}" && export UWSGI_BIN=/usr/bin/uwsgi_python3
+test -z "${LISTEN_HOST}" && export LISTEN_HOST=localhost
+test -z "${LISTEN_PORT}" && export LISTEN_PORT=3031
+test -z "${PIDFILE}" && export PIDFILE=/tmp/hex-zero.pid
+test -z "${LOGFILE}" && export LOGFILE=/var/log/hex-zero/hex-zero.log
+test -z "${UWSGI_OPTS}" && export UWSGI_OPTS="--http-socket ${LISTEN_HOST}:${LISTEN_PORT} --wsgi-file /var/www/0x0/hex-zero.py --callable app --log-x-forwarded-for --logto ${LOGFILE} --touch-reload /var/www/0x0/hex-zero.py --touch-reload /var/www/0x0/hex-zero.conf --pidfile ${PIDFILE}"
+
+#test -n "${FORCE_KILL_OLD_UWSGI}" && {
+# ps -o user=,pid=,command:80= -u "${UWSGI_USER}" | awk '/hex-zero\.py/{print $2}' | xargs --no-run-if-empty kill
+#}
+
+#test "${UWSGI_USER}" != "${USER}" && {
+# printf "Please run $0 as user UWSGI_USER (${UWSGI_USER}) and not $USER. Aborted.\n" 1>&2 ; exit 1 ;
+#}
+
+${UWSGI_BIN} ${UWSGI_OPTS}
bgstack15