mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
Merge branch 'daemon-rework' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into daemon-rework
This commit is contained in:
commit
d187a83b54
4
.env.tpl
4
.env.tpl
@ -120,6 +120,10 @@ NOPAQUE_ADMIN=
|
|||||||
# Swarm nodes
|
# Swarm nodes
|
||||||
# NOPAQUE_DATA_DIR=
|
# NOPAQUE_DATA_DIR=
|
||||||
|
|
||||||
|
# CHOOSE ONE: False, True
|
||||||
|
# DEFAULT: False
|
||||||
|
# NOPAQUE_DAEMON_ENABLED=
|
||||||
|
|
||||||
# DEFAULT: 0.0.0.0
|
# DEFAULT: 0.0.0.0
|
||||||
# NOPAQUE_HOST=
|
# NOPAQUE_HOST=
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ RUN apt-get update \
|
|||||||
&& apt-get install --no-install-recommends --yes \
|
&& apt-get install --no-install-recommends --yes \
|
||||||
build-essential \
|
build-essential \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
wait-for-it \
|
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class Role(db.Model):
|
|||||||
# Fields
|
# Fields
|
||||||
default = db.Column(db.Boolean, default=False, index=True)
|
default = db.Column(db.Boolean, default=False, index=True)
|
||||||
name = db.Column(db.String(64), unique=True)
|
name = db.Column(db.String(64), unique=True)
|
||||||
permissions = db.Column(db.BigInteger)
|
permissions = db.Column(db.Integer)
|
||||||
# Relationships
|
# Relationships
|
||||||
users = db.relationship('User', backref='role', lazy='dynamic')
|
users = db.relationship('User', backref='role', lazy='dynamic')
|
||||||
|
|
||||||
|
29
web/boot.sh
29
web/boot.sh
@ -1,21 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ "${NOPAQUE_DAEMON_ENABLED}" == "True" ]]; then
|
||||||
|
echo "Starting nopaque daemon..."
|
||||||
|
./nopaque-daemon.sh &
|
||||||
|
fi
|
||||||
|
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
|
|
||||||
while true; do
|
if [[ "${#}" -eq 0 ]]; then
|
||||||
flask deploy
|
while true; do
|
||||||
if [[ "$?" == "0" ]]; then
|
flask deploy
|
||||||
break
|
if [[ "${?}" == "0" ]]; then
|
||||||
fi
|
break
|
||||||
echo Deploy command failed, retrying in 5 secs...
|
fi
|
||||||
sleep 5
|
echo Deploy command failed, retrying in 5 secs...
|
||||||
done
|
sleep 5
|
||||||
|
done
|
||||||
if [[ "$#" -eq 0 ]]; then
|
|
||||||
python nopaque.py
|
python nopaque.py
|
||||||
elif [[ "$1" == "flask" ]]; then
|
elif [[ "${1}" == "flask" ]]; then
|
||||||
exec ${@:1}
|
exec ${@:1}
|
||||||
else
|
else
|
||||||
echo "$0 [COMMAND]"
|
echo "${0} [COMMAND]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "nopaque startup script"
|
echo "nopaque startup script"
|
||||||
echo ""
|
echo ""
|
||||||
|
7
web/nopaque-daemon.sh
Executable file
7
web/nopaque-daemon.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
flask tasks
|
||||||
|
sleep 10
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user