blob: 31cf1a4192271ac3ef3f0ff2747482fb964f375c (
plain)
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
|
#!/bin/bash
dir=/var/lib/webvirt_api
post_install() {
cd "$dir"
virtualenv -p python "$dir"/venv
source "$dir"/venv/bin/activate
poetry install
python manage.py migrate
python manage.py collectstatic --noinput
chown -R webvirt:webvirt "$dir"
# Set /etc/shadow permissions.
chown root:shadow /etc/shadow
chmod 640 /etc/shadow
cat << EOF
A UWSGI configuration is provided at /etc/uwsgi/webvirt_api.ini.
To start the API server:
# systemctl start uwsgi@webvirt_api
By default, the API is accessible at http://localhost:9080.
EOF
}
post_upgrade() {
post_install $1
}
op=$1
shift
$op $*
|