1718 Commits

Author SHA1 Message Date
Pavel Punsky
b6e53ca4c9
Update version to 4.6.3 (#1609)
preparing for new tag 4.6.3

---------

Co-authored-by: tyranron <tyranron@gmail.com>
4.6.3
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)
Some checks failed
mingw / build (OFF, Release, windows-latest) (push) Has been cancelled
msvc-analyzer / msvc-analyzer (OFF, Release, x64, v143) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Debug, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Debug, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Release, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Release, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Debug, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Debug, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Release, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Release, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
Docker CI / release (GitHub) (push) Has been cancelled
Docker CI / test (amd64, alpine) (push) Has been cancelled
Docker CI / test (amd64, debian) (push) Has been cancelled
Docker CI / test (arm32v6, alpine) (push) Has been cancelled
Docker CI / test (arm32v6, debian) (push) Has been cancelled
Docker CI / test (arm32v7, alpine) (push) Has been cancelled
Docker CI / test (arm32v7, debian) (push) Has been cancelled
Docker CI / test (arm64v8, alpine) (push) Has been cancelled
Docker CI / test (arm64v8, debian) (push) Has been cancelled
Docker CI / test (i386, alpine) (push) Has been cancelled
Docker CI / test (i386, debian) (push) Has been cancelled
Docker CI / test (ppc64le, alpine) (push) Has been cancelled
Docker CI / test (ppc64le, debian) (push) Has been cancelled
Docker CI / test (s390x, debian) (push) Has been cancelled
Docker CI / push (alpine, docker.io) (push) Has been cancelled
Docker CI / push (alpine, ghcr.io) (push) Has been cancelled
Docker CI / push (alpine, quay.io) (push) Has been cancelled
Docker CI / push (debian, docker.io) (push) Has been cancelled
Docker CI / push (debian, ghcr.io) (push) Has been cancelled
Docker CI / push (debian, quay.io) (push) Has been cancelled
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
Some checks failed
Docker CI / test (amd64, alpine) (push) Has been cancelled
Docker CI / test (amd64, debian) (push) Has been cancelled
Docker CI / test (arm32v6, alpine) (push) Has been cancelled
Docker CI / test (arm32v6, debian) (push) Has been cancelled
Docker CI / test (arm32v7, alpine) (push) Has been cancelled
Docker CI / test (arm32v7, debian) (push) Has been cancelled
Docker CI / test (arm64v8, alpine) (push) Has been cancelled
Docker CI / test (arm64v8, debian) (push) Has been cancelled
Docker CI / test (i386, alpine) (push) Has been cancelled
Docker CI / test (i386, debian) (push) Has been cancelled
mingw / build (OFF, Release, windows-latest) (push) Has been cancelled
msvc-analyzer / msvc-analyzer (OFF, Release, x64, v143) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Debug, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Debug, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Release, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (OFF, Release, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Debug, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Debug, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Release, Win32, v142, windows-latest, x86-windows) (push) Has been cancelled
msvc / ${{matrix.os}}-vc-${{matrix.VCPKG_PLATFORM_TOOLSET}}-${{matrix.CMAKE_GENERATOR_PLATFORM}}-${{matrix.BUILD_TYPE}}-${{matrix.BUILD_SHARED_LIBS}} (ON, Release, x64, v143, windows-latest, x64-windows) (push) Has been cancelled
Docker CI / push (alpine, docker.io) (push) Has been cancelled
Docker CI / test (ppc64le, alpine) (push) Has been cancelled
Docker CI / test (ppc64le, debian) (push) Has been cancelled
Docker CI / test (s390x, debian) (push) Has been cancelled
Docker CI / push (alpine, ghcr.io) (push) Has been cancelled
Docker CI / push (alpine, quay.io) (push) Has been cancelled
Docker CI / push (debian, docker.io) (push) Has been cancelled
Docker CI / push (debian, ghcr.io) (push) Has been cancelled
Docker CI / push (debian, quay.io) (push) Has been cancelled
Docker CI / release (GitHub) (push) Has been cancelled
docker/4.6.2-r13
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 docker/4.6.2-r12 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 docker/4.6.2-r11 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 docker/4.6.2-r10 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
redraincatching
99777bd585
malloc now allocates space for string terminator (#1507)
addresses a code scanner vulnerability

the combination of `strlen` and `malloc` results in space being
allocated for the string, but not the null terminator required to end
the string, so space for an extra character has to be manually specified

#### references
- CERT C Coding Standard: [MEM35-C. Allocate sufficient memory for an
object](https://www.securecoding.cert.org/confluence/display/c/MEM35-C.+Allocate+sufficient+memory+for+an+object).
- Common Weakness Enumeration:
[CWE-131](https://cwe.mitre.org/data/definitions/131.html).
- Common Weakness Enumeration:
[CWE-120](https://cwe.mitre.org/data/definitions/120.html).
- Common Weakness Enumeration:
[CWE-122](https://cwe.mitre.org/data/definitions/122.html).
2024-05-29 20:42:31 -07:00
Michael Jones
ad94684b23
Use bool over int for the turnutils_uclient program (#1420)
Converts all of the variables in the uclient program that should be bool
but weren't.

A few other minor adjustments made at the behest of clang-tidy, but this
change does not address all of clang-tidy's complaints.
2024-05-29 20:39:51 -07:00
Michael Jones
58dc071b46
Fix lint complaint about comment (#1506) 2024-05-29 19:07:20 -07:00