View | Details | Raw Unified | Return to bug 233908 | Differences between
and this patch

Collapse All | Expand All

(-)b/net/Makefile (+1 lines)
Lines 479-484 Link Here
479
    SUBDIR += mrtparse
479
    SUBDIR += mrtparse
480
    SUBDIR += msend
480
    SUBDIR += msend
481
    SUBDIR += msoak
481
    SUBDIR += msoak
482
    SUBDIR += mtg
482
    SUBDIR += mtr
483
    SUBDIR += mtr
483
    SUBDIR += mtr-nox11
484
    SUBDIR += mtr-nox11
484
    SUBDIR += multicat
485
    SUBDIR += multicat
(-)b/net/mtg/Makefile (+29 lines)
Added Link Here
1
PORTNAME=	mtg
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	2.1.7
4
CATEGORIES=	net
5
MASTER_SITES=	https://raw.githubusercontent.com/9seconds/mtg/${DISTVERSIONFULL}/
6
DISTFILES=	go.mod
7
8
MAINTAINER=	drtr0jan@yandex.ru
9
COMMENT=	MTPROTO proxy server for Telegram
10
WWW=		https://github.com/9seconds/mtg
11
12
LICENSE=	MIT
13
LICENSE_FILE=	${WRKSRC}/LICENSE
14
15
USES=		go:modules
16
17
USE_GITHUB=	yes
18
GH_ACCOUNT=	9seconds
19
20
USE_RC_SUBR=	${PORTNAME}
21
22
GO_MODULE=	github.com/9seconds/mtg
23
GO_BUILDFLAGS+=	-ldflags "${LD_FLAG_STRING}" -tags netgo
24
25
LD_FLAG_STRING=	-s -w -X main.version=${PORTVERSION}
26
27
PLIST_FILES=	bin/${PORTNAME}
28
29
.include <bsd.port.mk>
(-)b/net/mtg/distinfo (+5 lines)
Added Link Here
1
TIMESTAMP = 1664463122
2
SHA256 (go/net_mtg/9seconds-mtg-v2.1.7_GH0/go.mod) = 98365f0af3c955ca92d77b06dbb737bc20f1f9d8d659f7e0500f5dcc1f9e9a00
3
SIZE (go/net_mtg/9seconds-mtg-v2.1.7_GH0/go.mod) = 2360
4
SHA256 (go/net_mtg/9seconds-mtg-v2.1.7_GH0/9seconds-mtg-v2.1.7_GH0.tar.gz) = 4a1dd8f138ea0bded2cba89e6987dac6adb158b437fd37cbaae3e0c6c06f44a9
5
SIZE (go/net_mtg/9seconds-mtg-v2.1.7_GH0/9seconds-mtg-v2.1.7_GH0.tar.gz) = 114099
(-)b/net/mtg/files/mtg.in (+66 lines)
Added Link Here
1
#!/bin/sh
2
3
# PROVIDE: mtg
4
# REQUIRE: NETWORKING
5
# KEYWORD: shutdown
6
#
7
# Add following lines to /etc/rc.conf to enable the MTG:
8
#
9
# mtg_enable (bool):			Set NO by default
10
#					Set YES to enable daemon
11
# mtg_user (user):			Set user to run mtg.
12
#					Default is "root".
13
# mtg_group (group):			Set group to run mtg.
14
#					Default is "wheel".
15
# mtg_args (str): 			Set flags used with mtg. 
16
#					Default is "". Use `mtg --help` to get instruction.
17
# mtg_syslog_enable (string):		Set to YES to enable syslog output
18
#					Default is "NO". See daemon(8).
19
# mtg_syslog_output_tag (str):		Set syslog tag if syslog enabled.
20
#					Default is "mtg". See daemon(8).
21
# mtg_syslog_output_priority (str):	Set syslog priority if syslog enabled.
22
#					Default is "notice". See daemon(8).
23
# mtg_syslog_output_facility (str):	Set syslog facility if syslog enabled.
24
#					Default is "daemon". See daemon(8).
25
26
. /etc/rc.subr
27
28
name=mtg
29
rcvar=mtg_enable
30
31
load_rc_config $name
32
33
: ${mtg_enable:=no}
34
: ${mtg_user:="root"}
35
: ${mtg_group:="wheel"}
36
: ${mtg_syslog_output_enable:="NO"}
37
38
start_precmd="mtg_prestart"
39
40
if checkyesno mtg_syslog_output_enable; then
41
	if [ -n "${mtg_syslog_output_tag}" ]; then
42
		mtg_syslog_output_flags="-T ${mtg_syslog_output_tag}"
43
	else
44
		mtg_syslog_output_flags="-T ${name}"
45
	fi
46
	if [ -n "${mtg_syslog_output_priority}" ]; then
47
		mtg_syslog_output_flags="${mtg_syslog_output_flags} -s ${mtg_syslog_output_priority}"
48
	fi
49
50
	if [ -n "${mtg_syslog_output_facility}" ]; then
51
		mtg_syslog_output_flags="${mtg_syslog_output_flags} -l ${mtg_syslog_output_facility}"
52
	fi
53
fi
54
55
pidfile="/var/run/${name}.pid"
56
command="/usr/sbin/daemon"
57
command_args="-f -t ${name} ${mtg_syslog_output_flags} -P ${pidfile} %%PREFIX%%/bin/mtg ${mtg_args}"
58
59
mtg_prestart()
60
{
61
	if [ ! -e "${pidfile}" ]; then
62
		install -m 0600 -o "${mtg_user}" -g "${mtg_group}" /dev/null "${pidfile}"
63
	fi
64
}
65
66
run_rc_command "$1"
(-)b/net/mtg/pkg-descr (-1 / +7 lines)
Added Link Here
0
- 
1
Mtg is an implementation of MTProto proxy in golang which is intended to be:
2
3
- Lightweight. It has to consume as less resources as possible but not by losing maintainability.
4
- Easily deployable. I strongly believe that Telegram proxies should follow the way 
5
  of ShadowSocks: promoted channels is a strange way of doing business I suppose.
6
- Single secret. I think that multiple secrets solves no problems and just complexify software.
7
- No management WebUI. This is an implementation of simple lightweight proxy.

Return to bug 233908