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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

.mise.toml 2.3KB

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