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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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=FuzzClientHandshake ./mtglib/internal/obfuscated2"
  42. [tasks."test:fuzz:server-generate-handshake-frame"]
  43. description = "Run fuzzy test for ServerGenerateHandshakeFrame"
  44. run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerGenerateHandshakeFrame ./mtglib/internal/obfuscated2"
  45. [tasks."test:fuzz:server-receive"]
  46. description = "Run fuzzy test for ServerReceive"
  47. run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerReceive ./mtglib/internal/obfuscated2"
  48. [tasks."test:fuzz:server-send"]
  49. description = "Run fuzzy test for ServerSend"
  50. run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerSend ./mtglib/internal/obfuscated2"
  51. [tasks.static]
  52. description = "Build static binary"
  53. sources = ["**/*.go", "go.mod", "go.sum"]
  54. outputs = ["mtg"]
  55. run = """
  56. #!/bin/bash
  57. version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)"
  58. go build \
  59. -trimpath \
  60. -mod=readonly \
  61. -ldflags="-extldflags '-static' -s -w -X 'main.version=$version'" \
  62. -a \
  63. -tags netgo
  64. """
  65. [tasks.release]
  66. description = "Create release tarballs"
  67. sources = ["**/*.go", "go.mod", "go.sum", ".goreleaser.yml"]
  68. run = [
  69. "goreleaser --snapshot --clean",
  70. "find dist -depth 1 -type d | xargs -r rm -r",
  71. "rm ./dist/config.yaml"
  72. ]
  73. [tasks.image]
  74. description = "Build docker image"
  75. sources = ["**/*.go", "go.mod", "go.sum", "Dockerfile"]
  76. run = "docker buildx build --pull -t mtg ."
  77. [tasks.docs]
  78. description = "Run doc server"
  79. run = "pkgsite -http 0.0.0.0:10000"
  80. [tasks.fmt]
  81. description = "Reformat source code"
  82. sources = ["**/*.go"]
  83. run = "gofumpt -w --extra ."