d2ray/ci_prep.sh

59 lines
1.6 KiB
Bash
Raw Normal View History

2021-04-23 06:51:06 +00:00
#!/bin/sh
2021-04-23 06:52:21 +00:00
set -e
2021-04-23 06:51:06 +00:00
2021-09-22 13:08:13 +00:00
2021-04-23 06:58:02 +00:00
apk add openssh openssl wget unzip zip apache2-utils
2021-04-23 06:51:06 +00:00
source image/crypt.sh
chmod 600 ./id_root
# versions
2021-09-24 15:32:42 +00:00
VER_XRAY=1.4.5
2021-04-23 06:51:06 +00:00
VER_SO=2.5.20
VER_NG=1.6.20
2021-04-23 06:51:06 +00:00
# upload files
for filename in confs/*; do
basename=$(basename $filename)
hash_sha256 $basename $(cat ./key)
output=$crypt_ret
2021-04-23 07:14:37 +00:00
encrypt_file $filename $(cat ./key) $output
2021-04-23 06:51:06 +00:00
scp -P77 -o StrictHostKeychecking=no -i ./id_root $output root@parrot.quacker.org:/dat/apps/nginx/http_dl/root/pub
rm $output
done
# build zip
2021-04-23 06:52:21 +00:00
URL_SO=https://github.com/FelisCatus/SwitchyOmega/releases/download/v$VER_SO/SwitchyOmega_Chromium.crx
2021-04-25 08:24:50 +00:00
wget $URL_SO -O SwitchyOmega_Chromium.zip
mkdir zip/chrome
unzip ./SwitchyOmega_Chromium.zip -d zip/chrome || true
2021-04-23 06:55:57 +00:00
URL_NG=https://github.com/2dust/v2rayNG/releases/download/$VER_NG/v2rayNG_"$VER_NG"_arm64-v8a.apk
2021-04-25 08:24:50 +00:00
wget $URL_NG -P image/nginx/download/android/
2021-04-23 06:52:21 +00:00
URL_XRAY_WIN=https://github.com/XTLS/Xray-core/releases/download/v$VER_XRAY/Xray-windows-64.zip
2021-04-25 08:24:50 +00:00
wget $URL_XRAY_WIN
unzip Xray-windows-64.zip -d zip/windows
2021-04-23 06:52:21 +00:00
URL_XRAY_MAC=https://github.com/XTLS/Xray-core/releases/download/v$VER_XRAY/Xray-macos-64.zip
2021-04-25 08:24:50 +00:00
wget $URL_XRAY_MAC
unzip Xray-macos-64.zip -d zip/macos
2021-04-23 06:51:06 +00:00
2021-04-25 08:24:50 +00:00
URL_XRAY_LINUX=https://github.com/XTLS/Xray-core/releases/download/v$VER_XRAY/Xray-linux-64.zip
2021-04-23 06:53:13 +00:00
wget $URL_XRAY_LINUX -P image/
2021-04-23 06:51:06 +00:00
2021-04-25 08:36:34 +00:00
cd zip
zip -r -D ../windows_macos.zip .
cd ..
2021-04-25 08:24:50 +00:00
mv windows_macos.zip image/nginx/download/
2021-04-23 06:51:06 +00:00
# build htpassword
touch .htpasswd
htpasswd -b ./.htpasswd liangyifang liangyifang
htpasswd -b ./.htpasswd ruyuechun ruyuechun
htpasswd -b ./.htpasswd liuxiangdong liuxiangdong
2021-04-28 04:35:34 +00:00
htpasswd -b ./.htpasswd zhoubowen zhoubowen
2021-04-23 07:14:37 +00:00
encrypt_file ./.htpasswd "$(cat ./key)" image/htpasswd