Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
[[ $EUID -eq 0 ]] || { echo 'Run as root on the target Ubuntu server.'; exit 1; }
|
||||
[[ "$PWD" == /opt/dilib-dashboard ]] || { echo 'Extract project to /opt/dilib-dashboard first.'; exit 1; }
|
||||
apt-get update
|
||||
apt-get install -y python3 python3-venv python3-dev build-essential libpq-dev postgresql postgresql-client redis-server
|
||||
id dilib >/dev/null 2>&1 || useradd --system --home /var/lib/dilib-dashboard --shell /usr/sbin/nologin dilib
|
||||
install -d -o dilib -g dilib -m 750 /var/lib/dilib-dashboard
|
||||
install -d -m 750 -o root -g dilib /etc/dilib-dashboard
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
if [[ ! -f /etc/dilib-dashboard/dashboard.env ]]; then
|
||||
install -m 640 -o root -g dilib .env.example /etc/dilib-dashboard/dashboard.env
|
||||
.venv/bin/python scripts/generate-secrets.py /etc/dilib-dashboard/dashboard.env
|
||||
fi
|
||||
install -m 644 deploy/systemd/dilib-{api,ui,worker,beat,backup}.service /etc/systemd/system/
|
||||
install -m 644 deploy/systemd/dilib-backup.timer /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
printf '%s\n' 'Dependencies installed. Configure database, environment and HTTPS as described in docs/INSTALLATION.md. Services are not started yet.'
|
||||
Reference in New Issue
Block a user