Commit Graph

1786 Commits

Author SHA1 Message Date
tyranron
a68c57caac
Try BuildKit QEMU auto-emulation on CI for Docker images 2023-10-05 12:45:25 +03:00
Gustavo Garcia
597b36c5a2
Fix missing strncpy in fix_stun_check_message_integrity_str (#1282)
Co-authored-by: Gustavo Garcia <gustavogb@mail.com>
Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
2023-10-04 10:06:40 -07:00
tyranron
213ecd3388
Try build s390x platform Docker images in MacOS on CI 2023-10-04 16:58:52 +03:00
tyranron
c03096ee7b
Update Alpine to 3.18.4 version and Debian "bookworm" to 20230919 snapshot in Docker image 2023-10-04 14:04:56 +03:00
Gustavo Garcia
4ddca0b0b9
Fix ubuntu 16 build with GH action checkout version to v3 (#1281)
Co-authored-by: Gustavo Garcia <gustavogb@mail.com>
2023-10-03 20:44:31 -07:00
Pavel Punsky
95c2967252
Fix memleak in pgsql_reread_realms (#1278)
Fixes #1259

If `ur_string_map_put ` fails then the string that was just `strdup`-ed
will leak memory
Now the return value is checked and memory free-ed in case of failure
2023-10-02 16:20:14 +02:00
Gustavo Garcia
88ced47138
Replace srand/rand with srandom/random (#1279)
- srandom/random provide stronger randomness characteristics than
srand/rand in some operating systems.
- usage of srand/rand is not very consistent in coturn.

There is room for more refactoring and use apputils helper functions in
ns_turn_msg.c too but i'm not sure that dependency from "client" module
to "apps" module is a good idea yet.

Thx @0xdea

Co-authored-by: Gustavo Garcia <gustavogb@mail.com>
2023-10-02 16:19:57 +02:00
Gustavo Garcia
4e0d21e1b5
Fix memcpy len checks stun_is_challenge_response_str (#1280)
Add missing checks for length of realm/nonce/server_name before copying
those values to the buffer passed to stun_is_challenge_response_str.

The function stun_is_challenge_response_str is only used in uclient test
application.

Thank you very much @0xdea

Co-authored-by: Gustavo Garcia <gustavogb@mail.com>
2023-10-02 16:19:38 +02:00
dependabot[bot]
17e3b81a36
Upgrade docker/setup-qemu-action to 3 version (#1265)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 14:43:53 +02:00
dependabot[bot]
70f93468ad
Upgrade docker/setup-buildx-action to 3 version (#1264)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 14:13:17 +02:00
dependabot[bot]
05845b1c22
Upgrade docker/login-action to 3 version (#1263)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 12:51:34 +02:00
dependabot[bot]
ea96379905
Upgrade actions/checkout to 4 version (#1261)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 14:14:40 +02:00
Alexander Udovichenko
2a695ea855
Add warning and disable web admin if no-tls option used (#1256)
Fixes https://github.com/coturn/coturn/issues/1239

https to web ui freeze in browser if no_tls option used, because no tls
stuff initialized.
This PR add warning about this and comment aboute this in default config
2023-08-27 16:27:37 -07:00
Pavel Punsky
2850550be1
Fix formatting to fix lint error (#1258) 2023-08-27 16:26:37 -07:00
czephyr
19744a4a39
added warnings for prometheus apt unavailability (#1184)
added some warnings that the prometheus implementation is unavailable
when installing through apt
coturn/coturn#1133
2023-08-20 13:17:37 -07:00
Kang Lin
c0cb48d4a2
Update version in vcpkg.json (#1254)
Please update version in vcpkg.json, when tag
2023-08-17 18:56:42 -07:00
Aaron Bird
0f450f5492
Fix error of make command in Cygwin environment (#1236)
Environment:
- Windows 10
- Cygwin 2.925

make output:
```
<command-line>: note: this is the location of the previous definition
src/apps/common/ns_turn_utils.c:53:10: fatal error: sys/syscall.h: No such file or directory
   53 | #include <sys/syscall.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
In file included from src/client/ns_turn_ioaddr.h:34,
                 from src/client/ns_turn_msg.h:34,
                 from src/apps/common/stun_buffer.h:34,
                 from src/apps/common/stun_buffer.c:31:
src/ns_turn_defs.h:223: warning: "TURN_NO_SCTP" redefined
  223 | #define TURN_NO_SCTP
      |
<command-line>: note: this is the location of the previous definition
make: *** [Makefile:127: bin/turnutils_oauth] Error 1
```
2023-08-13 17:14:16 -07:00
Cybermilitia
72cf9ba52b
Fix recursive call in delete alternate server (#1250)
I tested the code part by using manual and automated tools for more than
2 years.

Fixes #823 

When you try to delete an alternate server in the list by using "das :" command on the CLI, the session gets stuck and can't response although alternate server is removed.

The problem appears to be related to calling del_alt_server function in the same function recursively.

Co-authored-by: CUMHUR KARAHAN <cumhur.karahan@turkcell.com.tr>
2023-08-13 16:38:19 -07:00
Jorge
0924770181
Add CodeQL workflow (#1228)
Hello from [GitHub Security Lab](https://securitylab.github.com/)!

Your repository is critical to the security of the Open Source Software
(OSS) ecosystem and as part of our mission to make OSS safer, we are
contributing a [CodeQL configuration for code
scanning](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#setting-up-code-scanning-manually)
to your repository. By enabling code scanning with CodeQL, you will be
able to continuously analyze your code and surface potential
vulnerabilities [before they can even reach your
codebase](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests#about-code-scanning-results-on-pull-requests).
In fact, you may have seen some alerts already appearing on this pull
request!

We’ve tested the configuration manually before opening this pull request
and adjusted it to the needs of your particular repository, but feel
free to tweak it further! Check [this
page](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#editing-a-code-scanning-workflow) for
detailed documentation.

Questions? Check out the FAQ below!

### FAQ
<details>
<summary>Click here to expand the FAQ section</summary>

#### How often will the code scanning analysis run?
By default, code scanning will trigger a scan with the CodeQL engine on
the following events:
* On every pull request — to flag up potential security problems for you
to investigate before merging a PR.
* On every push to your default branch and other protected branches —
this keeps the analysis results on your repository’s *Security* tab up
to date.
* Once a week at a fixed time — to make sure you benefit from the latest
updated security analysis even when no code was committed or PRs were
opened.

#### What will this cost?
Nothing! The CodeQL engine will run inside GitHub Actions, making use of
your [unlimited free compute minutes for public
repositories](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#about-billing-for-github-actions).

#### Where can I see the results of the analysis?
The results of the analysis will be available on the *Security* tab of
your repository. You can find more information about the results
[here](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).

#### What types of problems does CodeQL find?
By default, code scanning runs the [`default` query
suite](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/built-in-codeql-query-suites#default-query-suite).

#### How do I upgrade my CodeQL engine?
No need! New versions of the CodeQL analysis are constantly deployed on
GitHub.com; your repository will automatically benefit from the most
recently released version.

#### The analysis doesn’t seem to be working
If you get an error in GitHub Actions that indicates that CodeQL wasn’t
able to analyze your code, please [follow the instructions
here](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow)
to debug the analysis.

#### Which source code hosting platforms does code scanning support?
GitHub code scanning is deeply integrated within GitHub itself. If you’d
like to scan source code that is hosted elsewhere, we suggest that you
create a mirror of that code on GitHub.

</details>
2023-08-10 20:20:16 -07:00
tyranron
d7db17f048
Fix redundant Docker image tags with major OS version (#1230, #1226) 2023-07-05 12:27:59 +03:00
tyranron
6bb9109b93
Bump up Docker image revision number 2023-07-04 15:17:53 +03:00
Kai Ren
c484eab8b1
Improve Docker image tagging with major OS version (#1230, #1226)
Additionally:
- update Debian "bookworm" to 20230703 snapshot in Docker image
2023-07-04 15:16:01 +03:00
tyranron
8b802f9a5e
Update Alpine to 3.18.2 version to fix CVE-2023-1255 and CVE-2023-2650 in Docker image 2023-06-15 13:20:22 +02:00
tyranron
f908c65a06
Upgrade Debian to "bookworm" in Docker image 2023-06-13 16:41:35 +02:00
Robert Scheck
8f9446cf8f
Change printf() to TURN_LOG_FUNC() for --no-stdout-log (#1221) 2023-06-01 19:38:33 -07:00
rim
7bc932a905
Fix build with libressl 3.6+ (#1198)
Tested on FreeBSD 13/stable
2023-05-14 16:38:58 -07:00
tyranron
d526e7afcc
Upgrade Alpine to 3.17 version and Debian "bullseye" to 20230502 snapshot in Docker image 2023-05-10 17:19:21 +02:00
Mathieu Aubin
4ba2f69ba3
Update turnserver.spec (#1192) 2023-04-23 13:51:31 -07:00
tyranron
730b328660
Fix Docker tests for 4.6.2 Coturn 2023-04-12 14:59:07 +03:00
Zoey
d5aa172f96
Upgrade Alpine 3.17 version in Docker image (#1156)
Co-authored-by: Kai Ren <tyranron@gmail.com>
2023-04-12 14:02:13 +03:00
tyranron
8c8ef74a35
Upgrade Docker image to 4.6.2 Coturn version
Additionally:
- update Debian "bullseye" to 20230411 snapshot in Docker image
2023-04-12 13:39:09 +03:00
Pavel Punsky
af8a057eac
Update version to 4.6.2 (#1174)
Update version number, generate authors and changelog files

Release notes (short summary of changes)
```
- Make sure microhttpd starts using epoll if supported
- Add sessioncount to prometheus metrics
- Add STUN request/response/error prometheus counters
- Cleanup logs on turnserver start
- Fix duplicate stdout log output
- Log threadId to logs to aid in multi-threaded debugging
- Optional build info compiled into turnserver binary
- Fix arguments expansion in `docker-entrypoint.sh`
- Santise database connection strings before printing to log
- Support Windows MSVC
- Add configuration option for TLS 1.3 ciphersuites
- Improve openssl3 and FIPS support
- Use single SSL_CTX for TLS and DTLS support
- Update openssl API use to non-deprecated version
- Set string bytes to null to prevent random origin
- Fix memory corruption on socket close
- Fix packet backlog fifo that processed packets in reverse order in some scenarios
- Fix off-by-one when terminating gcm_nonce
- Fixes to Redis memleaks and socketleaks
- Fix malformed response to mobility refresh request
- Fuzzing support
- Ignore raw UDP if no_udp is enabled
- Better detect availability of SCTP protocol
```

---------

Co-authored-by: tyranron <tyranron@gmail.com>
2023-04-10 19:00:08 -07:00
Cédric DIJOUX
67beeb83b1
Fix MSVC CI build (#1182)
Removing windows.h inclusion, not needed with ws2tcpip.h. Causes some
struct redefinitions.
2023-04-01 18:28:27 -07:00
tyranron
0a3d510750
Update Alpine to 3.16.5 version and Debian "bullseye" to 20230320 snapshot to fix CVE-2023-0464 and CVE-2023-0465 in Docker image 2023-03-31 16:46:23 +03:00
Thibaut ACKERMANN
242eb78227
Prometheus: make sure microhttpd starts using epoll if supported (#1173)
In some cases the prometheus server was started using SELECT even if
EPOLL was supported.
Some flags were changed in microhttpd and now we use MHD_VERSION to make
sure to use the right ones in all cases (support old version, for ubuntu
16.04 for ex).

This fixes the issue #1167

I also added a log to make sure we know which version is used,
especially to inform the user that the SELECT version might lead to
issues on highly used servers.
2023-03-19 18:04:04 -07:00
Stefan Sundin
43f8b873a7
Fix typo in mainrelay.c (#1169) 2023-03-12 17:29:39 -07:00
Pavel Punsky
79fb65519c
Remove unused include that breaks OpenBSD (#1165)
PR #855 introduced new include <ssys/sysinfo.h> 
It is not required for compilation or turnserver function but breaks
OpenBSD build (which does not have this file)
This PR removes the include to restore OpenBSD build compatibility

Fixes #1162

Test Plan:
TBD - need some one to test build
2023-03-06 08:50:12 +01:00
tyranron
cc2560b06a
Update Alpine to 3.16.4 version and Debian "bullseye" to 20230208 snapshot to fix CVE-2023-0286 (and friends) in Docker image 2023-02-13 12:55:23 +02:00
tyranron
f558842cd0
Prepare 4.6.1-r1 release of Docker image 2023-01-31 19:22:21 +02:00
Shu Muto
629faceeef
Fix arguments expansion in docker-entrypoint.sh (#1110, #902)
Co-authored-by: Kai Ren <tyranron@gmail.com>
2023-01-31 19:09:43 +02:00
Pavel Punsky
46a38d1c8c
Delete LICENSE.OpenSSL
There is no reason to include the license of openssl - coturn uses openssl just like any other library
As a reference - Apache httpd does not have openssl license

#1049
2023-01-21 16:50:40 -08:00
r3g_5z
212e782355
use santisied psql string (#1144)
Noticed the plaintext password of my postgresql server in my coturn
logs, but postgresql errors would return the password sanitised. Simple
fix to log the sanitised string.


![image](https://user-images.githubusercontent.com/112147643/213053494-c8a5d226-0b04-4c8d-9b52-3e1330291a39.png)


Signed-off-by: r3g_5z <june@girlboss.ceo>

Signed-off-by: r3g_5z <june@girlboss.ceo>
2023-01-19 17:55:46 -08:00
Jasper
8f8038a7fb
Use the actual redis connection string to connect, not the sanitized one (#1141)
fixes #1140
2023-01-13 15:52:47 -08:00
Gustavo Garcia
43b430a715
Update CONTRIBUTING.md 2023-01-09 19:27:00 +01:00
Gustavo Garcia
0b01b9bbaa
Fix brew for MacOS CI build (#1136)
MacOS CI build started to fail in the PRs because when upgrading python
it was not possible to override one existing file (related to 2to3
package). Apparently this happens because MacOS runners some times have
python versions not installed/compatible with brew.

Example of the failure:
https://github.com/coturn/coturn/actions/runs/3850951324

The proposed workaround is taken from here:
https://github.com/actions/runner-images/issues/2322
2023-01-08 20:43:31 -08:00
Emil Ljungdahl
980ef8f9dc
Implement non-blocking recvfrom on Windows (#1124)
This pull request is a split of PR #1061

As @KangLin pointed out in the original PR those sockets should ideally
be permanently non-blocking for performance reasons, but they are NOT at
the moment.
Someone with more knowledge about the code in dtls_listener.c should
probably have a look if it would be feasible to change the sockets to
non-blocking already at creation, similar to what is done in
udpserver.c...
2023-01-08 20:42:16 -08:00
Gustavo Garcia
fae5d2756e
Add contributing guidelines (#1135)
Add some basic contributing guidelines based (almost cloned) on the
Redis ones.

There were some questions about how to contribute and get started with
the project. I see this type of document in other projects that I think
can be useful.
2023-01-08 08:39:31 +01:00
Pavel Punsky
85c11b69e3
Move and split documentation files (#1096)
This is not a long term documentation works - this is a temp proposal to
modernize existing documentation

- Create docs folder
- Move existing documentation files into docs
- Split one massive INSTALL files into smaller files (no text editing
was done except small markdown header formatting)
- Rename files to be markdowns for nicer rendering
- Bad md rendering is expected in many places
2022-12-22 11:13:24 -08:00
Emil Ljungdahl
9fa8af6163
Use inline functions for errno checks (#1123)
Since winsock do not use errno, and have different error codes, this is
needed to be windows compatible

This pull request is a split of PR #1061
2022-12-22 11:10:34 -08:00
Pavel Punsky
7038763627
Add STUN request/response/error prometheus counters (#1115)
Somewhat relevant to #1075
2022-12-17 17:50:09 +01:00