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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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