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.

.mise.toml 2.6KB

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