mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-10 17:34:41 +00:00
Tududi: v0.81
- Update NodeJS to 22 - Account for changes to env and npm scripts
This commit is contained in:
parent
2494af7e1c
commit
591d0f8940
2 changed files with 24 additions and 14 deletions
11
ct/tududi.sh
11
ct/tududi.sh
|
@ -27,17 +27,22 @@ function update_script() {
|
|||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
if check_for_gh_release "tududi" "chrisvel/tududi"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop tududi
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Remove and backup Files"
|
||||
DB="$(sed -n '/^DB_FILE/s/[^=]*=//p' /opt/tududi/backend/.env)"
|
||||
export DB_FILE="$DB"
|
||||
cp /opt/tududi/backend/.env /opt/tududi.env
|
||||
rm -rf /opt/tududi/backend/dist
|
||||
msg_ok "Backup and removed Files"
|
||||
|
||||
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "v0.80" "/opt/tududi"
|
||||
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
||||
|
||||
msg_info "Updating ${APP}"
|
||||
cd /opt/tududi
|
||||
|
@ -48,6 +53,10 @@ function update_script() {
|
|||
mv ./public/locales ./backend/dist
|
||||
mv ./public/favicon.* ./backend/dist
|
||||
mv /opt/tududi.env /opt/tududi/.env
|
||||
sed -i -e 's|/tududi$|/tududi/backend|' \
|
||||
-e 's|npm run start|bash /opt/tududi/backend/cmd/start.sh|' \
|
||||
/etc/systemd/system/tududi.service
|
||||
systemctl daemon-reload
|
||||
msg_ok "Updated $APP"
|
||||
|
||||
msg_info "Starting Service"
|
||||
|
|
|
@ -19,8 +19,8 @@ $STD apt-get install -y \
|
|||
yq
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="20" setup_nodejs
|
||||
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "v0.80" "/opt/tududi"
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
||||
|
||||
msg_info "Configuring Tududi"
|
||||
cd /opt/tududi
|
||||
|
@ -37,15 +37,16 @@ DB_LOCATION="/opt/tududi-db"
|
|||
UPLOAD_DIR="/opt/tududi-uploads"
|
||||
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
|
||||
SECRET="$(openssl rand -hex 64)"
|
||||
sed -e 's/^GOOGLE/# &/' \
|
||||
-e '/TUDUDI_SESSION/s/^# //' \
|
||||
-e '/NODE_ENV/s/^# //' \
|
||||
-e "s/your_session_secret_here/$SECRET/" \
|
||||
-e 's/development/production/' \
|
||||
-e "\$a\DB_FILE=$DB_LOCATION/production.sqlite3" \
|
||||
-e "\$a\TUDUDI_UPLOAD_PATH=$UPLOAD_DIR" \
|
||||
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
|
||||
export DB_FILE="$DB_LOCATION/production.sqlite3"
|
||||
cat <<EOF >/opt/tududi/backend/.env
|
||||
TUDUDI_SESSION_SECRET=${SECRET}
|
||||
TUDUDI_ALLOWED_ORIGINS=<your tududi IP or FQDN>
|
||||
NODE_ENV=production
|
||||
DB_FILE=${DB_LOCATION}/production.sqlite3
|
||||
TUDUDI_UPLOAD_PATH=${UPLOAD_DIR}
|
||||
DISABLE_TELEGRAM=true
|
||||
DIABLE_SCHEDULER=false
|
||||
EOF
|
||||
export DB_FILE="${DB_LOCATION}/production.sqlite3"
|
||||
$STD npm run db:init
|
||||
msg_ok "Created env and database"
|
||||
|
||||
|
@ -57,9 +58,9 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/tududi
|
||||
WorkingDirectory=/opt/tududi/backend
|
||||
EnvironmentFile=/opt/tududi/backend/.env
|
||||
ExecStart=/usr/bin/npm run start
|
||||
ExecStart=/usr/bin/bash /opt/tududi/backend/cmd/start.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue