mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-04-05 00:44:08 -04:00
fix(tubearchivist): use Docker-compatible paths for cache/media
TubeArchivist uses TA_CACHE_DIR and TA_MEDIA_DIR directly as URL paths. In Docker these are /cache and /youtube, matching nginx locations. Our paths (/opt/tubearchivist/cache, /opt/tubearchivist/media) broke video playback URLs and file downloads. Create symlinks /cache and /youtube pointing to data dirs, set env vars to match Docker defaults. Aligns nginx alias paths with official config.
This commit is contained in:
@@ -58,6 +58,10 @@ function update_script() {
|
|||||||
msg_info "Restoring Configuration"
|
msg_info "Restoring Configuration"
|
||||||
mv /opt/tubearchivist_env.bak /opt/tubearchivist/.env
|
mv /opt/tubearchivist_env.bak /opt/tubearchivist/.env
|
||||||
sed -i 's|^TA_APP_DIR=/opt/tubearchivist$|TA_APP_DIR=/opt/tubearchivist/backend|' /opt/tubearchivist/.env
|
sed -i 's|^TA_APP_DIR=/opt/tubearchivist$|TA_APP_DIR=/opt/tubearchivist/backend|' /opt/tubearchivist/.env
|
||||||
|
sed -i 's|^TA_CACHE_DIR=/opt/tubearchivist/cache$|TA_CACHE_DIR=/cache|' /opt/tubearchivist/.env
|
||||||
|
sed -i 's|^TA_MEDIA_DIR=/opt/tubearchivist/media$|TA_MEDIA_DIR=/youtube|' /opt/tubearchivist/.env
|
||||||
|
ln -sf /opt/tubearchivist/cache /cache
|
||||||
|
ln -sf /opt/tubearchivist/media /youtube
|
||||||
ln -sf /opt/tubearchivist/.env /opt/tubearchivist/backend/.env
|
ln -sf /opt/tubearchivist/.env /opt/tubearchivist/backend/.env
|
||||||
msg_ok "Restored Configuration"
|
msg_ok "Restored Configuration"
|
||||||
|
|
||||||
|
|||||||
@@ -83,14 +83,16 @@ fi
|
|||||||
TA_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
TA_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
ES_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
ES_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||||
mkdir -p /opt/tubearchivist/{cache,media}
|
mkdir -p /opt/tubearchivist/{cache,media}
|
||||||
|
ln -sf /opt/tubearchivist/cache /cache
|
||||||
|
ln -sf /opt/tubearchivist/media /youtube
|
||||||
cat <<EOF >/opt/tubearchivist/.env
|
cat <<EOF >/opt/tubearchivist/.env
|
||||||
TA_HOST=http://${LOCAL_IP}:8000
|
TA_HOST=http://${LOCAL_IP}:8000
|
||||||
TA_USERNAME=admin
|
TA_USERNAME=admin
|
||||||
TA_PASSWORD=${TA_PASSWORD}
|
TA_PASSWORD=${TA_PASSWORD}
|
||||||
TA_BACKEND_PORT=8080
|
TA_BACKEND_PORT=8080
|
||||||
TA_APP_DIR=/opt/tubearchivist/backend
|
TA_APP_DIR=/opt/tubearchivist/backend
|
||||||
TA_CACHE_DIR=/opt/tubearchivist/cache
|
TA_CACHE_DIR=/cache
|
||||||
TA_MEDIA_DIR=/opt/tubearchivist/media
|
TA_MEDIA_DIR=/youtube
|
||||||
ES_SNAPSHOT_DIR=/var/lib/elasticsearch/snapshot
|
ES_SNAPSHOT_DIR=/var/lib/elasticsearch/snapshot
|
||||||
ELASTIC_PASSWORD=${ES_PASSWORD}
|
ELASTIC_PASSWORD=${ES_PASSWORD}
|
||||||
REDIS_CON=redis://localhost:6379
|
REDIS_CON=redis://localhost:6379
|
||||||
@@ -127,22 +129,22 @@ server {
|
|||||||
|
|
||||||
location /cache/videos/ {
|
location /cache/videos/ {
|
||||||
auth_request /_auth;
|
auth_request /_auth;
|
||||||
alias /opt/tubearchivist/cache/videos/;
|
alias /cache/videos/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /cache/channels/ {
|
location /cache/channels/ {
|
||||||
auth_request /_auth;
|
auth_request /_auth;
|
||||||
alias /opt/tubearchivist/cache/channels/;
|
alias /cache/channels/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /cache/playlists/ {
|
location /cache/playlists/ {
|
||||||
auth_request /_auth;
|
auth_request /_auth;
|
||||||
alias /opt/tubearchivist/cache/playlists/;
|
alias /cache/playlists/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /media/ {
|
location /media/ {
|
||||||
auth_request /_auth;
|
auth_request /_auth;
|
||||||
alias /opt/tubearchivist/media/;
|
alias /youtube/;
|
||||||
types {
|
types {
|
||||||
text/vtt vtt;
|
text/vtt vtt;
|
||||||
}
|
}
|
||||||
@@ -150,7 +152,7 @@ server {
|
|||||||
|
|
||||||
location /youtube/ {
|
location /youtube/ {
|
||||||
auth_request /_auth;
|
auth_request /_auth;
|
||||||
alias /opt/tubearchivist/media/;
|
alias /youtube/;
|
||||||
types {
|
types {
|
||||||
video/mp4 mp4;
|
video/mp4 mp4;
|
||||||
}
|
}
|
||||||
@@ -270,7 +272,7 @@ User=root
|
|||||||
WorkingDirectory=/opt/tubearchivist/backend
|
WorkingDirectory=/opt/tubearchivist/backend
|
||||||
EnvironmentFile=/opt/tubearchivist/.env
|
EnvironmentFile=/opt/tubearchivist/.env
|
||||||
Environment=PATH=/opt/tubearchivist/.venv/bin:/usr/local/bin:/usr/bin:/bin
|
Environment=PATH=/opt/tubearchivist/.venv/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
ExecStartPre=/bin/bash -c 'for i in \$(seq 1 60); do sqlite3 /opt/tubearchivist/cache/db.sqlite3 "SELECT 1 FROM django_celery_beat_crontabschedule LIMIT 1" 2>/dev/null && exit 0; sleep 2; done; exit 1'
|
ExecStartPre=/bin/bash -c 'for i in \$(seq 1 60); do sqlite3 /cache/db.sqlite3 "SELECT 1 FROM django_celery_beat_crontabschedule LIMIT 1" 2>/dev/null && exit 0; sleep 2; done; exit 1'
|
||||||
ExecStart=/opt/tubearchivist/.venv/bin/celery -A task beat --loglevel=error --scheduler django_celery_beat.schedulers:DatabaseScheduler
|
ExecStart=/opt/tubearchivist/.venv/bin/celery -A task beat --loglevel=error --scheduler django_celery_beat.schedulers:DatabaseScheduler
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
Reference in New Issue
Block a user