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

@@ -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"