Compare commits

...

2 Commits

Author SHA1 Message Date
CanbiZ 6bee7e291e
Update tianji-install.sh 2024-10-08 09:41:12 +02:00
CanbiZ 5420269e97
Fix Tianji Installation & Performance-Boost 2024-10-08 09:39:48 +02:00
1 changed files with 13 additions and 3 deletions

View File

@ -18,6 +18,9 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
postgresql \ postgresql \
python3 \
cmake \
g++ \
build-essential \ build-essential \
curl \ curl \
sudo \ sudo \
@ -36,6 +39,7 @@ $STD apt-get update
$STD apt-get install -y nodejs $STD apt-get install -y nodejs
$STD npm install -g pnpm@9.7.1 $STD npm install -g pnpm@9.7.1
$STD npm install -g pm2 $STD npm install -g pm2
export NODE_OPTIONS="--max_old_space_size=4096"
msg_ok "Installed Node.js, pnpm & pm2" msg_ok "Installed Node.js, pnpm & pm2"
msg_info "Setting up PostgreSQL" msg_info "Setting up PostgreSQL"
@ -62,9 +66,12 @@ wget -q "https://github.com/msgbyte/tianji/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip unzip -q v${RELEASE}.zip
mv tianji-${RELEASE} /opt/tianji mv tianji-${RELEASE} /opt/tianji
cd tianji cd tianji
export NODE_OPTIONS=--max_old_space_size=4096 $STD pnpm install --filter @tianji/client... --config.dedupe-peer-dependents=false --frozen-lockfile
$STD pnpm install $STD pnpm build:static
$STD pnpm build $STD pnpm install --filter @tianji/server... --config.dedupe-peer-dependents=false
mkdir -p ./src/server/public
cp -r ./geo ./src/server/public
$STD pnpm build:server
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
cat <<EOF >/opt/tianji/src/server/.env cat <<EOF >/opt/tianji/src/server/.env
DATABASE_URL="postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME?schema=public" DATABASE_URL="postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME?schema=public"
@ -84,6 +91,9 @@ customize
msg_info "Cleaning up" msg_info "Cleaning up"
rm -R /opt/v${RELEASE}.zip rm -R /opt/v${RELEASE}.zip
rm -rf /opt/tianji/src/client
rm -rf /opt/tianji/website
rm -rf /opt/tianji/reporter
$STD apt-get -y autoremove $STD apt-get -y autoremove
$STD apt-get -y autoclean $STD apt-get -y autoclean
msg_ok "Cleaned" msg_ok "Cleaned"