mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
The image downloaded the bare v2raya and v2raya_core binaries and its own copies of the rule data, so the Alpine package itself was never installed by anything in the release; the 2.5.14 apk shipped unable to install. The image now installs installer_alpine_<arch>_<version>.apk from the release, which makes a broken apk fail the image build, and takes its geoip.dat and geosite.dat from the package like every other Linux package. LoyalsoldierSite.dat stays a copy of geosite.dat, as the image has always shipped it. The script now stops at the first failed command and on an architecture with no Alpine package.
37 lines
1.3 KiB
Bash
37 lines
1.3 KiB
Bash
#!/bin/sh
|
|
# The image installs the release's own Alpine package, so every release
|
|
# installs its apk at least once before anyone else does. The release
|
|
# workflow substitutes the version.
|
|
set -ex
|
|
case "$(arch)" in
|
|
x86_64)
|
|
v2raya_arch="x64"
|
|
;;
|
|
armv7l)
|
|
v2raya_arch="armv7"
|
|
;;
|
|
aarch64)
|
|
v2raya_arch="arm64"
|
|
;;
|
|
riscv64)
|
|
v2raya_arch="riscv64"
|
|
;;
|
|
*)
|
|
echo "no Alpine package for $(arch)" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
package="installer_alpine_${v2raya_arch}_Realv2rayAVersion.apk"
|
|
wget -O "/tmp/$package" "https://github.com/v2rayA/v2rayA/releases/download/vRealv2rayAVersion/$package"
|
|
apk add --no-cache --allow-untrusted "/tmp/$package" iproute2 iptables iptables-legacy nftables tzdata
|
|
rm "/tmp/$package"
|
|
# GFWList mode reads LoyalsoldierSite.dat; the image has always shipped it as
|
|
# a copy of geosite.dat, which the first GFWList update replaces.
|
|
cp /usr/share/v2raya/geosite.dat /usr/share/v2raya/LoyalsoldierSite.dat
|
|
install ./iptables.sh /usr/local/bin/iptables
|
|
install ./ip6tables.sh /usr/local/bin/ip6tables
|
|
install ./iptables.sh /usr/local/bin/iptables-nft
|
|
install ./ip6tables.sh /usr/local/bin/ip6tables-nft
|
|
install ./iptables.sh /usr/local/bin/iptables-legacy
|
|
install ./ip6tables.sh /usr/local/bin/ip6tables-legacy
|