Bug 275114 - [NEW PORT] net/eturnal: Modern STUN and TURN server written in erlang
Summary: [NEW PORT] net/eturnal: Modern STUN and TURN server written in erlang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dave Cottlehuber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 18:02 UTC by yzrh
Modified: 2024-01-04 23:37 UTC (History)
4 users (show)

See Also:


Attachments
eturnal 1.12.0 (15.70 KB, patch)
2023-11-15 18:02 UTC, yzrh
no flags Details | Diff
testport log (18.71 KB, text/plain)
2023-11-15 18:02 UTC, yzrh
no flags Details
pet patch a bit (15.95 KB, patch)
2024-01-04 23:19 UTC, Dave Cottlehuber
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description yzrh 2023-11-15 18:02:04 UTC
Created attachment 246339 [details]
eturnal 1.12.0

I have never worked with Rebar3.  Coming from C, erlang and nodejs are
rather painful to port (build).  It is necessary to override do-install,
Mk scripts in ports are not copying other erlang libraries.  The ugly hack
about erts_dir is due to Rebar3 generating incorrect shell script.

Upstream acknowledged the many problems with Rebar3:
https://github.com/processone/eturnal/blob/master/doc/PACKAGING.md

If an Rebar3 (erlang) expert shows up, please let me know the changes needed
to get it committed.  Many thanks.
Comment 1 yzrh 2023-11-15 18:02:33 UTC
Created attachment 246340 [details]
testport log
Comment 2 Mina Galić freebsd_triage 2023-11-15 18:11:57 UTC
putting erlang@ in cc, they might have some input
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2023-11-17 20:26:19 UTC
Out of curiosity, how does this compare to net/turnserver (coturn) and why would you choose one over the other?
Comment 4 yzrh 2023-11-18 12:04:17 UTC
It shares the same TURN library with ejabberd.  The focus is the current
WebRTC (and other real time communication) applications.  As such,
it is easier to configure than coturn -- just change the shared
secret (if behind NAT, supply external address).
Unlike coturn, it does not support any user database (other than a 
static user table).  Simply because RTC does not make use of any user database,
but ephemeral accounts created with a shared secret.

The short version:
        * eturnal is the lightweight solution for a very common use case (real time communication).
        * Erlang means low latency.
        * Fewer dependencies (features) than coturn.
        * Users won't ask how to enable REST (like https://github.com/coturn/coturn/issues/1275) :)
Comment 5 Dave Cottlehuber freebsd_committer freebsd_triage 2024-01-04 23:19:50 UTC
Created attachment 247449 [details]
pet patch a bit

thanks for your contribution! I made a few minor changes:

- complied with portclippy & portfmt
- sorted pkg-plist in en_US.UTF-8 locale
- use `' -exec ${STRIP_CMD} {} +`
- add net/Makefile change

Normally in erlang world, tools like rebar3 will create a full self-contained
release, including the erts runtime, and ports tree would bundle all of that
"as is". This simplifies some things (dependencies just work), and complicates
others (respecting hier(7) can be quite hard work). This is using
`{include_erts, true}` in rebar.config, currently not the default.

It might be easier to submit an upstream patch to address these in the Makefile
for next time?
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-01-04 23:26:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=51829949294f2fc73e7efc24bd0595bc083971a0

commit 51829949294f2fc73e7efc24bd0595bc083971a0
Author:     Dave Cottlehuber <dch@FreeBSD.org>
AuthorDate: 2024-01-04 23:25:10 +0000
Commit:     Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2024-01-04 23:25:10 +0000

    net/eturnal: erlang-based TURN server (new port)

    - appease portclippy
    - sort pkg-plist

    PR:             275114
    Sponsored by:   SkunkWerks, GmbH

 GIDs                                             |   2 +-
 UIDs                                             |   2 +-
 net/Makefile                                     |   1 +
 net/eturnal/Makefile (new)                       |  90 +++++++++++++++++++
 net/eturnal/distinfo (new)                       |  33 +++++++
 net/eturnal/files/eturnal.in (new)               |  78 +++++++++++++++++
 net/eturnal/files/patch-config_eturnal.yml (new) |  13 +++
 net/eturnal/pkg-descr (new)                      |   5 ++
 net/eturnal/pkg-plist (new)                      | 107 +++++++++++++++++++++++
 9 files changed, 329 insertions(+), 2 deletions(-)