Bug 294300 - net/mtg: update to 2.2.8
Summary: net/mtg: update to 2.2.8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Yusuf Yaman
URL: https://github.com/9seconds/mtg/relea...
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-07 11:39 UTC by Oleg Streejak
Modified: 2026-04-10 20:47 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (drtr0jan)
osa: maintainer-feedback+
nxjoseph: merge-quarterly+


Attachments
upgrade patch (1.10 KB, patch)
2026-04-07 11:39 UTC, Oleg Streejak
no flags Details | Diff
patch to 2.2.8 (1.10 KB, patch)
2026-04-07 19:04 UTC, Oleg Streejak
no flags Details | Diff
mtg.patch (3.42 KB, patch)
2026-04-08 13:57 UTC, Boris Korzun
drtr0jan: maintainer-approval+
Details | Diff
0001-net-mtg-Update-2.2.6-2.2.8.patch (4.03 KB, patch)
2026-04-08 15:27 UTC, Yusuf Yaman
no flags Details | Diff
mtg.patch (3.57 KB, patch)
2026-04-08 22:09 UTC, Boris Korzun
drtr0jan: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Streejak 2026-04-07 11:39:42 UTC
Created attachment 269453 [details]
upgrade patch

Hi all,
please upgrade to 2.2.7

changelog: https://github.com/9seconds/mtg/releases/tag/v2.2.7

patch's attached
Comment 1 Boris Korzun 2026-04-07 11:43:13 UTC
Hi Oleg, do you need 2.2.7 features?
Comment 2 Oleg Streejak 2026-04-07 11:47:56 UTC
(In reply to Boris Korzun from comment #1)
not actually but does they broke anything? updated & compiled it locally, everything seems to work fine, so's proposed the update to the ports tree. That's the main and only reason.
Comment 3 Boris Korzun 2026-04-07 16:46:32 UTC
2.2.8 has been released. I prepare the patch.
Comment 4 Oleg Streejak 2026-04-07 19:03:36 UTC
(In reply to Boris Korzun from comment #3)
I did the same thing, updated port tree to 2.2.8, compiled & merged my config.toml w/ updated ...sample. Everything works fine as far as I can see.
Comment 5 Oleg Streejak 2026-04-07 19:04:42 UTC
Created attachment 269466 [details]
patch to 2.2.8
Comment 6 Boris Korzun 2026-04-08 13:57:51 UTC
Created attachment 269502 [details]
mtg.patch

Update to 2.2.8

Changelogs:
* https://github.com/9seconds/mtg/releases/tag/v2.2.8
* https://github.com/9seconds/mtg/releases/tag/v2.2.7

Also added default secret auto generation. Also fixed default mtg_args in rc-script.
Comment 7 Yusuf Yaman freebsd_committer freebsd_triage 2026-04-08 15:27:14 UTC
Created attachment 269506 [details]
0001-net-mtg-Update-2.2.6-2.2.8.patch

(In reply to Boris Korzun from comment #6)
Thanks, I have got leftover files error from Poudriere, probably caused by "sed -i .bak".

What about implementing it into mtg.in rc.d file instead?

Can you review my patch and test it? 

For me, running the extra service command "generate_secret" makes it work once, creates a backup .bak file just in case.

It changes the secret in config.toml, saves a backup named .bak.

It also changes the secret in .sample file, but does not make backup of it.

Running it again does not do any change.

I have a bit trouble understanding that two if grep ... conditionals, though...

# grep "secret =" /usr/local/etc/mtg/*
/usr/local/etc/mtg/config.toml:secret = "ee88c31d190bff2a806eb6fd658c53264b73746f726167652e676f6f676c65617069732e636f6d"
/usr/local/etc/mtg/config.toml.bak:secret = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d"
/usr/local/etc/mtg/config.toml.sample:secret = "ee88c31d190bff2a806eb6fd658c53264b73746f726167652e676f6f676c65617069732e636f6d"

Maybe we might also make the service run "generate_secret" extra command in the first run initially for better.

I also did this change below since it takes bool (YES/NO) and not (str).

-# mtg_syslog_output_enable (str):      Set to YES to enable syslog output
+# mtg_syslog_output_enable (bool):     Set to YES to enable syslog output

Also added:

-: ${mtg_enable:=no}
+: ${mtg_enable:="NO"}
+: ${mtg_syslog_output_tag:="mtg"}
+: ${mtg_syslog_output_priority:="notice"}
+: ${mtg_syslog_output_facility:="daemon"}

I don't know if the new last three definitions are required, didn't read daemon(8) :/.

Thanks for the collaboration!
Comment 8 Boris Korzun 2026-04-08 22:09:13 UTC
Created attachment 269519 [details]
mtg.patch

(In reply to Yusuf Yaman from comment #7)
Fixed the poudriere issue. Also fixed rc-script variables description.

It isn't need to specify default values for syslog output variables, like priority, facility, etc. Specified in daemon(8) by default.
Comment 9 Yusuf Yaman freebsd_committer freebsd_triage 2026-04-10 17:12:42 UTC
(In reply to Boris Korzun from comment #8)
I see, okay, that patch looks good.

just for the record, I've noticed some tests that require networking fails in Poudriere.
Comment 10 commit-hook freebsd_committer freebsd_triage 2026-04-10 20:44:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=64b3e5969883b4679b3dc1dda34a1cdf6442ff85

commit 64b3e5969883b4679b3dc1dda34a1cdf6442ff85
Author:     Boris Korzun <drtr0jan@yandex.ru>
AuthorDate: 2026-04-10 20:35:27 +0000
Commit:     Yusuf Yaman <nxjoseph@FreeBSD.org>
CommitDate: 2026-04-10 20:44:08 +0000

    net/mtg: Update 2.2.6 => 2.2.8

    Changelogs:
    * https://github.com/9seconds/mtg/releases/tag/v2.2.7
    * https://github.com/9seconds/mtg/releases/tag/v2.2.8

    Port changes:
    * Add pkg-post-install script to change default secret
      in the configuration file for security purposes.

    PR:             294300
    Reported by:    Oleg Streejak <oleg@pcbtech.ru>
    Approved by:    Boris Korzun <drtr0jan@yandex.ru> (maintainer)
    Approved by:    osa (mentor)
    MFH:            2026Q2

 net/mtg/Makefile               |  7 +++----
 net/mtg/distinfo               | 10 +++++-----
 net/mtg/files/mtg.in           | 12 +++++++-----
 net/mtg/pkg-post-install (new) | 23 +++++++++++++++++++++++
 4 files changed, 38 insertions(+), 14 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2026-04-10 20:45:49 UTC
A commit in branch 2026Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=690e4ccb4b00f3087c30df75d53559bbd5e6ca7b

commit 690e4ccb4b00f3087c30df75d53559bbd5e6ca7b
Author:     Boris Korzun <drtr0jan@yandex.ru>
AuthorDate: 2026-04-10 20:35:27 +0000
Commit:     Yusuf Yaman <nxjoseph@FreeBSD.org>
CommitDate: 2026-04-10 20:44:54 +0000

    net/mtg: Update 2.2.6 => 2.2.8

    Changelogs:
    * https://github.com/9seconds/mtg/releases/tag/v2.2.7
    * https://github.com/9seconds/mtg/releases/tag/v2.2.8

    Port changes:
    * Add pkg-post-install script to change default secret
      in the configuration file for security purposes.

    PR:             294300
    Reported by:    Oleg Streejak <oleg@pcbtech.ru>
    Approved by:    Boris Korzun <drtr0jan@yandex.ru> (maintainer)
    Approved by:    osa (mentor)
    MFH:            2026Q2

    (cherry picked from commit 64b3e5969883b4679b3dc1dda34a1cdf6442ff85)

 net/mtg/Makefile               |  7 +++----
 net/mtg/distinfo               | 10 +++++-----
 net/mtg/files/mtg.in           | 12 +++++++-----
 net/mtg/pkg-post-install (new) | 23 +++++++++++++++++++++++
 4 files changed, 38 insertions(+), 14 deletions(-)
Comment 12 Yusuf Yaman freebsd_committer freebsd_triage 2026-04-10 20:47:00 UTC
Committed, thanks!