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
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

.mise.toml 2.7KB

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