Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. [tools]
  2. "go:golang.org/x/pkgsite/cmd/pkgsite" = "latest"
  3. "go:golang.org/x/tools/gopls" = "latest"
  4. "go:golang.org/x/vuln/cmd/govulncheck" = "latest"
  5. "go:mvdan.cc/gofumpt" = "latest"
  6. go = "latest"
  7. golangci-lint = "latest"
  8. goreleaser = "latest"
  9. [vars]
  10. fuzzflags = "-fuzztime=120s"
  11. [tasks.build]
  12. description = "Build binary"
  13. sources = ["**/*.go", "go.mod", "go.sum"]
  14. outputs = ["mtg"]
  15. run = "go build"
  16. [tasks.update]
  17. description = "Update dependencies"
  18. run = [
  19. "go get -u",
  20. "go mod tidy -go=1.26"
  21. ]
  22. [tasks.lint]
  23. description = "Run linter"
  24. run = "golangci-lint run"
  25. [tasks.vuln]
  26. description = "Test for vulnerabilities"
  27. run = "govulncheck ./..."
  28. [tasks.test]
  29. description = "Run tests"
  30. run = "go test -v -race ./..."
  31. [tasks.covtest]
  32. description = "Run tests with code coverage"
  33. run = "go test -coverprofile=coverage.txt -covermode=atomic -count=2 -race -v ./..."
  34. [tasks.test-all]
  35. description = "Run all tests"
  36. depends = [
  37. "test",
  38. "test:fuzz:*"
  39. ]
  40. [tasks."test:fuzz:client-hello"]
  41. description = "Run fuzzy test for ClientHello"
  42. run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzReadClientHello ./mtglib/internal/tls/fake"
  43. [tasks."test:fuzz:client-handshake"]
  44. description = "Run fuzzy test for ClientHandshake"
  45. run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzClientServerHandshake ./mtglib/internal/obfuscation"
  46. [tasks."test:fuzz:server-handshake-frame"]
  47. description = "Run fuzzy test for GenerateHandshakeFrame"
  48. run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzGenerateHandshakeFrame ./mtglib/internal/obfuscation"
  49. [tasks.static]
  50. description = "Build static binary"
  51. sources = ["**/*.go", "go.mod", "go.sum"]
  52. outputs = ["mtg"]
  53. run = """
  54. #!/bin/bash
  55. version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)"
  56. go build \
  57. -trimpath \
  58. -mod=readonly \
  59. -ldflags="-extldflags '-static' -s -w -X 'main.version=$version'" \
  60. -a \
  61. -tags netgo
  62. """
  63. [tasks.release]
  64. description = "Create release tarballs"
  65. sources = ["**/*.go", "go.mod", "go.sum", ".goreleaser.yml"]
  66. run = [
  67. "goreleaser --snapshot --clean",
  68. "find dist -depth 1 -type d | xargs -r rm -r",
  69. "rm ./dist/config.yaml"
  70. ]
  71. [tasks.image]
  72. description = "Build docker image"
  73. sources = ["**/*.go", "go.mod", "go.sum", "Dockerfile"]
  74. run = "docker buildx build --pull -t mtg ."
  75. [tasks.docs]
  76. description = "Run doc server"
  77. run = "pkgsite -http 0.0.0.0:10000"
  78. [tasks.fmt]
  79. description = "Reformat source code"
  80. sources = ["**/*.go"]
  81. run = "gofumpt -w --extra ."