Commit Graph

1721 Commits

Author SHA1 Message Date
Pavel Punsky
94fcfadce1
[BREAKING] Reverse SOFTWARE_ATTRIBUTE_OPT to avoid inverse logic (#1598)
As part of looking at #1588 , I figured that sending `SOFTWARE`
attribute is also part of a problem as it increases messages sent out by
coturn and thus increasing amplification factor. For 4.6.2, the
additional size is 24 bytes (4 bytes attribute header, and 20 bytes for
"Coturn-4.6.2 'Gorst'")

If we are to use an example from #1588, "A 62 byte request will be met
with Coturn’s 401 Unauthorized response which is 150 bytes, a factor of
~2.42." - without SOFTWARE the response will be 126 bytes which reduces
amplification factor to ~2.

As I observed with multiple providers using coturn - some of the are
sending it. Meaning, they do not set `--no-software-attribute` - most
probably due to lack of clarity about this setting.

I believe sending SOFTWARE_ATTRIBUTE should be off by default which is
hinted in the RFC
(https://datatracker.ietf.org/doc/html/rfc8489#section-16.1.2)

Detailed changes:
- Extract setting the attribute into a function to avoid code
duplication
- This option is now not reloadable
- The option is now called `software_attribute` because inverse logic
creates multiple double-not in the code which makes it harder to read.
- `no-software_attribute` is still functional but marked as deprecated
in documentation

Test Plan:
- Run local tests with different cli arguments (new and deprecated) and
confirm SOFTWARE attribute is off by default, and added when arguments
say so
2024-12-13 09:28:45 -08:00
tyranron
a6b052c570
Upgrade Docker image to 4.6.3 Coturn version 2024-12-11 19:33:47 +01:00
Kai Ren
adae3dda3e
Refactor CI workflows and fix failures due to Node.js 20 (#1610, actions/checkout#1809) 2024-12-11 19:27:05 +01:00
Pavel Punsky
b6e53ca4c9
Update version to 4.6.3 (#1609)
preparing for new tag 4.6.3

---------

Co-authored-by: tyranron <tyranron@gmail.com>
2024-12-11 10:13:38 -08:00
Pavel Punsky
329cda4715
Fix cmake and prometheus test build jobs (#1608)
Some actions do not build with prometheus - adding prometheus tests
fails the jobs
cmake build tests did not run due to different target folder (while
reporting success) - now the bin folder is detected
2024-12-10 19:38:39 -08:00
Alex Gustafsson
d63704c72d
Implement custom prometheus http handler (#1591)
Implement a custom prometheus http handler in order to:

1. Support listening on a specified address as opposed to any
2. Remove the requirement on the unmaintained promhttp library

This feature comes with one limitation: if an IPv4 address is used, the
server will not listen on the IPv6-mapped address, even if IPv6 is
available. That is, dual-stacking does not work.

Solves: #1475

---------

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2024-12-10 10:28:43 -08:00
tyranron
8f9c87075b
Upgrade Alpine to 3.21 version in Docker image 2024-12-06 19:10:33 +01:00
tyranron
817bbd1bea
Update Debian "bookworm" to 20241202 snapshot in Docker image 2024-12-05 12:28:33 +01:00
Robert Silén
f6004a1c18
Add MariaDB support to README.md (#1601)
Suggesting to add MariaDB to README - any reason not to?
2024-11-21 14:13:36 -08:00
maddy
c4a954a7fc
Allow authenticating with a username to redis (#1488)
Add ability to authenticate to redis with a password (and optionally username for redis 6.0)

Tested by building and using with redis on old and new versionss
2024-11-18 16:51:02 -08:00
hariprasadt
e5ffe6e0a3
Easy installation of coturn on AWS (#1581)
https://github.com/coturn/coturn/issues/1576

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2024-11-18 09:00:08 -08:00
Chai-Shi
268f811f9e
Add prometheus setting suggestions on turn.conf in example folder (#1597)
I believe that many users, like myself, prefer to reference the
`turn.conf` file when deploying the TURN server with Docker, rather than
the `Readme.turnserver`. Additionally, I think it's important to
synchronize the Prometheus settings from the README into the` turn.conf`
file for better clarity. This way, users won't overlook any essential
options.

Co-authored-by: Ben Chang <ben_chang@htc.com>
2024-11-17 19:49:10 -08:00
Pavel Punsky
4c2a2d568f
Install openssl-1.1.1 on amazonlinux:2 instead of openssl-1.0.1 (#1595)
In preparation to deprecation of openssl below version 1.1.1 switch to
using openssl-1.1.1 on amazonlinux:2 (where 1.0.2 is the default)

Fixes build issue for #1397
2024-11-14 16:59:31 -08:00
tyranron
f8c5695827
Update Debian "bookworm" to 20241111 snapshot in Docker image 2024-11-13 12:17:07 +01:00
Scott Godin
edcdfc8b02
Add new Drain feature (#1529)
Add new Drain feature

-when coturn server is in drain mode
  -current allocations will continue to work as usual
  -new allocations will be rejected with a 403 (Forbidden) response
  -when all allocations go away, then coturn will shutdown
-Enable drain mode with either
  -signaling SIGUSR1
  -turn_admin_server "drain" CLI command

This contribution is from Wire. https://wire.com/
2024-10-27 18:56:58 -07:00
tyranron
8e3a03d2da
Update Debian "bookworm" to 20241016 snapshot in Docker image 2024-10-21 10:47:11 +02:00
Michael Jones
af4c44a818
Additional refactoring of ns_turn_allocation.* to address security scanner concerns (#1514)
You can see the list here:
https://github.com/coturn/coturn/security/code-scanning

In this case, i'm attempting to address:

ns_turn_allocation.c:725 -- Dereferencing NULL pointer. 'ub->bufs'
contains the same NULL value as 'realloc()' did.
ns_turn_allocation.c:724 -- 'realloc' might return null pointer:
assigning null pointer to 'ub->bufs', which is passed as an argument to
'realloc', will cause the original memory block to be leaked.
ns_turn_allocation.c:604 -- Dereferencing NULL pointer. 'a->tcs.elems'
contains the same NULL value as 'realloc()' did.
    ns_turn_allocation.c:582 -- Dereferencing NULL pointer 'tc'.
ns_turn_allocation.c:603 -- 'realloc' might return null pointer:
assigning null pointer to 'a->tcs.elems', which is passed as an argument
to 'realloc', will cause the original memory block to be leaked.
    ns_turn_allocation.c:525 -- Using uninitialized memory '*chi'.
    ns_turn_allocation.c:229 -- Using uninitialized memory '*slot'.

---------

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2024-10-18 20:54:47 -07:00
redraincatching
08480ce137
fixed linting error in mainrelay.c (#1558)
fixed a formatting problem causing issues with `clang-format` in the
linting action
see
[here](https://github.com/redraincatching/coturn/actions/runs/10262259860)
for an example
2024-10-04 10:29:22 -07:00
eakraly
86a8f659fb
Fix rpm version scripts (#1556)
Fix #1521
2024-10-04 10:28:11 -07:00
Sven Tennie
cbb04aa9a2
Delete dead code (#1563)
`stun_port` isn't read after setting it. Thus, we can remove it.
2024-10-04 10:27:31 -07:00
Mészáros Mihály
e78d8f4fae
Fix cli auth (#1578)
Fix to avoid accept all password except the right cli_password

Co-authored-by: Mészáros Mihály <misi@eper.majd.eu>
2024-10-04 10:26:17 -07:00
tyranron
775d8fbf70
Update Debian "bookworm" to 20240926 snapshot in Docker image 2024-09-30 16:17:57 +03:00
tyranron
bc39021cd7
Update Alpine to 3.20.3 version in Docker image to fix CVE-2024-6119 2024-09-09 12:35:02 +03:00
tyranron
24346a4542
Update Debian "bookworm" to 20240904 snapshot in Docker image 2024-09-06 15:23:11 +03:00
Michael Jones
b523616b1f
Use bool, instead of int, for the functions in ns_turn_msg.c (#1553)
And address knockon effects in other files, e.g. adjust if-statements
and other function parameters and return types.
2024-08-23 17:49:14 -07:00
Pavel Punsky
858b088a88
Reformat code (#1557)
Reformat to address linter error
2024-08-21 15:42:18 -07:00
tyranron
8976c989c8
Update Debian "bookworm" to 20240812 snapshot in Docker image 2024-08-19 13:58:56 +03:00
Sergey Radionov
7711c43525
configure: data files shouldn't be executable (#1542)
for example it creates `/etc/turnserver.conf.default` as executable,
which is strange...
2024-08-05 22:04:27 -07:00
Michael Jones
eee52ad1b9
Update libtelnet (#1545)
to commit
5f5ecee776

Which is the lastest commit in the "develop" branch. 

This seems to fix a couple of places where non-0 is mistakenly returned
as "success" -- why projects don't use bool for these return types is
beyond my understanding.
2024-08-04 17:33:33 -07:00
Michael Jones
958f70d5c2
Use calloc where appropriate, avoid memset when normal buffer initialization works (#1550)
Depends on https://github.com/coturn/coturn/pull/1547
2024-08-04 17:30:58 -07:00
Michael Jones
c4da2a8ea4
Fix make lint (#1547) 2024-08-04 17:21:34 -07:00
Michael Jones
5fa67a65f5
Fix compiler warnings from continuous integration (#1555)
Almost all of the warnings were about truncating pointers, because
sizeof(void*) != sizeof(long) on all platforms.
2024-08-04 15:44:15 -07:00
Michael Jones
ba0ea42914
Fix nodejs/glibc problem with old container images. (#1548)
This problem is caused by this issue:
https://github.com/actions/checkout/issues/1809

Several comments include documentation on various environment variables
to force it to use the older nodejs release still, but probably those
various workarounds will stop working eventually.
2024-08-04 15:40:17 -07:00
David Smitmanis
1f74024a30
windows: Only attempt to bind when the network interface is up (#1527)
Previously if the system had an interface with a static IP configured,
coturn would attempt to bind to that address, even if the interface was
down. This would fail, and prevent coturn from starting (even if there
were other usable interfaces)
2024-07-26 22:22:25 -07:00
tyranron
00ce90cee0
Update Alpine to 3.20.2 version to fix CVE-2024-5535 in Docker image 2024-07-26 13:10:14 +03:00
tyranron
7afa4e9ac9
Update Debian "bookworm" to 20240722 snapshot in Docker image 2024-07-26 12:39:52 +03:00
Pavel Punsky
c7d431a36a
Memset user_db before reading conf file, not after (#1537)
Fixes #1533 and #1534

Memsetting `turn_params.default_users_db` before reading conf file, not
after.
Because auth is read in first iteration so secret was wiped out.

# test plan
Add new test script that uses config file to setup turnserver instead of
cli arguments and confirm it works (fails without the change)
2024-07-14 16:59:26 -07:00
tyranron
d541f56613
Update Debian "bookworm" to 20240701 snapshot in Docker image 2024-07-03 11:50:59 +03:00
tyranron
fbe07c4a16
Update Alpine to 3.20.1 version to fix CVE-2024-4741, CVE-2023-42364 and CVE-2023-42365 in Docker image 2024-06-21 07:19:38 +02:00
redraincatching
295b9cfe1a
added support for amazon linux and renamed tests.yml (#1401)
superseding changes made in pr
https://github.com/coturn/coturn/pull/1394 on request of @jonesmz

dependent on pr https://github.com/coturn/coturn/pull/1399 - uses the
composite action for dependency installation i wrote there

added YAML file for amazon linux and renames tests.yml to
ubuntu_tests.yml for clarity
2024-06-16 18:18:50 -07:00
tyranron
0868999b5c
Update Debian "bookworm" to 20240612 snapshot in Docker image 2024-06-13 14:07:26 +02:00
Michael Jones
c3d235b6e9
Check the result of malloc in send_message_to_redis (#1515) 2024-06-02 16:36:27 -07:00
Michael Jones
0de3bda383
Check the result of malloc in mongo_set_realm_option_one (#1516) 2024-06-02 16:35:37 -07:00
Michael Jones
a394fb1cee
Simplify workflow for codeql (#1517) 2024-06-02 16:34:29 -07:00
Michael Jones
868f15a672
Move the hiredis_libevent2 code from common to relay (#1509)
The point of this change is to make the build instructions a bit more
straight forward. Since the hiresevent2 source files are only ever used
by the relay target, this scoping makes sense in general.
2024-06-01 18:16:39 -07:00
Michael Jones
d1db5e590d
Include what you use (#1512)
Use the include-what-you-use program to (partially) clean up header
includes, so that only includes which are needed, and no includes that
are not needed (or at least closer to that ideal) are done.

For a c-language project, the build-time improvements from this change
is minimal. This would have a much bigger impact on a C++ project than a
C-project for build times.

So for coturn, this change is mostly intended to just provide
consistency and make it easier to locate weird issues like strange
dependencies, and unnecessary connections between code.
2024-06-01 18:13:08 -07:00
Michael Jones
ebf7587aaf
Remove deprecated macos-11, add macos-13 and macos-14 (#1511) 2024-06-01 18:10:55 -07:00
Michael Jones
e45d846331
Check the result of malloc in string_list_add (#1495) 2024-05-29 20:49:54 -07:00
Michael Jones
35a3293531
Check the result of realloc and calloc in ch_map_get (#1497) 2024-05-29 20:48:46 -07:00
Michael Jones
66a85ef09e
Address clang-tidy warnings in db files (#1405)
The general approach here was:

- Always declare variables as close to where they are defined as
possible.
- Check for pre-conditions of functions before doing work (e.g. ensure
we can connect to the DB before doing a bunch of string formatting)
- Keep the scope of mutexes as reasonably small as practical.
- Use idiomatic C11, such as for-loops over the thing being iterated,
not while() loops over constants, or variables that aren't modified.
- Prefer if(fail){return} function-body after over `if(not fail){
function-body inside if} return;

Clang-tidy returns a clean bill of health, but while going through this
file i noticed a lot of things that raise questions.

Lack of checking column counts. Lack of handling the possibility of
multiple return values. Questionably handling of strings. Complete lack
of checking function inputs for invalid values (e.g. nullptr).

I'm not going to fix those, my organization doesn't USE the DB drivers,
so i have little interest in re-working the logic beyond addressing
clang-tidy warnings for my own sanity, but i did add TODO comments for
someone else to look at in the future.



Additional note: While the changes look very invasive.... they aren't.

I don't think there is a way to get github to ignore whitespace in the
filediff, but if someone were to compare the commit locally, they'll see
that almost all of the changes are just adjusting indentation.
2024-05-29 20:44:23 -07:00