download code from release instead of git repo

This commit is contained in:
KernelSailor 2025-12-26 19:37:59 +01:00
parent 2dd49e9b43
commit 85652adee9
2 changed files with 15 additions and 31 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG # Copyright (c) 2021-2025 community-scripts ORG
# Author: KernelSailor # Author: KernelSailor
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
@ -24,14 +24,6 @@ function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/snowflake ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if ! id snowflake &>/dev/null; then
msg_error "snowflake user not found!"
exit
fi
msg_info "Updating Container OS" msg_info "Updating Container OS"
$STD apt update $STD apt update
@ -44,17 +36,18 @@ function update_script() {
systemctl stop snowflake-proxy systemctl stop snowflake-proxy
msg_ok "Stopped Service" msg_ok "Stopped Service"
msg_info "Updating Go"
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
setup_go setup_go
msg_ok "Updated Go"
msg_info "Updating ${APP} to v${RELEASE}" msg_info "Updating ${APP} to v${RELEASE}"
cd /opt/snowflake || exit cd /opt
$STD git fetch --all $STD curl -fsSL "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v${RELEASE}/snowflake-v${RELEASE}.tar.gz" -o snowflake.tar.gz
$STD git checkout "v${RELEASE}" $STD tar -xzf snowflake.tar.gz
rm -rf snowflake
mv "snowflake-v${RELEASE}" snowflake
rm snowflake.tar.gz
chown -R snowflake:snowflake /opt/snowflake chown -R snowflake:snowflake /opt/snowflake
$STD sudo -u snowflake go build -o proxy ./proxy cd /opt/snowflake/proxy
$STD sudo -u snowflake go build -o snowflake-proxy .
echo "${RELEASE}" >/opt/${APP}_version.txt echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP} to v${RELEASE}" msg_ok "Updated ${APP} to v${RELEASE}"

View File

@ -13,14 +13,6 @@ setting_up_container
network_check network_check
update_os update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
ca-certificates \
curl \
git \
jq
msg_ok "Installed Dependencies"
setup_go setup_go
msg_info "Creating snowflake user" msg_info "Creating snowflake user"
@ -28,16 +20,15 @@ useradd -r -s /bin/false -d /opt/snowflake snowflake
msg_ok "Created snowflake user" msg_ok "Created snowflake user"
msg_info "Building Snowflake Proxy from Source" msg_info "Building Snowflake Proxy from Source"
cd /opt || exit
RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//') RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//')
$STD git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git cd /opt
cd snowflake || exit $STD curl -fsSL "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v${RELEASE}/snowflake-v${RELEASE}.tar.gz" -o snowflake.tar.gz
git config --global --add safe.directory /opt/snowflake $STD tar -xzf snowflake.tar.gz
$STD git checkout "v${RELEASE}" mv "snowflake-v${RELEASE}" snowflake
rm snowflake.tar.gz
chown -R snowflake:snowflake /opt/snowflake chown -R snowflake:snowflake /opt/snowflake
cd proxy || exit cd /opt/snowflake/proxy
$STD sudo -u snowflake go build -o snowflake-proxy . $STD sudo -u snowflake go build -o snowflake-proxy .
cd /opt/snowflake || exit
echo "${RELEASE}" >/opt/tor-snowflake_version.txt echo "${RELEASE}" >/opt/tor-snowflake_version.txt
msg_ok "Built Snowflake Proxy v${RELEASE}" msg_ok "Built Snowflake Proxy v${RELEASE}"