1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00
This commit is contained in:
loyalsoldier
2021-05-04 21:51:38 +08:00
committed by Shelikhoo
parent 3ba9a5b4f5
commit 40f8e82204
8 changed files with 49 additions and 54 deletions

View File

@@ -13,18 +13,22 @@ import (
"github.com/v2fly/v2ray-core/v4/app/router"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/platform"
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
)
func init() {
const (
geoipURL = "https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat"
geositeURL = "https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat"
)
wd, err := os.Getwd()
common.Must(err)
tempPath := filepath.Join(wd, "..", "..", "testing", "temp")
os.Setenv("v2ray.location.asset", tempPath)
geoipPath := filepath.Join(tempPath, "geoip.dat")
geoipPath := platform.GetAssetLocation("geoip.dat")
os.Setenv("v2ray.location.asset", tempPath)
if _, err := os.Stat(geoipPath); err != nil && errors.Is(err, fs.ErrNotExist) {
common.Must(os.MkdirAll(tempPath, 0755))