Commit Graph

1761 Commits

Author SHA1 Message Date
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 8f9446cf8f.
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) 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 2025-01-09 12:58:41 +02:00
tyranron
e825110d38
Update Alpine to 3.21.1 version in Docker image 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 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