mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-05 21:14:27 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a5a7f0515 |
+14
-2
@@ -32,7 +32,14 @@ function update_script() {
|
|||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
|
||||||
if check_for_gh_release "tududi" "chrisvel/tududi"; then
|
RELEASE=""
|
||||||
|
if ! grep -qs '^DATABASE_URL=' /opt/tududi/backend/.env; then
|
||||||
|
RELEASE="v1.15.0"
|
||||||
|
msg_warn "Tududi 2.0 runs on PostgreSQL only, so this SQLite install stays on 1.15.0"
|
||||||
|
msg_warn "To move to 2.0, export in Settings > Backups and import into a new Tududi LXC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_for_gh_release "tududi" "chrisvel/tududi" "${RELEASE}" "2.0 needs PostgreSQL"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop tududi
|
systemctl stop tududi
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
@@ -43,9 +50,14 @@ function update_script() {
|
|||||||
else
|
else
|
||||||
cp /opt/tududi/.env /opt/tududi.env
|
cp /opt/tududi/.env /opt/tududi.env
|
||||||
fi
|
fi
|
||||||
|
if ! grep -q '^TUDUDI_UPLOAD_PATH=' /opt/tududi.env; then
|
||||||
|
mkdir -p /opt/tududi-uploads
|
||||||
|
[[ -d /opt/tududi/backend/uploads ]] && cp -a /opt/tududi/backend/uploads/. /opt/tududi-uploads/
|
||||||
|
echo "TUDUDI_UPLOAD_PATH=/opt/tududi-uploads" >>/opt/tududi.env
|
||||||
|
fi
|
||||||
msg_ok "Backed up env file"
|
msg_ok "Backed up env file"
|
||||||
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "${CHECK_UPDATE_RELEASE}" "/opt/tududi"
|
||||||
|
|
||||||
msg_info "Updating Tududi"
|
msg_info "Updating Tududi"
|
||||||
cd /opt/tududi
|
cd /opt/tududi
|
||||||
|
|||||||
@@ -13,13 +13,9 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
|
||||||
$STD apt install -y \
|
|
||||||
sqlite3 \
|
|
||||||
yq
|
|
||||||
msg_ok "Installed Dependencies"
|
|
||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
PG_VERSION="17" setup_postgresql
|
||||||
|
PG_DB_NAME="tududi" PG_DB_USER="tududi" setup_postgresql_db
|
||||||
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
||||||
|
|
||||||
msg_info "Configuring Tududi"
|
msg_info "Configuring Tududi"
|
||||||
@@ -30,30 +26,22 @@ $STD npm run frontend:build
|
|||||||
mv ./dist ./backend
|
mv ./dist ./backend
|
||||||
msg_ok "Configured Tududi"
|
msg_ok "Configured Tududi"
|
||||||
|
|
||||||
msg_info "Creating env and database"
|
msg_info "Creating env"
|
||||||
DB_LOCATION="/opt/tududi-db"
|
mkdir -p /opt/tududi-uploads
|
||||||
UPLOAD_DIR="/opt/tududi-uploads"
|
|
||||||
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
|
|
||||||
SECRET="$(openssl rand -hex 64)"
|
SECRET="$(openssl rand -hex 64)"
|
||||||
sed -e '/^NODE_ENV=/s/=.*$/=production/' \
|
sed -e '/^NODE_ENV=/s/=.*$/=production/' \
|
||||||
-e 's/^TUDUDI_USER/# TUDUDI_USER/g' \
|
-e 's/^TUDUDI_USER/# TUDUDI_USER/g' \
|
||||||
-e "/_SECRET=/s/=.*$/=${SECRET}/" \
|
-e "s/^TUDUDI_SESSION_SECRET=.*/TUDUDI_SESSION_SECRET=${SECRET}/" \
|
||||||
-e '/^# DB_FILE=/s/^# //' \
|
-e "s|^DATABASE_URL=.*|DATABASE_URL=postgres://tududi:${PG_DB_PASS}@localhost:5432/tududi|" \
|
||||||
-e "s|^DB_FILE=.*|DB_FILE=${DB_LOCATION}/production.sqlite3|" \
|
|
||||||
-e "/^# TUDUDI_ALLOWED/s/^# //; \
|
|
||||||
\|_ORIGINS=|s|=.*$|=<your tududi IP or FDQN>|" \
|
|
||||||
-e "/^# TUDUDI_UPLOAD/s/^# //; \
|
|
||||||
\|UPLOAD_PATH=|s|=.*$|=${UPLOAD_DIR}|" \
|
|
||||||
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
|
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
|
||||||
export DB_FILE="${DB_LOCATION}/production.sqlite3"
|
echo "TUDUDI_UPLOAD_PATH=/opt/tududi-uploads" >>/opt/tududi/backend/.env
|
||||||
$STD npm run db:init
|
msg_ok "Created env"
|
||||||
msg_ok "Created env and database"
|
|
||||||
|
|
||||||
msg_info "Creating service"
|
msg_info "Creating service"
|
||||||
cat <<EOF >/etc/systemd/system/tududi.service
|
cat <<EOF >/etc/systemd/system/tududi.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Tududi Service
|
Description=Tududi Service
|
||||||
After=network.target
|
After=network.target postgresql.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
Reference in New Issue
Block a user