diff --git a/install/healthchecks-install.sh b/install/healthchecks-install.sh index 84ed2a52..f6708b66 100644 --- a/install/healthchecks-install.sh +++ b/install/healthchecks-install.sh @@ -15,15 +15,15 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - gcc \ - libpq-dev \ - libcurl4-openssl-dev \ - libssl-dev + gcc \ + libpq-dev \ + libcurl4-openssl-dev \ + libssl-dev msg_ok "Installed Dependencies" msg_info "Setup Python3" $STD apt-get install -y \ - python3 python3-dev python3-pip + python3 python3-dev python3-pip $STD pip install --upgrade pip msg_ok "Setup Python3" @@ -42,23 +42,25 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8' $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" { - echo "healthchecks-Credentials" - echo "healthchecks Database User: $DB_USER" - echo "healthchecks Database Password: $DB_PASS" - echo "healthchecks Database Name: $DB_NAME" + echo "healthchecks-Credentials" + echo "healthchecks Database User: $DB_USER" + echo "healthchecks Database Password: $DB_PASS" + echo "healthchecks Database Name: $DB_NAME" } >>~/healthchecks.creds msg_ok "Set up Database" msg_info "Setup healthchecks" fetch_and_deploy_gh_release "healthchecks" "healthchecks/healthchecks" "source" cd /opt/healthchecks +mkdir -p /opt/healthchecks/static-collected/ $STD uv venv .venv $STD source .venv/bin/activate $STD uv pip install wheel $STD uv pip install gunicorn $STD uv pip install -r requirements.txt +LOCAL_IP=$(hostname -I | awk '{print $1}') cat </opt/healthchecks/.env -ALLOWED_HOSTS=0.0.0.0 +ALLOWED_HOSTS=${LOCAL_IP},localhost,127.0.0.1 DB=postgres DB_HOST=localhost DB_PORT=5432 @@ -87,7 +89,8 @@ SITE_ROOT=http://0.0.0.0:8000 EOF $STD .venv/bin/python3 manage.py makemigrations -$STD .venv/bin/python3 manage.py migrate +$STD .venv/bin/python3 manage.py migrate --noinput +$STD .venv/bin/python3 manage.py collectstatic --noinput ADMIN_EMAIL="admin@helper-scripts.local" ADMIN_PASSWORD="$DB_PASS"