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)
This commit is contained in:
wanetty 2025-11-01 09:13:58 +01:00
parent bc3c833038
commit 88795c5722
3 changed files with 11 additions and 27 deletions

View File

@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@ -33,18 +33,13 @@ function update_script() {
systemctl stop upgopher
msg_ok "Stopped Services"
cd /opt/upgopher
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)
wget -q "$RELEASE_URL"
tar -xzf upgopher_*_linux_amd64.tar.gz
mv upgopher_*_linux_amd64/* .
rmdir upgopher_*_linux_amd64
rm -f upgopher_*_linux_amd64.tar.gz
chmod +x upgopher
fetch_and_deploy_gh_release "upgopher" "wanetty/upgopher" "prebuild" "latest" "/opt/upgopher" "upgopher_*_linux_amd64.tar.gz"
chmod +x /opt/upgopher/upgopher
msg_info "Starting Services"
systemctl start upgopher
msg_ok "Started Services"
msg_ok "Updated Successfully"
msg_ok "Updated successfully!"
fi
exit
}

View File

@ -23,7 +23,7 @@
"ram": 512,
"hdd": 4,
"os": "Debian",
"version": "12"
"version": "13"
}
}
],

View File

@ -13,25 +13,13 @@ setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y curl wget
msg_ok "Installed Dependencies"
msg_info "Installing Upgopher"
mkdir -p /opt/upgopher
cd /opt/upgopher
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)
wget -q "$RELEASE_URL"
tar -xzf upgopher_*_linux_amd64.tar.gz
mv upgopher_*_linux_amd64/* .
rmdir upgopher_*_linux_amd64
rm -f upgopher_*_linux_amd64.tar.gz
chmod +x upgopher
fetch_and_deploy_gh_release "upgopher" "wanetty/upgopher" "prebuild" "latest" "/opt/upgopher" "upgopher_*_linux_amd64.tar.gz"
chmod +x /opt/upgopher/upgopher
msg_ok "Installed Upgopher"
msg_info "Configuring Upgopher"
# Use default configuration (no authentication, HTTP, default port/directory)
# Users can modify /etc/systemd/system/upgopher.service after installation to enable features
UPGOPHER_PORT="9090"
UPGOPHER_DIR="/opt/upgopher/uploads"
mkdir -p "$UPGOPHER_DIR"
@ -62,6 +50,7 @@ motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt clean -y
msg_ok "Cleaned"