Update babybuddy-install.sh

This commit is contained in:
CanbiZ 2025-05-16 08:14:07 +02:00
parent ae69dfd36e
commit e389f015f6

View File

@ -22,10 +22,12 @@ $STD apt-get install -y \
libpq-dev \
nginx \
python3 \
python3-venv \
python3-pip
python3-pip \
pipx
msg_ok "Installed Dependencies"
setup_uv
msg_info "Installing Babybuddy"
cd /opt
RELEASE=$(curl -fsSL https://api.github.com/repos/babybuddy/babybuddy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
@ -34,18 +36,17 @@ unzip -q v${RELEASE}.zip
mv babybuddy-${RELEASE} /opt/babybuddy
rm "v${RELEASE}.zip"
cd /opt/babybuddy
$STD pip install -U pip wheel pipenv
export PIPENV_VENV_IN_PROJECT=1
export PIPENV_IGNORE_VIRTUALENVS=1
export PIPENV_VERBOSITY=-1
$STD pipenv install
#$STD pipenv shell
mkdir -p /opt/data
uv venv .venv
source .venv/bin/activate
uv pip install -r requirements.txt
cp babybuddy/settings/production.example.py babybuddy/settings/production.py
touch /opt/babybuddy/data/db.sqlite3
chown -R www-data:www-data /opt/babybuddy/data
chmod 640 /opt/babybuddy/data/db.sqlite3
chmod 750 /opt/babybuddy/data
touch /opt/data/db.sqlite3
chown -R www-data:www-data /opt/data
chmod 640 /opt/data/db.sqlite3
chmod 750 /opt/data
cp babybuddy/settings/production.example.py babybuddy/settings/production.py
SECRET_KEY=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)
ALLOWED_HOSTS=$(hostname -I | tr ' ' ',' | sed 's/,$//')",127.0.0.1,localhost"
sed -i \
@ -56,12 +57,6 @@ sed -i \
export DJANGO_SETTINGS_MODULE=babybuddy.settings.production
python manage.py migrate
# Berechtigungen setzen
chown -R www-data:www-data /opt/babybuddy/data
chmod 640 /opt/babybuddy/data/db.sqlite3
chmod 750 /opt/babybuddy/data
msg_ok "Installed BabyBuddy WebApp"
# Django Admin Setup
DJANGO_ADMIN_USER=admin
DJANGO_ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)