texas2step 2.4.0__tar.gz → 2.4.2__tar.gz

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.
Files changed (67) hide show
  1. {texas2step-2.4.0 → texas2step-2.4.2}/PKG-INFO +1 -1
  2. {texas2step-2.4.0 → texas2step-2.4.2}/docs/configuration.md +10 -1
  3. {texas2step-2.4.0 → texas2step-2.4.2}/docs/roadmap.md +12 -0
  4. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/__init__.py +1 -1
  5. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/logs.py +52 -3
  6. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/rtc.py +17 -1
  7. texas2step-2.4.2/src/texas2step/static/assets/app.js +8 -0
  8. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/index.html +1 -1
  9. texas2step-2.4.0/src/texas2step/static/assets/app.js +0 -8
  10. {texas2step-2.4.0 → texas2step-2.4.2}/.gitignore +0 -0
  11. {texas2step-2.4.0 → texas2step-2.4.2}/LICENSE.md +0 -0
  12. {texas2step-2.4.0 → texas2step-2.4.2}/README.md +0 -0
  13. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/nginx/texas2step-http.conf +0 -0
  14. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/nginx/texas2step-log.conf +0 -0
  15. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/nginx/texas2step-speedtest.conf +0 -0
  16. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/nginx/texas2step.conf +0 -0
  17. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/texas2step-update.service +0 -0
  18. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/texas2step-update.timer +0 -0
  19. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/texas2step.default +0 -0
  20. {texas2step-2.4.0 → texas2step-2.4.2}/deploy/texas2step.service +0 -0
  21. {texas2step-2.4.0 → texas2step-2.4.2}/docs/access.md +0 -0
  22. {texas2step-2.4.0 → texas2step-2.4.2}/docs/api.md +0 -0
  23. {texas2step-2.4.0 → texas2step-2.4.2}/docs/development.md +0 -0
  24. {texas2step-2.4.0 → texas2step-2.4.2}/docs/experience.md +0 -0
  25. {texas2step-2.4.0 → texas2step-2.4.2}/docs/images/hero-dark.jpg +0 -0
  26. {texas2step-2.4.0 → texas2step-2.4.2}/docs/images/results-dark.jpg +0 -0
  27. {texas2step-2.4.0 → texas2step-2.4.2}/docs/images/results-light.jpg +0 -0
  28. {texas2step-2.4.0 → texas2step-2.4.2}/docs/images/upload-light.jpg +0 -0
  29. {texas2step-2.4.0 → texas2step-2.4.2}/docs/install.md +0 -0
  30. {texas2step-2.4.0 → texas2step-2.4.2}/docs/methodology.md +0 -0
  31. {texas2step-2.4.0 → texas2step-2.4.2}/docs/security.md +0 -0
  32. {texas2step-2.4.0 → texas2step-2.4.2}/docs/traffic.md +0 -0
  33. {texas2step-2.4.0 → texas2step-2.4.2}/legacy/README.md +0 -0
  34. {texas2step-2.4.0 → texas2step-2.4.2}/pyproject.toml +0 -0
  35. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/__main__.py +0 -0
  36. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/access.py +0 -0
  37. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/api/__init__.py +0 -0
  38. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/api/access.py +0 -0
  39. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/api/measure.py +0 -0
  40. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/api/meta.py +0 -0
  41. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/api/results.py +0 -0
  42. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/api/wire.py +0 -0
  43. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/app.py +0 -0
  44. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/cli.py +0 -0
  45. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/cluster.py +0 -0
  46. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/config.py +0 -0
  47. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/config_edit.py +0 -0
  48. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/config_merge.py +0 -0
  49. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/config_template.toml +0 -0
  50. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/engine.py +0 -0
  51. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/iface.py +0 -0
  52. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/lockouts.py +0 -0
  53. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/page.py +0 -0
  54. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/payload.py +0 -0
  55. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/quality.py +0 -0
  56. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/assets/app.css +0 -0
  57. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/assets/swagger/LICENSE +0 -0
  58. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/assets/swagger/NOTICE +0 -0
  59. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/assets/swagger/swagger-ui-bundle.js +0 -0
  60. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/assets/swagger/swagger-ui-bundle.js.LICENSE.txt +0 -0
  61. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/assets/swagger/swagger-ui.css +0 -0
  62. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/static/favicon.svg +0 -0
  63. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/stats.py +0 -0
  64. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/store.py +0 -0
  65. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/traffic.py +0 -0
  66. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/update.py +0 -0
  67. {texas2step-2.4.0 → texas2step-2.4.2}/src/texas2step/words.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: texas2step
3
- Version: 2.4.0
3
+ Version: 2.4.2
4
4
  Summary: Web-centric throughput, latency, jitter and packet-loss measurement between endpoints.
5
5
  Project-URL: Homepage, https://github.com/robert-patrick-texas/texas2step
6
6
  Project-URL: Documentation, https://robert-patrick-texas.github.io/texas2step/
@@ -300,7 +300,8 @@ The service logs to the journal (`journalctl -u texas2step -f`), and by default
300
300
  needs attention:
301
301
 
302
302
  * start, stop and worker messages;
303
- * warnings and errors from texas2step and from the WebRTC libraries behind the UDP probe;
303
+ * warnings and errors from texas2step, from the WebRTC libraries behind the UDP probe,
304
+ and from any other library it uses;
304
305
  * a line for each request that failed (status 400 or above), such as an upload over
305
306
  `max_upload_bytes`:
306
307
 
@@ -308,6 +309,14 @@ needs attention:
308
309
  WARNING: 203.0.113.7 - "POST /api/v1/up HTTP/2.0" 413
309
310
  ```
310
311
 
312
+ The journal files each line at its level, so you can leave out the start and stop
313
+ messages:
314
+
315
+ ```bash
316
+ journalctl -u texas2step -p warning # warnings, errors and failed requests
317
+ journalctl -u texas2step -p err # errors only
318
+ ```
319
+
311
320
  The address is the client's, as `/api/v1/whoami` reports it: behind nginx, it comes from
312
321
  `X-Forwarded-For` (see `trusted_proxies`), and the HTTP version is the one the client
313
322
  used with nginx. Successful requests aren't logged, because nginx's access log already
@@ -122,6 +122,18 @@ links and footer credit. Three places still say texas2step:
122
122
 
123
123
  Newest first. Each release's notes have the details and its upgrade steps.
124
124
 
125
+ ### [2.4.2](https://github.com/robert-patrick-texas/texas2step/releases/tag/v2.4.2) (2026-10-26)
126
+
127
+ - [x] The journal files each line at its level, so `journalctl -u texas2step -p warning`
128
+ shows warnings, errors and failed requests.
129
+ - [x] History asks for the access code only where the server gives it, which logged a
130
+ warning on servers with codes off.
131
+
132
+ ### [2.4.1](https://github.com/robert-patrick-texas/texas2step/releases/tag/v2.4.1) (2026-10-26)
133
+
134
+ - [x] A UDP session closed while it connects stops its connection checks, which logged
135
+ errors when the service stopped.
136
+
125
137
  ### [2.4.0](https://github.com/robert-patrick-texas/texas2step/releases/tag/v2.4.0) (2026-10-26)
126
138
 
127
139
  - [x] **HTTP/3 (QUIC)** and the other HTTP versions in Diag: with a name for each, rows
@@ -1,3 +1,3 @@
1
1
  """texas2step: web-centric throughput, latency, jitter and packet-loss measurement."""
2
2
 
3
- __version__ = "2.4.0"
3
+ __version__ = "2.4.2"
@@ -1,7 +1,8 @@
1
1
  """What the server logs: quiet by default, verbose with ``debug = true``.
2
2
 
3
3
  uvicorn applies :func:`config` in every worker. Lines go to stderr, which systemd sends
4
- to the journal. One line per request comes from texas2step (``app.RequestLog``), with the
4
+ to the journal, each with its level as a syslog priority in front for journald to file
5
+ it by. One line per request comes from texas2step (``app.RequestLog``), with the
5
6
  client's real address behind nginx: successes at INFO and failures at WARNING, so the
6
7
  ``texas2step`` logger's level decides which are written.
7
8
  """
@@ -9,8 +10,12 @@ client's real address behind nginx: successes at INFO and failures at WARNING, s
9
10
  from __future__ import annotations
10
11
 
11
12
  import logging
13
+ import os
14
+ import sys
12
15
  from typing import Any
13
16
 
17
+ from uvicorn.logging import DefaultFormatter
18
+
14
19
  # uvicorn's own WebSocket lines, by their format strings. They show the proxy's address,
15
20
  # and RequestLog writes the same events with the client's.
16
21
  UVICORN_WEBSOCKET = ('"WebSocket %s"', "connection open", "connection closed")
@@ -21,9 +26,48 @@ class NoUvicornWebSockets(logging.Filter):
21
26
  return not any(text in str(record.msg) for text in UVICORN_WEBSOCKET)
22
27
 
23
28
 
29
+ def to_journal() -> bool:
30
+ """Whether stderr is systemd's stream to the journal, which it names in JOURNAL_STREAM
31
+ as device:inode. A program the service starts inherits the variable, not always the
32
+ stream."""
33
+ try:
34
+ device, inode = (int(n) for n in os.environ["JOURNAL_STREAM"].split(":"))
35
+ stat = os.fstat(sys.stderr.fileno())
36
+ except (KeyError, ValueError, OSError, AttributeError):
37
+ return False
38
+ return (stat.st_dev, stat.st_ino) == (device, inode)
39
+
40
+
41
+ def priority(level: int) -> int:
42
+ """The syslog priority of a logging level: 2 critical, 3 error, 4 warning, 6 info, 7 debug."""
43
+ for floor, value in ((logging.CRITICAL, 2), (logging.ERROR, 3), (logging.WARNING, 4)):
44
+ if level >= floor:
45
+ return value
46
+ return 6 if level >= logging.INFO else 7
47
+
48
+
49
+ class Formatter(DefaultFormatter):
50
+ """uvicorn's, with ``journal``: each line starts with its priority, as ``<4>``, which
51
+ journald files it by and drops (sd-daemon(3)). Without it, journald files every line
52
+ as info, and ``journalctl -p warning`` finds nothing. A traceback goes as many lines,
53
+ so each gets one."""
54
+
55
+ def __init__(self, *args: Any, journal: bool = False, **kwargs: Any) -> None:
56
+ super().__init__(*args, **kwargs)
57
+ self.journal = journal
58
+
59
+ def format(self, record: logging.LogRecord) -> str:
60
+ text = super().format(record)
61
+ if not self.journal:
62
+ return text
63
+ prefix = f"<{priority(record.levelno)}>"
64
+ return "\n".join(prefix + line for line in text.split("\n"))
65
+
66
+
24
67
  def config(debug: bool) -> dict[str, Any]:
25
68
  """A logging.config.dictConfig for uvicorn.run."""
26
69
  level = "DEBUG" if debug else "WARNING"
70
+ journal = to_journal()
27
71
 
28
72
  def logger(handler: str, level: str | None = None) -> dict[str, Any]:
29
73
  return {"handlers": [handler], "propagate": False} | ({"level": level} if level else {})
@@ -34,14 +78,16 @@ def config(debug: bool) -> dict[str, Any]:
34
78
  "filters": {"no_websockets": {"()": NoUvicornWebSockets}},
35
79
  "formatters": {
36
80
  "plain": {
37
- "()": "uvicorn.logging.DefaultFormatter",
81
+ "()": Formatter,
38
82
  "fmt": "%(levelprefix)s %(message)s",
39
83
  "use_colors": None,
84
+ "journal": journal,
40
85
  },
41
86
  "named": {
42
- "()": "uvicorn.logging.DefaultFormatter",
87
+ "()": Formatter,
43
88
  "fmt": "%(levelprefix)s %(name)s: %(message)s",
44
89
  "use_colors": None,
90
+ "journal": journal,
45
91
  },
46
92
  },
47
93
  "handlers": {
@@ -70,4 +116,7 @@ def config(debug: bool) -> dict[str, Any]:
70
116
  "aiortc": logger("named", level),
71
117
  "aiortc.rtcsctptransport": {"level": "INFO" if debug else "WARNING"},
72
118
  },
119
+ # Any other library's warnings and errors, such as asyncio's "Task exception was
120
+ # never retrieved", which logging's last resort used to write without a level.
121
+ "root": {"handlers": ["named"], "level": "WARNING"},
73
122
  }
@@ -142,12 +142,28 @@ if AVAILABLE:
142
142
  aioice binds every host socket to port 0, and aiortc has no option to change that.
143
143
  A connection created while ``_PORT_RANGE`` is set binds its host sockets here
144
144
  instead and leaves the STUN and TURN candidates to aioice. Without a range it
145
- behaves exactly like its base class.
145
+ behaves like its base class, but for stopping its checks when it closes.
146
146
  """
147
147
 
148
148
  def __init__(self, *args: Any, **kwargs: Any) -> None:
149
149
  super().__init__(*args, **kwargs)
150
150
  self.port_range = _PORT_RANGE.get()
151
+ self._closing = False
152
+
153
+ # aioice closes the sockets but leaves its checks retrying, and keeps starting the
154
+ # waiting ones; each send then hits a closed socket, which asyncio raises (on an
155
+ # unconnected UDP transport) into the check. A session closed while its ICE is
156
+ # under way, such as one a block ends, stops them here instead.
157
+ def check_start_task(self, pair: Any) -> None:
158
+ if not self._closing:
159
+ super().check_start_task(pair)
160
+
161
+ async def close(self) -> None:
162
+ self._closing = True
163
+ for pair in self._check_list:
164
+ if pair.task is not None:
165
+ pair.task.cancel()
166
+ await super().close()
151
167
 
152
168
  async def get_component_candidates(
153
169
  self,