108 Commits

Author SHA1 Message Date
Pavel Punsky 36e1eee855 Restore CodeQL permissions, category, and manual build mode (#1901)
PR #1517 (Jun 2024) simplified codeql.yml in ways that left scans
incomplete: it dropped the actions:read / contents:read permissions and
the analyze category, both of which CodeQL Action requires for results
to land under the existing language category. Combined with the later
cpp -> c-cpp rename and v3 -> v4 upgrade, scheduled scans have not
refreshed the Security tab since Jun 1, 2024.

- Add actions:read and contents:read back to job permissions
- Set build-mode: manual on init (required for v3+/v4 manual builds)
- Pass category "/language:c-cpp" on analyze so SARIF de-duplicates
against the configured language
- Build with --parallel so the tracer keeps up on default runners
2026-05-08 09:02:51 -07:00
dependabot[bot] 97fd597fcb Bump repolevedavaj/install-nsis from 1.1.0 to 1.2.0 (#1899)
Bumps
[repolevedavaj/install-nsis](https://github.com/repolevedavaj/install-nsis)
from 1.1.0 to 1.2.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/repolevedavaj/install-nsis/releases">repolevedavaj/install-nsis's
releases</a>.</em></p>
<blockquote>
<h2>v1.2.0</h2>
<!-- raw HTML omitted -->
<h2>🚀 New features and improvements</h2>
<ul>
<li>Fix NSIS installer download (<a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/40">#40</a>
<a href="https://github.com/lordmulder"><code>@​lordmulder</code></a> +
<a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/41">#41</a>
<a
href="https://github.com/repolevedavaj"><code>@​repolevedavaj</code></a>)</li>
</ul>
<h2>📦 Dependency updates</h2>
<ul>
<li>Bump release-drafter/release-drafter from 6.1.0 to 7.2.0 (<a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/37">#37</a>)
@<a href="https://github.com/apps/dependabot">dependabot[bot]</a></li>
<li>Bump actions/checkout from 5 to 6 (<a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/29">#29</a>)
@<a href="https://github.com/apps/dependabot">dependabot[bot]</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/c14d0ea1b829818b4e9313d8e009b43f0a65fddd"><code>c14d0ea</code></a>
Merge pull request <a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/41">#41</a>
from repolevedavaj/fix/strlen-patch-download-url</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/7b8697d1199a09d10256551b45814079f103086b"><code>7b8697d</code></a>
Apply PR <a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/40">#40</a>
download fix to strlen_8192 patch step</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/9abd7fac248dc054cdc4e14fcf9b42cbd578100e"><code>9abd7fa</code></a>
Merge pull request <a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/37">#37</a>
from repolevedavaj/dependabot/github_actions/release-d...</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/c569f7c7d0186ead4335b0606bd0ca9d488aaada"><code>c569f7c</code></a>
Merge pull request <a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/40">#40</a>
from lordmulder/main</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/fb4d83d77758496ff007a717b63647e8634d138d"><code>fb4d83d</code></a>
Fixed.</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/9f060d05951d525ff9528d59c9bf00561a02e60d"><code>9f060d0</code></a>
Fixed</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/187e8883da4fe935fdaaf3a3bce7d7d11f5654b5"><code>187e888</code></a>
Change NSIS installer download link and User-Agent</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/59638711aebe5255a768fb9cde11cc47d06c7140"><code>5963871</code></a>
Bump release-drafter/release-drafter from 6.1.0 to 7.2.0</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/618f596b61aeb0254a327cceba89036242b79758"><code>618f596</code></a>
Merge pull request <a
href="https://redirect.github.com/repolevedavaj/install-nsis/issues/29">#29</a>
from repolevedavaj/dependabot/github_actions/actions/c...</li>
<li><a
href="https://github.com/repolevedavaj/install-nsis/commit/81fc6efc3373bd2a346607b92f73997e28c970df"><code>81fc6ef</code></a>
Bump actions/checkout from 5 to 6</li>
<li>See full diff in <a
href="https://github.com/repolevedavaj/install-nsis/compare/v1.1.0...v1.2.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=repolevedavaj/install-nsis&package-manager=github_actions&previous-version=1.1.0&new-version=1.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-07 22:23:07 -07:00
Pavel Punsky 453afd1fdc Add Unity-based unit test scaffolding (#1875)
## Summary
Introduces an opt-in unit test layer for coturn using
[Unity](https://github.com/ThrowTheSwitch/Unity) — a single-header
pure-C test framework that matches coturn's C11 toolchain, portability
bar, and zero-C++ production tree.

- Unity v2.6.0 is fetched on demand via CMake `FetchContent` (nothing
vendored).
- Tests are gated behind `-DBUILD_TESTING=ON` (off by default), so the
standard build and OSS-Fuzz pipeline are unaffected.
- Two test binaries cover pure C-callable code in `libturnclient`:
- `test_ioaddr` (6 cases) — `make_ioa_addr`,
`addr_get_port`/`addr_set_port`, `addr_eq` variants, `addr_to_string`,
IPv4/IPv6/garbage input
- `test_stun_msg` (7 cases) — STUN header construction,
request/indication/success/error response classification, transaction-ID
round-trip, channel message parsing, truncated/zeroed buffer rejection
- New `check` cmake target builds tests before running ctest (avoids the
`make test` footgun where the auto-generated `test` target only runs
already-built binaries).
- Legacy `Makefile.in` gets a `unit-tests` target that bootstraps
`build/unit-tests/` and delegates to the cmake `check` target. `make
check` and `make test` now run the RFC 5769 conformance suite **plus**
the Unity unit tests.
- CLAUDE.md documents the new workflow plus the one-liner for adding a
new `test_<name>.c`.

## Why
The existing test story is shell-script integration suites under
`examples/scripts/` — they exercise the binary end-to-end but can't pin
down behavior of individual functions, can't run without a full build
environment, and don't fail loudly when a unit-level invariant breaks. A
lightweight unit layer gives us:

- Targeted regression coverage for protocol parsing/encoding (the
highest bug-yield area).
- A natural home for tests of the kinds of subtle invariants already
documented in CLAUDE.md (port-counter overflow safety, port-bounds
inclusivity, HMAC buffer initialization).
- Sub-second feedback for contributors.

## Usage
```bash
# CMake direct
cmake -S . -B build -DBUILD_TESTING=ON
cmake --build build -j --target check     # build + run all unit tests
ctest --test-dir build --output-on-failure   # run already-built tests

# Legacy Makefile bridge (after ./configure)
make unit-tests   # bootstraps build/unit-tests/, builds + runs Unity tests
make check        # RFC 5769 conformance + unit tests
```

Adding a new test:
1. Drop `tests/test_<name>.c`
2. Append `coturn_add_test(test_<name>)` in `tests/CMakeLists.txt`
3. The `check` target picks it up automatically.

## Test plan
- [x] Clean cmake build with `-DBUILD_TESTING=ON` succeeds; full source
tree (turnserver, turnadmin, turnclient, turn_server, all turnutils)
still builds
- [x] `cmake --build build --target check` builds and runs both test
binaries — 13/13 cases pass
- [x] `ctest --verbose` shows per-case PASS lines for all 13 cases
- [x] Default build (`-DBUILD_TESTING` unset) does not fetch Unity or
build any test binary

## Notes for reviewers
- Why Unity over GoogleTest/Catch2: pure C, single source file, no C++
toolchain dependency, runs anywhere coturn does (incl. exotic CMake
targets like Solaris/AIX). GoogleTest would force `extern "C"` wrappers
and a C++ compiler everywhere.
2026-04-20 21:15:12 -07:00
dependabot[bot] eec3b277ed Upgrade softprops/action-gh-release from 2 to 3 version (#1866)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-14 10:43:37 +02:00
dependabot[bot] 318239ae2d Upgrade actions/github-script from 8 to 9 version (#1855)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-10 13:56:51 +02:00
Pavel Punsky 17b15e39cd Fix tests execution in CI (#1836)
Small fixes across CI workflows and test scripts:
- In examples/run_tests.sh & examples/run_tests_conf.sh: ensure both
turnserver and the turnutils_peer background process are killed at the
end
- cmake.yml so binaries end up in the expected folder
- linux.yml - add install so that binaries are in the expected folder
2026-04-04 13:09:53 -07:00
dependabot[bot] d6e828c717 Upgrade docker/setup-buildx-action from 3 to 4 version (#1828)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-06 00:26:51 +01:00
dependabot[bot] 679f9b4865 Upgrade docker/login-action from 3 to 4 version (#1826)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-05 12:38:23 +01:00
dependabot[bot] 8479d13b12 Upgrade docker/setup-qemu-action from 3 to 4 version (#1825)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-05 12:37:36 +01:00
dependabot[bot] b07d747d4b Upgrade actions/download-artifact from 7 to 8 version (#1820)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 00:57:38 +01:00
dependabot[bot] a56ee58ee5 Upgrade actions/upload-artifact from 6 to 7 version (#1819)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 00:56:53 +01:00
Pavel Punsky 35180707b9 Fix codeql scanning definition (#1814)
Language definition changed from cpp to c-cpp
2026-02-25 22:57:24 -08:00
Pavel Punsky e59f0ffeaa Fix thread sanitizer warning (#1812)
Resolves all sanitizer warnings caused by
1. simultaneous access to logger time
2. barrier during threads initialization at startup
2026-02-23 16:16:27 -08:00
Pavel Punsky 4c674289a8 OpenSSL: migrate to modern API for DH param (#1809)
Use openssl-3.0 apis
2026-02-21 17:31:17 -08:00
Pavel Punsky 8c8bf97a38 Remove ubuntu20, DEBUG builds from build matrix (#1803)
Random failures with tests including prometheus - no time to solve it
now so just disabling

Also, removing DEBUG targets from Windows builds
2026-02-15 18:38:39 -08:00
dependabot[bot] 15cecc97a2 Upgrade actions/download-artifact from 6 to 7 version (#1785)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-13 01:44:37 +01:00
dependabot[bot] 60ed2e246e Upgrade actions/upload-artifact from 5 to 6 version (#1784)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-13 01:43:51 +01:00
dependabot[bot] b7dfa236c1 Upgrade actions/cache from 4 to 5 version (#1783)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-12 12:03:36 +01:00
dependabot[bot] 9298847097 Upgrade actions/checkout from 5 to 6 version (#1776)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-21 13:37:27 +01:00
dependabot[bot] 5c14404c71 Upgrade actions/upload-artifact from 4 to 5 version (#1771)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-25 10:03:37 +02:00
dependabot[bot] 7cd09efe87 Upgrade actions/download-artifact from 5 to 6 version (#1772)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-25 10:02:45 +02:00
dependabot[bot] ec5f2bcd83 Upgrade github/codeql-action from 3 to 4 version (#1759)
Additionally:
- fix missing NSIS for Windows on CI
- replace macOS 13 with 26 on CI

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kai Ren <tyranron@gmail.com>
2025-10-08 13:43:16 +02:00
redraincatching d124014428 add fuzzing to ci workflows (#1745)
allow fuzzing to be performed as part of the continuous integration.

the timing of the fuzzing can be extended, and i aim to broaden the
scope of the fuzz testing as well, since we currently only test the stun
message parser.
2025-09-05 10:37:58 -07:00
dependabot[bot] 04a8e52e09 Upgrade actions/github-script from 7 to 8 version (#1746)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-05 14:20:10 +02:00
dependabot[bot] 3cfa30552d Upgrade actions/checkout from 4 to 5 version (#1733)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 13:30:02 +02:00
Kai Ren c67a41f5ff Upgrade vcpkg to 2025.07.25 release on MSVC CI (#1734) 2025-08-12 12:45:21 +02:00
dependabot[bot] 20761e0cd5 Upgrade actions/download-artifact from 4 to 5 version (#1731)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 11:22:45 +02:00
tyranron 4b69110460 Fix typo in Docker CI spec 2025-07-16 13:29:08 +03:00
tyranron 752cf2e565 Verify CHANGELOG date on Docker CI 2025-07-16 13:25:41 +03: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
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
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 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
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 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
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
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
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
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
Michael Jones a394fb1cee Simplify workflow for codeql (#1517) 2024-06-02 16:34:29 -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 6f82083ea3 Run all of the CI except for Docker builds on any change (#1415)
I'm having trouble testing changes in my own fork because many of the CI
workflows are only set to build on a pull request.

Better to just build on any commit.

I've left the docker builds as they are.
2024-05-27 13:50:43 -07:00
Michael Jones 544382f313 Fix mingw and MSVC ci build (#1491) 2024-05-27 13:43:40 -07:00
Michael Jones 525550ab86 Always run lint, regardless of branch (#1492)
Someone working on a branch in their own fork won't see the lint running
on their github-actions CI until they open a pull request.

It'd be much easier to ensure changes being worked on are going to pass
the linter if the linter runs before the last step of opening the PR.
2024-05-26 18:27:39 -07:00
redraincatching e96f22ab71 workflow tidying (#1396)
Normalisation of some of the workflow files
2024-04-09 23:18:03 +02:00
dependabot[bot] 9a79c813e3 Upgrade softprops/action-gh-release GitHub Action from 1 to 2 version (#1449) 2024-03-11 11:40:29 +01:00