You've already forked v2ray-core
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0385ccbd8c | ||
|
|
af88016320 | ||
|
|
09b955bead | ||
|
|
85c0a5bbbe | ||
|
|
db0bb472b0 |
2
core.go
2
core.go
@@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
version = "2.43"
|
||||
version = "2.44"
|
||||
build = "Custom"
|
||||
codename = "One for all"
|
||||
intro = "An unified platform for anti-censorship."
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set -x
|
||||
|
||||
apt-get update
|
||||
apt-get -y install jq git file
|
||||
apt-get -y install jq git file p7zip-full
|
||||
|
||||
function getattr() {
|
||||
curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/$2/attributes/$1
|
||||
@@ -45,23 +45,26 @@ export TRAVIS_TAG=${RELEASE_TAG}
|
||||
export GPG_SIGN_PASS=${SIGN_KEY_PASS}
|
||||
export V_USER=${VUSER}
|
||||
|
||||
$GOPATH/bin/vbuild --os=windows --arch=x86 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=windows --arch=x64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=macos --arch=x64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=x86 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=x64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=arm --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=arm64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mips64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mips64le --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mips --zip --sign
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mipsle --zip --sign
|
||||
$GOPATH/bin/vbuild --os=freebsd --arch=x86 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=freebsd --arch=amd64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=openbsd --arch=x86 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=openbsd --arch=amd64 --zip --sign
|
||||
$GOPATH/bin/vbuild --os=windows --arch=x86 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=windows --arch=x64 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=macos --arch=x64 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=x86 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=x64 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=arm --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=arm64 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mips64 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mips64le --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mips --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=linux --arch=mipsle --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=freebsd --arch=x86 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=freebsd --arch=amd64 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=openbsd --arch=x86 --zip --sign #--encrypt
|
||||
$GOPATH/bin/vbuild --os=openbsd --arch=amd64 --zip --sign #--encrypt
|
||||
|
||||
JSON_DATA=$(printf '{"tag_name": "%s", "prerelease": %s}' ${RELEASE_TAG} ${PRERELEASE})
|
||||
#RELBODY=$(cat $GOPATH/bin/metadata.txt | jq -R -s -c .)
|
||||
JSON_DATA=$(echo "{}" | jq -c ".tag_name=\"${RELEASE_TAG}\"")
|
||||
JSON_DATA=$(echo ${JSON_DATA} | jq -c ".prerelease=${PRERELEASE}")
|
||||
#JSON_DATA=$(echo ${JSON_DATA} | jq -c ".body=${RELBODY}")
|
||||
RELEASE_ID=$(curl --data "${JSON_DATA}" -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/v2ray/v2ray-core/releases | jq ".id")
|
||||
|
||||
function upload() {
|
||||
@@ -86,6 +89,21 @@ upload $GOPATH/bin/v2ray-freebsd-32.zip
|
||||
upload $GOPATH/bin/v2ray-openbsd-64.zip
|
||||
upload $GOPATH/bin/v2ray-openbsd-32.zip
|
||||
upload $GOPATH/bin/metadata.txt
|
||||
#upload $GOPATH/bin/vencrypted-macos.7z
|
||||
#upload $GOPATH/bin/vencrypted-windows-64.7z
|
||||
#upload $GOPATH/bin/vencrypted-windows-32.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-64.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-32.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-arm.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-arm64.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-mips64.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-mips64le.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-mips.7z
|
||||
#upload $GOPATH/bin/vencrypted-linux-mipsle.7z
|
||||
#upload $GOPATH/bin/vencrypted-freebsd-64.7z
|
||||
#upload $GOPATH/bin/vencrypted-freebsd-32.7z
|
||||
#upload $GOPATH/bin/vencrypted-openbsd-64.7z
|
||||
#upload $GOPATH/bin/vencrypted-openbsd-32.7z
|
||||
|
||||
if [[ "${PRERELEASE}" == "false" ]]; then
|
||||
|
||||
|
||||
@@ -135,10 +135,10 @@ func DialKCP(ctx context.Context, dest net.Destination) (internet.Connection, er
|
||||
if securitySettings := internet.SecuritySettingsFromContext(ctx); securitySettings != nil {
|
||||
switch securitySettings := securitySettings.(type) {
|
||||
case *v2tls.Config:
|
||||
config := securitySettings.GetTLSConfig()
|
||||
if dest.Address.Family().IsDomain() {
|
||||
config.ServerName = dest.Address.Domain()
|
||||
securitySettings.OverrideServerNameIfEmpty(dest.Address.Domain())
|
||||
}
|
||||
config := securitySettings.GetTLSConfig()
|
||||
tlsConn := tls.Client(iConn, config)
|
||||
iConn = tlsConn
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ func Dial(ctx context.Context, dest net.Destination) (internet.Connection, error
|
||||
if securitySettings := internet.SecuritySettingsFromContext(ctx); securitySettings != nil {
|
||||
tlsConfig, ok := securitySettings.(*tls.Config)
|
||||
if ok {
|
||||
config := tlsConfig.GetTLSConfig()
|
||||
if dest.Address.Family().IsDomain() {
|
||||
config.ServerName = dest.Address.Domain()
|
||||
tlsConfig.OverrideServerNameIfEmpty(dest.Address.Domain())
|
||||
}
|
||||
config := tlsConfig.GetTLSConfig()
|
||||
conn = tls.Client(conn, config)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ var (
|
||||
globalSessionCache = tls.NewLRUClientSessionCache(128)
|
||||
)
|
||||
|
||||
func (v *Config) BuildCertificates() []tls.Certificate {
|
||||
certs := make([]tls.Certificate, 0, len(v.Certificate))
|
||||
for _, entry := range v.Certificate {
|
||||
func (c *Config) BuildCertificates() []tls.Certificate {
|
||||
certs := make([]tls.Certificate, 0, len(c.Certificate))
|
||||
for _, entry := range c.Certificate {
|
||||
keyPair, err := tls.X509KeyPair(entry.Certificate, entry.Key)
|
||||
if err != nil {
|
||||
log.Trace(newError("ignoring invalid X509 key pair").Base(err).AtWarning())
|
||||
@@ -23,21 +23,27 @@ func (v *Config) BuildCertificates() []tls.Certificate {
|
||||
return certs
|
||||
}
|
||||
|
||||
func (v *Config) GetTLSConfig() *tls.Config {
|
||||
func (c *Config) GetTLSConfig() *tls.Config {
|
||||
config := &tls.Config{
|
||||
ClientSessionCache: globalSessionCache,
|
||||
NextProtos: []string{"http/1.1"},
|
||||
}
|
||||
if v == nil {
|
||||
if c == nil {
|
||||
return config
|
||||
}
|
||||
|
||||
config.InsecureSkipVerify = v.AllowInsecure
|
||||
config.Certificates = v.BuildCertificates()
|
||||
config.InsecureSkipVerify = c.AllowInsecure
|
||||
config.Certificates = c.BuildCertificates()
|
||||
config.BuildNameToCertificate()
|
||||
if len(v.ServerName) > 0 {
|
||||
config.ServerName = v.ServerName
|
||||
if len(c.ServerName) > 0 {
|
||||
config.ServerName = c.ServerName
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
func (c *Config) OverrideServerNameIfEmpty(serverName string) {
|
||||
if len(c.ServerName) == 0 {
|
||||
c.ServerName = serverName
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ func dialWebsocket(ctx context.Context, dest net.Destination) (net.Conn, error)
|
||||
tlsConfig, ok := securitySettings.(*tls.Config)
|
||||
if ok {
|
||||
protocol = "wss"
|
||||
dialer.TLSClientConfig = tlsConfig.GetTLSConfig()
|
||||
if dest.Address.Family().IsDomain() {
|
||||
dialer.TLSClientConfig.ServerName = dest.Address.Domain()
|
||||
tlsConfig.OverrideServerNameIfEmpty(dest.Address.Domain())
|
||||
}
|
||||
dialer.TLSClientConfig = tlsConfig.GetTLSConfig()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user