remove unnecessary dependencies; clean up worker & web install; remove zip after cleanup

This commit is contained in:
vhsdream 2024-11-28 16:57:42 -05:00
parent ed25d43a79
commit a0f6e148b5

View File

@ -15,8 +15,6 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
python3 \
python3-distutils \
g++ \ g++ \
build-essential \ build-essential \
curl \ curl \
@ -25,13 +23,6 @@ $STD apt-get install -y \
gnupg \ gnupg \
ca-certificates \ ca-certificates \
chromium \ chromium \
libpixman-1-dev \
libcairo2-dev \
libjpeg-dev \
libpango1.0-dev \
libgif-dev \
librsvg2-dev \
pkg-config \
mc mc
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
@ -72,9 +63,6 @@ RELEASE=$(curl -s https://api.github.com/repos/hoarder-app/hoarder/releases/late
wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip" wget -q "https://github.com/hoarder-app/hoarder/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip unzip -q v${RELEASE}.zip
mv hoarder-${RELEASE} /opt/hoarder mv hoarder-${RELEASE} /opt/hoarder
mkdir -p /opt/hoarder_data
cd /opt/hoarder cd /opt/hoarder
corepack enable corepack enable
export PUPPETEER_SKIP_DOWNLOAD="true" export PUPPETEER_SKIP_DOWNLOAD="true"
@ -82,14 +70,12 @@ export NEXT_TELEMETRY_DISABLED=1
export CI="true" export CI="true"
cd /opt/hoarder/apps/web cd /opt/hoarder/apps/web
$STD pnpm install --frozen-lockfile $STD pnpm install --frozen-lockfile
cd /opt/hoarder/apps/workers
$STD pnpm install --frozen-lockfile
cd /opt/hoarder/apps/web
$STD pnpm exec next build --experimental-build-mode compile $STD pnpm exec next build --experimental-build-mode compile
cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web cp -r /opt/hoarder/apps/web/.next/standalone/apps/web/server.js /opt/hoarder/apps/web
cd /opt/hoarder/apps/workers
$STD pnpm install --frozen-lockfile
HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24) HOARDER_SECRET=$(openssl rand -base64 36 | cut -c1-24)
cat <<EOF >/opt/hoarder/.env cat <<EOF >/opt/hoarder/.env
SERVER_VERSION=$RELEASE SERVER_VERSION=$RELEASE
NEXTAUTH_SECRET="$HOARDER_SECRET" NEXTAUTH_SECRET="$HOARDER_SECRET"
@ -103,6 +89,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Hoarder" msg_ok "Installed Hoarder"
msg_info "Running Database Migration" msg_info "Running Database Migration"
mkdir -p /opt/hoarder_data
cd /opt/hoarder/packages/db cd /opt/hoarder/packages/db
$STD pnpm migrate $STD pnpm migrate
mv db.db /opt/hoarder_data mv db.db /opt/hoarder_data
@ -177,6 +164,7 @@ customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -rf /tmp/meilisearch.deb rm -rf /tmp/meilisearch.deb
rm -f /opt/v${RELEASE}.zip
$STD apt-get autoremove -y $STD apt-get autoremove -y
$STD apt-get autoclean -y $STD apt-get autoclean -y
msg_ok "Cleaned" msg_ok "Cleaned"