Compare commits

...

140 Commits

Author SHA1 Message Date
zu1k
4006705932 fix nil pointer bug 2020-09-07 13:09:07 +08:00
zu1k
c592df34ab filter nil proxy when append to slice 2020-09-07 13:04:04 +08:00
zu1k
f2d9137488 lookup ip and country when parse proxy 2020-09-07 12:59:45 +08:00
zu1k
d84f2791a3 opti country find 2020-09-07 12:48:03 +08:00
zu1k
240ac61ec0 use ip if exec nslookup 2020-09-07 12:44:55 +08:00
zu1k
5514bbff60 update html 2020-09-07 12:28:23 +08:00
zu1k
d47a3e272e fix nil pointer in derive 2020-09-07 12:12:59 +08:00
zu1k
d324325c89 bump version 2020-09-07 12:03:32 +08:00
zu1k
7554c48fa7 add sip002 support & derive proxy 2020-09-07 12:02:44 +08:00
zu1k
74e5056c60 fix db insert batch fail 2020-09-07 11:46:55 +08:00
zu1k
0e3a17a9f2 add online chat 2020-09-06 10:49:06 +08:00
zu1k
87f1fff34b fix null pointer bug 2020-09-06 10:21:23 +08:00
zu1k
49b1c695fc try to convert between ssr and ss 2020-09-06 10:10:40 +08:00
zu1k
679c6fa0d4 fetch proxies from db every task & bump version 2020-09-06 09:17:50 +08:00
zu1k
864f8403ac use miner patch size 2020-09-05 22:30:05 +08:00
zu1k
f2275c7bdc manual gc every crawl 2020-09-05 22:16:06 +08:00
zu1k
5b5999834d add debug pprof 2020-09-05 21:08:58 +08:00
zu1k
30e46c6ace mod proxy model 2020-09-05 17:40:07 +08:00
zu1k
53e5dc4011 restore html when load 2020-09-05 12:23:53 +08:00
zu1k
c27411dc3d bump version 2020-09-05 12:03:55 +08:00
zu1k
65ad07f579 add database url to config file 2020-09-05 12:03:22 +08:00
zu1k
5ef4144e72 expose country and useable‘ 2020-09-05 11:24:09 +08:00
zu1k
a17b7f6fc9 specific goversion for heroku 2020-09-05 10:58:45 +08:00
zu1k
0d7c58716e fix db 2020-09-05 10:40:30 +08:00
zu1k
9eca907b88 add db support 2020-09-05 10:30:20 +08:00
zu1k
49e1105763 try to fix ssr base64 2020-09-04 17:51:15 +08:00
zu1k
5fde0b6658 add link for all proxies 2020-09-04 17:13:19 +08:00
zu1k
6b769ef998 fix preFilter error & mod sssub 2020-09-04 17:08:43 +08:00
zu1k
458ba6dd35 fix bugs 2020-09-04 16:49:32 +08:00
zu1k
82f6e1dae8 add sub support 2020-09-04 16:40:50 +08:00
zu1k
9de327fb29 add link export for vmess 2020-09-04 16:40:50 +08:00
zu1k
0e88bb62b5 add link export support for ssr 2020-09-04 16:40:50 +08:00
zu1k
ef1b6eab6b add link export for ss & trojan 2020-09-04 16:40:50 +08:00
dependabot[bot]
fb90213e33 Bump github.com/cloudflare/cloudflare-go from 0.13.1 to 0.13.2
Bumps [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) from 0.13.1 to 0.13.2.
- [Release notes](https://github.com/cloudflare/cloudflare-go/releases)
- [Commits](https://github.com/cloudflare/cloudflare-go/compare/v0.13.1...v0.13.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-04 16:40:50 +08:00
zu1k
a87e298002 check all proxies's health every time 2020-08-30 15:02:19 +08:00
zu1k
0b6eea08d1 add gen bindata shell 2020-08-30 13:45:10 +08:00
zu1k
37797cba06 update bindata 2020-08-30 13:40:24 +08:00
zu1k
100f3d5431 update html 2020-08-30 13:33:32 +08:00
zu1k
80276f4b4d add ru country 2020-08-30 11:37:03 +08:00
zu1k
e149b1cc18 add more country to clash 2020-08-30 08:38:34 +08:00
zu1k
8fe4d7e7db update clash config file 2020-08-29 21:28:47 +08:00
zu1k
27c936fbe0 update clash config file 2020-08-29 21:22:00 +08:00
zu1k
65b0eb3798 Bump version 2020-08-29 20:50:21 +08:00
zu1k
54b72a9324 add noneed country filter 2020-08-29 20:49:27 +08:00
zu1k
3c6304b8c2 update example config file 2020-08-29 20:28:45 +08:00
zu1k
ca12fc149b remove fanqiangdang 2020-08-29 14:33:06 +08:00
zu1k
7de03fce79 add statistic 2020-08-29 14:10:10 +08:00
zu1k
03cf8c6c22 fix name reindex 2020-08-26 13:41:12 +08:00
zu1k
60009fedea fix country filter 2020-08-26 13:26:18 +08:00
zu1k
6421e09c8e Bump version 2020-08-26 13:09:16 +08:00
zu1k
c3698f8ed5 Add flags.json to bindata and use map instead of slices 2020-08-26 13:07:30 +08:00
zu1k
84d037c0b8 Merge pull request #11 from sparkyvxcx/develop
Add country flag emoji before country code in each proxy name field, some typo fix
2020-08-26 12:49:01 +08:00
Sparkvix
ff52fc0ed1 Add getFlag method for GeoIP struct 2020-08-26 00:10:00 -04:00
Sparkvix
2f731b0acb Add country flag emoji before country code in each proxy name field, some typo fix 2020-08-25 13:41:59 -04:00
zu1k
cedd5b4ec4 update readme 2020-08-25 14:37:15 +08:00
zu1k
a6387cfefd remove windows platform 2020-08-25 14:30:51 +08:00
zu1k
b54d2d4c01 fix linux file path 2020-08-25 14:29:14 +08:00
zu1k
933a2ea73b Merge pull request #10 from zu1k/dependabot/go_modules/github.com/cloudflare/cloudflare-go-0.13.1
Bump github.com/cloudflare/cloudflare-go from 0.13.0 to 0.13.1
2020-08-25 14:26:35 +08:00
zu1k
673da5b59a fix for github action 2020-08-25 14:25:32 +08:00
zu1k
0828209ae1 bump version 2020-08-25 14:25:32 +08:00
zu1k
386b302208 use bindata 2020-08-25 14:25:32 +08:00
dependabot[bot]
bbebdca897 Bump github.com/cloudflare/cloudflare-go from 0.13.0 to 0.13.1
Bumps [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/cloudflare/cloudflare-go/releases)
- [Commits](https://github.com/cloudflare/cloudflare-go/compare/v0.13.0...v0.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-25 06:21:26 +00:00
zu1k
88ad9e8ba1 Merge pull request #9 from zu1k/dependabot/github_actions/actions/checkout-v2.3.2
Bump actions/checkout from v2.3.1 to v2.3.2
2020-08-25 07:39:59 +08:00
zu1k
655d5facaa opti some func 2020-08-24 19:26:29 +08:00
dependabot[bot]
69025eb9c2 Bump actions/checkout from v2.3.1 to v2.3.2
Bumps [actions/checkout](https://github.com/actions/checkout) from v2.3.1 to v2.3.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.1...2036a08e25fa78bbd946711a407b529a0a1204bf)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-24 08:06:44 +00:00
zu1k
51f6f9f953 update readme 2020-08-24 13:28:40 +08:00
zu1k
ffda71e641 docker add tzdata dep 2020-08-24 13:26:18 +08:00
zu1k
2b22846028 add getters count show 2020-08-24 13:20:55 +08:00
zu1k
526487be04 fix source.uaml 2020-08-23 17:57:42 +08:00
zu1k
8ca93891ff fix bug 2020-08-23 17:32:55 +08:00
zu1k
32c07bcd60 fix name 2020-08-23 17:21:21 +08:00
zu1k
42035022c6 splite source from config 2020-08-23 17:14:04 +08:00
zu1k
2e9a2b4281 add version show 2020-08-23 00:14:00 +08:00
zu1k
4ee01fbc6d go mod tidy 2020-08-23 00:06:27 +08:00
zu1k
dfa76a0255 mod 2020-08-23 00:04:31 +08:00
zu1k
03604fa900 update html 2020-08-22 16:26:24 +08:00
zu1k
7e1dd60837 add country filter 2020-08-22 16:25:24 +08:00
zu1k
a52e63cf65 fix domain race 2020-08-22 15:49:35 +08:00
zu1k
71b9af384c fix domain race 2020-08-22 15:47:56 +08:00
zu1k
095733101b add config error show 2020-08-22 15:43:12 +08:00
zu1k
579a5dc750 Merge branch 'heroku' of github.com:zu1k/proxypool into heroku 2020-08-22 15:33:57 +08:00
zu1k
03a9795ae2 show config file 2020-08-22 15:30:19 +08:00
zu1k
1936ef319e Update app.json 2020-08-22 09:14:54 +08:00
zu1k
20b6066c6a update github 2020-08-21 16:15:03 +08:00
zu1k
53813e71b2 update readme 2020-08-21 16:14:07 +08:00
zu1k
1ea57c65f5 update readme 2020-08-21 16:12:54 +08:00
zu1k
fe6c8e603b add crawl time show 2020-08-21 13:25:38 +08:00
zu1k
45275bc2d3 fix fetch http config file not parse env 2020-08-21 13:01:00 +08:00
zu1k
e6d0f19c0a proxy sort order: name \ type 2020-08-21 11:00:32 +08:00
zu1k
2c4a6a833d update html 2020-08-21 10:21:11 +08:00
zu1k
9f6ae0cb9b add type len 2020-08-21 09:53:08 +08:00
zu1k
6262f510e9 mod html 2020-08-21 09:48:05 +08:00
zu1k
eea6a692e6 fix trojan provider 2020-08-21 09:38:10 +08:00
zu1k
f9d2dbbed9 remoe fanqiangdang num limit 2020-08-21 09:05:17 +08:00
zu1k
6f70ee0b7b update web fanqiangdang 2020-08-21 09:00:26 +08:00
zu1k
bb6600cdd6 fix trojan 2020-08-21 08:31:45 +08:00
zu1k
5a2b0a4188 comment on source.yaml 2020-08-21 08:16:24 +08:00
zu1k
5c2b14f836 update readme 2020-08-20 22:44:15 +08:00
zu1k
345c6f89b6 add trojan link grep 2020-08-20 22:42:40 +08:00
zu1k
097c2d2241 add trojan support 2020-08-20 22:30:59 +08:00
zu1k
023de15f0e config file not found 2020-08-20 20:32:03 +08:00
zu1k
70dea95241 remove config test 2020-08-20 19:25:30 +08:00
zu1k
1a713ed8e4 use local config source default 2020-08-20 19:21:51 +08:00
zu1k
d92cd20d88 add config file path param 2020-08-20 19:06:25 +08:00
zu1k
17c051cee3 add proxies count show 2020-08-20 18:32:41 +08:00
zu1k
07a91fd647 fix for github action 2020-08-20 18:25:23 +08:00
zu1k
c6c5a4c707 can modify domain 2020-08-20 18:23:32 +08:00
zu1k
008183b40e change source url 2020-08-20 15:58:31 +08:00
zu1k
21551f7a67 update readme 2020-08-20 15:44:01 +08:00
zu1k
35c6d1348b add google analytics 2020-08-20 09:39:17 +08:00
zu1k
1e10be9153 update readme 2020-08-20 09:29:27 +08:00
zu1k
8d988f0f5b add more tgchannel 2020-08-19 22:54:10 +08:00
zu1k
a7a8a9ff8b vmess identifier add uuid 2020-08-19 21:20:08 +08:00
zu1k
a9fa94c8c1 opti 2020-08-19 21:12:49 +08:00
zu1k
4cfb143f88 crowl sub in tgchannel‘ 2020-08-19 21:06:19 +08:00
zu1k
3fbdb91e7d update index.html 2020-08-19 09:28:24 +08:00
zu1k
6b462f6310 update readme 2020-08-19 08:34:52 +08:00
zu1k
32c1c7c127 update readme 2020-08-19 08:10:11 +08:00
zu1k
be46f914de add heroku app.json 2020-08-19 08:05:19 +08:00
zu1k
89338d7152 remove nouse getter 2020-08-19 06:50:45 +08:00
zu1k
1fee5e87ff rename func 2020-08-18 19:07:52 +08:00
zu1k
2ba481e388 clean for all 2020-08-18 19:06:47 +08:00
zu1k
daea47552d opti 2020-08-18 18:37:38 +08:00
zu1k
59ea871190 fix proxy list clone 2020-08-18 18:31:45 +08:00
zu1k
ef44ef7436 use deep copy 2020-08-18 16:42:30 +08:00
zu1k
f1ec6c6bf8 fix port long time no bind 2020-08-18 16:24:20 +08:00
zu1k
e91c024e7b change type all 2020-08-18 16:18:08 +08:00
zu1k
32dadde123 add more tgchannel 2020-08-18 11:14:38 +08:00
zu1k
573f8cb312 add more webfuzz 2020-08-18 10:53:39 +08:00
zu1k
67457a5a9e add more subs 2020-08-18 10:49:56 +08:00
zu1k
b61dd2d8ec add heroku support 2020-08-18 10:08:38 +08:00
zu1k
c0ee23cb98 add heroku metrics 2020-08-18 09:51:24 +08:00
zu1k
f3c3397844 add ssrtool 2020-08-18 09:00:26 +08:00
zu1k
8b2b109ca9 add more source 2020-08-17 20:56:07 +08:00
zu1k
b2b7c94b68 add more sources 2020-08-17 17:31:26 +08:00
zu1k
119873e704 add webfuzzsub getter 2020-08-17 11:54:38 +08:00
zu1k
4fd88553ba opti name 2020-08-17 11:08:47 +08:00
zu1k
12da2a73d6 remove duplicate code 2020-08-17 09:17:39 +08:00
zu1k
a29d02c88e close chan when noneed 2020-08-16 22:32:09 +08:00
zu1k
7d0cac882c add debug charts 2020-08-16 21:15:03 +08:00
79 changed files with 4872 additions and 2968 deletions

2
.github/FUNDING.yml vendored
View File

@@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://blog.lgf.im/donate/']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.3.2
- name: Build and push Docker images
uses: docker/build-push-action@v1.1.0

View File

@@ -12,7 +12,7 @@ jobs:
go-version: 1.14.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.3.2
- name: Cache go module
uses: actions/cache@v2
@@ -26,6 +26,12 @@ jobs:
run: |
go test ./...
- name: gen go-bindata
if: startsWith(github.ref, 'refs/tags/')
run: |
go get -u github.com/go-bindata/go-bindata/...
go-bindata -o internal/bindata/geoip/geoip.go -pkg bingeoip assets/GeoLite2-City.mmdb assets/flags.json
- name: Build
if: startsWith(github.ref, 'refs/tags/')
env:

2
.gitignore vendored
View File

@@ -21,4 +21,4 @@ vendor
# macOS file
.DS_Store
*.exe
assets/html/

View File

@@ -9,9 +9,8 @@ RUN go mod download && \
FROM alpine:latest
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /proxypool-src
COPY ./assets /proxypool-src/assets
COPY ./source.yaml /proxypool-src
COPY --from=builder /proxypool /proxypool-src/
ENTRYPOINT ["/proxypool-src/proxypool"]

View File

@@ -20,11 +20,8 @@ PLATFORM_LIST = \
freebsd-386 \
freebsd-amd64
WINDOWS_ARCH_LIST = \
windows-386 \
windows-amd64
all: linux-amd64 darwin-amd64 windows-amd64 # Most used
all: linux-amd64 darwin-amd64
docker:
$(GOBUILD) -o $(BINDIR)/$(NAME)-$@
@@ -74,24 +71,14 @@ freebsd-386:
freebsd-amd64:
GOARCH=amd64 GOOS=freebsd $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
windows-386:
GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe
windows-amd64:
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe
gz_releases=$(addsuffix .gz, $(PLATFORM_LIST))
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST))
$(gz_releases): %.gz : %
chmod +x $(BINDIR)/$(NAME)-$(basename $@)
gzip -f -S -$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@)
$(zip_releases): %.zip : %
zip -m -j $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@).exe
all-arch: $(PLATFORM_LIST)
all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST)
releases: $(gz_releases) $(zip_releases)
releases: $(gz_releases)
clean:
rm $(BINDIR)/*

View File

@@ -2,7 +2,7 @@
<br>proxypool<br>
</h1>
<h5 align="center">自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重测试可用性后提供节点列表</h5>
<h5 align="center">自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess、trojan节点信息,聚合去重测试可用性后提供节点列表</h5>
<p align="center">
<a href="https://github.com/zu1k/proxypool/actions">
@@ -16,22 +16,31 @@
</a>
</p>
![Star](https://img.shields.io/github/stars/zu1k/proxypool.svg?style=social&label=Star) 来都来了不点个Star再走
## 支持
- 支持ss、ssr、vmess节点链接与订阅
- 任意 Telegram 频道抓取
- 机场订阅地址抓取解析
- 支持ss、ssr、vmess、trojan多种类型
- Telegram频道抓取
- 订阅地址抓取解析
- 公开互联网页面模糊抓取
- 翻墙党论坛新节点信息
- 其他节点分享网站
- 定时抓取更新
- 使用配置文件提供抓取源
- 定时抓取自动更新
- 通过配置文件设置抓取源
- 自动检测节点可用性
## 安装
### 使用Heroku
点击按钮进入部署页面,填写基本信息然后运行
其中 `DOMAIN` 需要填写为你需要绑定的域名,`CONFIG_FILE` 需要填写你的配置文件路径,配置文件模板见 config/config.yaml 文件
`CF` 开头的选项暂不需要填写,不影响程序运行
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
> 因为爬虫程序需要持续运行,所以至少选择 $7/月 的配置
> 免费配置长时间无人访问会被heroku强制停止
### 从源码编译
需要安装Golang
@@ -52,30 +61,28 @@ docker pull docker.pkg.github.com/zu1k/proxypool/proxypool:latest
## 使用
### 共享抓取配置文件
### 修改配置文件
每一次抓取前会自动从github下载最新的抓取配置文件
首先修改 config.yaml 中的必要配置信息cf开头的选项不需要填写
直接运行 `proxypool` 程序即可
source.yaml 文件中定义了抓取源,需要定期手动维护更新
### 自定义抓取配置文件
### 启动程序
使用 `-c` 参数指定配置文件路径支持http链接
```shell
proxypool -c source.yaml
proxypool -c config.yaml
```
### 帮助更新配置文件
可以在 https://github.com/zu1k/proxypool/issues/3 进行留言
### 用户使用
目前公开版本: https://proxy.tgbot.co
直接在clash添加配置文件即可使用 https://proxy.tgbot.co/clash/config
## 截图
![Speedtest](docs/speedtest.png)
![Fast](docs/fast.png)
## 声明
本项目遵循 GNU General Public License v3.0 开源,在此基础上,所有使用本项目提供服务者都必须在网站首页保留指向本项目的链接
禁止使用本项目进行营利和做其他违法事情,产生的一切后果本项目概不负责

View File

@@ -1,51 +1,211 @@
package api
import (
"html/template"
"net/http"
"os"
"strconv"
"github.com/gin-gonic/gin"
"github.com/zu1k/proxypool/app/cache"
"github.com/zu1k/proxypool/provider"
_ "github.com/heroku/x/hmetrics/onload"
"github.com/zu1k/proxypool/config"
binhtml "github.com/zu1k/proxypool/internal/bindata/html"
"github.com/zu1k/proxypool/internal/cache"
"github.com/zu1k/proxypool/pkg/provider"
)
const version = "v0.3.9"
var router *gin.Engine
func setupRouter() {
router = gin.Default()
gin.SetMode(gin.ReleaseMode)
router = gin.New()
router.Use(gin.Recovery())
temp, err := loadTemplate()
if err != nil {
panic(err)
}
router.SetHTMLTemplate(temp)
router.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "assets/html/index.html", gin.H{
"domain": config.Config.Domain,
"getters_count": cache.GettersCount,
"all_proxies_count": cache.AllProxiesCount,
"ss_proxies_count": cache.SSProxiesCount,
"ssr_proxies_count": cache.SSRProxiesCount,
"vmess_proxies_count": cache.VmessProxiesCount,
"trojan_proxies_count": cache.TrojanProxiesCount,
"useful_proxies_count": cache.UsefullProxiesCount,
"last_crawl_time": cache.LastCrawlTime,
"version": version,
})
})
router.GET("/clash", func(c *gin.Context) {
c.HTML(http.StatusOK, "assets/html/clash.html", gin.H{
"domain": config.Config.Domain,
})
})
router.GET("/surge", func(c *gin.Context) {
c.HTML(http.StatusOK, "assets/html/surge.html", gin.H{
"domain": config.Config.Domain,
})
})
router.GET("/clash/config", func(c *gin.Context) {
c.HTML(http.StatusOK, "assets/html/clash-config.yaml", gin.H{
"domain": config.Config.Domain,
})
})
router.GET("/surge/config", func(c *gin.Context) {
c.HTML(http.StatusOK, "assets/html/surge.conf", gin.H{
"domain": config.Config.Domain,
})
})
router.StaticFile("/", "assets/index.html")
router.StaticFile("/clash", "assets/clash.html")
router.StaticFile("/surge", "assets/surge.html")
router.StaticFile("/clash/config", "assets/clash-config.yaml")
router.StaticFile("/surge/config", "assets/surge.conf")
router.GET("/clash/proxies", func(c *gin.Context) {
proxyTypes := c.DefaultQuery("type", "")
proxyCountry := c.DefaultQuery("c", "")
proxyNotCountry := c.DefaultQuery("nc", "")
text := ""
if proxyTypes == "all" || proxyTypes == "" {
if proxyTypes == "" && proxyCountry == "" && proxyNotCountry == "" {
text = cache.GetString("clashproxies")
if text == "" {
proxies := cache.GetProxies()
clash := provider.Clash{Proxies: proxies}
proxies := cache.GetProxies("proxies")
clash := provider.Clash{
provider.Base{
Proxies: &proxies,
},
}
text = clash.Provide()
cache.SetString("clashproxies", text)
}
} else if proxyTypes == "all" {
proxies := cache.GetProxies("allproxies")
clash := provider.Clash{
provider.Base{
Proxies: &proxies,
Types: proxyTypes,
Country: proxyCountry,
NotCountry: proxyNotCountry,
},
}
text = clash.Provide()
} else {
proxies := cache.GetProxies()
clash := provider.Clash{Proxies: proxies, Types: proxyTypes}
proxies := cache.GetProxies("proxies")
clash := provider.Clash{
provider.Base{
Proxies: &proxies,
Types: proxyTypes,
Country: proxyCountry,
NotCountry: proxyNotCountry,
},
}
text = clash.Provide()
}
c.String(200, text)
})
router.GET("/surge/proxies", func(c *gin.Context) {
text := cache.GetString("surgeproxies")
if text == "" {
proxies := cache.GetProxies()
surge := provider.Surge{Proxies: proxies}
proxyTypes := c.DefaultQuery("type", "")
proxyCountry := c.DefaultQuery("c", "")
proxyNotCountry := c.DefaultQuery("nc", "")
text := ""
if proxyTypes == "" && proxyCountry == "" && proxyNotCountry == "" {
text = cache.GetString("surgeproxies")
if text == "" {
proxies := cache.GetProxies("proxies")
surge := provider.Surge{
provider.Base{
Proxies: &proxies,
},
}
text = surge.Provide()
cache.SetString("surgeproxies", text)
}
} else if proxyTypes == "all" {
proxies := cache.GetProxies("allproxies")
surge := provider.Surge{
provider.Base{
Proxies: &proxies,
Types: proxyTypes,
Country: proxyCountry,
NotCountry: proxyNotCountry,
},
}
text = surge.Provide()
} else {
proxies := cache.GetProxies("proxies")
surge := provider.Surge{
provider.Base{
Proxies: &proxies,
Types: proxyTypes,
Country: proxyCountry,
NotCountry: proxyNotCountry,
},
}
text = surge.Provide()
cache.SetString("surgeproxies", text)
}
c.String(200, text)
})
router.GET("/ss/sub", func(c *gin.Context) {
proxies := cache.GetProxies("proxies")
ssSub := provider.SSSub{
provider.Base{
Proxies: &proxies,
Types: "ss",
},
}
c.String(200, ssSub.Provide())
})
router.GET("/ssr/sub", func(c *gin.Context) {
proxies := cache.GetProxies("proxies")
ssrSub := provider.SSRSub{
provider.Base{
Proxies: &proxies,
Types: "ssr",
},
}
c.String(200, ssrSub.Provide())
})
router.GET("/vmess/sub", func(c *gin.Context) {
proxies := cache.GetProxies("proxies")
vmessSub := provider.VmessSub{
provider.Base{
Proxies: &proxies,
Types: "vmess",
},
}
c.String(200, vmessSub.Provide())
})
router.GET("/sip002/sub", func(c *gin.Context) {
proxies := cache.GetProxies("proxies")
sip002Sub := provider.SIP002Sub{
provider.Base{
Proxies: &proxies,
Types: "ss",
},
}
c.String(200, sip002Sub.Provide())
})
router.GET("/link/:id", func(c *gin.Context) {
idx := c.Param("id")
proxies := cache.GetProxies("allproxies")
id, err := strconv.Atoi(idx)
if err != nil {
c.String(500, err.Error())
}
if id >= proxies.Len() {
c.String(500, "id too big")
}
c.String(200, proxies[id].Link())
})
}
func Run() {
@@ -56,3 +216,16 @@ func Run() {
}
router.Run(":" + port)
}
func loadTemplate() (t *template.Template, err error) {
_ = binhtml.RestoreAssets("", "assets/html")
t = template.New("")
for _, fileName := range binhtml.AssetNames() {
data := binhtml.MustAsset(fileName)
t, err = t.New(fileName).Parse(string(data))
if err != nil {
return nil, err
}
}
return t, nil
}

25
app.json Normal file
View File

@@ -0,0 +1,25 @@
{
"name": "proxypool",
"description": "自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重测试可用性后提供节点列表",
"website": "https://proxy.tgbot.co/",
"repository": "https://github.com/zu1k/proxypool",
"success_url": "/",
"logo": "https://raw.githubusercontent.com/zu1k/proxypool/heroku/assets/proxy.jpg",
"keywords": ["golang", "ss", "ssr", "vmess", "shadowsocks", "shadowsocksr", "trojan"],
"env": {
"CONFIG_FILE": {
"description": "Path to config file, could be a url."
},
"DOMAIN": {
"description": "Domain to use."
},
"CF_API_EMAIL": {
"description": "Cloudflare Email.",
"required": false
},
"CF_API_KEY": {
"description": "Cloudflare API key.",
"required": false
}
}
}

View File

@@ -1,36 +0,0 @@
package app
import (
"errors"
"fmt"
"strconv"
"testing"
"github.com/zu1k/proxypool/config"
"github.com/zu1k/proxypool/getter"
)
func TestConfigFile(t *testing.T) {
c, err := config.Parse("../source.yaml")
if err != nil {
t.Error(err)
return
}
if c == nil {
t.Error(errors.New("no sources"))
return
}
for idx, source := range c.Sources {
g, err := getter.NewGetter(source.Type, source.Options)
if err != nil {
t.Error(err, idx)
fmt.Println(source)
return
}
if g == nil {
t.Error(errors.New("getter is nil:" + strconv.Itoa(idx)))
fmt.Println(source)
return
}
}
}

View File

@@ -1,10 +0,0 @@
package app
import (
"github.com/jasonlvhit/gocron"
)
func Cron() {
_ = gocron.Every(10).Minutes().Do(CrawlGo)
<-gocron.Start()
}

View File

@@ -1,35 +0,0 @@
package app
import (
"errors"
"fmt"
"github.com/zu1k/proxypool/config"
"github.com/zu1k/proxypool/getter"
)
var Getters = make([]getter.Getter, 0)
func InitConfigAndGetters(path string) (err error) {
c, err := config.Parse(path)
if err != nil {
return err
}
if c == nil {
return errors.New("no sources")
}
InitGetters(c.Sources)
return nil
}
func InitGetters(sources []config.Source) {
Getters = make([]getter.Getter, 0)
for _, source := range sources {
g, err := getter.NewGetter(source.Type, source.Options)
if err == nil && g != nil {
Getters = append(Getters, g)
fmt.Println("init getter:", source.Type, source.Options)
}
}
fmt.Println("Getter count:", len(Getters))
}

View File

@@ -1,12 +0,0 @@
package app
import "github.com/zu1k/proxypool/proxy"
var (
GeoIp proxy.GeoIP
ProjectName = "proxypool"
)
func InitGeoIpDB() {
GeoIp = proxy.NewGeoIP("assets/GeoLite2-City.mmdb")
}

View File

@@ -1,95 +0,0 @@
package app
import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"strconv"
"sync"
"github.com/zu1k/proxypool/config"
"gopkg.in/yaml.v2"
"github.com/zu1k/proxypool/app/cache"
"github.com/zu1k/proxypool/provider"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
)
var NeedFetchNewConfigFile = false
func Crawl() {
if NeedFetchNewConfigFile {
FetchNewConfigFileThenInit()
}
proxies := make([]proxy.Proxy, 0)
for _, g := range Getters {
proxies = append(proxies, g.Get()...)
}
proxies = append(proxies, cache.GetProxies()...)
proxies = proxy.Deduplication(proxies)
num := len(proxies)
for i := 0; i < num; i++ {
proxies[i].SetName(strconv.Itoa(rand.Int()))
}
log.Println("Crawl node count:", num)
cache.SetProxies(proxies)
cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())
cache.SetString("surgeproxies", provider.Surge{Proxies: proxies}.Provide())
}
func CrawlGo() {
if NeedFetchNewConfigFile {
FetchNewConfigFileThenInit()
}
wg := &sync.WaitGroup{}
var pc = make(chan proxy.Proxy)
for _, g := range Getters {
wg.Add(1)
go g.Get2Chan(pc, wg)
}
proxies := cache.GetProxies()
go func() {
wg.Wait()
close(pc)
}()
for node := range pc {
if node != nil {
proxies = append(proxies, node)
}
}
proxies = proxy.Deduplication(proxies)
log.Println("CrawlGo node count:", len(proxies))
proxies = proxy.CleanProxies(provider.Clash{Proxies: proxies}.CleanProxies())
log.Println("CrawlGo clash useable node count:", len(proxies))
num := len(proxies)
for i := 0; i < num; i++ {
country, err := GeoIp.Find(proxies[i].BaseInfo().Server)
if err != nil || country == "" {
country = "Earth"
}
proxies[i].SetName(fmt.Sprintf("%s_%d_%s", ProjectName, i+1, country))
}
cache.SetProxies(proxies)
cache.SetString("clashproxies", provider.Clash{Proxies: proxies}.Provide())
cache.SetString("surgeproxies", provider.Surge{Proxies: proxies}.Provide())
}
func FetchNewConfigFileThenInit() {
fmt.Println("fetch new config file...")
resp, err := tool.GetHttpClient().Get("https://raw.githubusercontent.com/zu1k/proxypool/master/source.yaml")
if err != nil {
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
err = yaml.Unmarshal(body, &config.SourceConfig)
if err != nil {
return
}
InitGetters(config.SourceConfig.Sources)
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,118 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<title>免费Clash节点</title>
<style type='text/css'>
body {
background-color: white;
color: #333333;
font-family: Arial, sans-serif;
margin: 0;
padding: 36px;
line-height: 1;
font-size: 14px;
}
.section {
margin-bottom: 36px;
}
.section.friendly {
color: #222222;
}
.section.friendly h1 {
font-size: 26px;
background-color: #dad8e4;
padding: 18px 22px 15px 22px;
margin: 0;
overflow: hidden;
}
.section.friendly h1 strong {
display: inline-block;
float: left;
}
.section.friendly h1 small {
display: inline-block;
float: right;
text-align: right;
font-size: 18px;
padding-top: 4px;
color: #333333;
}
.section.friendly .article {
border: 4px solid #dad8e4;
padding: 24px 18px 18px 18px;
}
.section.friendly .article h3 {
font-size: 20px;
margin: 0 0 18px 0;
}
.section.friendly .article a {
color: #6b6ceb;
}
.section.friendly .article a:visited {
color: #1d1d3b;
}
.section.friendly .article p {
font-size: 14px;
}
.section.friendly .article ul {
list-style-type: square;
}
.section.original {
background-color: #eeeeee;
color: #444444;
}
.section.original h2 {
background-color: #dddddd;
margin: 0;
padding: 18px 22px 18px 22px;
font-size: 20px;
}
.section.original pre {
margin: 0;
padding: 18px 22px 18px 22px;
overflow: auto;
font-family: monaco, monospaced;
}
.section.original pre code {
display: block;
font-size: 11px;
width: 100%;
}
</style>
</head>
<body>
<div class='container'>
<div class='section friendly'>
<h1><strong>免费Clash节点</strong></h1>
<div class='article'>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供clash配置每10分钟更新</p>
<br>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a> <a href="clash://install-config?url=https://proxy.tgbot.co/clash/config">一键导入</a></p>
<p>Clash proxy-provider(Shadowrocket添加订阅方式可用)<a href="https://proxy.tgbot.co/clash/proxies">https://proxy.tgbot.co/clash/proxies</a></p>
<br>
<p>筛选代理类型(此种方式你只能自己维护配置文件)https://proxy.tgbot.co/clash/proxies?type=ss,ssr,vmess</p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>
</body>
</html>

2000
assets/flags.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,89 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<title>免费节点</title>
<style type='text/css'>
body {
background-color: white;
color: #333333;
font-family: Arial, sans-serif;
margin: 0;
padding: 36px;
line-height: 1;
font-size: 14px; }
.section {
margin-bottom: 36px; }
.section.friendly {
color: #222222; }
.section.friendly h1 {
font-size: 26px;
background-color: #dad8e4;
padding: 18px 22px 15px 22px;
margin: 0;
overflow: hidden; }
.section.friendly h1 strong {
display: inline-block;
float: left; }
.section.friendly h1 small {
display: inline-block;
float: right;
text-align: right;
font-size: 18px;
padding-top: 4px;
color: #333333; }
.section.friendly .article {
border: 4px solid #dad8e4;
padding: 24px 18px 18px 18px; }
.section.friendly .article h3 {
font-size: 20px;
margin: 0 0 18px 0; }
.section.friendly .article a {
color: #6b6ceb; }
.section.friendly .article a:visited {
color: #1d1d3b; }
.section.friendly .article p {
font-size: 14px; }
.section.friendly .article ul {
list-style-type: square; }
.section.original {
background-color: #eeeeee;
color: #444444; }
.section.original h2 {
background-color: #dddddd;
margin: 0;
padding: 18px 22px 18px 22px;
font-size: 20px; }
.section.original pre {
margin: 0;
padding: 18px 22px 18px 22px;
overflow: auto;
font-family: monaco, monospaced; }
.section.original pre code {
display: block;
font-size: 11px;
width: 100%; }
</style>
</head>
<body>
<div class='container'>
<div class='section friendly'>
<h1><strong>免费节点</strong></h1>
<div class='article'>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、ssr、vmess节点信息聚合去重后提供节点列表每10分钟更新</p>
<br>
<p>Clash配置文件<a href="https://proxy.tgbot.co/clash/config">https://proxy.tgbot.co/clash/config</a> <a href="clash://install-config?url=https://proxy.tgbot.co/clash/config">一键导入</a></p>
<p>Clash proxy-provider(Shadowrocket添加订阅方式可用)<a href="https://proxy.tgbot.co/clash/proxies">https://proxy.tgbot.co/clash/proxies</a></p>
<br>
<p>Surge配置文件<a href="https://proxy.tgbot.co/surge/config">https://proxy.tgbot.co/surge/config</a> <a href="surge3:///install-config?url=https://proxy.tgbot.co/surge/config">一键导入</a></p>
<p>Surge proxy list<a href="https://proxy.tgbot.co/surge/proxies">https://proxy.tgbot.co/surge/proxies</a></p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>
</body>
</html>

BIN
assets/proxy.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -1,24 +0,0 @@
sources:
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
- type: webfuzz
options:
url: https://merlinblog.xyz/wiki/freess.html
- type: tgchannel
options:
channel: ssrList
num: 200
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum.php?mod=rss&fid=50&auth=0
num: 200
- type: web-freessrxyz
options:
- type: web-lucnorg
options:

View File

@@ -1,45 +0,0 @@
[Proxy]
Direct = direct
[Proxy Group]
Proxy = select, 延迟最低, 失败切换, 手动选择
延迟最低 = url-test, policy-path=https://proxy.tgbot.co/surge/proxies, url=http://www.qualcomm.cn/generate_204, update-interval=3600, interval = 600s, tolerance = 100ms, timeout = 5s, evaluate-before-use = true
失败切换 = fallback, policy-path=https://proxy.tgbot.co/surge/proxies, url=http://www.qualcomm.cn/generate_204, update-interval=3600, interval = 600s, tolerance = 100ms, timeout = 5s, evaluate-before-use = true
手动选择 = select, policy-path=https://proxy.tgbot.co/surge/proxies, url=http://www.qualcomm.cn/generate_204, update-interval=3600, interval = 600s, tolerance = 100ms, timeout = 5s, evaluate-before-use = true
Apple = select, Direct, Proxy
Adblock = select, Direct, REJECT, REJECT-TINYGIF
[Rule]
# RULESET
RULE-SET,SYSTEM,Direct
#
# Unbreak 后续规则修正
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Unbreak.list,Adblock
# Advertising 广告
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Guard/Advertising.list,Adblock
# Privacy 隐私
# RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Guard/Privacy.list,Adblock
# Hijacking 运营商劫持或恶意网站
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Guard/Hijacking.list,Adblock
#
# Apple
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Extra/Apple/Apple.list,Apple
#
# 代理
# Streaming 国际流媒体服务
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/StreamingMedia/Streaming.list,Proxy
# StreamingSE 中国流媒体服务(面向海外版本)
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/StreamingMedia/StreamingSE.list,Proxy
# Global 全球加速
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Global.list,Proxy
#
RULE-SET,https://github.com/Hackl0us/SS-Rule-Snippet/raw/master/Rulesets/App/social/Telegram.list,Proxy
RULE-SET,https://github.com/Hackl0us/SS-Rule-Snippet/raw/master/Rulesets/App/social/WhatsApp.list,Proxy
RULE-SET,https://github.com/Hackl0us/SS-Rule-Snippet/raw/master/Rulesets/App/social/LINE.list,Proxy
#
# Direct
RULE-SET,https://github.com/DivineEngine/Profiles/raw/master/Surge/Ruleset/Extra/ChinaIP.list,Direct
#
RULE-SET,LAN,Direct
# GEOIP,CN,Direct
FINAL,Proxy,dns-failed

View File

@@ -1,86 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="True">
<title>免费Surge节点</title>
<style type='text/css'>
body {
background-color: white;
color: #333333;
font-family: Arial, sans-serif;
margin: 0;
padding: 36px;
line-height: 1;
font-size: 14px; }
.section {
margin-bottom: 36px; }
.section.friendly {
color: #222222; }
.section.friendly h1 {
font-size: 26px;
background-color: #dad8e4;
padding: 18px 22px 15px 22px;
margin: 0;
overflow: hidden; }
.section.friendly h1 strong {
display: inline-block;
float: left; }
.section.friendly h1 small {
display: inline-block;
float: right;
text-align: right;
font-size: 18px;
padding-top: 4px;
color: #333333; }
.section.friendly .article {
border: 4px solid #dad8e4;
padding: 24px 18px 18px 18px; }
.section.friendly .article h3 {
font-size: 20px;
margin: 0 0 18px 0; }
.section.friendly .article a {
color: #6b6ceb; }
.section.friendly .article a:visited {
color: #1d1d3b; }
.section.friendly .article p {
font-size: 14px; }
.section.friendly .article ul {
list-style-type: square; }
.section.original {
background-color: #eeeeee;
color: #444444; }
.section.original h2 {
background-color: #dddddd;
margin: 0;
padding: 18px 22px 18px 22px;
font-size: 20px; }
.section.original pre {
margin: 0;
padding: 18px 22px 18px 22px;
overflow: auto;
font-family: monaco, monospaced; }
.section.original pre code {
display: block;
font-size: 11px;
width: 100%; }
</style>
</head>
<body>
<div class='container'>
<div class='section friendly'>
<h1><strong>免费Surge节点</strong></h1>
<div class='article'>
<p>自动抓取tg频道、订阅地址、公开互联网上的ss、vmess节点信息聚合去重后提供Surge节点列表每10分钟更新</p>
<br>
<p>Surge配置文件<a href="https://proxy.tgbot.co/surge/config">https://proxy.tgbot.co/surge/config</a> <a href="surge3:///install-config?url=https://proxy.tgbot.co/surge/config">一键导入</a></p>
<p>Surge proxy list<a href="https://proxy.tgbot.co/surge/proxies">https://proxy.tgbot.co/surge/proxies</a></p>
<br>
<p>抓取程序已开源:<a href="https://github.com/zu1k/proxypool">https://github.com/zu1k/proxypool</a></p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,50 +1,72 @@
package config
import (
"fmt"
"errors"
"io/ioutil"
"os"
"strings"
"github.com/ghodss/yaml"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/tool"
)
type Source struct {
Type string `json:"type" yaml:"type"`
Options tool.Options `json:"options" yaml:"options"`
var configFilePath = "config.yaml"
type ConfigOptions struct {
Domain string `json:"domain" yaml:"domain"`
DatabaseUrl string `json:"database_url" yaml:"database_url"`
CFEmail string `json:"cf_email" yaml:"cf_email"`
CFKey string `json:"cf_key" yaml:"cf_key"`
SourceFiles []string `json:"source-files" yaml:"source-files"`
}
type Config struct {
Sources []Source `json:"sources" yaml:"sources"`
}
// Config 配置
var Config ConfigOptions
var SourceConfig = Config{}
func Parse(path string) (*Config, error) {
fileData, err := readFile(path)
// Parse 解析配置文件,支持本地文件系统和网络链接
func Parse(path string) error {
if path == "" {
path = configFilePath
} else {
configFilePath = path
}
fileData, err := ReadFile(path)
if err != nil {
return nil, err
return err
}
SourceConfig = Config{}
err = yaml.Unmarshal(fileData, &SourceConfig)
Config = ConfigOptions{}
err = yaml.Unmarshal(fileData, &Config)
if err != nil {
return nil, err
return err
}
return &SourceConfig, nil
// 部分配置环境变量优先
if domain := os.Getenv("DOMAIN"); domain != "" {
Config.Domain = domain
}
if cfEmail := os.Getenv("CF_API_EMAIL"); cfEmail != "" {
Config.CFEmail = cfEmail
}
if cfKey := os.Getenv("CF_API_KEY"); cfKey != "" {
Config.CFKey = cfKey
}
return nil
}
func readFile(path string) ([]byte, error) {
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil, err
// 从本地文件或者http链接读取配置文件内容
func ReadFile(path string) ([]byte, error) {
if strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://") {
resp, err := tool.GetHttpClient().Get(path)
if err != nil {
return nil, errors.New("config file http get fail")
}
defer resp.Body.Close()
return ioutil.ReadAll(resp.Body)
} else {
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil, err
}
return ioutil.ReadFile(path)
}
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
if len(data) == 0 {
return nil, fmt.Errorf("Configuration file %s is empty", path)
}
return data, err
}

16
config/config.yaml Normal file
View File

@@ -0,0 +1,16 @@
# your domain
domain: example.com
# database url
database_url: ""
# cloudflare api
cf_email: ""
cf_key: ""
# source definition file
source-files:
# use local file
- source.yaml
# use web file
- https://example.com/source.yaml

8
config/source.go Normal file
View File

@@ -0,0 +1,8 @@
package config
import "github.com/zu1k/proxypool/pkg/tool"
type Source struct {
Type string `json:"type" yaml:"type"`
Options tool.Options `json:"options" yaml:"options"`
}

29
config/source.yaml Normal file
View File

@@ -0,0 +1,29 @@
# 模糊抓取订阅链接
- type: webfuzzsub
options:
url: https://raw.githubusercontent.com/du5/free/master/sub.list
# 订阅链接
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
# 网页模糊抓取
- type: webfuzz
options:
url: https://merlinblog.xyz/wiki/freess.html
# tg频道抓取
- type: tgchannel
options:
channel: ssrList
num: 200
# 翻墙党论坛抓取
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum-48-1.html
# 某个网站抓取
- type: web-freessrxyz
options:

2
docs/genbindata.sh Normal file
View File

@@ -0,0 +1,2 @@
go-bindata -o internal/bindata/html/html.go -pkg binhtml assets/html/
go-bindata -o internal/bindata/geoip/geoip.go -pkg bingeoip assets/GeoLite2-City.mmdb assets/flags.json

View File

@@ -1,81 +0,0 @@
package getter
import (
"fmt"
"sync"
"github.com/gocolly/colly"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
)
func init() {
Register("web-fanqiangdang", NewWebFanqiangdangGetter)
}
type WebFanqiangdang struct {
c *colly.Collector
NumNeeded int
Url string
results []string
}
func NewWebFanqiangdangGetter(options tool.Options) (getter Getter, err error) {
num, found := options["num"]
t := 200
switch num.(type) {
case int:
t = num.(int)
case float64:
t = int(num.(float64))
}
if !found || t <= 0 {
t = 200
}
urlInterface, found := options["url"]
if found {
url, err := AssertTypeStringNotNull(urlInterface)
if err != nil {
return nil, err
}
return &WebFanqiangdang{
c: colly.NewCollector(),
NumNeeded: t,
Url: url,
}, nil
}
return nil, ErrorUrlNotFound
}
func (w *WebFanqiangdang) Get() []proxy.Proxy {
w.results = make([]string, 0)
// 找到所有的文字消息
w.c.OnHTML("td.t_f", func(e *colly.HTMLElement) {
w.results = append(w.results, GrepLinksFromString(e.Text)...)
})
// 从订阅中取出每一页,因为是订阅,所以都比较新
w.c.OnXML("//item//link", func(e *colly.XMLElement) {
if len(w.results) < w.NumNeeded {
_ = e.Request.Visit(e.Text)
}
})
w.results = make([]string, 0)
err := w.c.Visit(w.Url)
if err != nil {
_ = fmt.Errorf("%s", err.Error())
}
return StringArray2ProxyArray(w.results)
}
func (w *WebFanqiangdang) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := w.Get()
for _, node := range nodes {
pc <- node
}
}

View File

@@ -1,85 +0,0 @@
package getter
import (
"encoding/base64"
"encoding/json"
"io/ioutil"
"sync"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
)
func init() {
Register("web-lucnorg", NewWebLucnorg)
}
const lucnorgSsrLink = "https://lncn.org/api/ssrList"
type WebLucnOrg struct {
}
func NewWebLucnorg(options tool.Options) (getter Getter, err error) {
return &WebLucnOrg{}, nil
}
func (w *WebLucnOrg) Get() []proxy.Proxy {
resp, err := tool.GetHttpClient().Post(lucnorgSsrLink, nil)
if err != nil {
return nil
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil
}
response := struct {
Code string `json:"code"`
Ssrs string `json:"ssrs"`
}{}
err = json.Unmarshal(body, &response)
if err != nil {
return nil
}
dec := decryptAesForLucn(response.Code, response.Ssrs)
if dec == nil {
return nil
}
type node struct {
Url string `json:"url"`
}
ssrs := make([]node, 0)
err = json.Unmarshal(dec, &ssrs)
if err != nil {
return nil
}
result := make([]string, 0)
for _, node := range ssrs {
result = append(result, node.Url)
}
return StringArray2ProxyArray(result)
}
func (w *WebLucnOrg) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := w.Get()
for _, node := range nodes {
pc <- node
}
}
func decryptAesForLucn(code string, c string) []byte {
if code == "" {
code = "abclnv561cqqfg30"
}
cipher, err := base64.StdEncoding.DecodeString(c)
if err != nil {
return nil
}
result := tool.AesEcbDecryptWithPKCS7Unpadding(cipher, []byte(code))
return result
}

19
go.mod
View File

@@ -1,3 +1,5 @@
// +heroku goVersion go1.14
module github.com/zu1k/proxypool
go 1.14
@@ -9,33 +11,32 @@ require (
github.com/antchfx/htmlquery v1.2.3 // indirect
github.com/antchfx/xmlquery v1.2.4 // indirect
github.com/antchfx/xpath v1.1.8 // indirect
github.com/cloudflare/cloudflare-go v0.13.2
github.com/ghodss/yaml v1.0.0
github.com/gin-gonic/gin v1.6.3
github.com/go-playground/validator/v10 v10.3.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gocolly/colly v1.2.0
github.com/golang/protobuf v1.4.2 // indirect
github.com/heroku/x v0.0.25
github.com/ivpusic/grpool v1.0.0
github.com/jackc/pgproto3/v2 v2.0.4 // indirect
github.com/jasonlvhit/gocron v0.0.1
github.com/json-iterator/go v1.1.10 // indirect
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/miekg/dns v1.1.31 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/oschwald/geoip2-golang v1.4.0
github.com/oschwald/maxminddb-golang v1.7.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
github.com/spf13/cobra v1.0.0 // indirect
github.com/spf13/viper v1.7.1 // indirect
github.com/temoto/robotstxt v1.1.1 // indirect
github.com/zu1k/nali v0.2.2 // indirect
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 // indirect
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.3.0
gorm.io/driver/postgres v1.0.0
gorm.io/gorm v1.20.0
)

430
go.sum
View File

@@ -1,27 +1,16 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Dreamacro/clash v1.0.1-0.20200812125056-8b7c731fd629 h1:876g402+S9ROmgHU7wGdSssWz/TNiJJsDsphd2qsbRc=
github.com/Dreamacro/clash v1.0.1-0.20200812125056-8b7c731fd629/go.mod h1:LMbDBvj4kuiE5TGhZ8JxhEdRpBtZRjQllo2r7RfUw1c=
github.com/Dreamacro/go-shadowsocks2 v0.1.6-0.20200722122336-8e5c7db4f96a h1:JhQFrFOkCpRB8qsN6PrzHFzjy/8iQpFFk5cbOiplh6s=
github.com/Dreamacro/go-shadowsocks2 v0.1.6-0.20200722122336-8e5c7db4f96a/go.mod h1:LSXCjyHesPY3pLjhwff1mQX72ItcBT/N2xNC685cYeU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE=
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/StackExchange/wmi v0.0.0-20170410192909-ea383cf3ba6e/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
@@ -32,36 +21,28 @@ github.com/antchfx/xmlquery v1.2.4/go.mod h1:KQQuESaxSlqugE2ZBcM/qn+ebIpt+d+4Xx7
github.com/antchfx/xpath v1.1.6/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
github.com/antchfx/xpath v1.1.8 h1:PcL6bIX42Px5usSx6xRYw/wjB3wYGkj0MJ9MBzEKVgk=
github.com/antchfx/xpath v1.1.8/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/armon/go-proxyproto v0.0.0-20190211145416-68259f75880e/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU=
github.com/aws/aws-sdk-go v1.13.10/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k=
github.com/axiomhq/hyperloglog v0.0.0-20180317131949-fe9507de0228/go.mod h1:IOXAcuKIFq/mDyuQ4wyJuJ79XLMsmLM+5RdQ+vWrL7o=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cloudflare/cloudflare-go v0.13.2 h1:bhMGoNhAg21DuqJjU9jQepRRft6vYfo6pejT3NN4V6A=
github.com/cloudflare/cloudflare-go v0.13.2/go.mod h1:27kfc1apuifUmJhp069y0+hwlKDg4bd8LWlu7oKeZvM=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2iZY63YTKWo0=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -69,23 +50,19 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec=
github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
github.com/go-chi/cors v1.1.1 h1:eHuqxsIw89iXcWnWUN8R72JMibABJTN/4IOYI5WERvw=
github.com/go-chi/cors v1.1.1/go.mod h1:K2Yje0VW/SJzxiyMYu6iPQYa7hMjQX2i/F491VChg1I=
github.com/go-chi/render v1.0.1 h1:4/5tis2cKaNdnv9zFLfXzcquC9HbeZgCnxGnKrltBS8=
github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-ini/ini v1.33.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o=
github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
@@ -95,17 +72,20 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI=
github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -118,8 +98,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -127,236 +107,244 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gops v0.3.8-0.20200229223415-3a98d6d24562/go.mod h1:bj0cwMmX1X4XIJFTjR99R5sCxNssNJ8HebFNvoQlmgY=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.6/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/heroku/rollrus v0.2.0/go.mod h1:B3MwEcr9nmf4xj0Sr5l9eSht7wLKMa1C+9ajgAU79ek=
github.com/heroku/x v0.0.25 h1:6/2rENs6rfUds9jOxy9oO59b0fiOx/FeTCGOyLMXcZw=
github.com/heroku/x v0.0.25/go.mod h1:qE/I0jp6rIeTBBosrPYV4ygRX3OMhqmC/A6x8ewodJQ=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/ipipdotnet/ipdb-go v1.3.0 h1:FfkSkAI1do3bZ7F35ueGuF7Phur64jmikQ1C4IPl/gc=
github.com/ipipdotnet/ipdb-go v1.3.0/go.mod h1:yZ+8puwe3R37a/3qRftXo40nZVQbxYDLqls9o5foexs=
github.com/ivpusic/grpool v1.0.0 h1:+FCiCo3GhfsvzfXuJWnpJUNb/VaqyYVgG8C+qvh07Rc=
github.com/ivpusic/grpool v1.0.0/go.mod h1:WPmiAI5ExAn06vg+0JzyPzXMQutJmpb7TrBtyLJkOHQ=
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA=
github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE=
github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s=
github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk=
github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
github.com/jackc/pgconn v1.6.4 h1:S7T6cx5o2OqmxdHaXLH1ZeD1SbI8jBznyYE9Ec0RCQ8=
github.com/jackc/pgconn v1.6.4/go.mod h1:w2pne1C2tZgP+TvjqLpOigGzNqjBgQW9dUw/4Chex78=
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA=
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA=
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgproto3/v2 v2.0.4 h1:RHkX5ZUD9bl/kn0f9dYUWs1N7Nwvo1wwUYvKiR26Zco=
github.com/jackc/pgproto3/v2 v2.0.4/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0=
github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po=
github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ=
github.com/jackc/pgtype v1.4.2 h1:t+6LWm5eWPLX1H5Se702JSBcirq6uWa4jiG4wV1rAWY=
github.com/jackc/pgtype v1.4.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig=
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA=
github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o=
github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg=
github.com/jackc/pgx/v4 v4.8.1 h1:SUbCLP2pXvf/Sr/25KsuI4aTxiFYIvpfk4l6aTSdyCw=
github.com/jackc/pgx/v4 v4.8.1/go.mod h1:4HOLxrl8wToZJReD04/yB20GDwf4KBYETvlHciCnwW0=
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jasonlvhit/gocron v0.0.1 h1:qTt5qF3b3srDjeOIR4Le1LfeyvoYzJlYpqvG7tJX5YU=
github.com/jasonlvhit/gocron v0.0.1/go.mod h1:k9a3TV8VcU73XZxfVHCHWMWF9SOqgoku0/QlY2yvlA4=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E=
github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/joeshaw/envdecode v0.0.0-20180129163420-d5f34bca07f3/go.mod h1:Q+alOFAXgW5SrcfMPt/G4B2oN+qEcQRJjkn/f4mKL04=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/leesper/go_rng v0.0.0-20171009123644-5344a9259b21/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lstoll/grpce v1.7.0/go.mod h1:XiCWl3R+avNCT7KsTjv3qCblgsSqd0SC4ymySrH226g=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo=
github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/oschwald/geoip2-golang v1.4.0 h1:5RlrjCgRyIGDz/mBmPfnAF4h8k0IAcRv9PvrpOfz+Ug=
github.com/oschwald/geoip2-golang v1.4.0/go.mod h1:8QwxJvRImBH+Zl6Aa6MaIcs5YdlZSTKtzmPGzQqi9ng=
github.com/oschwald/maxminddb-golang v1.6.0 h1:KAJSjdHQ8Kv45nFIbtoLGrGWqHFajOIm7skTyz/+Dls=
github.com/oschwald/maxminddb-golang v1.6.0/go.mod h1:DUJFucBg2cvqx42YmDa/+xHvb0elJtOm3o4aFQ/nb/w=
github.com/oschwald/maxminddb-golang v1.7.0 h1:JmU4Q1WBv5Q+2KZy5xJI+98aUwTIrPPxZUkd5Cwr8Zc=
github.com/oschwald/maxminddb-golang v1.7.0/go.mod h1:RXZtst0N6+FY/3qCNmZMBApR19cdQj43/NM9VkrNAis=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.2-0.20190227000051-27936f6d90f9/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY=
github.com/rcrowley/go-metrics v0.0.0-20160613154715-cfa5a85e9f0a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ=
github.com/rollbar/rollbar-go v1.2.0/go.mod h1:czC86b8U4xdUH7W2C6gomi2jutLm8qK0OtrF5WMvpcc=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda h1:h+YpzUB/bGVJcLqW+d5GghcCmE/A25KbzjXvWJQi/+o=
github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda/go.mod h1:MSotTrCv1PwoR8QgU1JurEx+lNNbtr25I+m0zbLyAGw=
github.com/saracen/go7z-fixtures v0.0.0-20190623165746-aa6b8fba1d2f/go.mod h1:6Ff0ADODZ6S3gYepgZ2w7OqFrTqtFcfwDUhmm8jsUhs=
github.com/saracen/solidblock v0.0.0-20190426153529-45df20abab6f h1:1cJITU3JUI8qNS5T0BlXwANsVdyoJQHQ4hvOxbunPCw=
github.com/saracen/solidblock v0.0.0-20190426153529-45df20abab6f/go.mod h1:LyBTue+RWeyIfN3ZJ4wVxvDuvlGJtDgCLgCb6HCPgps=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc h1:jUIKcSPO9MoMJBbEoyE/RJoE8vz7Mb8AjvifMMwSyvY=
github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk=
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soveran/redisurl v0.0.0-20180322091936-eb325bc7a4b8/go.mod h1:FVJ8jbHu7QrNFs3bZEsv/L5JjearIAY9N0oXh2wk+6Y=
github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA=
github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4=
github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/zu1k/nali v0.2.2 h1:LRo52LXqdhwbjCFOs5Bl9XGewvJnd3MC92m5hDPFHyc=
github.com/zu1k/nali v0.2.2/go.mod h1:5BILGeMPfJz+sv3Sov25g8kkNGgB/ouj5lYSD39SUuc=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
github.com/unrolled/secure v1.0.1/go.mod h1:R6rugAuzh4TQpbFAq69oqZggyBQxFRFQIewtz5z7Jsc=
github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ=
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -364,18 +352,18 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -385,93 +373,87 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20171017063910-8dbc5d05d6ed/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191224085550-c709ea063b76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed h1:WBkVNH1zd9jg/dK4HCM4lNANnmd12EHC9z+LmcCG4ns=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA=
golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.0.0-20190502212712-4a2eb0188cbc/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181221175505-bd9b4fb69e2f/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
@@ -484,31 +466,35 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/caio/go-tdigest.v2 v2.3.0/go.mod h1:HPfh/CLN8UWDMOC76lqxVeKa5E24ypoVuTj4BLMb9cU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/eapache/channels.v1 v1.1.0 h1:5bGAyKKvyCTWjSj7mhefG6Lc68VyN4MH1v8/7OoeeB4=
gopkg.in/eapache/channels.v1 v1.1.0/go.mod h1:BHIBujSvu9yMTrTYbTCjDD43gUhtmaOtTWDe7sTv1js=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/postgres v1.0.0 h1:Yh4jyFQ0a7F+JPU0Gtiam/eKmpT/XFc1FKxotGqc6FM=
gorm.io/driver/postgres v1.0.0/go.mod h1:wtMFcOzmuA5QigNsgEIb7O5lhvH1tHAF1RbWmLWV4to=
gorm.io/gorm v1.9.19/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.20.0 h1:qfIlyaZvrF7kMWY3jBdEBXkXJ2M5MFYMTppjILxS3fQ=
gorm.io/gorm v1.20.0/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/goversion v1.0.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=

54
internal/app/getter.go Normal file
View File

@@ -0,0 +1,54 @@
package app
import (
"errors"
"fmt"
"github.com/zu1k/proxypool/internal/cache"
"github.com/ghodss/yaml"
"github.com/zu1k/proxypool/config"
"github.com/zu1k/proxypool/pkg/getter"
)
var Getters = make([]getter.Getter, 0)
func InitConfigAndGetters(path string) (err error) {
err = config.Parse(path)
if err != nil {
return
}
if s := config.Config.SourceFiles; len(s) == 0 {
return errors.New("no sources")
} else {
initGetters(s)
}
return
}
func initGetters(sourceFiles []string) {
Getters = make([]getter.Getter, 0)
for _, path := range sourceFiles {
data, err := config.ReadFile(path)
if err != nil {
fmt.Errorf("Init SourceFile Error: %s\n", err.Error())
continue
}
sourceList := make([]config.Source, 0)
err = yaml.Unmarshal(data, &sourceList)
if err != nil {
fmt.Errorf("Init SourceFile Error: %s\n", err.Error())
continue
}
for _, source := range sourceList {
g, err := getter.NewGetter(source.Type, source.Options)
if err == nil && g != nil {
Getters = append(Getters, g)
fmt.Println("init getter:", source.Type, source.Options)
}
}
}
fmt.Println("Getter count:", len(Getters))
cache.GettersCount = len(Getters)
}

80
internal/app/task.go Normal file
View File

@@ -0,0 +1,80 @@
package app
import (
"log"
"sync"
"time"
"github.com/zu1k/proxypool/internal/cache"
"github.com/zu1k/proxypool/internal/database"
"github.com/zu1k/proxypool/pkg/provider"
"github.com/zu1k/proxypool/pkg/proxy"
)
var location, _ = time.LoadLocation("PRC")
func CrawlGo() {
wg := &sync.WaitGroup{}
var pc = make(chan proxy.Proxy)
for _, g := range Getters {
wg.Add(1)
go g.Get2Chan(pc, wg)
}
proxies := cache.GetProxies("allproxies")
proxies = append(proxies, database.GetAllProxies()...)
go func() {
wg.Wait()
close(pc)
}()
for node := range pc {
if node != nil {
proxies = append(proxies, node)
}
}
// 节点衍生并去重
proxies = proxies.Deduplication().Derive()
log.Println("CrawlGo node count:", len(proxies))
proxies = provider.Clash{
provider.Base{
Proxies: &proxies,
},
}.CleanProxies()
log.Println("CrawlGo cleaned node count:", len(proxies))
proxies.NameSetCounrty().Sort().NameAddIndex().NameAddTG()
log.Println("Proxy rename DONE!")
// 全节点存储到数据库
database.SaveProxyList(proxies)
cache.SetProxies("allproxies", proxies)
cache.AllProxiesCount = proxies.Len()
log.Println("AllProxiesCount:", cache.AllProxiesCount)
cache.SSProxiesCount = proxies.TypeLen("ss")
log.Println("SSProxiesCount:", cache.SSProxiesCount)
cache.SSRProxiesCount = proxies.TypeLen("ssr")
log.Println("SSRProxiesCount:", cache.SSRProxiesCount)
cache.VmessProxiesCount = proxies.TypeLen("vmess")
log.Println("VmessProxiesCount:", cache.VmessProxiesCount)
cache.TrojanProxiesCount = proxies.TypeLen("trojan")
log.Println("TrojanProxiesCount:", cache.TrojanProxiesCount)
cache.LastCrawlTime = time.Now().In(location).Format("2006-01-02 15:04:05")
// 可用性检测
log.Println("Now proceed proxy health check...")
proxies = proxy.CleanBadProxiesWithGrpool(proxies)
log.Println("CrawlGo clash usable node count:", len(proxies))
proxies.NameReIndex()
cache.SetProxies("proxies", proxies)
cache.UsefullProxiesCount = proxies.Len()
cache.SetString("clashproxies", provider.Clash{
provider.Base{
Proxies: &proxies,
},
}.Provide())
cache.SetString("surgeproxies", provider.Surge{
provider.Base{
Proxies: &proxies,
},
}.Provide())
}

View File

@@ -0,0 +1,213 @@
// Code generated for package bingeoip by go-bindata DO NOT EDIT. (@generated)
// sources:
// assets/GeoLite2-City.mmdb
// assets/flags.json
package bingeoip
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// bindataRead reads the given file from disk. It returns an error on failure.
func bindataRead(path, name string) ([]byte, error) {
buf, err := ioutil.ReadFile(path)
if err != nil {
err = fmt.Errorf("Error reading asset %s at %s: %v", name, path, err)
}
return buf, err
}
type asset struct {
bytes []byte
info os.FileInfo
}
// assetsGeolite2CityMmdb reads file data from disk. It returns an error on failure.
func assetsGeolite2CityMmdb() (*asset, error) {
path := "assets/GeoLite2-City.mmdb"
name := "assets/GeoLite2-City.mmdb"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// assetsFlagsJson reads file data from disk. It returns an error on failure.
func assetsFlagsJson() (*asset, error) {
path := "assets/flags.json"
name := "assets/flags.json"
bytes, err := bindataRead(path, name)
if err != nil {
return nil, err
}
fi, err := os.Stat(path)
if err != nil {
err = fmt.Errorf("Error reading asset info %s at %s: %v", name, path, err)
}
a := &asset{bytes: bytes, info: fi}
return a, err
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not found", name)
}
// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
}
// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("AssetInfo %s not found", name)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"assets/GeoLite2-City.mmdb": assetsGeolite2CityMmdb,
"assets/flags.json": assetsFlagsJson,
}
// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
// data/
// foo.txt
// img/
// a.png
// b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
node := _bintree
if len(name) != 0 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"assets": &bintree{nil, map[string]*bintree{
"GeoLite2-City.mmdb": &bintree{assetsGeolite2CityMmdb, map[string]*bintree{}},
"flags.json": &bintree{assetsFlagsJson, map[string]*bintree{}},
}},
}}
// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
}
func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

File diff suppressed because one or more lines are too long

View File

@@ -1,27 +1,24 @@
package cache
import (
"log"
"time"
"github.com/patrickmn/go-cache"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/pkg/proxy"
)
var c = cache.New(cache.NoExpiration, 10*time.Minute)
func GetProxies() []proxy.Proxy {
result, found := c.Get("proxies")
func GetProxies(key string) proxy.ProxyList {
result, found := c.Get(key)
if found {
log.Println(len(result.([]proxy.Proxy)))
return result.([]proxy.Proxy)
return result.(proxy.ProxyList)
}
log.Println("Cache not found")
return nil
}
func SetProxies(proxies []proxy.Proxy) {
c.Set("proxies", proxies, cache.NoExpiration)
func SetProxies(key string, proxies proxy.ProxyList) {
c.Set(key, proxies, cache.NoExpiration)
}
func SetString(key, value string) {

15
internal/cache/vars.go vendored Normal file
View File

@@ -0,0 +1,15 @@
package cache
var (
GettersCount = 0
AllProxiesCount = 0
SSRProxiesCount = 0
SSProxiesCount = 0
VmessProxiesCount = 0
TrojanProxiesCount = 0
UsefullProxiesCount = 0
LastCrawlTime = "程序刚升级完成,正在爬取中..."
)

View File

@@ -0,0 +1,30 @@
package cloudflare
import (
"fmt"
"log"
"github.com/cloudflare/cloudflare-go"
"github.com/zu1k/proxypool/config"
)
func test() {
api, err := cloudflare.New(config.Config.CFKey, config.Config.CFKey)
if err != nil {
log.Fatal(err)
}
// Fetch the zone ID
id, err := api.ZoneIDByName(config.Config.Domain)
if err != nil {
log.Fatal(err)
}
// Fetch zone details
zone, err := api.ZoneDetails(id)
if err != nil {
log.Fatal(err)
}
// Print zone details
fmt.Println(zone)
}

20
internal/cron/cron.go Normal file
View File

@@ -0,0 +1,20 @@
package cron
import (
"runtime"
"github.com/jasonlvhit/gocron"
"github.com/zu1k/proxypool/internal/app"
)
func Cron() {
_ = gocron.Every(15).Minutes().Do(crawlTask)
<-gocron.Start()
}
func crawlTask() {
_ = app.InitConfigAndGetters("")
app.CrawlGo()
app.Getters = nil
runtime.GC()
}

31
internal/database/db.go Normal file
View File

@@ -0,0 +1,31 @@
package database
import (
"fmt"
"os"
"github.com/zu1k/proxypool/config"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
)
var DB *gorm.DB
func connect() (err error) {
dsn := "user=proxypool password=proxypool dbname=proxypool port=5432 sslmode=disable TimeZone=Asia/Shanghai"
if url := config.Config.DatabaseUrl; url != "" {
dsn = url
}
if url := os.Getenv("DATABASE_URL"); url != "" {
dsn = url
}
DB, err = gorm.Open(postgres.Open(dsn), &gorm.Config{
Logger: logger.Default.LogMode(logger.Silent),
})
if err == nil {
fmt.Println("DB connect success: ", DB.Name())
}
return
}

View File

@@ -0,0 +1,9 @@
package database
import "testing"
func TestConnect(t *testing.T) {
t.SkipNow()
//connect()
InitTables()
}

View File

@@ -0,0 +1,79 @@
package database
import (
"github.com/zu1k/proxypool/pkg/proxy"
"gorm.io/gorm"
)
type Proxy struct {
gorm.Model
proxy.Base
Link string
Identifier string `gorm:"unique"`
}
func InitTables() {
if DB == nil {
err := connect()
if err != nil {
return
}
}
err := DB.AutoMigrate(&Proxy{})
if err != nil {
panic(err)
}
}
const roundSize = 100
func SaveProxyList(pl proxy.ProxyList) {
if DB == nil {
return
}
// TODO 批量插入因为是生成一个sql如果插入失败重复就全都没了
//size := pl.Len()
//round := (size + roundSize - 1) / roundSize
//
//for r := 0; r < round; r++ {
// proxies := make([]Proxy, 0, roundSize)
// for i, j := r*roundSize, (r+1)*roundSize-1; i < j && i < size; i++ {
// p := pl[i]
// proxies = append(proxies, Proxy{
// Base: *p.BaseInfo(),
// Link: p.Link(),
// Identifier: p.Identifier(),
// })
// }
// DB.Create(&proxies)
//}
for _, p := range pl {
DB.Create(&Proxy{
Base: *p.BaseInfo(),
Link: p.Link(),
Identifier: p.Identifier(),
})
}
}
func GetAllProxies() (proxies proxy.ProxyList) {
proxies = make(proxy.ProxyList, 0)
if DB == nil {
return
}
proxiesDB := make([]Proxy, 0)
DB.Select("link").Find(&proxiesDB)
for _, proxyDB := range proxiesDB {
if proxiesDB != nil {
p, err := proxy.ParseProxyFromLink(proxyDB.Link)
if err == nil && p != nil {
proxies = append(proxies, p)
}
}
}
return
}

46
main.go
View File

@@ -5,36 +5,40 @@ import (
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"github.com/zu1k/proxypool/api"
"github.com/zu1k/proxypool/app"
"github.com/zu1k/proxypool/internal/app"
"github.com/zu1k/proxypool/internal/cron"
"github.com/zu1k/proxypool/internal/database"
"github.com/zu1k/proxypool/pkg/proxy"
)
var configFilePath = ""
func main() {
go pprof()
go func() {
http.ListenAndServe("0.0.0.0:6060", nil)
}()
filePath := flag.String("c", "", "path to config file: source.yaml")
flag.StringVar(&configFilePath, "c", "", "path to config file: config.yaml")
flag.Parse()
if *filePath == "" {
app.NeedFetchNewConfigFile = true
} else {
err := app.InitConfigAndGetters(*filePath)
if err != nil {
fmt.Println(err)
}
if configFilePath == "" {
configFilePath = os.Getenv("CONFIG_FILE")
}
if configFilePath == "" {
configFilePath = "config.yaml"
}
err := app.InitConfigAndGetters(configFilePath)
if err != nil {
panic(err)
}
app.InitGeoIpDB()
go app.Cron()
database.InitTables()
proxy.InitGeoIpDB()
fmt.Println("Do the first crawl...")
app.CrawlGo()
go app.CrawlGo()
go cron.Cron()
api.Run()
}
func pprof() {
ip := "127.0.0.1:6060"
if err := http.ListenAndServe(ip, nil); err != nil {
fmt.Printf("start pprof failed on %s\n", ip)
}
}

View File

@@ -2,15 +2,14 @@ package getter
import (
"errors"
"strings"
"sync"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
type Getter interface {
Get() []proxy.Proxy
Get() proxy.ProxyList
Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup)
}
@@ -30,26 +29,13 @@ func NewGetter(sourceType string, options tool.Options) (getter Getter, err erro
return nil, ErrorCreaterNotSupported
}
func String2Proxy(link string) proxy.Proxy {
var err error
var data proxy.Proxy
if strings.HasPrefix(link, "ssr://") {
data, err = proxy.ParseSSRLink(link)
} else if strings.HasPrefix(link, "vmess://") {
data, err = proxy.ParseVmessLink(link)
} else if strings.HasPrefix(link, "ss://") {
data, err = proxy.ParseSSLink(link)
}
if err != nil {
return nil
}
return data
}
func StringArray2ProxyArray(origin []string) []proxy.Proxy {
results := make([]proxy.Proxy, 0)
func StringArray2ProxyArray(origin []string) proxy.ProxyList {
results := make(proxy.ProxyList, 0)
for _, link := range origin {
results = append(results, String2Proxy(link))
p, err := proxy.ParseProxyFromLink(link)
if err == nil && p != nil {
results = append(results, p)
}
}
return results
}
@@ -58,10 +44,11 @@ func GrepLinksFromString(text string) []string {
results := proxy.GrepSSRLinkFromString(text)
results = append(results, proxy.GrepVmessLinkFromString(text)...)
results = append(results, proxy.GrepSSLinkFromString(text)...)
results = append(results, proxy.GrepTrojanLinkFromString(text)...)
return results
}
func FuzzParseProxyFromString(text string) []proxy.Proxy {
func FuzzParseProxyFromString(text string) proxy.ProxyList {
return StringArray2ProxyArray(GrepLinksFromString(text))
}

View File

@@ -2,11 +2,12 @@ package getter
import (
"io/ioutil"
"log"
"strings"
"sync"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
func init() {
@@ -17,7 +18,7 @@ type Subscribe struct {
Url string
}
func (s *Subscribe) Get() []proxy.Proxy {
func (s *Subscribe) Get() proxy.ProxyList {
resp, err := tool.GetHttpClient().Get(s.Url)
if err != nil {
return nil
@@ -41,6 +42,7 @@ func (s *Subscribe) Get() []proxy.Proxy {
func (s *Subscribe) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := s.Get()
log.Printf("STATISTIC: Subscribe\tcount=%d\turl=%s\n", len(nodes), s.Url)
for _, node := range nodes {
pc <- node
}

View File

@@ -2,11 +2,12 @@ package getter
import (
"fmt"
"log"
"sync"
"github.com/gocolly/colly"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
func init() {
@@ -40,7 +41,7 @@ func NewTGChannelGetter(options tool.Options) (getter Getter, err error) {
return nil, err
}
return &TGChannelGetter{
c: colly.NewCollector(),
c: tool.GetColly(),
NumNeeded: t,
Url: "https://t.me/s/" + url,
}, nil
@@ -48,11 +49,17 @@ func NewTGChannelGetter(options tool.Options) (getter Getter, err error) {
return nil, ErrorUrlNotFound
}
func (g *TGChannelGetter) Get() []proxy.Proxy {
func (g *TGChannelGetter) Get() proxy.ProxyList {
result := make(proxy.ProxyList, 0)
g.results = make([]string, 0)
// 找到所有的文字消息
g.c.OnHTML("div.tgme_widget_message_text", func(e *colly.HTMLElement) {
g.results = append(g.results, GrepLinksFromString(e.Text)...)
// 抓取到http链接有可能是订阅链接或其他链接无论如何试一下
subUrls := urlRe.FindAllString(e.Text, -1)
for _, url := range subUrls {
result = append(result, (&Subscribe{Url: url}).Get()...)
}
})
// 找到之前消息页面的链接,加入访问队列
@@ -67,13 +74,13 @@ func (g *TGChannelGetter) Get() []proxy.Proxy {
if err != nil {
_ = fmt.Errorf("%s", err.Error())
}
return StringArray2ProxyArray(g.results)
return append(result, StringArray2ProxyArray(g.results)...)
}
func (g *TGChannelGetter) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := g.Get()
log.Printf("STATISTIC: TGChannel\tcount=%d\turl=%s\n", len(nodes), g.Url)
for _, node := range nodes {
pc <- node
}

View File

@@ -0,0 +1,72 @@
package getter
import (
"fmt"
"log"
"strings"
"sync"
"github.com/gocolly/colly"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
func init() {
Register("web-fanqiangdang", NewWebFanqiangdangGetter)
}
type WebFanqiangdang struct {
c *colly.Collector
Url string
results proxy.ProxyList
}
func NewWebFanqiangdangGetter(options tool.Options) (getter Getter, err error) {
urlInterface, found := options["url"]
if found {
url, err := AssertTypeStringNotNull(urlInterface)
if err != nil {
return nil, err
}
return &WebFanqiangdang{
c: colly.NewCollector(),
Url: url,
}, nil
}
return nil, ErrorUrlNotFound
}
func (w *WebFanqiangdang) Get() proxy.ProxyList {
w.results = make(proxy.ProxyList, 0)
w.c.OnHTML("td.t_f", func(e *colly.HTMLElement) {
w.results = append(w.results, FuzzParseProxyFromString(e.Text)...)
subUrls := urlRe.FindAllString(e.Text, -1)
for _, url := range subUrls {
w.results = append(w.results, (&Subscribe{Url: url}).Get()...)
}
})
w.c.OnHTML("th.new>a[href]", func(e *colly.HTMLElement) {
url := e.Attr("href")
if strings.HasPrefix(url, "https://fanqiangdang.com/thread") {
_ = e.Request.Visit(url)
}
})
w.results = make(proxy.ProxyList, 0)
err := w.c.Visit(w.Url)
if err != nil {
_ = fmt.Errorf("%s", err.Error())
}
return w.results
}
func (w *WebFanqiangdang) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := w.Get()
log.Printf("STATISTIC: Fanqiangdang\tcount=%d\turl=%s\n", len(nodes), w.Url)
for _, node := range nodes {
pc <- node
}
}

View File

@@ -3,10 +3,11 @@ package getter
import (
"encoding/json"
"io/ioutil"
"log"
"sync"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
func init() {
@@ -25,7 +26,7 @@ func NewWebFreessrxyzGetter(options tool.Options) (getter Getter, err error) {
return &WebFreessrXyz{}, nil
}
func (w *WebFreessrXyz) Get() []proxy.Proxy {
func (w *WebFreessrXyz) Get() proxy.ProxyList {
results := freessrxyzFetch(freessrxyzSsrLink)
results = append(results, freessrxyzFetch(freessrxyzV2rayLink)...)
return results
@@ -34,12 +35,13 @@ func (w *WebFreessrXyz) Get() []proxy.Proxy {
func (w *WebFreessrXyz) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := w.Get()
log.Printf("STATISTIC: FreeSSRxyz\tcount=%d\turl=%s\n", len(nodes), "api.free-ssr.xyz")
for _, node := range nodes {
pc <- node
}
}
func freessrxyzFetch(link string) []proxy.Proxy {
func freessrxyzFetch(link string) proxy.ProxyList {
resp, err := tool.GetHttpClient().Get(link)
if err != nil {
return nil

View File

@@ -2,10 +2,11 @@ package getter
import (
"io/ioutil"
"log"
"sync"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
func init() {
@@ -16,7 +17,7 @@ type WebFuzz struct {
Url string
}
func (w *WebFuzz) Get() []proxy.Proxy {
func (w *WebFuzz) Get() proxy.ProxyList {
resp, err := tool.GetHttpClient().Get(w.Url)
if err != nil {
return nil
@@ -26,12 +27,14 @@ func (w *WebFuzz) Get() []proxy.Proxy {
if err != nil {
return nil
}
return FuzzParseProxyFromString(string(body))
}
func (w *WebFuzz) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := w.Get()
log.Printf("STATISTIC: WebFuzz\tcount=%d\turl=%s\n", len(nodes), w.Url)
for _, node := range nodes {
pc <- node
}

View File

@@ -0,0 +1,91 @@
package getter
import (
"io/ioutil"
"log"
"regexp"
"sync"
"github.com/zu1k/proxypool/pkg/proxy"
"github.com/zu1k/proxypool/pkg/tool"
)
func init() {
Register("webfuzzsub", NewWebFuzzSubGetter)
}
type WebFuzzSub struct {
Url string
}
func (w *WebFuzzSub) Get() proxy.ProxyList {
resp, err := tool.GetHttpClient().Get(w.Url)
if err != nil {
return nil
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil
}
text := string(body)
subUrls := urlRe.FindAllString(text, -1)
result := make(proxy.ProxyList, 0)
for _, url := range subUrls {
result = append(result, (&Subscribe{Url: url}).Get()...)
}
return result
}
func (w *WebFuzzSub) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
defer wg.Done()
nodes := w.Get()
log.Printf("STATISTIC: WebFuzzSub\tcount=%d\turl=%s\n", len(nodes), w.Url)
for _, node := range nodes {
pc <- node
}
}
func NewWebFuzzSubGetter(options tool.Options) (getter Getter, err error) {
urlInterface, found := options["url"]
if found {
url, err := AssertTypeStringNotNull(urlInterface)
if err != nil {
return nil, err
}
return &WebFuzzSub{Url: url}, nil
}
return nil, ErrorUrlNotFound
}
var urlRe = regexp.MustCompile(urlPattern)
const (
// 匹配 IP4
ip4Pattern = `((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)`
// 匹配 IP6参考以下网页内容
// http://blog.csdn.net/jiangfeng08/article/details/7642018
ip6Pattern = `(([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|` +
`(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|` +
`(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|` +
`(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
`(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
`(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
`(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|` +
`(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))`
// 同时匹配 IP4 和 IP6
ipPattern = "(" + ip4Pattern + ")|(" + ip6Pattern + ")"
// 匹配域名
domainPattern = `[a-zA-Z0-9][a-zA-Z0-9_-]{0,62}(\.[a-zA-Z0-9][a-zA-Z0-9_-]{0,62})*(\.[a-zA-Z][a-zA-Z0-9]{0,10}){1}`
// 匹配 URL
urlPattern = `((https|http)?://)?` + // 协议
`(([0-9a-zA-Z]+:)?[0-9a-zA-Z_-]+@)?` + // pwd:user@
"(" + ipPattern + "|(" + domainPattern + "))" + // IP 或域名
`(:\d{1,5})?` + // 端口
`(/+[a-zA-Z0-9][a-zA-Z0-9_.-]*)*/*` + // path
`(\?([a-zA-Z0-9_-]+(=.*&?)*)*)*` // query
)

80
pkg/provider/base.go Normal file
View File

@@ -0,0 +1,80 @@
package provider
import (
"strings"
"github.com/zu1k/proxypool/pkg/proxy"
)
type Provider interface {
Provide() string
}
type Base struct {
Proxies *proxy.ProxyList `yaml:"proxies"`
Types string `yaml:"type"`
Country string `yaml:"country"`
NotCountry string `yaml:"not_country"`
}
func (b *Base) preFilter() {
proxies := make(proxy.ProxyList, 0)
needFilterType := true
needFilterCountry := true
needFilterNotCountry := true
if b.Types == "" || b.Types == "all" {
needFilterType = false
}
if b.Country == "" || b.Country == "all" {
needFilterCountry = false
}
if b.NotCountry == "" {
needFilterNotCountry = false
}
types := strings.Split(b.Types, ",")
countries := strings.Split(b.Country, ",")
notCountries := strings.Split(b.NotCountry, ",")
bProxies := *b.Proxies
for _, p := range bProxies {
if needFilterType {
typeOk := false
for _, t := range types {
if p.TypeName() == t {
typeOk = true
break
}
}
if !typeOk {
goto exclude
}
}
if needFilterNotCountry {
for _, c := range notCountries {
if strings.Contains(p.BaseInfo().Name, c) {
goto exclude
}
}
}
if needFilterCountry {
countryOk := false
for _, c := range countries {
if strings.Contains(p.BaseInfo().Name, c) {
countryOk = true
break
}
}
if !countryOk {
goto exclude
}
}
proxies = append(proxies, p)
exclude:
}
b.Proxies = &proxies
}

90
pkg/provider/clash.go Normal file
View File

@@ -0,0 +1,90 @@
package provider
import (
"strings"
"github.com/zu1k/proxypool/pkg/tool"
"github.com/zu1k/proxypool/pkg/proxy"
)
type Clash struct {
Base
}
func (c Clash) CleanProxies() (proxies proxy.ProxyList) {
proxies = make(proxy.ProxyList, 0)
for _, p := range *c.Proxies {
if checkClashSupport(p) {
proxies = append(proxies, p)
}
}
return
}
func (c Clash) Provide() string {
c.preFilter()
var resultBuilder strings.Builder
resultBuilder.WriteString("proxies:\n")
for _, p := range *c.Proxies {
if checkClashSupport(p) {
resultBuilder.WriteString(p.ToClash() + "\n")
}
}
return resultBuilder.String()
}
func checkClashSupport(p proxy.Proxy) bool {
switch p.TypeName() {
case "ssr":
ssr := p.(*proxy.ShadowsocksR)
if tool.CheckInList(proxy.SSRCipherList, ssr.Cipher) && tool.CheckInList(ssrProtocolList, ssr.Protocol) && tool.CheckInList(ssrObfsList, ssr.Obfs) {
return true
}
case "vmess":
vmess := p.(*proxy.Vmess)
if tool.CheckInList(vmessCipherList, vmess.Cipher) {
return true
}
case "ss":
ss := p.(*proxy.Shadowsocks)
if tool.CheckInList(proxy.SSCipherList, ss.Cipher) {
return true
}
case "trojan":
return true
default:
return false
}
return false
}
var ssrObfsList = []string{
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
"tls1.2_ticket_fastauth",
}
var ssrProtocolList = []string{
"origin",
"verify_deflate",
"verify_sha1",
"auth_sha1",
"auth_sha1_v2",
"auth_sha1_v4",
"auth_aes128_md5",
"auth_aes128_sha1",
"auth_chain_a",
"auth_chain_b",
}
var vmessCipherList = []string{
"auto",
"aes-128-gcm",
"chacha20-poly1305",
"none",
}

21
pkg/provider/ssrsub.go Normal file
View File

@@ -0,0 +1,21 @@
package provider
import (
"strings"
"github.com/zu1k/proxypool/pkg/tool"
)
type SSRSub struct {
Base
}
func (sub SSRSub) Provide() string {
sub.Types = "ssr"
sub.preFilter()
var resultBuilder strings.Builder
for _, p := range *sub.Proxies {
resultBuilder.WriteString(p.Link() + "\n")
}
return tool.Base64EncodeString(resultBuilder.String(), false)
}

62
pkg/provider/sssub.go Normal file
View File

@@ -0,0 +1,62 @@
package provider
import (
"encoding/json"
"strconv"
"strings"
"github.com/zu1k/proxypool/pkg/tool"
"github.com/zu1k/proxypool/pkg/proxy"
)
type SSSub struct {
Base
}
type ssJson struct {
Remarks string `json:"remarks"`
Server string `json:"server"`
ServerPort string `json:"server_port"`
Method string `json:"method"`
Password string `json:"password"`
Plugin string `json:"plugin"`
PluginOpts map[string]interface{} `json:"plugin_opts"`
}
func (sub SSSub) Provide() string {
sub.Types = "ss"
sub.preFilter()
proxies := make([]ssJson, 0, sub.Proxies.Len())
for _, p := range *sub.Proxies {
pp := p.(*proxy.Shadowsocks)
proxies = append(proxies, ssJson{
Remarks: pp.Name,
Server: pp.Server,
ServerPort: strconv.Itoa(pp.Port),
Method: pp.Cipher,
Password: pp.Password,
Plugin: pp.Plugin,
PluginOpts: pp.PluginOpts,
})
}
text, err := json.Marshal(proxies)
if err != nil {
return ""
}
return string(text)
}
type SIP002Sub struct {
Base
}
func (sub SIP002Sub) Provide() string {
sub.Types = "ss"
sub.preFilter()
var resultBuilder strings.Builder
for _, p := range *sub.Proxies {
resultBuilder.WriteString(p.Link() + "\n")
}
return tool.Base64EncodeString(resultBuilder.String(), false)
}

View File

@@ -3,22 +3,24 @@ package provider
import (
"strings"
"github.com/zu1k/proxypool/proxy"
"github.com/zu1k/proxypool/pkg/tool"
"github.com/zu1k/proxypool/pkg/proxy"
)
type Surge struct {
Proxies []proxy.Proxy `yaml:"proxies"`
Base
}
func (s Surge) Provide() string {
var resultBuilder strings.Builder
s.preFilter()
for _, p := range s.Proxies {
var resultBuilder strings.Builder
for _, p := range *s.Proxies {
if checkSurgeSupport(p) {
resultBuilder.WriteString(p.ToSurge() + "\n")
resultBuilder.WriteString(p.ToClash() + "\n")
}
}
return resultBuilder.String()
}
@@ -30,7 +32,7 @@ func checkSurgeSupport(p proxy.Proxy) bool {
return true
case *proxy.Shadowsocks:
ss := p.(*proxy.Shadowsocks)
if checkInList(ssCipherList, ss.Cipher) {
if tool.CheckInList(proxy.SSCipherList, ss.Cipher) {
return true
}
default:

21
pkg/provider/vmesssub.go Normal file
View File

@@ -0,0 +1,21 @@
package provider
import (
"strings"
"github.com/zu1k/proxypool/pkg/tool"
)
type VmessSub struct {
Base
}
func (sub VmessSub) Provide() string {
sub.Types = "vmess"
sub.preFilter()
var resultBuilder strings.Builder
for _, p := range *sub.Proxies {
resultBuilder.WriteString(p.Link() + "\n")
}
return tool.Base64EncodeString(resultBuilder.String(), false)
}

88
pkg/proxy/base.go Normal file
View File

@@ -0,0 +1,88 @@
package proxy
import (
"errors"
"strings"
)
type Base struct {
Name string `yaml:"name" json:"name" gorm:"index"`
Server string `yaml:"server" json:"server" gorm:"index"`
Port int `yaml:"port" json:"port" gorm:"index"`
Type string `yaml:"type" json:"type" gorm:"index"`
UDP bool `yaml:"udp,omitempty" json:"udp,omitempty"`
Country string `yaml:"country,omitempty" json:"country,omitempty" gorm:"index"`
Useable bool `yaml:"useable,omitempty" json:"useable,omitempty" gorm:"index"`
}
func (b *Base) TypeName() string {
if b.Type == "" {
return "unknown"
}
return b.Type
}
func (b *Base) SetName(name string) {
b.Name = name
}
func (b *Base) SetIP(ip string) {
b.Server = ip
}
func (b *Base) BaseInfo() *Base {
return b
}
func (b *Base) Clone() Base {
c := *b
return c
}
func (b *Base) SetUseable(useable bool) {
b.Useable = useable
}
func (b *Base) SetCountry(country string) {
b.Country = country
}
type Proxy interface {
String() string
ToClash() string
ToSurge() string
Link() string
Identifier() string
SetName(name string)
SetIP(ip string)
TypeName() string
BaseInfo() *Base
Clone() Proxy
SetUseable(useable bool)
SetCountry(country string)
}
func ParseProxyFromLink(link string) (p Proxy, err error) {
if strings.HasPrefix(link, "ssr://") {
p, err = ParseSSRLink(link)
} else if strings.HasPrefix(link, "vmess://") {
p, err = ParseVmessLink(link)
} else if strings.HasPrefix(link, "ss://") {
p, err = ParseSSLink(link)
} else if strings.HasPrefix(link, "trojan://") {
p, err = ParseTrojanLink(link)
}
if err != nil || p == nil {
return nil, errors.New("link parse failed")
}
ip, country, err := geoIp.Find(p.BaseInfo().Server)
if err != nil {
country = "🏁 ZZ"
}
p.SetCountry(country)
// trojan依赖域名
if p.TypeName() != "trojan" {
p.SetIP(ip)
}
return
}

135
pkg/proxy/check.go Normal file
View File

@@ -0,0 +1,135 @@
package proxy
import (
"context"
"encoding/json"
"fmt"
"sync"
"time"
"github.com/ivpusic/grpool"
"github.com/Dreamacro/clash/adapters/outbound"
)
const defaultURLTestTimeout = time.Second * 5
func testDelay(p Proxy) (delay uint16, err error) {
pmap := make(map[string]interface{})
err = json.Unmarshal([]byte(p.String()), &pmap)
if err != nil {
return
}
pmap["port"] = int(pmap["port"].(float64))
if p.TypeName() == "vmess" {
pmap["alterId"] = int(pmap["alterId"].(float64))
}
clashProxy, err := outbound.ParseProxy(pmap)
if err != nil {
fmt.Println(err.Error())
return
}
ctx, cancel := context.WithTimeout(context.Background(), defaultURLTestTimeout)
delay, err = clashProxy.URLTest(ctx, "http://www.gstatic.com/generate_204")
cancel()
return delay, err
}
func CleanBadProxiesWithGrpool(proxies []Proxy) (cproxies []Proxy) {
pool := grpool.NewPool(500, 200)
c := make(chan checkResult)
defer close(c)
pool.WaitCount(len(proxies))
go func() {
for _, p := range proxies {
pp := p
pool.JobQueue <- func() {
defer pool.JobDone()
delay, err := testDelay(pp)
if err == nil {
c <- checkResult{
name: pp.Identifier(),
delay: delay,
}
}
}
}
}()
done := make(chan struct{})
defer close(done)
go func() {
pool.WaitAll()
pool.Release()
done <- struct{}{}
}()
okMap := make(map[string]struct{})
for {
select {
case r := <-c:
if r.delay > 0 {
okMap[r.name] = struct{}{}
}
case <-done:
cproxies = make(ProxyList, 0, 500)
for _, p := range proxies {
if _, ok := okMap[p.Identifier()]; ok {
cproxies = append(cproxies, p.Clone())
}
}
return
}
}
}
func CleanBadProxies(proxies []Proxy) (cproxies []Proxy) {
c := make(chan checkResult, 40)
wg := &sync.WaitGroup{}
wg.Add(len(proxies))
for _, p := range proxies {
go testProxyDelayToChan(p, c, wg)
}
go func() {
wg.Wait()
close(c)
}()
okMap := make(map[string]struct{})
for r := range c {
if r.delay > 0 {
okMap[r.name] = struct{}{}
}
}
cproxies = make(ProxyList, 0, 500)
for _, p := range proxies {
if _, ok := okMap[p.Identifier()]; ok {
p.SetUseable(true)
cproxies = append(cproxies, p.Clone())
} else {
p.SetUseable(false)
}
}
return
}
type checkResult struct {
name string
delay uint16
}
func testProxyDelayToChan(p Proxy, c chan checkResult, wg *sync.WaitGroup) {
defer wg.Done()
delay, err := testDelay(p)
if err == nil {
c <- checkResult{
name: p.Identifier(),
delay: delay,
}
}
}

100
pkg/proxy/convert.go Normal file
View File

@@ -0,0 +1,100 @@
package proxy
import (
"errors"
"github.com/zu1k/proxypool/pkg/tool"
)
var ErrorTypeCanNotConvert = errors.New("type not support")
// Convert2SS convert proxy to ShadowsocksR if possible
func Convert2SSR(p Proxy) (ssr *ShadowsocksR, err error) {
if p.TypeName() == "ss" {
ss := p.(*Shadowsocks)
if ss == nil {
return nil, errors.New("ss is nil")
}
if !tool.CheckInList(SSRCipherList, ss.Cipher) {
return nil, errors.New("cipher not support")
}
base := ss.Base
base.Type = "ssr"
return &ShadowsocksR{
Base: base,
Password: ss.Password,
Cipher: ss.Cipher,
Protocol: "origin",
Obfs: "plain",
Group: "proxy.tgbot.co",
}, nil
}
return nil, ErrorTypeCanNotConvert
}
// Convert2SS convert proxy to Shadowsocks if possible
func Convert2SS(p Proxy) (ss *Shadowsocks, err error) {
if p.TypeName() == "ss" {
ssr := p.(*ShadowsocksR)
if ssr == nil {
return nil, errors.New("ssr is nil")
}
if !tool.CheckInList(SSCipherList, ssr.Cipher) {
return nil, errors.New("cipher not support")
}
if ssr.Protocol != "origin" || ssr.Obfs != "plain" {
return nil, errors.New("protocol or obfs not allowed")
}
base := ssr.Base
base.Type = "ss"
return &Shadowsocks{
Base: base,
Password: ssr.Password,
Cipher: ssr.Cipher,
Plugin: "",
PluginOpts: nil,
}, nil
}
return nil, ErrorTypeCanNotConvert
}
var SSRCipherList = []string{
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"aes-128-ofb",
"aes-192-ofb",
"aes-256-ofb",
"des-cfb",
"bf-cfb",
"cast5-cfb",
"rc4-md5",
"chacha20-ietf",
"salsa20",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
}
var SSCipherList = []string{
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"rc4-md5",
"chacha20-ietf",
"xchacha20",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
}

105
pkg/proxy/geoip.go Normal file
View File

@@ -0,0 +1,105 @@
package proxy
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"os"
"github.com/oschwald/geoip2-golang"
bingeoip "github.com/zu1k/proxypool/internal/bindata/geoip"
)
var geoIp GeoIP
func InitGeoIpDB() {
err := bingeoip.RestoreAsset("", "assets/GeoLite2-City.mmdb")
if err != nil {
panic(err)
}
err = bingeoip.RestoreAsset("", "assets/flags.json")
if err != nil {
panic(err)
}
geoIp = NewGeoIP("assets/GeoLite2-City.mmdb", "assets/flags.json")
}
// GeoIP2
type GeoIP struct {
db *geoip2.Reader
emojiMap map[string]string
}
type CountryEmoji struct {
Code string `json:"code"`
Emoji string `json:"emoji"`
}
// new geoip from db file
func NewGeoIP(geodb, flags string) (geoip GeoIP) {
// 判断文件是否存在
_, err := os.Stat(geodb)
if err != nil && os.IsNotExist(err) {
log.Println("文件不存在,请自行下载 Geoip2 City库并保存在", geodb)
os.Exit(1)
} else {
db, err := geoip2.Open(geodb)
if err != nil {
log.Fatal(err)
}
geoip.db = db
}
_, err = os.Stat(flags)
if err != nil && os.IsNotExist(err) {
log.Println("flags 文件不存在,请自行下载 flags.json并保存在", flags)
os.Exit(1)
} else {
data, err := ioutil.ReadFile(flags)
if err != nil {
log.Fatal(err)
return
}
var countryEmojiList = make([]CountryEmoji, 0)
err = json.Unmarshal(data, &countryEmojiList)
if err != nil {
log.Fatalln(err.Error())
return
}
emojiMap := make(map[string]string)
for _, i := range countryEmojiList {
emojiMap[i.Code] = i.Emoji
}
geoip.emojiMap = emojiMap
}
return
}
// find ip info
func (g GeoIP) Find(ipORdomain string) (ip, country string, err error) {
ips, err := net.LookupIP(ipORdomain)
if err != nil {
return "", "", err
}
ip = ips[0].String()
var record *geoip2.City
record, err = g.db.City(ips[0])
if err != nil {
return
}
countryIsoCode := record.Country.IsoCode
if countryIsoCode == "" {
country = fmt.Sprintf("🏁 ZZ")
}
emoji, found := g.emojiMap[countryIsoCode]
if found {
country = fmt.Sprintf("%v %v", emoji, countryIsoCode)
} else {
country = fmt.Sprintf("🏁 ZZ")
}
return
}

62
pkg/proxy/link_test.go Normal file
View File

@@ -0,0 +1,62 @@
package proxy
import (
"fmt"
"testing"
)
func TestSSLink(t *testing.T) {
ss, err := ParseSSLink("ss://YWVzLTI1Ni1jZmI6ZUlXMERuazY5NDU0ZTZuU3d1c3B2OURtUzIwMXRRMERAMTcyLjEwNC4xNjEuNTQ6ODA5OQ==#翻墙党223.13新加坡")
if err != nil {
t.Error(err)
}
fmt.Println(ss)
fmt.Println(ss.Link())
ss, err = ParseSSLink(ss.Link())
if err != nil {
t.Error(err)
}
fmt.Println(ss)
}
func TestSSRLink(t *testing.T) {
ssr, err := ParseSSRLink("ssr://MTcyLjEwNC4xNjEuNTQ6ODA5OTpvcmlnaW46YWVzLTI1Ni1jZmI6cGxhaW46WlVsWE1FUnVhelk1TkRVMFpUWnVVM2QxYzNCMk9VUnRVekl3TVhSUk1FUT0vP29iZnNwYXJhbT0mcHJvdG9wYXJhbT0mcmVtYXJrcz01Ny03NWFLWjVZV2FNakl6TGpFejVwYXc1WXFnNVoyaCZncm91cD01cGF3NVlxZzVaMmg=")
if err != nil {
t.Error(err)
}
fmt.Println(ssr)
fmt.Println(ssr.Link())
ssr, err = ParseSSRLink(ssr.Link())
if err != nil {
t.Error(err)
}
fmt.Println(ssr)
}
func TestTrojanLink(t *testing.T) {
trojan, err := ParseTrojanLink("trojan://65474277@sqcu.hostmsu.ru:55551?allowinsecure=0&peer=mza.hkfq.xyz&mux=1&ws=0&wspath=&wshost=&ss=0&ssmethod=aes-128-gcm&sspasswd=&group=#%E9%A6%99%E6%B8%AFCN2-MZA%E8%8A%82%E7%82%B9-%E5%AE%BF%E8%BF%81%E8%81%94%E9%80%9A%E4%B8%AD%E8%BD%AC")
if err != nil {
t.Error(err)
}
fmt.Println(trojan)
fmt.Println(trojan.Link())
trojan, err = ParseTrojanLink(trojan.Link())
if err != nil {
t.Error(err)
}
fmt.Println(trojan)
}
func TestVmessLink(t *testing.T) {
v, err := ParseVmessLink("vmess://ew0KICAidiI6ICIyIiwNCiAgInBzIjogIuW+ruS/oeWFrOS8l+WPtyDlpJrlvannmoTlpKfljYPkuJbnlYwiLA0KICAiYWRkIjogInMyNzEuc25vZGUueHl6IiwNCiAgInBvcnQiOiAiNDQzIiwNCiAgImlkIjogIjZhOTAwZDYzLWNiOTItMzVhMC1hZWYwLTNhMGMxMWFhODUyMyIsDQogICJhaWQiOiAiMSIsDQogICJuZXQiOiAid3MiLA0KICAidHlwZSI6ICJub25lIiwNCiAgImhvc3QiOiAiczI3MS5zbm9kZS54eXoiLA0KICAicGF0aCI6ICIvcGFuZWwiLA0KICAidGxzIjogInRscyINCn0=")
if err != nil {
t.Error(err)
}
fmt.Println(v)
fmt.Println(v.Link())
v, err = ParseVmessLink(v.Link())
if err != nil {
t.Error(err)
}
fmt.Println(v)
}

129
pkg/proxy/proxies.go Normal file
View File

@@ -0,0 +1,129 @@
package proxy
import (
"fmt"
"sort"
"strings"
)
type ProxyList []Proxy
func (ps ProxyList) Len() int {
return len(ps)
}
func (ps ProxyList) TypeLen(t string) int {
l := 0
for _, p := range ps {
if p.TypeName() == t {
l++
}
}
return l
}
var sortType = make(map[string]int)
func init() {
sortType["ss"] = 1
sortType["ssr"] = 2
sortType["vmess"] = 3
sortType["trojan"] = 4
}
func (ps ProxyList) Less(i, j int) bool {
if ps[i].BaseInfo().Name == ps[j].BaseInfo().Name {
return sortType[ps[i].BaseInfo().Type] < sortType[ps[j].BaseInfo().Type]
} else {
return ps[i].BaseInfo().Name < ps[j].BaseInfo().Name
}
}
func (ps ProxyList) Swap(i, j int) {
ps[i], ps[j] = ps[j], ps[i]
}
func (ps ProxyList) Deduplication() ProxyList {
result := make(ProxyList, 0, len(ps))
temp := map[string]struct{}{}
for _, item := range ps {
if item != nil {
if _, ok := temp[item.Identifier()]; !ok {
temp[item.Identifier()] = struct{}{}
result = append(result, item)
}
}
}
return result
}
func (ps ProxyList) Sort() ProxyList {
sort.Sort(ps)
return ps
}
func (ps ProxyList) NameSetCounrty() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
ps[i].SetName(ps[i].BaseInfo().Country)
}
return ps
}
func (ps ProxyList) NameAddIndex() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
ps[i].SetName(fmt.Sprintf("%s_%+02v", ps[i].BaseInfo().Name, i+1))
}
return ps
}
func (ps ProxyList) NameReIndex() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
originName := ps[i].BaseInfo().Name
country := strings.SplitN(originName, "_", 2)[0]
ps[i].SetName(fmt.Sprintf("%s_%+02v", country, i+1))
}
return ps
}
func (ps ProxyList) NameAddTG() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
ps[i].SetName(fmt.Sprintf("%s %s", ps[i].BaseInfo().Name, "@peekfun"))
}
return ps
}
func (ps ProxyList) Clone() ProxyList {
result := make(ProxyList, 0, len(ps))
for _, pp := range ps {
if pp != nil {
result = append(result, pp.Clone())
}
}
return result
}
// Derive 将原有节点中的ss和ssr互相转换进行衍生
func (ps ProxyList) Derive() ProxyList {
proxies := ps
for _, p := range ps {
if p == nil {
continue
}
if p.TypeName() == "ss" {
ssr, err := Convert2SSR(p)
if err == nil {
proxies = append(proxies, ssr)
}
} else if p.TypeName() == "ssr" {
ss, err := Convert2SS(p)
if err == nil {
proxies = append(proxies, ss)
}
}
}
return proxies.Deduplication()
}

View File

@@ -11,7 +11,7 @@ import (
"strconv"
"strings"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/tool"
)
var (
@@ -61,16 +61,15 @@ func (ss Shadowsocks) ToSurge() string {
}
}
func (ss *Shadowsocks) SetName(name string) {
ss.Name = name
func (ss Shadowsocks) Clone() Proxy {
return &ss
}
func (ss *Shadowsocks) Type() string {
return "ss"
}
func (ss *Shadowsocks) BaseInfo() *Base {
return &ss.Base
// https://shadowsocks.org/en/config/quick-guide.html
func (ss Shadowsocks) Link() (link string) {
payload := fmt.Sprintf("%s:%s@%s:%d", ss.Cipher, ss.Password, ss.Server, ss.Port)
payload = tool.Base64EncodeString(payload, false)
return fmt.Sprintf("ss://%s#%s", payload, ss.Name)
}
func ParseSSLink(link string) (*Shadowsocks, error) {

View File

@@ -3,6 +3,7 @@ package proxy
import (
"encoding/json"
"errors"
"fmt"
"math/rand"
"net"
"net/url"
@@ -10,7 +11,7 @@ import (
"strconv"
"strings"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/tool"
)
var (
@@ -34,7 +35,7 @@ type ShadowsocksR struct {
}
func (ssr ShadowsocksR) Identifier() string {
return net.JoinHostPort(ssr.Server, strconv.Itoa(ssr.Port)) + ssr.ProtocolParam
return net.JoinHostPort(ssr.Server, strconv.Itoa(ssr.Port)) + ssr.Password + ssr.ProtocolParam
}
func (ssr ShadowsocksR) String() string {
@@ -57,16 +58,21 @@ func (ssr ShadowsocksR) ToSurge() string {
return ""
}
func (ssr *ShadowsocksR) SetName(name string) {
ssr.Name = name
func (ssr ShadowsocksR) Clone() Proxy {
return &ssr
}
func (ssr *ShadowsocksR) Type() string {
return "ssr"
}
func (ssr *ShadowsocksR) BaseInfo() *Base {
return &ssr.Base
// https://github.com/HMBSbige/ShadowsocksR-Windows/wiki/SSR-QRcode-scheme
func (ssr ShadowsocksR) Link() (link string) {
payload := fmt.Sprintf("%s:%d:%s:%s:%s:%s",
ssr.Server, ssr.Port, ssr.Protocol, ssr.Cipher, ssr.Obfs, tool.Base64EncodeString(ssr.Password, true))
query := url.Values{}
query.Add("obfsparam", tool.Base64EncodeString(ssr.ObfsParam, true))
query.Add("protoparam", tool.Base64EncodeString(ssr.ProtocolParam, true))
query.Add("remarks", tool.Base64EncodeString(ssr.Name, true))
query.Add("group", tool.Base64EncodeString("proxy.tgbot.co", true))
payload = tool.Base64EncodeString(fmt.Sprintf("%s/?%s", payload, query.Encode()), true)
return fmt.Sprintf("ssr://%s", payload)
}
func ParseSSRLink(link string) (*ShadowsocksR, error) {

165
pkg/proxy/trojan.go Normal file
View File

@@ -0,0 +1,165 @@
package proxy
import (
"encoding/json"
"errors"
"math/rand"
"net"
"net/url"
"regexp"
"strconv"
"strings"
)
var (
ErrorNotTrojanink = errors.New("not a correct trojan link")
)
type Trojan struct {
Base
Password string `yaml:"password" json:"password"`
ALPN []string `yaml:"alpn,omitempty" json:"alpn,omitempty"`
SNI string `yaml:"sni,omitempty" json:"sni,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty" json:"skip-cert-verify,omitempty"`
UDP bool `yaml:"udp,omitempty" json:"udp,omitempty"`
}
/**
- name: "trojan"
type: trojan
server: server
port: 443
password: yourpsk
# udp: true
# sni: example.com # aka server name
# alpn:
# - h2
# - http/1.1
# skip-cert-verify: true
*/
func (t Trojan) Identifier() string {
return net.JoinHostPort(t.Server, strconv.Itoa(t.Port)) + t.Password
}
func (t Trojan) String() string {
data, err := json.Marshal(t)
if err != nil {
return ""
}
return string(data)
}
func (t Trojan) ToClash() string {
data, err := json.Marshal(t)
if err != nil {
return ""
}
return "- " + string(data)
}
func (t Trojan) ToSurge() string {
return ""
}
func (t Trojan) Clone() Proxy {
return &t
}
// https://p4gefau1t.github.io/trojan-go/developer/url/
func (t Trojan) Link() (link string) {
query := url.Values{}
if t.SNI != "" {
query.Set("sni", url.QueryEscape(t.SNI))
}
uri := url.URL{
Scheme: "trojan",
User: url.User(url.QueryEscape(t.Password)),
Host: net.JoinHostPort(t.Server, strconv.Itoa(t.Port)),
RawQuery: query.Encode(),
Fragment: t.Name,
}
return uri.String()
}
func ParseTrojanLink(link string) (*Trojan, error) {
if !strings.HasPrefix(link, "trojan://") && !strings.HasPrefix(link, "trojan-go://") {
return nil, ErrorNotTrojanink
}
/**
trojan-go://
$(trojan-password)
@
trojan-host
:
port
/?
sni=$(tls-sni.com)&
type=$(original|ws|h2|h2+ws)&
host=$(websocket-host.com)&
path=$(/websocket/path)&
encryption=$(ss;aes-256-gcm;ss-password)&
plugin=$(...)
#$(descriptive-text)
*/
uri, err := url.Parse(link)
if err != nil {
return nil, ErrorNotSSLink
}
password := uri.User.Username()
password, _ = url.QueryUnescape(password)
server := uri.Hostname()
port, _ := strconv.Atoi(uri.Port())
moreInfos := uri.Query()
sni := moreInfos.Get("sni")
sni, _ = url.QueryUnescape(sni)
transformType := moreInfos.Get("type")
transformType, _ = url.QueryUnescape(transformType)
host := moreInfos.Get("host")
host, _ = url.QueryUnescape(host)
path := moreInfos.Get("path")
path, _ = url.QueryUnescape(path)
alpn := make([]string, 0)
if transformType == "h2" {
alpn = append(alpn, "h2")
}
if port == 0 {
return nil, ErrorNotTrojanink
}
return &Trojan{
Base: Base{
Name: strconv.Itoa(rand.Int()),
Server: server,
Port: port,
Type: "trojan",
},
Password: password,
ALPN: alpn,
UDP: true,
SNI: host,
SkipCertVerify: true,
}, nil
}
var (
trojanPlainRe = regexp.MustCompile("trojan(-go)?://([A-Za-z0-9+/_&?=@:%.-])+")
)
func GrepTrojanLinkFromString(text string) []string {
results := make([]string, 0)
texts := strings.Split(text, "trojan://")
for _, text := range texts {
results = append(results, trojanPlainRe.FindAllString("trojan://"+text, -1)...)
}
return results
}

View File

@@ -11,7 +11,7 @@ import (
"strconv"
"strings"
"github.com/zu1k/proxypool/tool"
"github.com/zu1k/proxypool/pkg/tool"
)
var (
@@ -40,7 +40,7 @@ type HTTPOptions struct {
}
func (v Vmess) Identifier() string {
return net.JoinHostPort(v.Server, strconv.Itoa(v.Port)) + v.Cipher
return net.JoinHostPort(v.Server, strconv.Itoa(v.Port)) + v.Cipher + v.UUID
}
func (v Vmess) String() string {
@@ -82,16 +82,16 @@ func (v Vmess) ToSurge() string {
}
}
func (v *Vmess) SetName(name string) {
v.Name = name
func (v Vmess) Clone() Proxy {
return &v
}
func (v *Vmess) Type() string {
return "vmess"
}
func (v *Vmess) BaseInfo() *Base {
return &v.Base
func (v Vmess) Link() (link string) {
vjv, err := json.Marshal(v.toLinkJson())
if err != nil {
return
}
return fmt.Sprintf("vmess://%s", tool.Base64EncodeBytes(vjv))
}
type vmessLinkJson struct {
@@ -108,6 +108,27 @@ type vmessLinkJson struct {
Tls string `json:"tls"`
}
func (v Vmess) toLinkJson() vmessLinkJson {
vj := vmessLinkJson{
Add: v.Server,
Ps: v.Name,
Port: v.Port,
Id: v.UUID,
Aid: strconv.Itoa(v.AlterID),
Net: v.Network,
Path: v.WSPath,
Host: v.ServerName,
V: "2",
}
if v.TLS {
vj.Tls = "tls"
}
if host, ok := v.WSHeaders["HOST"]; ok && host != "" {
vj.Host = host
}
return vj
}
func ParseVmessLink(link string) (*Vmess, error) {
if !strings.HasPrefix(link, "vmess") {
return nil, ErrorNotVmessLink
@@ -198,10 +219,11 @@ func ParseVmessLink(link string) (*Vmess, error) {
}
port := 443
portInterface := vmessJson.Port
if i, ok := portInterface.(int); ok {
port = i
} else if s, ok := portInterface.(string); ok {
port, _ = strconv.Atoi(s)
switch portInterface.(type) {
case int:
port = portInterface.(int)
case string:
port, _ = strconv.Atoi(portInterface.(string))
}
alterId, err := strconv.Atoi(vmessJson.Aid)

View File

@@ -26,3 +26,14 @@ func Base64DecodeString(src string) (dst string, err error) {
dst = string(dstbytes)
return
}
func Base64EncodeString(origin string, urlsafe bool) (result string) {
if urlsafe {
return base64.URLEncoding.EncodeToString([]byte(origin))
}
return base64.StdEncoding.EncodeToString([]byte(origin))
}
func Base64EncodeBytes(origin []byte) (result string) {
return base64.StdEncoding.EncodeToString([]byte(origin))
}

10
pkg/tool/check.go Normal file
View File

@@ -0,0 +1,10 @@
package tool
func CheckInList(list []string, item string) bool {
for _, i := range list {
if item == i {
return true
}
}
return false
}

27
pkg/tool/colly.go Normal file
View File

@@ -0,0 +1,27 @@
package tool
import (
"net"
"net/http"
"time"
"github.com/gocolly/colly"
)
func GetColly() *colly.Collector {
c := colly.NewCollector(
colly.UserAgent(UserAgent),
)
c.WithTransport(&http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 10 * time.Second, // 超时时间
KeepAlive: 10 * time.Second, // keepAlive 超时时间
}).DialContext,
MaxIdleConns: 100, // 最大空闲连接数
IdleConnTimeout: 20 * time.Second, // 空闲连接超时
TLSHandshakeTimeout: 10 * time.Second, // TLS 握手超时
ExpectContinueTimeout: 10 * time.Second,
})
return c
}

View File

@@ -6,6 +6,8 @@ import (
"time"
)
const UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
type HttpClient struct {
*http.Client
}
@@ -28,7 +30,7 @@ func (c *HttpClient) Get(url string) (resp *http.Response, err error) {
return nil, err
}
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36")
req.Header.Set("User-Agent", UserAgent)
return c.Do(req)
}
@@ -38,6 +40,6 @@ func (c *HttpClient) Post(url string, body io.Reader) (resp *http.Response, err
return nil, err
}
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36")
req.Header.Set("User-Agent", UserAgent)
return c.Do(req)
}

View File

@@ -1,14 +0,0 @@
package provider
type Provider interface {
Provide() string
}
func checkInList(list []string, item string) bool {
for _, i := range list {
if item == i {
return true
}
}
return false
}

View File

@@ -1,141 +0,0 @@
package provider
import (
"strings"
"github.com/zu1k/proxypool/proxy"
)
type Clash struct {
Proxies []proxy.Proxy `yaml:"proxies"`
Types string `yaml:"type"`
}
func (c Clash) CleanProxies() (proxies []proxy.Proxy) {
proxies = make([]proxy.Proxy, 0)
for _, p := range c.Proxies {
if checkClashSupport(p) {
proxies = append(proxies, p)
}
}
return
}
func (c Clash) Provide() string {
var resultBuilder strings.Builder
resultBuilder.WriteString("proxies:\n")
if c.Types == "" || c.Types == "all" {
for _, p := range c.Proxies {
if checkClashSupport(p) {
resultBuilder.WriteString(p.ToClash() + "\n")
}
}
} else {
types := strings.Split(c.Types, ",")
for _, p := range c.Proxies {
if checkClashSupport(p) {
for _, t := range types {
if p.Type() == t {
resultBuilder.WriteString(p.ToClash() + "\n")
}
}
}
}
}
return resultBuilder.String()
}
func checkClashSupport(p proxy.Proxy) bool {
switch p.Type() {
case "ssr":
ssr := p.(*proxy.ShadowsocksR)
if checkInList(ssrCipherList, ssr.Cipher) && checkInList(ssrProtocolList, ssr.Protocol) && checkInList(ssrObfsList, ssr.Obfs) {
return true
}
case "vmess":
vmess := p.(*proxy.Vmess)
if checkInList(vmessCipherList, vmess.Cipher) {
return true
}
case "ss":
ss := p.(*proxy.Shadowsocks)
if checkInList(ssCipherList, ss.Cipher) {
return true
}
default:
return false
}
return false
}
var ssrCipherList = []string{
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"aes-128-ofb",
"aes-192-ofb",
"aes-256-ofb",
"des-cfb",
"bf-cfb",
"cast5-cfb",
"rc4-md5",
"chacha20-ietf",
"salsa20",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
}
var ssrObfsList = []string{
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
"tls1.2_ticket_fastauth",
}
var ssrProtocolList = []string{
"origin",
"verify_deflate",
"verify_sha1",
"auth_sha1",
"auth_sha1_v2",
"auth_sha1_v4",
"auth_aes128_md5",
"auth_aes128_sha1",
"auth_chain_a",
"auth_chain_b",
}
var vmessCipherList = []string{
"auto",
"aes-128-gcm",
"chacha20-poly1305",
"none",
}
var ssCipherList = []string{
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"rc4-md5",
"chacha20-ietf",
"xchacha20",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
}

View File

@@ -1,33 +0,0 @@
package proxy
type Base struct {
Name string `yaml:"name" json:"name"`
Server string `yaml:"server" json:"server"`
Port int `yaml:"port" json:"port"`
Type string `yaml:"type" json:"type"`
UDP bool `yaml:"udp,omitempty" json:"udp,omitempty"`
}
type Proxy interface {
String() string
ToClash() string
ToSurge() string
Identifier() string
SetName(name string)
Type() string
BaseInfo() *Base
}
func Deduplication(src []Proxy) []Proxy {
result := make([]Proxy, 0, len(src))
temp := map[string]struct{}{}
for _, item := range src {
if item != nil {
if _, ok := temp[item.Identifier()]; !ok {
temp[item.Identifier()] = struct{}{}
result = append(result, item)
}
}
}
return result
}

View File

@@ -1,77 +0,0 @@
package proxy
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/Dreamacro/clash/adapters/outbound"
)
const defaultURLTestTimeout = time.Second * 15
func Check(p Proxy) (delay uint16, err error) {
pmap := make(map[string]interface{})
err = json.Unmarshal([]byte(p.String()), &pmap)
if err != nil {
return
}
pmap["port"] = int(pmap["port"].(float64))
if p.Type() == "vmess" {
pmap["alterId"] = int(pmap["alterId"].(float64))
}
clashProxy, err := outbound.ParseProxy(pmap)
if err != nil {
fmt.Println(err.Error())
return
}
ctx, cancel := context.WithTimeout(context.Background(), defaultURLTestTimeout)
defer cancel()
delay, err = clashProxy.URLTest(ctx, "http://www.gstatic.com/generate_204")
return delay, err
}
func CleanProxies(proxies []Proxy) (cproxies []Proxy) {
c := make(chan checkResult, 40)
for _, p := range proxies {
go checkProxyWithChan(p, c)
}
okMap := make(map[string]struct{})
size := len(proxies)
for i := 0; i < size; i++ {
r := <-c
if r.delay > 0 {
okMap[r.name] = struct{}{}
}
}
cproxies = make([]Proxy, 0)
for _, p := range proxies {
if _, ok := okMap[p.Identifier()]; ok {
cproxies = append(cproxies, p)
}
}
return
}
type checkResult struct {
name string
delay uint16
}
func checkProxyWithChan(p Proxy, c chan checkResult) {
delay, err := Check(p)
if err != nil {
c <- checkResult{
name: p.Identifier(),
delay: 0,
}
return
}
c <- checkResult{
name: p.Identifier(),
delay: delay,
}
}

View File

@@ -1,45 +0,0 @@
package proxy
import (
"log"
"net"
"os"
"github.com/oschwald/geoip2-golang"
)
// GeoIP2
type GeoIP struct {
db *geoip2.Reader
}
// new geoip from db file
func NewGeoIP(filePath string) (geoip GeoIP) {
// 判断文件是否存在
_, err := os.Stat(filePath)
if err != nil && os.IsNotExist(err) {
log.Println("文件不存在,请自行下载 Geoip2 City库并保存在", filePath)
os.Exit(1)
} else {
db, err := geoip2.Open(filePath)
if err != nil {
log.Fatal(err)
}
geoip = GeoIP{db: db}
}
return
}
// find ip info
func (g GeoIP) Find(ipORdomain string) (country string, err error) {
ips, err := net.LookupIP(ipORdomain)
if err != nil {
return "", err
}
ipData := net.ParseIP(ips[0].String())
record, err := g.db.City(ipData)
if err != nil {
return "", err
}
return record.Country.IsoCode, nil
}

View File

@@ -1,279 +0,0 @@
sources:
# 订阅链接
- type: subscribe
options:
url: https://suda.sub.koicloud.pw/link/K9vz0uFPe9ULfdqX?sub=3
- type: subscribe
options:
url: https://raw.githubusercontent.com/Pcrab/Dotfiles/912c1104b3f8121f72f7ee11590f52bc9c44dde7/.config/electron-ssr/gui-config.json
- type: subscribe
options:
url: https://v2.fit/modules/servers/V2raySocks/osubscribe.php?sid=7063&token=lKJwbO2onxIr
- type: subscribe
options:
url: https://www.liesauer.net/yogurt/subscribe?ACCESS_TOKEN=d309c6921bbd7d0d
- type: subscribe
options:
url: https://neurotoxinw.coding.net/p/qifei/d/qifei/git/raw/master/README.md
- type: subscribe
options:
url: https://sbnmsl.co/link/2cpTGUGJtHBXUK7d?sub=3
- type: subscribe
options:
url: https://extrm.info/link/uirPjznB7esOezjr?sub=1
- type: subscribe
options:
url: http://www.sksla.pro/api/v1/client/subscribe?token=99c3fa86424539bd3bd34a893bc6dee8
- type: subscribe
options:
url: https://vvsub.xyz/api/al/19786-xDX1SCq61Ymi
- type: subscribe
options:
url: https://rss-node.com/link/vqOaWFJRfbYxpAhY?mu=1
- type: subscribe
options:
url: https://tm2w.live/link/EqICUlKXmn1EJwaw?sub=3
- type: subscribe
options:
url: https://dingyue.suying666.info/link/o7j43Aykx8CWBehE?sub=3
- type: subscribe
options:
url: https://dingyue.suying666.info/link/o7j43Aykx8CWBehE?sub=1
- type: subscribe
options:
url: https://www.haidaobot.xyz/link/QwdUmWolPN0LkThW?mu=2
- type: subscribe
options:
url: https://pptp.cloud/sub/cXHG9wqUpQbhHr7b.html
- type: subscribe
options:
url: https://suda.sub.koicloud.pw/link/JgULLCNkImsJ6Ibh?sub=3
- type: subscribe
options:
url: https://jiyou.world/modules/servers/V2raySocks/osubscribetest.php?sid=57394&token=V3GM60lgqZL9
- type: subscribe
options:
url: https://aero.moe/link/kxdbKdopH3paUqUf?sub=3
- type: subscribe
options:
url: http://dy.tntv2.xyz/link/pTL0RgiVblXLIQjS?sub=3&extend=1
- type: subscribe
options:
url: https://719401146.online//link/oHPA3bXVc2zeqGGq?mu=2
- type: subscribe
options:
url: https://www.v2ray.pw/link/b5e255KbnnATXc60?mu=2+&extend=1
- type: subscribe
options:
url: http://ssrdingyue.ueuo.com/v2/8y12r
- type: subscribe
options:
url: https://www.suncloud.fun/link/Su683BQEyUdxtyuY?mu=1&extend=1
- type: subscribe
options:
url: https://sub88.xyz/link/egy4oyqok9aavpcy?sub=3
- type: subscribe
options:
url: https://qiaomenzhuanfx.netlify.com/
- type: subscribe
options:
url: https://sub88.xyz/link/lkY8Jt5Q3SHlffra?mu=2
- type: subscribe
options:
url: https://raw.githubusercontent.com/hotsymbol/vpnsetting/master/v2rayopen
- type: subscribe
options:
url: https://raw.githubusercontent.com/satrom/V2SSR/master/V2RAY/Sub.txt
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
- type: subscribe
options:
url: http://qe83xk711.sabkt.gdipper.com/freev2ray.txt
- type: subscribe
options:
url: https://iwxf.netlify.app/
- type: subscribe
options:
url: https://rss.getfree.win/link/w9ted9eZq1zbC3gx?sub=1
- type: subscribe
options:
url: https://youlianboshi.netlify.com/
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ss-sub
- type: subscribe
options:
url: https://bujidao302.com/link/IJ6wKEt96Otboilb?mu=2
- type: subscribe
options:
url: https://raw.githubusercontent.com/satrom/V2SSR/master/SSR/Day.txt
- type: subscribe
options:
url: https://raw.githubusercontent.com/ntkernel/lantern/master/vmess_base64.txt
- type: subscribe
options:
url: https://lei-su.me//link/Dw3lmyXXJJTnvsBA?sub=3&extend=1
- type: subscribe
options:
url: https://raw.githubusercontent.com/cdp2020/v2ray/master/README.md
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ssrsub
- type: subscribe
options:
url: https://www.liesauer.net/yogurt/subscribe?ACCESS_TOKEN=DAYxR3mMaZAsaqUb
- type: subscribe
options:
url: https://rss.cnrss.xyz/link/Rcr8h8fvZIWE001U?mu=2
- type: subscribe
options:
url: https://12o.ooo/link/JLisT80gOhRkiFnX?sub=1
- type: subscribe
options:
url: https://sub1.m87sub.xyz/link/pZDgnxhgL6Poh1GQ?sub=3
- type: subscribe
options:
url: https://raw.githubusercontent.com/satrom/V2SSR/master/SSR/Sub.txt
- type: subscribe
options:
url: https://sub88.xyz/link/lkY8Jt5Q3SHlffra?mu=2
- type: subscribe
options:
url: https://s.sublank.xyz/subscribe/66056/0yzuMVawjpr/ssr/
- type: subscribe
options:
url: https://sub1.m87sub.xyz/link/pZDgnxhgL6Poh1GQ?sub=1
- type: subscribe
options:
url: http://qe83xk711.sabkt.gdipper.com/freess.txt
- type: subscribe
options:
url: https://raw.githubusercontent.com/pojiezhiyuanjun/freev2/master/20200808.txt
- type: subscribe
options:
url: https://sub1.m87sub.xyz/link/2488O6IM4n4nksMG?sub=3
- type: subscribe
options:
url: http://103.72.166.89/v2ray.php
- type: subscribe
options:
url: https://fly.lo-lita.ru/api/v1/client/subscribe?token=94be7fa3d65791197dd10c6a0b757571
- type: subscribe
options:
url: https://raw.githubusercontent.com/RaymondHarris971/ssrsub/master/9a075bdee5.txt
- type: subscribe
options:
url: https://bit.ly/2D5fWhX
- type: subscribe
options:
url: https://www.suncloud.fun/link/ja3OIcMTrky6VhN6?mu=1&extend=1
- type: subscribe
options:
url: https://raw.githubusercontent.com/voken100g/AutoSSR/master/recent
- type: subscribe
options:
url: https://jiang.netlify.com/
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/v2ray
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ssrsub
- type: subscribe
options:
url: https://raw.githubusercontent.com/ssrsub/ssr/master/ss-sub
- type: subscribe
options:
url: https://heikejilaila.xyz/keji.php?id=22c7b9fdda20bb7405b270cd75971f66
- type: subscribe
options:
url: https://youlianboshi.netlify.app/
# 网页模糊抓取
- type: webfuzz
options:
url: https://zfjvpn.gitbook.io/
- type: webfuzz
options:
url: https://www.freefq.com/d/file/free-ssr/20200811/1f3e9d0d0064f662457062712dcf1b66.txt
- type: webfuzz
options:
url: https://merlinblog.xyz/wiki/freess.html
- type: webfuzz
options:
url: https://zfjvpn.gitbook.io/123/
# tg频道
- type: tgchannel
options:
channel: ssrList
num: 200
- type: tgchannel
options:
channel: ssList
num: 200
- type: tgchannel
options:
channel: SSRSUB
num: 200
- type: tgchannel
options:
channel: FreeSSRNode
num: 200
- type: tgchannel
options:
channel: ssrlists
num: 200
- type: tgchannel
options:
channel: ssrshares
num: 200
- type: tgchannel
options:
channel: V2List
num: 200
- type: tgchannel
options:
channel: ssrtool
num: 200
- type: tgchannel
options:
channel: vmessr
num: 200
- type: tgchannel
options:
channel: FreeSSR666
num: 200
- type: tgchannel
options:
channel: fanqiang666
num: 200
- type: tgchannel
options:
channel: jiedianfenxiang
num: 200
- type: tgchannel
options:
channel: freeshadowsock
num: 200
# 翻墙党,后面的东西都无需修改
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum.php?mod=rss&fid=50&auth=0
num: 200
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum.php?mod=rss&fid=2&auth=0
num: 200
- type: web-fanqiangdang
options:
url: https://fanqiangdang.com/forum.php?mod=rss&fid=36&auth=0
num: 200
- type: web-freessrxyz
options:
- type: web-lucnorg
options:

View File

@@ -1,43 +0,0 @@
package tool
import (
"bytes"
"crypto/aes"
)
func PKCS7Padding(ciphertext []byte, blockSize int) []byte {
padding := blockSize - len(ciphertext)%blockSize
padtext := bytes.Repeat([]byte{byte(padding)}, padding)
return append(ciphertext, padtext...)
}
func PKCS7UnPadding(origData []byte) []byte {
length := len(origData)
unpadding := int(origData[length-1])
return origData[:(length - unpadding)]
}
func AesEcbDecryptWithPKCS7Unpadding(data, key []byte) []byte {
block, _ := aes.NewCipher(key)
decrypted := make([]byte, len(data))
size := block.BlockSize()
for bs, be := 0, size; bs < len(data); bs, be = bs+size, be+size {
block.Decrypt(decrypted[bs:be], data[bs:be])
}
return PKCS7UnPadding(decrypted)
}
func AesEcbEncryptWithPKCS7Padding(data, key []byte) []byte {
block, _ := aes.NewCipher(key)
data = PKCS7Padding(data, block.BlockSize())
decrypted := make([]byte, len(data))
size := block.BlockSize()
for bs, be := 0, size; bs < len(data); bs, be = bs+size, be+size {
block.Encrypt(decrypted[bs:be], data[bs:be])
}
return decrypted
}