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.3KB

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