修订文档,代码;令-d参数也自动下载 geosite文件夹.

This commit is contained in:
e1732a364fed
2000-01-01 00:00:00 +00:00
parent 7dee7eb50f
commit bdb73ffc9d
3 changed files with 14 additions and 5 deletions

View File

@@ -89,6 +89,8 @@ func runPreCommands() {
if download {
tryDownloadMMDB()
tryDownloadGeositeSource()
}
}
@@ -195,6 +197,10 @@ func printAllState(w io.Writer, withoutTProxy bool) {
// 我们只需要一个dial配置即可. listen我们不使用配置文件的配置而是自行监听一个随机端口用于http代理
func tryDownloadGeositeSource() {
if netLayer.HasGeositeFolder() {
return
}
var outClient proxy.Client
if defaultOutClient != nil && defaultOutClient.Name() != proxy.DirectName && defaultOutClient.Name() != proxy.RejectName {

View File

@@ -95,12 +95,13 @@ sudo systemctl start verysimple
https://github.com/e1732a364fed/v2ray_simple/pkgs/container/v2ray_simple
主要贡献者: @qzydustin , @1Xgkr6wq
## docker
docker pull ghcr.io/e1732a364fed/v2ray_simple:latest
docker run -d \
--platform linux/amd64 \
--name verysimple \
-e TZ="Asia/Shanghai" \
-v /dev/shm:/dev/shm \
@@ -120,7 +121,7 @@ https://github.com/e1732a364fed/v2ray_simple/pkgs/container/v2ray_simple
## docker-compose
在 docker-compose.yaml 的目录下,运行 `docker-compose up -d` 来启动;运行 `docker-compose down` 来关闭。
含有 docker-compose.yaml 的目录下,运行 `docker-compose up -d` 来启动;运行 `docker-compose down` 来关闭。
这个docker-compose 设计时,要求你 宿主机有一个 `/etc/verysimple` 文件夹,里面放 一个 `server.toml` 配置文件。

View File

@@ -183,15 +183,17 @@ func LoadGeositeFiles() (err error) {
return nil
}
func HasGeositeFolder() bool {
return utils.DirExist(utils.GetFilePath("geosite/data"))
}
// DownloadCommunity_DomainListFiles 从 v2fly/domain-list-community 下载数据文件, 并放到 geosite文件夹中。
// 如果已存在geosite文件夹return immediately.
//
// 该函数适用于系统中没有git的情况, 如果有git我们直接 git clone就行了,而且还能不断pull进行滚动更新
func DownloadCommunity_DomainListFiles(proxyurl string) {
dir := "geosite/data"
dir = utils.GetFilePath(dir)
if utils.DirExist(dir) {
if HasGeositeFolder() {
utils.PrintStr("geosite/data folder already exists.\n")
return
}