Skip to content

Commit 88795c5

Browse files
committed
feat: Implement PR feedback for Upgopher script
- Update Debian version from 12 to 13 - Replace manual download/extraction with fetch_and_deploy_gh_release function - Remove redundant curl/wget installation (already in core dependencies) - Remove unnecessary comments - Add apt clean -y to cleanup section - Modernize apt-get commands to apt - Update success message to 'Updated successfully!' - Fix asset pattern to match release files (upgopher_*_linux_amd64.tar.gz)
1 parent bc3c833 commit 88795c5

File tree

3 files changed

+11
-27
lines changed

3 files changed

+11
-27
lines changed

ct/upgopher.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
1111
var_ram="${var_ram:-512}"
1212
var_disk="${var_disk:-4}"
1313
var_os="${var_os:-debian}"
14-
var_version="${var_version:-12}"
14+
var_version="${var_version:-13}"
1515
var_unprivileged="${var_unprivileged:-1}"
1616

1717
header_info "$APP"
@@ -33,18 +33,13 @@ function update_script() {
3333
systemctl stop upgopher
3434
msg_ok "Stopped Services"
3535

36-
cd /opt/upgopher
37-
RELEASE_URL=$(curl -s https://api.github.com/repos/wanetty/upgopher/releases/latest | grep "browser_download_url.*linux_amd64.tar.gz" | cut -d '"' -f 4)
38-
wget -q "$RELEASE_URL"
39-
tar -xzf upgopher_*_linux_amd64.tar.gz
40-
mv upgopher_*_linux_amd64/* .
41-
rmdir upgopher_*_linux_amd64
42-
rm -f upgopher_*_linux_amd64.tar.gz
43-
chmod +x upgopher
36+
fetch_and_deploy_gh_release "upgopher" "wanetty/upgopher" "prebuild" "latest" "/opt/upgopher" "upgopher_*_linux_amd64.tar.gz"
37+
chmod +x /opt/upgopher/upgopher
38+
4439
msg_info "Starting Services"
4540
systemctl start upgopher
4641
msg_ok "Started Services"
47-
msg_ok "Updated Successfully"
42+
msg_ok "Updated successfully!"
4843
fi
4944
exit
5045
}

frontend/public/json/upgopher.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"ram": 512,
2424
"hdd": 4,
2525
"os": "Debian",
26-
"version": "12"
26+
"version": "13"
2727
}
2828
}
2929
],

install/upgopher-install.sh

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,13 @@ setting_up_container
1313
network_check
1414
update_os
1515

16-
msg_info "Installing Dependencies"
17-
$STD apt-get install -y curl wget
18-
msg_ok "Installed Dependencies"
19-
2016
msg_info "Installing Upgopher"
2117
mkdir -p /opt/upgopher
22-
cd /opt/upgopher
23-
RELEASE_URL=$(curl -s https://api.github.com/repos/wanetty/upgopher/releases/latest | grep "browser_download_url.*linux_amd64.tar.gz" | cut -d '"' -f 4)
24-
wget -q "$RELEASE_URL"
25-
tar -xzf upgopher_*_linux_amd64.tar.gz
26-
mv upgopher_*_linux_amd64/* .
27-
rmdir upgopher_*_linux_amd64
28-
rm -f upgopher_*_linux_amd64.tar.gz
29-
chmod +x upgopher
18+
fetch_and_deploy_gh_release "upgopher" "wanetty/upgopher" "prebuild" "latest" "/opt/upgopher" "upgopher_*_linux_amd64.tar.gz"
19+
chmod +x /opt/upgopher/upgopher
3020
msg_ok "Installed Upgopher"
3121

3222
msg_info "Configuring Upgopher"
33-
# Use default configuration (no authentication, HTTP, default port/directory)
34-
# Users can modify /etc/systemd/system/upgopher.service after installation to enable features
3523
UPGOPHER_PORT="9090"
3624
UPGOPHER_DIR="/opt/upgopher/uploads"
3725
mkdir -p "$UPGOPHER_DIR"
@@ -62,6 +50,7 @@ motd_ssh
6250
customize
6351

6452
msg_info "Cleaning up"
65-
$STD apt-get -y autoremove
66-
$STD apt-get -y autoclean
53+
$STD apt -y autoremove
54+
$STD apt -y autoclean
55+
$STD apt clean -y
6756
msg_ok "Cleaned"

0 commit comments

Comments
 (0)