Skip to content

Commit 3348e2f

Browse files
authored
Tududi: v0.81 (#7517)
1 parent def41f6 commit 3348e2f

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

ct/tududi.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,22 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30+
31+
NODE_VERSION="22" setup_nodejs
32+
3033
if check_for_gh_release "tududi" "chrisvel/tududi"; then
3134
msg_info "Stopping Service"
3235
systemctl stop tududi
3336
msg_ok "Stopped Service"
3437

3538
msg_info "Remove and backup Files"
39+
DB="$(sed -n '/^DB_FILE/s/[^=]*=//p' /opt/tududi/backend/.env)"
40+
export DB_FILE="$DB"
3641
cp /opt/tududi/backend/.env /opt/tududi.env
3742
rm -rf /opt/tududi/backend/dist
3843
msg_ok "Backup and removed Files"
3944

40-
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "v0.80" "/opt/tududi"
45+
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
4146

4247
msg_info "Updating ${APP}"
4348
cd /opt/tududi
@@ -48,6 +53,10 @@ function update_script() {
4853
mv ./public/locales ./backend/dist
4954
mv ./public/favicon.* ./backend/dist
5055
mv /opt/tududi.env /opt/tududi/.env
56+
sed -i -e 's|/tududi$|/tududi/backend|' \
57+
-e 's|npm run start|bash /opt/tududi/backend/cmd/start.sh|' \
58+
/etc/systemd/system/tududi.service
59+
systemctl daemon-reload
5160
msg_ok "Updated $APP"
5261

5362
msg_info "Starting Service"

install/tududi-install.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ $STD apt-get install -y \
1919
yq
2020
msg_ok "Installed Dependencies"
2121

22-
NODE_VERSION="20" setup_nodejs
23-
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "v0.80" "/opt/tududi"
22+
NODE_VERSION="22" setup_nodejs
23+
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
2424

2525
msg_info "Configuring Tududi"
2626
cd /opt/tududi
@@ -37,15 +37,16 @@ DB_LOCATION="/opt/tududi-db"
3737
UPLOAD_DIR="/opt/tududi-uploads"
3838
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
3939
SECRET="$(openssl rand -hex 64)"
40-
sed -e 's/^GOOGLE/# &/' \
41-
-e '/TUDUDI_SESSION/s/^# //' \
42-
-e '/NODE_ENV/s/^# //' \
43-
-e "s/your_session_secret_here/$SECRET/" \
44-
-e 's/development/production/' \
45-
-e "\$a\DB_FILE=$DB_LOCATION/production.sqlite3" \
46-
-e "\$a\TUDUDI_UPLOAD_PATH=$UPLOAD_DIR" \
47-
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
48-
export DB_FILE="$DB_LOCATION/production.sqlite3"
40+
cat <<EOF >/opt/tududi/backend/.env
41+
TUDUDI_SESSION_SECRET=${SECRET}
42+
TUDUDI_ALLOWED_ORIGINS=<your tududi IP or FQDN>
43+
NODE_ENV=production
44+
DB_FILE=${DB_LOCATION}/production.sqlite3
45+
TUDUDI_UPLOAD_PATH=${UPLOAD_DIR}
46+
DISABLE_TELEGRAM=true
47+
DIABLE_SCHEDULER=false
48+
EOF
49+
export DB_FILE="${DB_LOCATION}/production.sqlite3"
4950
$STD npm run db:init
5051
msg_ok "Created env and database"
5152

@@ -57,9 +58,9 @@ After=network.target
5758
5859
[Service]
5960
Type=simple
60-
WorkingDirectory=/opt/tududi
61+
WorkingDirectory=/opt/tududi/backend
6162
EnvironmentFile=/opt/tududi/backend/.env
62-
ExecStart=/usr/bin/npm run start
63+
ExecStart=/usr/bin/bash /opt/tududi/backend/cmd/start.sh
6364
6465
[Install]
6566
WantedBy=multi-user.target

0 commit comments

Comments
 (0)