Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
faceair committed Apr 24, 2019
1 parent 60f1cba commit fb2dd8e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 11 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,30 @@ $GOPATH/bin/gotit -port 8080
```
Run `gotit` directly see help for other commands. Gotit use system `GOPATH` to save dependencies by default.

### CI or individual use direct trust certificate (recommended)

```
# Import environment variables and certificates
export HTTPS_PROXY=http://127.0.0.1:3128
curl -o /usr/local/share/ca-certificates/gotit.crt http://127.0.0.1:3128/ssl && update-ca-certificates
# Normal use
go get -v github.com/golang/dep/cmd/dep
go get -v github.com/axw/gocov/gocov
go get -v github.com/AlekSi/gocov-xml
go get -v golang.org/x/lint/golint
dep ensure -v
go mod download
glide install -v
# Delete the certificate after the build
rm /usr/local/share/ca-certificates/gotit.crt && update-ca-certificates
```

### Configure dependency management tool

If you are concerned about the security of importing certificates, you can try to bypass the HTTPS verification of the package management tool.

#### dep

dep don't support skip HTTPS certificate verification, we need [patch](https://github.com/faceair/dep/commit/43c5e6bf4597bc644a9326d16849b986076b7921) dep. You can build it yourself in this [fork repository](https://github.com/faceair/dep) or [download modified binary files](https://github.com/faceair/dep/releases/latest).
Expand Down Expand Up @@ -71,10 +93,6 @@ HTTPS_PROXY=http://127.0.0.1:8080 glide install
HTTPS_PROXY=http://127.0.0.1:8080 GIT_SSL_NO_VERIFY=true go get -v -insecure github.com/faceair/gotit
```

#### other

TODO

## FAQ

1. When does Gotit update the repository?
Expand Down
34 changes: 27 additions & 7 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Gotit 是一个由 [betproxy](https://github.com/faceair/betproxy) 强力驱动

## Gotit 有什么特性?

- **** 命中缓存时拉取速度非常快!
- **可靠** 断网或源库被删后 Gotit 可以依靠缓存继续工作 (天天开十X大都不怕 🙌)
- **透明** 理论上支持所有 Go 包管理工具(需要关闭 HTTPS 证书校验)
**** 命中缓存时拉取速度非常快!
**可靠** 断网或源库被删后 Gotit 可以依靠缓存继续工作 (天天开十X大都不怕 🙌)
**透明** 理论上支持所有 Go 包管理工具(需要关闭 HTTPS 证书校验)

## 部署

Expand All @@ -41,8 +41,32 @@ $GOPATH/bin/gotit -port 8080
```
直接运行 `gotit` 可以查看其他命令的使用帮助,默认 `gotit` 使用系统 `GOPATH` 保存依赖包。

### 配置

### CI 或个人使用直接信任证书 (推荐)

```
# 导入环境变量和证书
export HTTPS_PROXY=http://127.0.0.1:3128
curl -o /usr/local/share/ca-certificates/gotit.crt http://127.0.0.1:3128/ssl && update-ca-certificates
# 正常使用就好
go get -v github.com/golang/dep/cmd/dep
go get -v github.com/axw/gocov/gocov
go get -v github.com/AlekSi/gocov-xml
go get -v golang.org/x/lint/golint
dep ensure -v
go mod download
glide install -v
# 构建完毕可以删除证书
rm /usr/local/share/ca-certificates/gotit.crt && update-ca-certificates
```

### 配置包管理工具

如果你担心导入证书的安全问题,可以尝试绕过包管理工具的 HTTPS 校验。

#### dep

dep 不支持关闭 HTTPS 证书校验,我们需要打上自己的 [Patch](https://github.com/faceair/dep/commit/43c5e6bf4597bc644a9326d16849b986076b7921)。你可以自己在这份 [Fork 仓库](https://github.com/faceair/dep)构建,或者[下载修改后的二进制文件](https://github.com/faceair/dep/releases/latest)
Expand Down Expand Up @@ -71,10 +95,6 @@ HTTPS_PROXY=http://127.0.0.1:8080 glide install
HTTPS_PROXY=http://127.0.0.1:8080 GIT_SSL_NO_VERIFY=true go get -v -insecure github.com/faceair/gotit
```

#### 其他包管理工具

TODO

## 常见问题

1. Gotit 什么时候更新仓库?
Expand Down

0 comments on commit fb2dd8e

Please sign in to comment.