Compare commits

..

1 Commits

Author SHA1 Message Date
MickLesk 695cd75026 storyteller: fix build paths for upstream applications/web/ monorepo restructure 2026-08-19 22:37:43 +02:00
3 changed files with 17 additions and 85 deletions
+2 -37
View File
@@ -30,35 +30,9 @@ function update_script() {
exit
fi
if [[ ! -f /etc/systemd/system/bgutil-provider.service ]]; then
msg_info "Adding BgUtil POT Provider"
ensure_dependencies ffmpeg libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
fetch_and_deploy_gh_release "bgutil-ytdlp-pot-provider" "Brainicism/bgutil-ytdlp-pot-provider" "tarball"
cd /opt/bgutil-ytdlp-pot-provider/server
$STD npm ci
$STD npx tsc
cat <<EOF >/etc/systemd/system/bgutil-provider.service
[Unit]
Description=BgUtil YT-DLP POT Provider
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/bgutil-ytdlp-pot-provider/server
ExecStart=/usr/bin/node build/main.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now bgutil-provider
msg_ok "Added BgUtil POT Provider"
fi
if check_for_gh_release "tubearchivist" "tubearchivist/tubearchivist"; then
msg_info "Stopping Services"
systemctl stop bgutil-provider tubearchivist tubearchivist-celery tubearchivist-beat
systemctl stop tubearchivist tubearchivist-celery tubearchivist-beat
msg_ok "Stopped Services"
create_backup \
@@ -84,17 +58,8 @@ EOF
mkdir -p /opt/yt_plugins/bgutil
$STD uv pip install --python /opt/tubearchivist/.venv/bin/python --target /opt/yt_plugins/bgutil -r /opt/tubearchivist/backend/requirements.plugins.txt
fi
$STD uv pip install --python /opt/tubearchivist/.venv/bin/python -U --prerelease allow "yt-dlp[default]"
msg_ok "Rebuilt Tube Archivist"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "bgutil-ytdlp-pot-provider" "Brainicism/bgutil-ytdlp-pot-provider" "tarball"
msg_info "Rebuilding BgUtil POT Provider"
cd /opt/bgutil-ytdlp-pot-provider/server
$STD npm ci
$STD npx tsc
msg_ok "Rebuilt BgUtil POT Provider"
msg_info "Restoring Configuration"
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
@@ -111,7 +76,7 @@ EOF
msg_ok "Restored Configuration"
msg_info "Starting Services"
systemctl start bgutil-provider tubearchivist tubearchivist-celery tubearchivist-beat
systemctl start tubearchivist tubearchivist-celery tubearchivist-beat
systemctl reload nginx
msg_ok "Started Services"
msg_ok "Updated successfully!"
+12 -12
View File
@@ -34,7 +34,7 @@ msg_info "Setting up Storyteller"
cd /opt/storyteller
$STD corepack yarn install --network-timeout 600000
$STD gcc -g -fPIC -rdynamic -shared web/sqlite/uuid.c -o web/sqlite/uuid.c.so
$STD gcc -g -fPIC -rdynamic -shared applications/web/sqlite/uuid.c -o applications/web/sqlite/uuid.c.so
STORYTELLER_SECRET_KEY=$(openssl rand -base64 32)
cat <<EOF >/opt/storyteller/.env
STORYTELLER_SECRET_KEY=${STORYTELLER_SECRET_KEY}
@@ -60,17 +60,17 @@ export NODE_ENV=production
export NEXT_TELEMETRY_DISABLED=1
export SQLITE_NATIVE_BINDING=/opt/storyteller/node_modules/better-sqlite3/build/Release/better_sqlite3.node
$STD corepack yarn workspaces foreach -Rpt --from @storyteller-platform/web --exclude @storyteller-platform/eslint run build
mkdir -p /opt/storyteller/web/.next/standalone/web/.next/static
cp -rT /opt/storyteller/web/.next/static /opt/storyteller/web/.next/standalone/web/.next/static
if [[ -d /opt/storyteller/web/public ]]; then
mkdir -p /opt/storyteller/web/.next/standalone/web/public
cp -rT /opt/storyteller/web/public /opt/storyteller/web/.next/standalone/web/public
mkdir -p /opt/storyteller/applications/web/.next/standalone/applications/web/.next/static
cp -rT /opt/storyteller/applications/web/.next/static /opt/storyteller/applications/web/.next/standalone/applications/web/.next/static
if [[ -d /opt/storyteller/applications/web/public ]]; then
mkdir -p /opt/storyteller/applications/web/.next/standalone/applications/web/public
cp -rT /opt/storyteller/applications/web/public /opt/storyteller/applications/web/.next/standalone/applications/web/public
fi
mkdir -p /opt/storyteller/web/.next/standalone/web/migrations
cp -rT /opt/storyteller/web/migrations /opt/storyteller/web/.next/standalone/web/migrations
mkdir -p /opt/storyteller/web/.next/standalone/web/sqlite
cp -rT /opt/storyteller/web/sqlite /opt/storyteller/web/.next/standalone/web/sqlite
ln -sf /opt/storyteller/.env /opt/storyteller/web/.next/standalone/web/.env
mkdir -p /opt/storyteller/applications/web/.next/standalone/applications/web/migrations
cp -rT /opt/storyteller/applications/web/migrations /opt/storyteller/applications/web/.next/standalone/applications/web/migrations
mkdir -p /opt/storyteller/applications/web/.next/standalone/applications/web/sqlite
cp -rT /opt/storyteller/applications/web/sqlite /opt/storyteller/applications/web/.next/standalone/applications/web/sqlite
ln -sf /opt/storyteller/.env /opt/storyteller/applications/web/.next/standalone/applications/web/.env
msg_ok "Built Storyteller"
msg_info "Creating Service"
@@ -82,7 +82,7 @@ After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/storyteller/web/.next/standalone/web
WorkingDirectory=/opt/storyteller/applications/web/.next/standalone/applications/web
EnvironmentFile=/opt/storyteller/.env
ExecStart=/usr/bin/node --enable-source-maps server.js
Restart=on-failure
+3 -36
View File
@@ -25,26 +25,13 @@ $STD apt install -y \
libsasl2-dev \
libssl-dev \
sqlite3 \
ffmpeg \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
pkg-config
ffmpeg
msg_ok "Installed Dependencies"
UV_PYTHON="3.13" setup_uv
NODE_VERSION="24" setup_nodejs
fetch_and_deploy_gh_release "deno" "denoland/deno" "prebuild" "latest" "/usr/local/bin" "deno-$(arch_resolve "x86_64" "aarch64")-unknown-linux-gnu.zip"
fetch_and_deploy_gh_release "bgutil-ytdlp-pot-provider" "Brainicism/bgutil-ytdlp-pot-provider" "tarball"
msg_info "Building BgUtil POT Provider Server"
cd /opt/bgutil-ytdlp-pot-provider/server
$STD npm ci
$STD npx tsc
msg_ok "Built BgUtil POT Provider Server"
msg_info "Installing ElasticSearch"
setup_deb822_repo \
@@ -129,10 +116,6 @@ EOF
systemctl enable -q --now redis-server
msg_ok "Set up Tube Archivist"
msg_info "Installing yt-dlp Nightly"
$STD uv pip install --python /opt/tubearchivist/.venv/bin/python -U --prerelease allow "yt-dlp[default]"
msg_ok "Installed yt-dlp Nightly"
msg_info "Configuring Nginx"
sed -i 's/^user www-data;$/user root;/' /etc/nginx/nginx.conf
cat <<'EOF' >/etc/nginx/sites-available/default
@@ -247,26 +230,10 @@ exec $PYTHON backend_start.py
RUNEOF
chmod +x /opt/tubearchivist/backend/run.sh
ln -sf /opt/tubearchivist/.env /opt/tubearchivist/backend/.env
cat <<EOF >/etc/systemd/system/bgutil-provider.service
[Unit]
Description=BgUtil YT-DLP POT Provider
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/bgutil-ytdlp-pot-provider/server
ExecStart=/usr/bin/node build/main.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/tubearchivist.service
[Unit]
Description=Tube Archivist Backend
After=network.target elasticsearch.service redis-server.service bgutil-provider.service
After=network.target elasticsearch.service redis-server.service
[Service]
Type=simple
@@ -319,7 +286,7 @@ RuntimeMaxSec=3600
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now bgutil-provider tubearchivist tubearchivist-celery tubearchivist-beat
systemctl enable -q --now tubearchivist tubearchivist-celery tubearchivist-beat
msg_ok "Created Services"
motd_ssh