Skip to content

Commit b22d672

Browse files
authored
Merge pull request #1928 from ggfevans/fix/rackula-remove-self-verification
fix(rackula): drop self-verification blocks, align nginx -t with repo idiom
2 parents da1b8aa + b97ad6d commit b22d672

2 files changed

Lines changed: 3 additions & 44 deletions

File tree

ct/rackula.sh

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function update_script() {
3636
msg_ok "Stopped Services"
3737

3838
create_backup /opt/rackula/data
39-
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rackula" "RackulaLives/Rackula" "prebuild" "${var_version}" "/opt/rackula" "rackula-lxc-*.tar.gz"
39+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rackula" "RackulaLives/Rackula" "prebuild" "latest" "/opt/rackula" "rackula-lxc-*.tar.gz"
4040
restore_backup
4141

4242
msg_info "Updating Configuration"
@@ -62,29 +62,10 @@ function update_script() {
6262
msg_ok "Updated Configuration"
6363

6464
msg_info "Starting Services"
65-
if ! nginx -t >/dev/null 2>&1; then
66-
msg_error "nginx configuration test failed (run 'nginx -t' for details)"
67-
systemctl start nginx rackula-api || true
68-
exit 1
69-
fi
65+
$STD nginx -t
7066
systemctl start nginx rackula-api
7167
msg_ok "Started Services"
7268

73-
msg_info "Verifying Services"
74-
for i in $(seq 1 10); do
75-
if curl -sf --connect-timeout 2 --max-time 5 http://127.0.0.1/api/health >/dev/null 2>&1; then
76-
msg_ok "Service running successfully"
77-
break
78-
fi
79-
if [ "$i" -eq 10 ]; then
80-
msg_info "Last rackula-api logs"
81-
journalctl -u rackula-api --no-pager -n 50 || true
82-
msg_error "Service failed to respond on http://127.0.0.1/api/health within 10 seconds"
83-
exit 1
84-
fi
85-
sleep 1
86-
done
87-
8869
msg_ok "Updated successfully!"
8970
fi
9071
exit

install/rackula-install.sh

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ install -m 755 "$BUN_TMP/bun-linux-${BUN_VARIANT}/bun" /usr/local/bun/bin/bun
3636
rm -rf "$BUN_TMP"
3737
ln -sf /usr/local/bun/bin/bun /usr/local/bin/bun
3838
ln -sf /usr/local/bun/bin/bun /usr/local/bin/bunx
39-
[ -x /usr/local/bun/bin/bun ] || {
40-
msg_error "Bun installation failed"
41-
exit 1
42-
}
4339
msg_ok "Installed Bun"
4440

4541
fetch_and_deploy_gh_release "rackula" "RackulaLives/Rackula" "prebuild" "latest" "/opt/rackula" "rackula-lxc-*.tar.gz"
@@ -82,10 +78,7 @@ msg_info "Configuring nginx"
8278
cp /opt/rackula/config/nginx.conf /etc/nginx/sites-available/rackula
8379
rm -f /etc/nginx/sites-enabled/default
8480
ln -sf /etc/nginx/sites-available/rackula /etc/nginx/sites-enabled/rackula
85-
if ! $STD nginx -t; then
86-
msg_error "nginx configuration test failed (run 'nginx -t' for details)"
87-
exit 1
88-
fi
81+
$STD nginx -t
8982
msg_ok "Configured nginx"
9083

9184
msg_info "Creating Services"
@@ -106,21 +99,6 @@ systemctl enable -q nginx rackula-api
10699
systemctl restart nginx rackula-api
107100
msg_ok "Created Services"
108101

109-
msg_info "Verifying Services"
110-
for i in $(seq 0 9); do
111-
if curl -sf --connect-timeout 2 --max-time 5 http://127.0.0.1/api/health >/dev/null 2>&1; then
112-
msg_ok "Service running successfully"
113-
break
114-
fi
115-
sleep 1
116-
if [ "$i" -eq 9 ]; then
117-
msg_info "Last rackula-api logs"
118-
journalctl -u rackula-api --no-pager -n 50 || true
119-
msg_error "Service failed to respond on http://127.0.0.1/api/health within 10 seconds"
120-
exit 1
121-
fi
122-
done
123-
124102
motd_ssh
125103
customize
126104
cleanup_lxc

0 commit comments

Comments
 (0)