download code from release instead of git repo
This commit is contained in:
parent
2dd49e9b43
commit
85652adee9
@ -1,5 +1,5 @@
|
||||
#!/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
|
||||
# Author: KernelSailor
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
@ -24,14 +24,6 @@ function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
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"
|
||||
$STD apt update
|
||||
@ -44,17 +36,18 @@ function update_script() {
|
||||
systemctl stop snowflake-proxy
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Updating Go"
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/tools.func)
|
||||
setup_go
|
||||
msg_ok "Updated Go"
|
||||
|
||||
msg_info "Updating ${APP} to v${RELEASE}"
|
||||
cd /opt/snowflake || exit
|
||||
$STD git fetch --all
|
||||
$STD git checkout "v${RELEASE}"
|
||||
cd /opt
|
||||
$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 tar -xzf snowflake.tar.gz
|
||||
rm -rf snowflake
|
||||
mv "snowflake-v${RELEASE}" snowflake
|
||||
rm snowflake.tar.gz
|
||||
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
|
||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||
|
||||
|
||||
@ -13,14 +13,6 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
jq
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_go
|
||||
|
||||
msg_info "Creating snowflake user"
|
||||
@ -28,16 +20,15 @@ useradd -r -s /bin/false -d /opt/snowflake snowflake
|
||||
msg_ok "Created snowflake user"
|
||||
|
||||
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//')
|
||||
$STD git clone https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
|
||||
cd snowflake || exit
|
||||
git config --global --add safe.directory /opt/snowflake
|
||||
$STD git checkout "v${RELEASE}"
|
||||
cd /opt
|
||||
$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 tar -xzf snowflake.tar.gz
|
||||
mv "snowflake-v${RELEASE}" snowflake
|
||||
rm snowflake.tar.gz
|
||||
chown -R snowflake:snowflake /opt/snowflake
|
||||
cd proxy || exit
|
||||
cd /opt/snowflake/proxy
|
||||
$STD sudo -u snowflake go build -o snowflake-proxy .
|
||||
cd /opt/snowflake || exit
|
||||
echo "${RELEASE}" >/opt/tor-snowflake_version.txt
|
||||
msg_ok "Built Snowflake Proxy v${RELEASE}"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user