Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge fly #2758

Merged
merged 52 commits into from
Oct 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4f6e028
update geoip, geosite
actions-user Oct 2, 2020
353df85
Actions: do NOT run on repo "v2ray/v2ray-core" (#244)
Loyalsoldier Oct 2, 2020
2fc5f96
Refine codes (#245)
Loyalsoldier Oct 2, 2020
dcf368b
Refine Azure Pipelines & Bazel: remove unnecessary steps (#246)
Loyalsoldier Oct 2, 2020
9f344fa
remove shadowsosks ota (#238)
kslr Oct 2, 2020
67f409d
Stats: Implements blocking/non-blocking messaging of Channel (#250)
Vigilans Oct 2, 2020
60909da
VLESS PREVIEW 2.2
RPRX Oct 3, 2020
2e4042e
Merge pull request #253 from rprx/master
RPRX Oct 3, 2020
271532f
Add full VLESS fallbacks support to Trojan (#254)
RPRX Oct 3, 2020
36f0b7d
Fix Trojan inbound access log (#255)
RPRX Oct 3, 2020
088ce4e
Refine proto.go due to protoc-gen-go-grpc update (#257)
Loyalsoldier Oct 3, 2020
7a789fe
Run go fmt
Loyalsoldier Oct 3, 2020
f184d16
Fix golangci nolint
Loyalsoldier Oct 3, 2020
68dd2a0
Merge pull request #258 from Loyalsoldier/refine-codes
Loyalsoldier Oct 3, 2020
4ba4cad
Refine func GetModuleName
Loyalsoldier Oct 4, 2020
edefca7
Refine & make proto.go work outside GOPATH
Loyalsoldier Oct 4, 2020
9b249f9
Make variables of vprotogen easier to find
Loyalsoldier Oct 4, 2020
d30b5fb
Merge pull request #259 from Loyalsoldier/refine-code
Loyalsoldier Oct 4, 2020
4130b54
Support to read go.mod recursively to get module path
Loyalsoldier Oct 4, 2020
0650af4
Refine errorgen
Loyalsoldier Oct 4, 2020
b181045
Errorgen: support to run outside of GOPATH
Loyalsoldier Oct 4, 2020
9a452bc
Merge pull request #260 from Loyalsoldier/refine-errorgen
Loyalsoldier Oct 4, 2020
b8a7803
VLESS PREVIEW 2.3
RPRX Oct 4, 2020
ef872ff
Merge pull request #262 from rprx/master
RPRX Oct 4, 2020
a308620
Fix
RPRX Oct 4, 2020
bb44d01
Format proto files using clang-format according to google style (#264)
Loyalsoldier Oct 5, 2020
8599697
Bump github.com/pires/go-proxyproto from 0.1.3 to 0.2.0 (#265)
dependabot[bot] Oct 5, 2020
c344edd
Up
RPRX Oct 5, 2020
48fde93
remove unused doc in release
kslr Oct 6, 2020
03fb762
removes all file system paths from the compiled executable, to improv…
kslr Oct 6, 2020
bcc7b78
Add XTLS support to mKCP (#267)
RPRX Oct 6, 2020
359f844
compiler use gogcc, remove gcflags and asmflags (#269)
kslr Oct 7, 2020
4bf1b4e
VLESS PREVIEW 2.4
RPRX Oct 7, 2020
884feea
Merge pull request #271 from rprx/master
RPRX Oct 7, 2020
6e4701b
Build: do NOT rely on GOPATH & refine user-package.sh (#270)
Loyalsoldier Oct 7, 2020
8071aa9
Update rights owner
kslr Oct 7, 2020
7ef520b
Refine user-package (#272)
Loyalsoldier Oct 7, 2020
6769e65
Run go mod tidy (#273)
Loyalsoldier Oct 7, 2020
26aecf0
Refine Dockerfile (#274)
Loyalsoldier Oct 7, 2020
93a91ea
Refine README (#275)
Loyalsoldier Oct 7, 2020
ba99e32
Bazel: discard GOPATH (#278)
Loyalsoldier Oct 7, 2020
f0403a6
Refine scripts (#279)
Loyalsoldier Oct 7, 2020
425b4b4
Add padding to abstract unix domain socket in fallbacks (#277)
lucifer9 Oct 8, 2020
4545283
Fix misspelling according to goreportcard result (#282)
Loyalsoldier Oct 8, 2020
97dac8c
Build: comply with upstream (#283)
Loyalsoldier Oct 8, 2020
8e8127b
update geoip, geosite
actions-user Oct 9, 2020
a44e1ed
update to IETF QUIC draft-29 (#287)
kslr Oct 9, 2020
811981b
Geofile workflow: only run on v2fly/v2ray-core (#288)
Loyalsoldier Oct 9, 2020
1f70185
bump version
VentoValery Oct 9, 2020
807922f
Reduce timeout & fix ineffassign (#290)
Loyalsoldier Oct 9, 2020
ed97a25
Refine golangci-lint settings (#293)
Loyalsoldier Oct 9, 2020
c50fef4
Refine golangci-lint settings (#294)
Loyalsoldier Oct 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 4 additions & 20 deletions .github/linters/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
run:
timeout: 5m
skip-dirs:
- external
skip-files:
- generated.*

issues:
new: true
exclude-rules:
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- goconst

linters:
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- misspell
- nakedret
- noctx
Expand All @@ -49,6 +30,9 @@ linters:
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
disable:
- deadcode
- errcheck
- unused
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

jobs:
analyze:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
coverage:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

jobs:
lint:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
sign:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Checkout default branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
stale-issue-message: "This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days"
stale-pr-message: 'It has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days'
days-before-stale: 120
days-before-close: 5
days-before-close: 5
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

jobs:
test:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/updateGeofile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
update:
if: github.repository == 'v2fly/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# STEP 1 build executable binary
############################
FROM golang:alpine AS builder

RUN apk update && apk add --no-cache git bash wget curl
WORKDIR /go/src/v2ray.com/core
WORKDIR /build
RUN git clone --progress https://github.com/v2fly/v2ray-core.git . && \
bash ./release/user-package.sh nosource noconf codename=$(git describe --tags) buildname=docker-fly abpathtgz=/tmp/v2ray.tgz
bash ./release/user-package.sh nosource noconf codename=$(git describe --abbrev=0 --tags) buildname=docker-fly abpathtgz=/tmp/v2ray.tgz

############################
# STEP 2 build a small image
############################
Expand All @@ -20,4 +22,3 @@ RUN apk update && apk add ca-certificates && \
#ENTRYPOINT ["/usr/bin/v2ray/v2ray"]
ENV PATH /usr/bin/v2ray:$PATH
CMD ["v2ray", "-config=/etc/v2ray/config.json"]

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2020 V2Ray
Copyright (c) 2015-2020 V2Fly Community

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Project V
![](https://github.com/v2fly/v2ray-core/workflows/Test/badge.svg)
[![codecov.io][3]][4] [![GoDoc][5]][6] [![codebeat][7]][8] [![Downloads][9]][10] [![Downloads][11]][12]

[3]: https://codecov.io/gh/v2fly/v2ray-core/branch/master/graph/badge.svg?branch=master "Coverage badge"
[![GitHub Test Badge][1]][2] [![codecov.io][3]][4] [![GoDoc][5]][6] [![codebeat][7]][8] [![Downloads][9]][10] [![Downloads][11]][12]

[1]: https://github.com/v2fly/v2ray-core/workflows/Test/badge.svg "GitHub Test Badge"
[2]: https://github.com/v2fly/v2ray-core/actions "GitHub Actions Page"
[3]: https://codecov.io/gh/v2fly/v2ray-core/branch/master/graph/badge.svg?branch=master "Coverage Badge"
[4]: https://codecov.io/gh/v2fly/v2ray-core?branch=master "Codecov Status"
[5]: https://godoc.org/v2ray.com/core?status.svg "GoDoc badge"
[5]: https://godoc.org/v2ray.com/core?status.svg "GoDoc Badge"
[6]: https://godoc.org/v2ray.com/core "GoDoc"
[7]: https://codebeat.co/badges/f2354ca8-3e24-463d-a2e3-159af73b2477 "Codebeat badge"
[8]: https://codebeat.co/projects/github-com-v2ray-v2ray-core-master "Codebeat"
[9]: https://img.shields.io/github/downloads/v2ray/v2ray-core/total.svg "All releases badge"
[10]: https://github.com/v2ray/v2ray-core/releases/ "All releases number"
[11]: https://img.shields.io/github/downloads/v2fly/v2ray-core/total.svg "All releases badge"
[12]: https://github.com/v2fly/v2ray-core/releases/ "All releases number"
[7]: https://goreportcard.com/badge/github.com/v2fly/v2ray-core "Goreportcard Badge"
[8]: https://goreportcard.com/report/github.com/v2fly/v2ray-core "Goreportcard Result"
[9]: https://img.shields.io/github/downloads/v2ray/v2ray-core/total.svg "v2ray/v2ray-core downloads count"
[10]: https://github.com/v2ray/v2ray-core/releases "v2ray/v2ray-core release page"
[11]: https://img.shields.io/github/downloads/v2fly/v2ray-core/total.svg "v2fly/v2ray-core downloads count"
[12]: https://github.com/v2fly/v2ray-core/releases "v2fly/v2ray-core release page"

Project V is a set of network tools that help you to build your own computer network. It secures your network connections and thus protects your privacy. See [our website](https://www.v2fly.org/) for more information.

Expand All @@ -23,9 +25,9 @@ Project V is a set of network tools that help you to build your own computer net

This repo relies on the following third-party projects:

* In production:
* [gorilla/websocket](https://github.com/gorilla/websocket)
* [gRPC](https://google.golang.org/grpc)
* For testing only:
* [miekg/dns](https://github.com/miekg/dns)
* [h12w/socks](https://github.com/h12w/socks)
- In production:
- [gorilla/websocket](https://github.com/gorilla/websocket)
- [gRPC](https://google.golang.org/grpc)
- For testing only:
- [miekg/dns](https://github.com/miekg/dns)
- [h12w/socks](https://github.com/h12w/socks)
2 changes: 1 addition & 1 deletion app/commander/commander.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package commander

//go:generate errorgen
//go:generate go run v2ray.com/core/common/errors/errorgen

import (
"context"
Expand Down
3 changes: 2 additions & 1 deletion app/commander/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/commander/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "common/serial/typed_message.proto";
message Config {
// Tag of the outbound handler that handles grpc connections.
string tag = 1;
// Services that supported by this server. All services must implement Service interface.
// Services that supported by this server. All services must implement Service
// interface.
repeated v2ray.core.common.serial.TypedMessage service = 2;
}
1 change: 0 additions & 1 deletion app/dispatcher/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ option java_multiple_files = true;

message SessionConfig {
reserved 1;

}

message Config {
Expand Down
2 changes: 1 addition & 1 deletion app/dispatcher/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package dispatcher

//go:generate errorgen
//go:generate go run v2ray.com/core/common/errors/errorgen

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion app/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package dispatcher

//go:generate errorgen
//go:generate go run v2ray.com/core/common/errors/errorgen
13 changes: 8 additions & 5 deletions app/dns/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions app/dns/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ enum DomainMatchingType {
}

message Config {
// Nameservers used by this DNS. Only traditional UDP servers are support at the moment.
// A special value 'localhost' as a domain address can be set to use DNS on local system.
// Nameservers used by this DNS. Only traditional UDP servers are support at
// the moment. A special value 'localhost' as a domain address can be set to
// use DNS on local system.
repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true];

// NameServer list used by this DNS client.
Expand All @@ -47,7 +48,8 @@ message Config {
// Deprecated. Use static_hosts.
map<string, v2ray.core.common.net.IPOrDomain> Hosts = 2 [deprecated = true];

// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes (IPv6).
// Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes
// (IPv6).
bytes client_ip = 3;

message HostMapping {
Expand All @@ -56,8 +58,9 @@ message Config {

repeated bytes ip = 3;

// ProxiedDomain indicates the mapped domain has the same IP address on this domain. V2Ray will use this domain for IP queries.
// This field is only effective if ip is empty.
// ProxiedDomain indicates the mapped domain has the same IP address on this
// domain. V2Ray will use this domain for IP queries. This field is only
// effective if ip is empty.
string proxied_domain = 4;
}

Expand Down
2 changes: 1 addition & 1 deletion app/dns/dns.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package dns is an implementation of core.DNS feature.
package dns

//go:generate errorgen
//go:generate go run v2ray.com/core/common/errors/errorgen
11 changes: 4 additions & 7 deletions app/dns/dohdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import (
"sync/atomic"
"time"

dns_feature "v2ray.com/core/features/dns"

"golang.org/x/net/dns/dnsmessage"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol/dns"
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal/pubsub"
"v2ray.com/core/common/task"
dns_feature "v2ray.com/core/features/dns"
"v2ray.com/core/features/routing"
"v2ray.com/core/transport/internet"
)
Expand Down Expand Up @@ -221,13 +220,11 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO
if d, ok := ctx.Deadline(); ok {
deadline = d
} else {
deadline = time.Now().Add(time.Second * 8)
deadline = time.Now().Add(time.Second * 5)
}

for _, req := range reqs {

go func(r *dnsRequest) {

// generate new context for each req, using same context
// may cause reqs all aborted if any one encounter an error
dnsCtx := context.Background()
Expand All @@ -245,7 +242,8 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO
// forced to use mux for DOH
dnsCtx = session.ContextWithMuxPrefered(dnsCtx, true)

dnsCtx, cancel := context.WithDeadline(dnsCtx, deadline)
var cancel context.CancelFunc
dnsCtx, cancel = context.WithDeadline(dnsCtx, deadline)
defer cancel()

b, err := dns.PackMessage(r.msg)
Expand All @@ -269,7 +267,6 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO
}

func (s *DoHNameServer) dohHTTPSContext(ctx context.Context, b []byte) ([]byte, error) {

body := bytes.NewBuffer(b)
req, err := http.NewRequest("POST", s.dohURL, body)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/dns/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package dns

//go:generate errorgen
//go:generate go run v2ray.com/core/common/errors/errorgen

import (
"context"
Expand Down Expand Up @@ -209,7 +209,7 @@ func New(ctx context.Context, config *Config) (*Server, error) {
ruleIter = 0
ruleCurr++
}
} else { // No original rule, generate one according to current domain matcher (majorly for compability with tests)
} else { // No original rule, generate one according to current domain matcher (majorly for compatibility with tests)
info.domainRuleIdx = uint16(len(rules))
rules = append(rules, matcher.String())
}
Expand Down
2 changes: 1 addition & 1 deletion app/log/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package command

//go:generate errorgen
//go:generate go run v2ray.com/core/common/errors/errorgen

import (
"context"
Expand Down
5 changes: 2 additions & 3 deletions app/log/command/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ option go_package = "v2ray.com/core/app/log/command";
option java_package = "com.v2ray.core.app.log.command";
option java_multiple_files = true;

message Config {
}
message Config {}

message RestartLoggerRequest {}

message RestartLoggerResponse{}
message RestartLoggerResponse {}

service LoggerService {
rpc RestartLogger(RestartLoggerRequest) returns (RestartLoggerResponse) {}
Expand Down
Loading