Bug 233908 - [NEW PORT] net/mtg: Community implementation of TMProto Proxy for Telegram
Summary: [NEW PORT] net/mtg: Community implementation of TMProto Proxy for Telegram
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL: https://github.com/9seconds/mtg
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2018-12-10 11:46 UTC by Anton
Modified: 2026-03-03 18:50 UTC (History)
7 users (show)

See Also:


Attachments
Diff with the port (4.69 KB, patch)
2018-12-10 11:46 UTC, Anton
no flags Details | Diff
Diff with the port (4.76 KB, patch)
2018-12-24 10:36 UTC, Anton
no flags Details | Diff
mtg.patch (15.93 KB, patch)
2022-02-22 21:32 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (15.93 KB, patch)
2022-02-23 09:01 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (15.92 KB, patch)
2022-03-23 09:35 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (4.99 KB, patch)
2023-01-10 19:37 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (4.77 KB, patch)
2025-03-10 07:35 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (4.95 KB, patch)
2026-02-18 20:04 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (4.97 KB, patch)
2026-02-20 13:52 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (4.97 KB, patch)
2026-02-27 09:59 UTC, Boris Korzun
no flags Details | Diff
mtg.patch (4.97 KB, patch)
2026-03-03 18:50 UTC, Boris Korzun
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton 2018-12-10 11:46:21 UTC
Created attachment 200006 [details]
Diff with the port

New port net/mtg.
That application is created by community, pure Golang implementation of MTProto Proxy for Telegram messenger which helps people to use it in case of original servers of Telegram is blocked by someone.

Source: https://github.com/9seconds/mtg
Comment 1 Nathan 2018-12-10 23:13:47 UTC
Comment on attachment 200006 [details]
Diff with the port

COMMENT=    Mtg is a Golang implementation of MTProto proxy server for Telegram
Don't include port name in comment

I haven't looked at the source, but if it has a license file, needs to be put in LICENSE_FILE=
Comment 2 Anton 2018-12-24 10:36:03 UTC
Created attachment 200439 [details]
Diff with the port

Description is updated, LICENSE_FILE added.
Comment 3 Tobias Kortkamp freebsd_committer freebsd_triage 2019-01-28 10:36:44 UTC
I'm sorry, but I'm rejecting this.  The port opens network connections
during the build which our package building tool Poudriere doesn't
allow.  If you can fix this please reopen.  Look at some Go ports
on how they build themselves for inspiration for example devel/grv.
Comment 4 Boris Korzun 2022-02-22 21:32:10 UTC
Created attachment 232019 [details]
mtg.patch

(In reply to Tobias Kortkamp from comment #3)

Updated version of the port in the attachment. The port hasn't opened network connections during the build anymore.
Comment 5 Anton 2022-02-23 08:52:29 UTC
Reopen it in case Boris Korzun will maintain it in future. Unfortunately I have no resources and needs to do that.
Comment 6 Boris Korzun 2022-02-23 09:01:16 UTC
Created attachment 232034 [details]
mtg.patch

(In reply to Anton from comment #5)

Ok. I can take a maintainership.
Comment 7 Boris Korzun 2022-03-23 09:35:56 UTC
Created attachment 232652 [details]
mtg.patch

Updated to 2.1.6.
Comment 8 Boris Korzun 2023-01-10 19:37:56 UTC
Created attachment 239386 [details]
mtg.patch

Update to 2.1.7
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2025-03-10 05:10:10 UTC
^Triage: maintainer-feedback has no relevance for new ports.
Comment 10 Boris Korzun 2025-03-10 07:35:07 UTC
Created attachment 258526 [details]
mtg.patch
Comment 11 Daniel Engberg freebsd_committer freebsd_triage 2025-07-05 18:48:00 UTC
Returning this to the pool to let someone else decide
Comment 12 Andrey Khlebutin 2026-02-18 13:11:50 UTC
(In reply to Boris Korzun from comment #10)
Hello, Boris.

It looks like this string in the rc.d script doesn't work as expected:

command_args="-f -t ${name} ${mtg_syslog_output_flags} -P ${pidfile} %%PREFIX%%/bin/mtg ${mtg_args}"

"service mtg start" does nothing for me (FreeBSD 14.3). No mtg process starts.

This string works fine, so i solved my personal trouble:

command_args="-f -t ${name} ${mtg_syslog_output_flags} -P ${pidfile} /usr/local/bin/mtg ${mtg_args}"

I'm not a ports hacker and can't fix it properly or explain why it happens.

Thanks for your work!
Comment 13 Andrey Khlebutin 2026-02-18 13:19:40 UTC
I'd suggest including the example config file from the original repository as /usr/local/etc/mtg.toml{.example}:

https://github.com/9seconds/mtg/blob/master/example.config.toml

You might also add a default value for:
mtg_args="run /usr/local/etc/mtg.toml"
Comment 14 Andrey Khlebutin 2026-02-18 13:36:17 UTC
The fact that nobody has committed this really simple port for 7 years is a shame.

This port is extremely useful for countries with restricted Internet access. It's not just "a proxy" - it's the ability to communicate despite restrictions, feeling much more like a VPN solution.

So, guys, could you please review and commit the port?

Thanks in advance.
Comment 15 Boris Korzun 2026-02-18 20:04:51 UTC
Created attachment 268170 [details]
mtg.patch

Update to 2.1.9, also added sample config.

(In reply to Andrey Khlebutin from comment #12)
> It looks like this string in the rc.d script doesn't work as expected
I've tested on FreeBSD 14-stable, but haven't faced with the trouble. Have you tested by `make port install`?

(In reply to Andrey Khlebutin from comment #13)
> I'd suggest including the example config file from the original repository
Ok, added.

Please check the patch.
Comment 16 Andrey Khlebutin 2026-02-19 10:50:18 UTC
(In reply to Boris Korzun from comment #15)
It looks like it was my fault - everything works fine now!

Thank you!
Comment 17 Andrey Khlebutin 2026-02-20 12:17:43 UTC
(In reply to Boris Korzun from comment #15)
It looks like there's a typo in the rc.d/mtg script:
> # mtg_syslog_enable (string):		Set to YES to enable syslog output

but the "mtg_syslog_output_enable" variable is checked later:
> if checkyesno mtg_syslog_output_enable; then
> ...
Comment 18 Boris Korzun 2026-02-20 13:52:06 UTC
Created attachment 268208 [details]
mtg.patch

Update to 2.1.10

(In reply to Andrey Khlebutin from comment #17)
Yep, it's just a typo in a comment. Fixed. Thx.
Comment 19 Boris Korzun 2026-02-27 09:59:26 UTC
Created attachment 268396 [details]
mtg.patch

Updated to 2.1.12.
Comment 20 Ivan 2026-02-28 19:48:30 UTC
Looking forward to seeing this port in pkgs. There is an update 2.1.13 in the upstream
Comment 21 Boris Korzun 2026-03-03 18:50:36 UTC
Created attachment 268510 [details]
mtg.patch

(In reply to Ivan from comment #20)

Updated to 2.1.13