mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-11 09:54:36 +00:00
Tududi: v0.81 (#7517)
This commit is contained in:
parent
def41f66f4
commit
3348e2fff0
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!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
|
||||||
if check_for_gh_release "tududi" "chrisvel/tududi"; then
|
if check_for_gh_release "tududi" "chrisvel/tududi"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop tududi
|
systemctl stop tududi
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Remove and backup Files"
|
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
|
cp /opt/tududi/backend/.env /opt/tududi.env
|
||||||
rm -rf /opt/tududi/backend/dist
|
rm -rf /opt/tududi/backend/dist
|
||||||
msg_ok "Backup and removed Files"
|
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}"
|
msg_info "Updating ${APP}"
|
||||||
cd /opt/tududi
|
cd /opt/tududi
|
||||||
|
@ -48,6 +53,10 @@ function update_script() {
|
||||||
mv ./public/locales ./backend/dist
|
mv ./public/locales ./backend/dist
|
||||||
mv ./public/favicon.* ./backend/dist
|
mv ./public/favicon.* ./backend/dist
|
||||||
mv /opt/tududi.env /opt/tududi/.env
|
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_ok "Updated $APP"
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
|
|
|
@ -19,8 +19,8 @@ $STD apt-get install -y \
|
||||||
yq
|
yq
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
NODE_VERSION="20" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
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 "Configuring Tududi"
|
msg_info "Configuring Tududi"
|
||||||
cd /opt/tududi
|
cd /opt/tududi
|
||||||
|
@ -37,15 +37,16 @@ DB_LOCATION="/opt/tududi-db"
|
||||||
UPLOAD_DIR="/opt/tududi-uploads"
|
UPLOAD_DIR="/opt/tududi-uploads"
|
||||||
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
|
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
|
||||||
SECRET="$(openssl rand -hex 64)"
|
SECRET="$(openssl rand -hex 64)"
|
||||||
sed -e 's/^GOOGLE/# &/' \
|
cat <<EOF >/opt/tududi/backend/.env
|
||||||
-e '/TUDUDI_SESSION/s/^# //' \
|
TUDUDI_SESSION_SECRET=${SECRET}
|
||||||
-e '/NODE_ENV/s/^# //' \
|
TUDUDI_ALLOWED_ORIGINS=<your tududi IP or FQDN>
|
||||||
-e "s/your_session_secret_here/$SECRET/" \
|
NODE_ENV=production
|
||||||
-e 's/development/production/' \
|
DB_FILE=${DB_LOCATION}/production.sqlite3
|
||||||
-e "\$a\DB_FILE=$DB_LOCATION/production.sqlite3" \
|
TUDUDI_UPLOAD_PATH=${UPLOAD_DIR}
|
||||||
-e "\$a\TUDUDI_UPLOAD_PATH=$UPLOAD_DIR" \
|
DISABLE_TELEGRAM=true
|
||||||
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
|
DIABLE_SCHEDULER=false
|
||||||
export DB_FILE="$DB_LOCATION/production.sqlite3"
|
EOF
|
||||||
|
export DB_FILE="${DB_LOCATION}/production.sqlite3"
|
||||||
$STD npm run db:init
|
$STD npm run db:init
|
||||||
msg_ok "Created env and database"
|
msg_ok "Created env and database"
|
||||||
|
|
||||||
|
@ -57,9 +58,9 @@ After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/opt/tududi
|
WorkingDirectory=/opt/tududi/backend
|
||||||
EnvironmentFile=/opt/tududi/backend/.env
|
EnvironmentFile=/opt/tududi/backend/.env
|
||||||
ExecStart=/usr/bin/npm run start
|
ExecStart=/usr/bin/bash /opt/tududi/backend/cmd/start.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue