Skip to content

Commit 7d74807

Browse files
committed
Merge remote-tracking branch 'origin/stable' into v2
2 parents 136eea5 + f61a63a commit 7d74807

File tree

13 files changed

+46
-16
lines changed

13 files changed

+46
-16
lines changed

.github/workflows/govulncheck.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ jobs:
3131
with:
3232
submodules: recursive
3333

34-
- uses: jdx/mise-action@v3
35-
name: Install mise
34+
- name: Setup Go
35+
uses: actions/setup-go@v6
36+
with:
37+
go-version-file: go.mod
3638

37-
- name: Run tests
38-
run: mise tasks run vuln
39+
- name: Check for vulnerabilities
40+
run: |
41+
go run golang.org/x/vuln/cmd/govulncheck@latest ./...

example.config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ concurrency = 8192
4848
# Only ipv4 connectivity is used
4949
prefer-ip = "prefer-ipv6"
5050

51+
# If this setting is set, then mtg will try to get proxy updates from Telegram
52+
# Usually this is completely fine to have it disabled, because mtg has a list
53+
# of some core proxies hardcoded.
54+
auto-update = false
55+
5156
# FakeTLS uses domain fronting protection. So it needs to know a port to
5257
# access.
5358
#

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/panjf2000/ants/v2 v2.11.5
1515
github.com/prometheus/client_golang v1.23.2
1616
github.com/prometheus/common v0.67.5 // indirect
17-
github.com/prometheus/procfs v0.19.2 // indirect
17+
github.com/prometheus/procfs v0.20.0 // indirect
1818
github.com/rs/zerolog v1.34.0
1919
github.com/smira/go-statsd v1.3.4
2020
github.com/stretchr/objx v0.5.2 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNw
6868
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
6969
github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4=
7070
github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw=
71-
github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
72-
github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=
71+
github.com/prometheus/procfs v0.20.0 h1:AA7aCvjxwAquZAlonN7888f2u4IN8WVeFgBi4k82M4Q=
72+
github.com/prometheus/procfs v0.20.0/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo=
7373
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
7474
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
7575
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=

internal/cli/run_proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
255255
DomainFrontingIP: conf.GetDomainFrontingIP(nil),
256256
DomainFrontingProxyProtocol: conf.GetDomainFrontingProxyProtocol(false),
257257
PreferIP: conf.PreferIP.Get(mtglib.DefaultPreferIP),
258+
AutoUpdate: conf.AutoUpdate.Get(false),
258259

259260
AllowFallbackOnUnknownDC: conf.AllowFallbackOnUnknownDC.Get(false),
260261
TolerateTimeSkewness: conf.TolerateTimeSkewness.Value,

internal/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type Config struct {
2828
BindTo TypeHostPort `json:"bindTo"`
2929
ProxyProtocolListener TypeBool `json:"proxyProtocolListener"`
3030
PreferIP TypePreferIP `json:"preferIp"`
31+
AutoUpdate TypeBool `json:"autoUpdate"`
3132
DomainFrontingPort TypePort `json:"domainFrontingPort"`
3233
DomainFrontingIP TypeIP `json:"domainFrontingIp"`
3334
DomainFrontingProxyProtocol TypeBool `json:"domainFrontingProxyProtocol"`

internal/config/parse.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type tomlConfig struct {
1515
BindTo string `toml:"bind-to" json:"bindTo"`
1616
ProxyProtocolListener bool `toml:"proxy-protocol-listener" json:"proxyProtocolListener"`
1717
PreferIP string `toml:"prefer-ip" json:"preferIp,omitempty"`
18+
AutoUpdate bool `toml:"auto-update" json:"autoUpdate,omitempty"`
1819
DomainFrontingPort uint `toml:"domain-fronting-port" json:"domainFrontingPort,omitempty"`
1920
DomainFrontingIP string `toml:"domain-fronting-ip" json:"domainFrontingIp,omitempty"`
2021
DomainFrontingProxyProtocol bool `toml:"domain-fronting-proxy-protocol" json:"domainFrontingProxyProtocol,omitempty"`

mise.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ backend = "aqua:golangci/golangci-lint"
3333
"platforms.windows-x64" = { checksum = "sha256:c60c87695e79db8e320f0e5be885059859de52bb5ee5f11be5577828570bc2a3", url = "https://github.com/golangci/golangci-lint/releases/download/v2.10.1/golangci-lint-2.10.1-windows-amd64.zip"}
3434

3535
[[tools.goreleaser]]
36-
version = "2.13.3"
36+
version = "2.14.1"
3737
backend = "aqua:goreleaser/goreleaser"
38-
"platforms.linux-arm64" = { checksum = "sha256:156656d0f874542d618568bd50afd3d33ced2e8aab2c60cc7c21e1b9fa52031e", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.13.3/goreleaser_Linux_arm64.tar.gz"}
39-
"platforms.linux-x64" = { checksum = "sha256:4b66f2f78f78561330350651ade557b70328664718490f37834749073af21d20", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.13.3/goreleaser_Linux_x86_64.tar.gz"}
40-
"platforms.macos-arm64" = { checksum = "sha256:5516c37779efb3935d5b213cda3b0b9025ae94ddbcb51df6919acbcdef4194b0", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.13.3/goreleaser_Darwin_all.tar.gz"}
41-
"platforms.macos-x64" = { checksum = "sha256:5516c37779efb3935d5b213cda3b0b9025ae94ddbcb51df6919acbcdef4194b0", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.13.3/goreleaser_Darwin_all.tar.gz"}
42-
"platforms.windows-x64" = { checksum = "sha256:c5586c4ed749ca358ad61ed73ee4b8039cfa68daae8c23e69fb086d549dfb31d", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.13.3/goreleaser_Windows_x86_64.zip"}
38+
"platforms.linux-arm64" = { checksum = "sha256:a84d3b27f052c12ad5c8342d7caf1450a7174a305730aed21d72db09301e49a5", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.14.1/goreleaser_Linux_arm64.tar.gz"}
39+
"platforms.linux-x64" = { checksum = "sha256:2df975a7acbfdeaf888d596cab0024d48ec7fb7d747e1d08b90948b791f40a5f", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.14.1/goreleaser_Linux_x86_64.tar.gz"}
40+
"platforms.macos-arm64" = { checksum = "sha256:9f2e47f847b4f4177376fc6aa6914fbc7f673f59720076747e738b578c2e896e", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.14.1/goreleaser_Darwin_all.tar.gz"}
41+
"platforms.macos-x64" = { checksum = "sha256:9f2e47f847b4f4177376fc6aa6914fbc7f673f59720076747e738b578c2e896e", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.14.1/goreleaser_Darwin_all.tar.gz"}
42+
"platforms.windows-x64" = { checksum = "sha256:d7a3d8ba795e97ab8c4f8003630d300da164adf21fde5a4049440c20f15c3137", url = "https://github.com/goreleaser/goreleaser/releases/download/v2.14.1/goreleaser_Windows_x86_64.zip"}

mtglib/internal/dc/init.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ var defaultDCAddrSet = dcAddrSet{
5757
5: {
5858
{Network: "tcp4", Address: "149.154.171.5:443"},
5959
},
60+
203: {
61+
{Network: "tcp4", Address: "91.105.192.100:443"},
62+
},
6063
},
6164
v6: map[int][]Addr{
6265
1: {
@@ -74,5 +77,8 @@ var defaultDCAddrSet = dcAddrSet{
7477
5: {
7578
{Network: "tcp6", Address: "[2001:b28:f23f:f005::a]:443"},
7679
},
80+
203: {
81+
{Network: "tcp6", Address: "[2a0a:f280:0203:000a:5000:0000:0000:0100]:443"},
82+
},
7783
},
7884
}

mtglib/internal/dc/updater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (u *updater) run(ctx context.Context, callback func() error) {
3232
for {
3333
u.logger.Info("start update")
3434
if err := callback(); err != nil {
35-
u.logger.WarningError("cannot update: %w", err)
35+
u.logger.WarningError("cannot update", err)
3636
}
3737
u.logger.Info("updated")
3838

0 commit comments

Comments
 (0)