1
0
mirror of https://github.com/coturn/coturn.git synced 2025-12-24 17:31:00 +01:00

1768 Commits

Author SHA1 Message Date
Pavel Punsky
678996a529
Update version to 4.7.0 (#1691)
Set new release version to 4.7.0
Updating minor version due to some breaking changes in options to enable
more secure/robust configuration without additional flags (or relying on
recommended conf file which people seem to skip during updates)
4.7.0
2025-05-30 14:13:59 -07:00
Pavel Punsky
cc5e18fc89
Make older TLS versions optional (#1693)
TLSv1 and TLSv1.1 can be enabled using `--tlsv1` and `--tlsv1_1`
arguments accordingly
That assumes openssl version being used has these versions enabled
(which as of openssl-3.5 is not by default)
2025-05-30 09:20:14 -07:00
Gustavo Garcia
d7197fa263
Add missing close socket when ioa_socket call fails (#1694)
Fixes [#1071](https://github.com/coturn/coturn/issues/1071)

Not sure how this case can happen but better to handle the error case.

Co-authored-by: tyranron <tyranron@gmail.com>
2025-05-30 09:19:24 -07:00
Michael Jones
9ae1e3b3cb
Add spdx tags to all source files (#1510)
With notable exceptions of:

src/apps/common/win/*
src/apps/relay/telnet.*

The purpose of this change is to add the SPDX tags from
https://spdx.dev/, which is a linux foundation project, to the source
code.

This provides automated code provenance tools, which are used in setting
up software bill of materials reports, an easy time verifying that the
code license is known and no incompatibilities are present in a
codebase.

No copyright date, author, or license changes are made.

Note also that
7e525c8e1c
is the original commit for the ACME code (acme.h and acme.c) which was
then moved to acme.h and acme.c in this commit
d4686750ee
but neither commit indicates what license the ACME code was submitted
as.

https://github.com/coturn/coturn?tab=License-1-ov-file#readme is the
3-clause BSD license, but https://github.com/coturn/coturn/pull/672
documents that the author's intent was for the MIT license. So I've used
the SPDX tag and content of the MIT license for this change.
2025-05-30 11:56:04 +02:00
Michael Jones
0af0fc3ec2
Address various minor clang-tidy warnings (#1513)
No specific methodology other than checking the github CI output for the
`clang-tidy` job, and fixing things one at a time.
2025-05-29 19:12:50 -07:00
Gustavo Garcia
b47648490c
Update reference to old draft in README to RFC8016
Fixes #1177
2025-05-29 13:23:48 +02:00
Pavel Punsky
14f84fa48c
[BREAKING] Deprecate response-origin-only-with-rfc5780 (#1690)
Make this true - response-origin-only will only be enabled with rfc5780 option enabled
2025-05-28 16:37:20 -07:00
Pavel Punsky
4cc076d424
[BREAKING] Invert no-stun-backward-compatibility to be default on (#1689)
Deprecate `--no-stun-backward-compatibility` and set it to true by
default
Add new option `--stun-backward-compatibility`, off by default

Update example/recommended configuration files

This is a breaking change as passing `--no-stun-backward-compatibility`
will be rejected as invalid argument
2025-05-28 16:23:33 -07:00
Pavel Punsky
368355a06f
Invert RFC5780 option to default off (#1688)
Invert `--no-rfc5780` option to be true by default
Make it `--rfc5780` to enable it
Update example/recommended configuration files

Passing `--no-rfc5780` will have no effect as this is the default
behavior now
2025-05-28 15:08:57 -07:00
Gustavo Garcia
ce56a78a7a
Add modules diagram to developer doc (#1685)
Add basic diagram with modules of coturn inside Developer.md.

I also wanted to move the existing Flow chart to mermaid so that our doc
doesn't depend on external tools but i couldn't find the time to do it
properly (horizontal arrows are hard to represent with mermaid) so i
postponed that part.

This is the result of the mermaid diagram: 
![Screenshot 2025-05-26 at 12 54
29](https://github.com/user-attachments/assets/860bd56b-cb4a-462c-b931-a82c9d52fdc9)
2025-05-26 13:57:13 +02:00
Gustavo Garcia
f17cd2d854
Fix compilation warning with const - non const conversions (#1686)
When building with default configuration at least in MacOS we get
warnings about those conversions from const char* to char*. Fix it by
making all those argv ""const char*"
2025-05-26 13:54:50 +02:00
Greg Troxel
f94a61b526
Makefile.in: Don't install sql schema into DOCSDIR (#1684)
sql schema files are installed into SCHEMADIR, which is the right place.
Don't install them an extra time.

Fixes #1631
2025-05-26 13:51:22 +02:00
Asmir Mehic
823fd71c98
Fix infinite loop in ns_turn_server.c (#1460)
In case ur_map_get returns 1 server will enter infinite loop because
newid != 0.

Co-authored-by: Asmir <asmir.mehic@viber.com>
2025-05-25 15:38:42 +02:00
Michael Jones
c37462b33a
Fix the ability to compile coturn using C++ compiler (#1546)
This adjusts the code to allow compilation with a C++ compiler, but
doesn't change the build to use a C++ compiler. Everything should
continue working as-is with existing c-compilers. This is just a "let it
work" change, not a "change how it works" change.
2025-05-25 10:53:13 +02:00
tyranron
60813060da
Update Debian "bookworm" to 20250520 snapshot in Docker image 2025-05-22 13:47:52 +02:00
Gustavo Garcia
de84ecefb1
Restore returning 200 OK on root prometheus path for health check (#1678)
Restore the support to return a 200 OK in the root prometheus endpoint
(/) as stated in the documentation.

This feature was lost when removing libpromhttp

Fixes #1672
2025-05-22 11:37:29 +02:00
Gustavo Garcia
8a71069517
Improve MySQL connection error logging to include actual MySQL error message (#1679)
Address #270

MySQL reconnectiong after priviledge drop and reporting missleading
error log.
"Cannot open MySQL DB connection: <%s>, runtime error\n"

Always include the mysql error message for additional context.
2025-05-22 11:29:36 +02:00
maddy
c0b2c8d389
redis: use dbname param when redis is unauthenticated (#1668)
Fixes a regression pointed out at
<https://github.com/coturn/coturn/pull/1488#issuecomment-2801027711>.

A regression was introduced in the last PR where the dbname parameter
was not respected if using redis without authentication. The logic for
sending the select command responsible for switching to the correct
database was wrongly guarded behind authentication being provided. This
PR flattens the control flow so the select command is always sent,
whether using authentication or not.
2025-05-21 18:58:35 +02:00
Gustavo Garcia
b0dbf5cb8c
Show allocations increment/decrement logs behind verbose flag (#1677)
Fix #1657 

This log was added in a recent refactor for draining support and it is
very noisy. With this change the log is moved behind the "verbose" flag
and also does a minor cleanup to not have 2 duplicated lines for logging
when one is enough.

Co-authored-by: Gustavo Garcia <gustavogb@mail.com>
2025-05-21 13:47:48 +02:00
Stefan Kieszkowski
24647a1e83
[Quick Fix] Fix Repeated Line in Example turnserver.conf (#1671)
The `#allocation-default-address-family="ipv4"` line is repeated twice
in the example config, changed the second one to be `"ipv6"` which I
assume it was intended to be.
2025-05-21 07:33:51 +02:00
tyranron
1adf0213d7
Update Debian "bookworm" to 20250428 snapshot in Docker image 2025-04-29 16:53:44 +02:00
tyranron
1bc31844e0
Update Debian "bookworm" to 20250407 snapshot in Docker image 2025-04-10 13:28:35 +03:00
Leonid Gorbachev
beaed33e90
change for incorrect handling of TURN_NO_TLS environment variable (#1663)
In version 4.5.1.3, there was a handling of TURN_NO_TLS environment
variable and the TURN_xxx environment variables can be set in the
following manner:
      **export TURN_NO_TLS=1**
      export TURN_NO_PQ=1
      export TURN_NO_MYSQL=1
      export TURN_NO_MONGO=1
      export TURN_NO_SQLITE=1
      ./configure


In versions 4.5.2 and later, handling of TURN_NO_TLS was removed, and
with this TURN_NO_TLS is set as-is OSCFLAGS:

831b7245aa/configure (L1021)
And now, to set no-tls properly during compile time, we have to do the
following:
      **export TURN_NO_TLS=-DTURN_NO_TLS**
      export TURN_NO_PQ=1
      export TURN_NO_GCM=1

Otherwise, if leave previous approach, it obviously causes an error
during compile time:
```
    cc: error: 1: linker input file not found: No such file or directory
```

With this PR i would like to restore consistency of environment
variables that used for ./configure
2025-03-30 13:16:28 -07:00
Pavel Punsky
791e4c9f7a
Add Content-Type header to prometheus response (#1662)
Prometheus v3 requires `Content-Type` header
Fixes #1658
2025-03-30 12:58:41 -07:00
tyranron
831b7245aa
Update Debian "bookworm" to 20250317 snapshot in Docker image 2025-03-18 12:23:25 +02:00
tyranron
7b46ba121d
Update Debian "bookworm" to 20250224 snapshot in Docker image 2025-03-04 14:08:35 +01:00
nicolas-laduguie
a21733b23d
Fix infinite loop while triggering SIGHUP and log file reset causing … (#1630)
…segmentation fault

This reverts commit 8f9446cf8fe4b48ae542c630416fac63d06a6802.
2025-02-20 21:14:07 -08:00
redraincatching
9f3da44285
rename and dependency extraction (#1634)
rebase and refactor of [this
pr](https://github.com/coturn/coturn/pull/1400) from last year that was
never merged

rename of cmake YAML file to match others and extraction of dependencies
to already existing composite action
2025-02-20 21:12:24 -08:00
redraincatching
01628a7a01
updated types to bool in _turn_params_ to reflect C11 (#1406)
approach was as follows, for the `_turn_params_` struct:
- if a variable of type `int` or `vint` was only being used as a
boolean, replace it with bool as defined in `<stdbool.h>`
- replace its declaration with true/false, depending on prior assignment
as 0/1

changes were only made when i was certain the variables were not being
used as an `int`, so i may have missed some

no changes were made to other sections of the code as int-to-bool
assignment is allowed in C, only code within the structs were changed,
but that can be changed with a later commit

---

from a documentation perspective, it's not clear as to what purpose or
benefit the vint alias has. the definition in `ns_turn_defs.h` simply
reads

```c
typedef int vint;
typedef vint *vintp;
```
with no comments, and it seems most (but not all) `vint`s are being used
as interim booleans through the code. this may just be from lack of
knowledge of the codebase, but it doesn't seem useful in any way, so it
would be helpful if someone with more expertise could clarify

---------

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2025-02-20 21:03:13 -08:00
Kai Ren
1284a3f124
Explicitly install latest QEMU on CI for building Docker images (#1645) docker/4.6.3-r3 2025-02-17 16:06:56 +01:00
tyranron
4945a42349
Decrease Docker BuildKit max-parallelism for ppc64le arch 2025-02-17 14:34:06 +02:00
tyranron
7273e70bf3
Update Alpine to 3.21.3 version in Docker image 2025-02-17 12:58:42 +02:00
tyranron
3b2fb7ccef
Update Debian "bookworm" to 20250203 snapshot in Docker image 2025-02-06 14:25:28 +02:00
tyranron
2acb4b1989
Update Debian "bookworm" to 20250113 snapshot in Docker image 2025-01-14 12:39:57 +02:00
tyranron
a85eefc48a
Update Alpine to 3.21.2 version in Docker image docker/4.6.3-r2 2025-01-09 12:58:41 +02:00
tyranron
e825110d38
Update Alpine to 3.21.1 version in Docker image docker/4.6.3-r1 2025-01-08 13:02:43 +02:00
guoyingbo
22aae5d0d0
Windows '_WTA' bug (#1624)
Every time the '_WTA' is called, its initial value is null, so the
function returns directly.


c98bb93514/src/apps/common/apputils.c (L905-L908)

c98bb93514/src/apps/common/apputils.c (L939-L941)

c98bb93514/src/apps/common/apputils.c (L960-L962)

c98bb93514/src/apps/common/apputils.c (L981-L983)
2025-01-04 17:50:29 -08:00
Pavel Punsky
c98bb93514
Fix cmake issues detecting mongo and libsystemd on macOS (#1621)
- libsystemd does not exist on macOS - ignore it and reduce warnings
during cmake step
- mongo-c has cmake file on macOS - reusing the same code path and
reduce warnings
2024-12-27 14:52:44 -08:00
Pavel Punsky
58f1b8926c
Fix hiredis detection by cmake (#1620)
See #1618 for details

This fix allows proper hiredis detection on macOS when building with
cmake
2024-12-27 11:36:58 -08:00
tyranron
326b983ece
Update Debian "bookworm" to 20241223 snapshot in Docker image 2024-12-25 11:08:34 +02:00
Pavel Punsky
89a5600be1
Drop TLS version support detection (#1617)
With requiring openssl version at least 1.1.1 all versions of TLS (up to
and including 1.3) and DTLS 1.2 are supported
With that, no detection or ability to disable a version will be provided
2024-12-19 17:10:49 -08:00
Pavel Punsky
20da9cd09a
Cleanup ALPN_SUPPORTED define usage (#1616)
As of openssl 1.1.1 ALPN is supported - no need for all the ifdefs anymore
2024-12-19 16:41:45 -08:00
Pavel Punsky
9f779a64d0
Fix warnings type conversion (#1615) 2024-12-19 09:05:37 -08:00
Alex Gustafsson
790cc6f79e
Add parameter for specifying prometheus path (#1602)
Add a `--prometheus-path` parameter which allows users to specify at
what
path the metrics should be exposed.

This simplifies serving metrics on a specific path behind some
restrictive reverse proxies that expect the upstream server to serve
URLs with paths matching the requested path.

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2024-12-18 14:50:38 -08:00
Pavel Punsky
3370eaf12d
Do not build with Ubuntu 18, use 24 (#1613)
Re-delete file that was undeleted accidentally
2024-12-15 17:37:03 -08:00
Michael Jones
c9878469fc
[BREAKING] Remove support for openssl older than 1.1.1 (#1397)
Openssl 1.1.1 is end-of-life in September 2023.
This PR removes support for versions of openssl OLDER than 1.1.1
1.1.1 should still be usable after this change is merged.

I don't see any value in supporting 1.1.1, but didn't see a reason to
purge support for 1.1.1 when there are so few checks for >= 3.0.

Note that this does also remove CI support for Ubuntu 16.04. The
official version of OpenSSL from Ubuntu for this release is listed here:
https://launchpad.net/ubuntu/+source/openssl as 1.0.2g

Since no newer releases of coturn will be backported by Canonical to
Ubuntu 16.04, anyone using Coturn on this operating system will have to
download and compile it themselves. They may build their own version of
OpenSSL if they somehow cannot upgrade to a newer version of Ubuntu.

My position is that these users should prefer to upgrade to a newer
operating system than worry about chasing newer releases of Coturn.

Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2024-12-13 13:06:24 -08:00
Pavel Punsky
ea280f9431
[BREAKING] Cleanup deprecated options (#1599)
Following configuration options deleted:
- `--secret-ts-exp-time`
- `--prod` - disables SOFTWARE_ATTRIBUTE in messages. Now it is default.
To enable SOFTWARE_ATTRIBUTE use `--software-attribute`
- `--no-sslv2`, `--no-sslv3` - old versions of SSL are not supported and
it is not possible to enable them

These are breaking changes - if the CLI command has any of those
arguments it will cause turnserver to terminate and notify about unknown
argument
2024-12-13 09:31:06 -08:00
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 docker/4.6.3-r0 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