@@ -18,38 +18,17 @@ msg_info "Installing Dependencies"
1818$STD apt install -y \
1919 python3 \
2020 cmake \
21- g++ \
2221 build-essential \
23- git \
24- ca-certificates
22+ git
2523msg_ok " Installed Dependencies"
2624
2725NODE_VERSION=" 22" NODE_MODULE=" pnpm@$( curl -s https://raw.githubusercontent.com/msgbyte/tianji/master/package.json | jq -r ' .packageManager | split("@")[1]' ) " setup_nodejs
2826PG_VERSION=" 17" setup_postgresql
27+ PG_DB_NAME=" tianji_db" PG_DB_USER=" tianji" setup_postgresql_db
2928PYTHON_VERSION=" 3.13" setup_uv
30-
31- msg_info " Setting up PostgreSQL"
32- DB_NAME=tianji_db
33- DB_USER=tianji
34- DB_PASS=" $( openssl rand -base64 18 | cut -c1-13) "
35- TIANJI_SECRET=" $( openssl rand -base64 32 | cut -c1-24) "
36- $STD sudo -u postgres psql -c " CREATE DATABASE $DB_NAME ;"
37- $STD sudo -u postgres psql -c " CREATE USER $DB_USER WITH PASSWORD '$DB_PASS ';"
38- $STD sudo -u postgres psql -c " GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO $DB_USER ;"
39- $STD sudo -u postgres psql -c " ALTER DATABASE $DB_NAME OWNER TO $DB_USER ;"
40- $STD sudo -u postgres psql -c " ALTER USER $DB_USER WITH SUPERUSER;"
41- {
42- echo " "
43- echo " Database User: $DB_USER "
44- echo " Database Password: $DB_PASS "
45- echo " Database Name: $DB_NAME "
46- echo " Tianji Secret: $TIANJI_SECRET "
47- } >> ~/tianji.creds
48- msg_ok " Set up PostgreSQL"
49-
5029fetch_and_deploy_gh_release " tianji" " msgbyte/tianji"
5130
52- msg_info " Setup Tianji"
31+ msg_info " Setting up Tianji"
5332cd /opt/tianji
5433$STD pnpm install --filter @tianji/client... --config.dedupe-peer-dependents=false --frozen-lockfile
5534$STD pnpm build:static
@@ -69,7 +48,7 @@ rm -rf /opt/tianji/website
6948rm -rf /opt/tianji/reporter
7049msg_ok " Setup Tianji"
7150
72- msg_info " Setup AppRise"
51+ msg_info " Setting up AppRise"
7352$STD uv pip install apprise cryptography --system
7453msg_ok " Setup AppRise"
7554
@@ -84,7 +63,6 @@ ExecStart=/usr/bin/node /opt/tianji/src/server/dist/src/server/main.js
8463WorkingDirectory=/opt/tianji/src/server
8564Restart=always
8665RestartSec=10
87-
8866Environment=NODE_ENV=production
8967
9068[Install]
0 commit comments