Skip to content

Commit

Permalink
Update v2ray to v4.38.3 (#226)
Browse files Browse the repository at this point in the history
* Feat: use Go v1.16 & new module name of v2ray-core

* Chore: use Go v1.16 & remove unnecessary steps

* Feat: support Apple Silicon & remove gcflags option

* Chore: use v2ray-core v4.35.0

* Update build-release.sh

Go 1.15 drops support for 32-bit binaries on macOS, iOS, iPadOS, watchOS, and tvOS (the darwin/386 and darwin/arm ports)
Reference URL: https://tip.golang.org/doc/go1.15#darwin

Signed-off-by: Teddysun <[email protected]>

* Update README.md

* Bump v2ray-core to v4.35.1

* Bump v2ray-core to v4.36.2

* Bump v2ray-core to v4.37.1

Signed-off-by: GitHub <[email protected]>

* Bump v2ray-core to v4.37.3

* Bump v2ray-core to v4.38.3

Signed-off-by: IceCodeNew <[email protected]>

Co-authored-by: loyalsoldier <[email protected]>
Co-authored-by: Teddysun <[email protected]>
  • Loading branch information
3 people authored May 6, 2021
1 parent 997ef6e commit 7bd24b2
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 124 deletions.
8 changes: 1 addition & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.16
working_directory: ~/code
steps:
- checkout
- run: sudo apt-get update && sudo apt-get install -y upx
- restore_cache:
key: go-pkg-{{ checksum "go.sum" }}
- run: ./build-release.sh
- save_cache:
paths:
- /go/pkg
key: go-pkg-{{ checksum "go.sum" }}
- store_artifacts:
path: bin
destination: bin
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Yet another SIP003 plugin for shadowsocks, based on v2ray
## Yet another SIP003 plugin for shadowsocks, based on [v2ray](https://github.com/v2fly/v2ray-core)

[![CircleCI](https://circleci.com/gh/shadowsocks/v2ray-plugin.svg?style=shield)](https://circleci.com/gh/shadowsocks/v2ray-plugin)
[![Releases](https://img.shields.io/github/downloads/shadowsocks/v2ray-plugin/total.svg)](https://github.com/shadowsocks/v2ray-plugin/releases)
[![Language: Go](https://img.shields.io/badge/go-1.12+-blue.svg)](https://github.com/shadowsocks/v2ray-plugin/search?l=go)
[![Language: Go](https://img.shields.io/badge/go-1.13+-blue.svg)](https://github.com/shadowsocks/v2ray-plugin/search?l=go)
[![Go Report Card](https://goreportcard.com/badge/github.com/shadowsocks/v2ray-plugin)](https://goreportcard.com/report/github.com/shadowsocks/v2ray-plugin)
[![License](https://img.shields.io/github/license/shadowsocks/v2ray-plugin.svg)](LICENSE)

Expand Down Expand Up @@ -61,7 +61,7 @@ ss-local -c config.json -p 443 --plugin v2ray-plugin --plugin-opts "mode=quic;ho

### Issue a cert for TLS and QUIC

v2ray-plugin will look for TLS certificates signed by [acme.sh](https://github.com/Neilpang/acme.sh) by default.
`v2ray-plugin` will look for TLS certificates signed by [acme.sh](https://github.com/acmesh-official/acme.sh) by default.
Here's some sample commands for issuing a certificate using CloudFlare.
You can find commands for issuing certificates for other DNS providers at acme.sh.

Expand Down
62 changes: 36 additions & 26 deletions build-release.sh
Original file line number Diff line number Diff line change
@@ -1,63 +1,73 @@
#!/bin/bash
#!/usr/bin/env bash

sum="sha1sum"

if ! hash sha1sum 2>/dev/null; then
if ! hash shasum 2>/dev/null; then
echo "I can't see 'sha1sum' or 'shasum'"
echo "Please install one of them!"
exit
fi
sum="shasum"
if ! hash shasum 2>/dev/null; then
echo "I can't see 'sha1sum' or 'shasum'"
echo "Please install one of them!"
exit
fi
sum="shasum"
fi

[[ -z $upx ]] && upx="echo pending"
if [[ $upx == "echo pending" ]] && hash upx 2>/dev/null; then
upx="upx -9"
upx="upx -9"
fi

VERSION=$(git describe --tags)
LDFLAGS="-X main.VERSION=$VERSION -s -w"
GCFLAGS=""
LDFLAGS="-X main.VERSION=$VERSION -s -w -buildid="

OSES=(linux darwin windows freebsd)
ARCHS=(amd64 386)

mkdir bin

for os in ${OSES[@]}; do
for arch in ${ARCHS[@]}; do
suffix=""
if [ "$os" == "windows" ]
then
suffix=".exe"
fi
env CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -v -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o v2ray-plugin_${os}_${arch}${suffix}
$upx v2ray-plugin_${os}_${arch}${suffix} >/dev/null
tar -zcf bin/v2ray-plugin-${os}-${arch}-$VERSION.tar.gz v2ray-plugin_${os}_${arch}${suffix}
$sum bin/v2ray-plugin-${os}-${arch}-$VERSION.tar.gz
done
for arch in ${ARCHS[@]}; do
# Go 1.15 drops support for 32-bit binaries on macOS, iOS, iPadOS, watchOS, and tvOS (the darwin/386 and darwin/arm ports)
# Reference URL: https://tip.golang.org/doc/go1.15#darwin
if [ "$os" == "darwin" ] && [ "$arch" == "386" ]; then
continue
fi
suffix=""
if [ "$os" == "windows" ]; then
suffix=".exe"
fi
env CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -v -ldflags "$LDFLAGS" -o v2ray-plugin_${os}_${arch}${suffix}
$upx v2ray-plugin_${os}_${arch}${suffix} >/dev/null
tar -zcf bin/v2ray-plugin-${os}-${arch}-$VERSION.tar.gz v2ray-plugin_${os}_${arch}${suffix}
$sum bin/v2ray-plugin-${os}-${arch}-$VERSION.tar.gz
done
done

# ARM
ARMS=(5 6 7)
for v in ${ARMS[@]}; do
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=$v go build -v -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o v2ray-plugin_linux_arm$v
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=$v go build -v -ldflags "$LDFLAGS" -o v2ray-plugin_linux_arm$v
done
$upx v2ray-plugin_linux_arm* >/dev/null
tar -zcf bin/v2ray-plugin-linux-arm-$VERSION.tar.gz v2ray-plugin_linux_arm*
$sum bin/v2ray-plugin-linux-arm-$VERSION.tar.gz

# ARM64 (ARMv8 or aarch64)
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -v -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o v2ray-plugin_linux_arm64
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -v -ldflags "$LDFLAGS" -o v2ray-plugin_linux_arm64
$upx v2ray-plugin_linux_arm64 >/dev/null
tar -zcf bin/v2ray-plugin-linux-arm64-$VERSION.tar.gz v2ray-plugin_linux_arm64
$sum bin/v2ray-plugin-linux-arm64-$VERSION.tar.gz

# Darwin ARM64
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -ldflags "$LDFLAGS" -o v2ray-plugin_darwin_arm64
$upx v2ray-plugin_darwin_arm64 >/dev/null
tar -zcf bin/v2ray-plugin-darwin-arm64-$VERSION.tar.gz v2ray-plugin_darwin_arm64
$sum bin/v2ray-plugin-darwin-arm64-$VERSION.tar.gz

# MIPS
MIPSS=(mips mipsle)
for v in ${MIPSS[@]}; do
env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o v2ray-plugin_linux_$v
env CGO_ENABLED=0 GOOS=linux GOARCH=$v GOMIPS=softfloat go build -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o v2ray-plugin_linux_${v}_sf
env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags "$LDFLAGS" -o v2ray-plugin_linux_$v
env CGO_ENABLED=0 GOOS=linux GOARCH=$v GOMIPS=softfloat go build -ldflags "$LDFLAGS" -o v2ray-plugin_linux_${v}_sf
done
$upx v2ray-plugin_linux_mips* >/dev/null
tar -zcf bin/v2ray-plugin-linux-mips-$VERSION.tar.gz v2ray-plugin_linux_mips*
Expand All @@ -66,7 +76,7 @@ $sum bin/v2ray-plugin-linux-mips-$VERSION.tar.gz
# MIPS64
MIPS64S=(mips64 mips64le)
for v in ${MIPS64S[@]}; do
env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" -o v2ray-plugin_linux_$v
env CGO_ENABLED=0 GOOS=linux GOARCH=$v go build -v -ldflags "$LDFLAGS" -o v2ray-plugin_linux_$v
done
tar -zcf bin/v2ray-plugin-linux-mips64-$VERSION.tar.gz v2ray-plugin_linux_mips64*
$sum bin/v2ray-plugin-linux-mips64-$VERSION.tar.gz
2 changes: 1 addition & 1 deletion errors.generated.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"

type errPathObjHolder struct{}

Expand Down
18 changes: 4 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
module github.com/shadowsocks/v2ray-plugin

go 1.16

require (
github.com/golang/mock v1.3.1 // indirect
github.com/golang/protobuf v1.3.2
github.com/google/go-cmp v0.3.0 // indirect
github.com/miekg/dns v1.1.14 // indirect
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443 // indirect
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b // indirect
golang.org/x/sys v0.0.0-20190619223125-e40ef342dc56 // indirect
golang.org/x/text v0.3.2 // indirect
google.golang.org/genproto v0.0.0-20190611190212-a7e196e89fd3 // indirect
v2ray.com/core v4.19.1+incompatible
github.com/golang/protobuf v1.5.2
github.com/v2fly/v2ray-core/v4 v4.38.3
)

replace v2ray.com/core => github.com/v2ray/v2ray-core v4.23.2+incompatible

go 1.13
Loading

0 comments on commit 7bd24b2

Please sign in to comment.