Skip to content

Commit abc9e56

Browse files
authored
tubearchivist: fix: enhance update script (#16521)
1 parent 4255711 commit abc9e56

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

ct/tubearchivist.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ function update_script() {
3535
systemctl stop tubearchivist tubearchivist-celery tubearchivist-beat
3636
msg_ok "Stopped Services"
3737

38-
create_backup /opt/tubearchivist/.env
38+
create_backup \
39+
/opt/tubearchivist/.env \
40+
/opt/tubearchivist/cache \
41+
/opt/tubearchivist/backend/run.sh
3942

4043
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tubearchivist" "tubearchivist/tubearchivist" "tarball"
4144

@@ -48,6 +51,8 @@ function update_script() {
4851
mkdir -p /opt/tubearchivist/backend/static
4952
cp -r /opt/tubearchivist/frontend/dist/* /opt/tubearchivist/backend/static/
5053
cp /opt/tubearchivist/docker_assets/backend_start.py /opt/tubearchivist/backend/
54+
rm -rf /opt/tubearchivist/.venv
55+
$STD uv venv /opt/tubearchivist/.venv --python 3.13
5156
$STD uv pip install --python /opt/tubearchivist/.venv/bin/python -r /opt/tubearchivist/backend/requirements.txt
5257
if [[ -f /opt/tubearchivist/backend/requirements.plugins.txt ]]; then
5358
mkdir -p /opt/yt_plugins/bgutil
@@ -59,8 +64,14 @@ function update_script() {
5964
sed -i 's|^TA_APP_DIR=/opt/tubearchivist$|TA_APP_DIR=/opt/tubearchivist/backend|' /opt/tubearchivist/.env
6065
sed -i 's|^TA_CACHE_DIR=/opt/tubearchivist/cache$|TA_CACHE_DIR=/cache|' /opt/tubearchivist/.env
6166
sed -i 's|^TA_MEDIA_DIR=/opt/tubearchivist/media$|TA_MEDIA_DIR=/youtube|' /opt/tubearchivist/.env
62-
ln -sf /opt/tubearchivist/cache /cache
63-
ln -sf /opt/tubearchivist/media /youtube
67+
ln -sfn /opt/tubearchivist/cache /cache
68+
# /youtube may already be a user-managed Proxmox bind mount. Only create the symlink if nothing is there
69+
if [[ ! -e /youtube ]]; then
70+
mkdir -p /opt/tubearchivist/media
71+
ln -sfn /opt/tubearchivist/media /youtube
72+
elif ! mountpoint -q /youtube && [[ ! -L /youtube ]]; then
73+
msg_error "/youtube exists but is neither a mount nor a symlink - check manually"
74+
fi
6475
ln -sf /opt/tubearchivist/.env /opt/tubearchivist/backend/.env
6576
msg_ok "Restored Configuration"
6677

0 commit comments

Comments
 (0)