@norskvideo/ctl-dev-kit 0.2.143 → 0.2.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,6 +50,10 @@ runner, one of these must hold:
50
50
  norsk-ctl `docs/product-template-format.md`, Networking). The harness's media helpers
51
51
  (`mediaHttpBase`, `srtEgressUrl`, `mediaDirectUrl`) join the runner to that
52
52
  network for you, and `cleanupDaemon` leaves it before deleting the instance.
53
+ The harness honours `direct` only when the runner is itself a container,
54
+ since nothing else can join a docker network: on a host runner, or a runner
55
+ that is a VM with a docker daemon of its own, it logs that once and uses
56
+ published ports, so a workflow that hardcodes `direct` still runs there.
53
57
  - the launch passes `--publish-debug-ports`, restoring the old binding. The
54
58
  shared `runProductSmoke` and demo drivers do this for you when the host they
55
59
  fetch from is not loopback, and only after probing that the resolved ctl
@@ -4,15 +4,24 @@
4
4
  #
5
5
  # scripts/test-feed.sh up|down
6
6
  #
7
- # FEED_HOST is where the demo runs (default this machine); the port is
8
- # SRT_IN_PORT from ctl/studio.env, else the workflow's 5001.
7
+ # FEED_HOST is where the demo runs; by default this machine's own network address
8
+ # (not 127.0.0.1, which Docker's userland proxy carries and drops under load); the
9
+ # port is SRT_IN_PORT from ctl/studio.env, else the workflow's 5001.
9
10
  set -euo pipefail
10
11
  root="$(cd "$(dirname "$0")/.." && pwd)"
11
12
 
12
13
  # A setting from ctl/studio.env, or nothing: an unset one is not an error.
13
14
  studio_env() { grep -E "^$1=" "$root/ctl/studio.env" 2>/dev/null | cut -d= -f2- || true; }
14
15
 
15
- host="${FEED_HOST:-127.0.0.1}"
16
+ # This machine's primary IPv4 address, else 127.0.0.1 (no route, no `ip`, not Linux).
17
+ local_addr() {
18
+ local a=""
19
+ if [ "$(uname -s)" = Linux ] && command -v ip >/dev/null 2>&1; then
20
+ a=$(ip -4 route get 1.1.1.1 2>/dev/null | awk '{for (i = 1; i < NF; i++) if ($i == "src") { print $(i + 1); exit }}' || true)
21
+ fi
22
+ echo "${a:-127.0.0.1}"
23
+ }
24
+ host="${FEED_HOST:-$(local_addr)}"
16
25
  port="$(studio_env SRT_IN_PORT)"
17
26
  port="${port:-5001}"
18
27
  passphrase="$(studio_env SRT_IN_PASSPHRASE)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.143",
3
+ "version": "0.2.145",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",