-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart_auth2
More file actions
executable file
·115 lines (107 loc) · 2.39 KB
/
Copy pathstart_auth2
File metadata and controls
executable file
·115 lines (107 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
shopt -s nocasematch;
PORT=""
runtype="server"
if [[ "$1" == "" ]]
then
envfile=".env.standalone"
backend="false"
elif [[ -f ".env.$1" ]]
then
envfile=".env.$1"
if [[ "$2" == "" ]]
then
backend="false"
elif [[ "$2" =~ ^(true|false)$ ]]
then
backend=$2
else
backend="false"
fi
elif [[ "$1" =~ ^[0-9]+$ ]]
then
PORT=$1
if [[ "$2" == "" ]]
then
envfile=".env.standalone"
backend="false"
elif [[ "$2" =~ ^(true|false)$ ]]
then
backend=$2
envfile=".env.standalone"
else
envfile=".env.$2"
if [[ "$3" == "" ]]
then
backend="false"
else
backend=$3
fi
fi
elif [[ "$1" =~ ^(true|false)$ ]]
then
backend=$1
envfile=".env.standalone"
else
envfile=".env.$1"
backend="false"
runtype="command"
command="$1"
if [[ "$2" == "" ]]
then
envfile=".env.standalone"
else
envfile=".env.$2"
fi
fi
#cp .env.server .env
set -a
source $envfile
if [[ "$runtype" == "command" ]]
then
backend="false"
echo "envfile=${envfile}"
else
if [[ "$PORT" == "" ]]
then
PORT=9060
fi
echo "port=${PORT}, backend=${backend}, envfile=${envfile}"
fi
if [[ "$backend" =~ ^true$ ]]
then
source .env.monitor
if [[ "$envfile" == ".env.standalone" ]]
then
echo 'Running auth2 server in background'
else
echo 'Running auth2 cluster in background'
fi
export RUNNING_MODE="eventlet"
#export RUNNING_MODE="gevent"
#export RUNNING_MODE="sync"
uv run gunicorn authome.wsgi --config=gunicorn-dev.py >./logs/auth2_${PORT}.log 2>&1 &
#poetry run python manage.py runserver 0.0.0.0:$PORT >./logs/auth2_${PORT}.log 2>&1 &
pid=$!
echo ${pid} > ./logs/auth2_${PORT}.pid
elif [[ "$runtype" == "command" ]]
then
export RUNNING_MODE="sync"
if [[ "$envfile" == ".env.standalone" ]]
then
echo 'Running auth2 shell in foreground'
else
echo 'Running auth2 cluster shell in foreground'
fi
uv run python manage.py $command
else
if [[ "$envfile" == ".env.standalone" ]]
then
echo 'Running auth2 server in foreground'
else
echo 'Running auth2 cluster in foreground'
fi
source .env.monitor
export RUNNING_MODE="sync"
uv run python manage.py runserver 0.0.0.0:$PORT
fi