chore: replace v2ray/official with v2fly/v2fly-core

This commit is contained in:
mzz2017 committed 2020-02-03 13:03:59 +08:00
1 parent b891b27756
commit b253472008
8 files changed
+20 -39

No files matched your search

+4 -4
View File
@@ -136,7 +136,7 @@ V2RayA 致力于提供最简单的操作,满足绝大部分需求。
# pull stable version of v2raya
docker pull mzz2017/v2raya:stable
# pull latest version of v2ray
docker pull v2ray/official
docker pull v2fly/v2fly-core
# create volume to share data
docker volume create v2raya_shared-data
@@ -161,7 +161,7 @@ V2RayA 致力于提供最简单的操作,满足绝大部分需求。
-v v2raya_shared-data:/etc/v2ray \
--env V2RAY_LOCATION_ASSET=/etc/v2ray \
--name v2raya_v2ray \
v2ray/official \
v2fly/v2fly-core \
sh -c "cp -rfu /usr/bin/v2ray/* /etc/v2ray/ && v2ray -config=/etc/v2ray/config.json"
```
@@ -171,7 +171,7 @@ V2RayA 致力于提供最简单的操作,满足绝大部分需求。
# pull stable version of v2raya
docker pull mzz2017/v2raya:stable
# pull latest version of v2ray
docker pull v2ray/official
docker pull v2fly/v2fly-core
# create volume to share data
docker volume create v2raya_shared-data
@@ -196,7 +196,7 @@ V2RayA 致力于提供最简单的操作,满足绝大部分需求。
-v v2raya_shared-data:/etc/v2ray \
--env V2RAY_LOCATION_ASSET=/etc/v2ray \
--name v2raya_v2ray \
v2ray/official \
v2fly/v2fly-core \
/bin/sh -c "cp -rfu /usr/bin/v2ray/* /etc/v2ray/ && v2ray -config=/etc/v2ray/config.json"
```
部署完毕后,在[GUI demo](https://v2raya.mzz.pub)使用(或[部署GUI](https://github.com/mzz2017/V2RayA#%E5%A6%82%E4%BD%95%E9%83%A8%E7%BD%B2GUI))。
+1 -1
View File
@@ -17,7 +17,7 @@ services:
network_mode: host # --network host
pid: service:backend
restart: always
image: "v2ray/official"
image: "v2fly/v2fly-core"
environment:
- V2RAY_LOCATION_ASSET=/etc/v2ray
volumes:
+1 -1
View File
@@ -17,7 +17,7 @@ services:
network_mode: host # --network host
pid: service:backend
restart: always
image: "v2ray/official"
image: "v2fly/v2fly-core"
environment:
- V2RAY_LOCATION_ASSET=/etc/v2ray
volumes:
+1 -1
View File
@@ -515,7 +515,7 @@ export default {
handleClickImport() {
const that = this;
this.$buefy.dialog.prompt({
message: `填入ss/vmess/订阅地址`,
message: `填入ss/ssr/vmess/订阅地址`,
inputAttrs: {
type: "text",
value: ""
+3 -3
View File
@@ -40,7 +40,7 @@ func checkEnvironment() {
if err != nil {
log.Fatal(err)
}
if occupied, which := ports.IsPortOccupied(port, "tcp", true); occupied && len(which) > 0 {
if occupied, which := ports.IsPortOccupied(port, "tcp", true); occupied {
log.Fatalf("V2RayA启动失败,%v端口已被%v占用", port, which)
}
}
@@ -123,11 +123,11 @@ func hello() {
color.Red.Println("Version:", global.Version)
} else {
fmt.Println("V2RayA is running in Docker. Compatible mode starts up.")
fmt.Printf("%v\n", "Waiting for official/v2ray's running. Refer: https://github.com/mzz2017/V2RayA#docker%E6%96%B9%E5%BC%8F")
fmt.Printf("%v\n", "Waiting for container v2raya_v2ray's running. Refer: https://github.com/mzz2017/V2RayA#docker%E6%96%B9%E5%BC%8F")
for !v2ray.IsV2RayProcessExists() {
time.Sleep(1 * time.Second)
}
fmt.Println("Container official/v2ray is ready.")
fmt.Println("Container v2raya_v2ray is ready.")
}
color.Red.Println("V2RayA is running at", global.GetEnvironmentConfig().Address)
}
+1 -3
View File
@@ -147,7 +147,7 @@ iptables -t mangle -A SETMARK -p udp --dport 53 -j RETURN
iptables -t mangle -A SETMARK -p tcp --dport 53 -j RETURN
`
}
commands += `iptables -t mangle -A SETMARK -d 0.0.0.0/32 -j RETURN
commands += `
iptables -t mangle -A SETMARK -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A SETMARK -d 100.64.0.0/10 -j RETURN
iptables -t mangle -A SETMARK -d 127.0.0.0/8 -j RETURN
@@ -171,8 +171,6 @@ iptables -t mangle -A SSTP_OUT -m mark --mark 0xff -j RETURN
# 本机出方向规则,白名单端口
iptables -t mangle -A SSTP_OUT -p tcp -m multiport --sports {{TCP_PORTS}} -j RETURN
iptables -t mangle -A SSTP_OUT -p udp -m multiport --sports {{UDP_PORTS}} -j RETURN
# 本机出方向白名单
iptables -t mangle -A SSTP_OUT -d 1.0.0.1/32 -j RETURN
# 本机发出去的 TCP 和 UDP 走一下 SETMARK 链
iptables -t mangle -A SSTP_OUT -p tcp -m mark ! --mark 1 -j SETMARK
iptables -t mangle -A SSTP_OUT -p udp -m mark ! --mark 1 -j SETMARK
+3 -26
View File
@@ -2,10 +2,10 @@ package service
import (
"V2RayA/global"
"V2RayA/tools"
"bytes"
"errors"
"net/http"
"strconv"
"strings"
)
@@ -38,29 +38,6 @@ func CheckUpdate() (foundNew bool, remoteVersion string, err error) {
}
s = s[:r]
// 远端版本获取完毕
if strings.ToLower(global.Version) == "debug" {
return false, s, nil //debug模式无需检查更新
}
local := strings.Split(global.Version, ".")
remote := strings.Split(s, ".")
mlen := len(local)
if len(remote) < mlen {
mlen = len(remote)
}
for i := 0; i < mlen; i++ {
lc, err := strconv.Atoi(local[i])
if err != nil {
return false, "", err
}
rm, err := strconv.Atoi(remote[i])
if err != nil {
return false, "", err
}
if lc < rm { //按节比较,某一节如果本地小于远端,则需要更新
return true, s, nil
} else if lc > rm { //奇怪的事情,本地版本高于远端
return false, "", errors.New("奇怪的事情发生了,本地版本高于远端")
}
}
return len(remote) > len(local), s, nil //如果前面都一样,远端版本号长度更长则需要更新
ge, err := tools.VersionGreaterEqual(global.Version, s)
return !ge, s, err
}
+6
View File
@@ -21,6 +21,12 @@ func Min(a, b int) int {
/* return if v1 is after v2 */
func VersionGreaterEqual(v1, v2 string) (is bool, err error) {
if v1 == "debug" {
return true, nil
}
if v2 == "debug" {
return false, nil
}
a1 := strings.Split(v1, ".")
a2 := strings.Split(v2, ".")
l := Min(len(a1), len(a2))