Build server-arch speed test binary for NetworkOptimizer

Co-authored-by: MickLesk <47820557+MickLesk@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-08-14 20:20:37 +00:00
committed by GitHub
parent b183bcc64e
commit 655b8f84bf
2 changed files with 14 additions and 2 deletions
+6
View File
@@ -50,7 +50,13 @@ function update_script() {
chmod +x /opt/networkoptimizer/publish/NetworkOptimizer.Web
mkdir -p /opt/networkoptimizer/publish/tools
cd /opt/networkoptimizer/src/uwnspeedtest
# UniFi gateways are always arm64, so the gateway binary is built for arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "-s -w" -o /opt/networkoptimizer/publish/tools/uwnspeedtest-linux-arm64 .
# The "Run Test from Server" binary must match the container architecture
SERVER_ARCH="$(arch_resolve)"
if [[ "$SERVER_ARCH" != "arm64" ]]; then
CGO_ENABLED=0 GOOS=linux GOARCH="$SERVER_ARCH" $STD go build -trimpath -ldflags "-s -w" -o "/opt/networkoptimizer/publish/tools/uwnspeedtest-linux-${SERVER_ARCH}" .
fi
msg_ok "Rebuilt NetworkOptimizer"
msg_info "Starting Service"
+8 -2
View File
@@ -42,11 +42,17 @@ $STD dotnet publish src/NetworkOptimizer.Web -c Release -r "$RID" --self-contain
chmod +x /opt/networkoptimizer/publish/NetworkOptimizer.Web
msg_ok "Built NetworkOptimizer"
msg_info "Building Gateway Speed Test Binary"
msg_info "Building Speed Test Binaries"
mkdir -p /opt/networkoptimizer/publish/tools
cd /opt/networkoptimizer/src/uwnspeedtest
# UniFi gateways are always arm64, so the gateway binary is built for arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $STD go build -trimpath -ldflags "-s -w" -o /opt/networkoptimizer/publish/tools/uwnspeedtest-linux-arm64 .
msg_ok "Built Gateway Speed Test Binary"
# The "Run Test from Server" binary must match the container architecture
SERVER_ARCH="$(arch_resolve)"
if [[ "$SERVER_ARCH" != "arm64" ]]; then
CGO_ENABLED=0 GOOS=linux GOARCH="$SERVER_ARCH" $STD go build -trimpath -ldflags "-s -w" -o "/opt/networkoptimizer/publish/tools/uwnspeedtest-linux-${SERVER_ARCH}" .
fi
msg_ok "Built Speed Test Binaries"
msg_info "Configuring NetworkOptimizer"
cat <<EOF >/opt/networkoptimizer/networkoptimizer.env