Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
sudo apt-get install -y --no-install-recommends \
build-essential cmake ninja-build git curl \
libuv1-dev zlib1g-dev libssl-dev libsqlite3-dev
- name: Build libuvcpp 1.8.2 SDK
- name: Build libuvcpp 1.9.1 SDK
run: bash ./scripts/build-libuvcpp.sh .deps/libuvcpp-src .deps/libuvcpp
- name: Configure uvscope
run: |
Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
path: web/dist
- name: Install build dependencies
run: brew install cmake ninja libuv openssl@3 sqlite
- name: Build libuvcpp 1.8.2 SDK
- name: Build libuvcpp 1.9.1 SDK
run: |
export OPENSSL_ROOT_DIR="$(brew --prefix openssl@3)"
export CMAKE_PREFIX_PATH="$OPENSSL_ROOT_DIR"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs:
run: |
mkdir -p packages stage
cmake --install build --prefix "$PWD/stage"
# macOS 1.0.1 is a source-oriented build: libuvcpp and llhttp are
# macOS 1.0.2 is a source-oriented build: libuvcpp and llhttp are
# bundled; Homebrew supplies libuv and OpenSSL. Record the linkage for
# diagnostics and ad-hoc sign the executable.
otool -L stage/bin/uvscope || true
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ All notable changes to uvscope are documented here. The format is based on
`cancelled` result immediately instead of waiting for the configured timeout, and is not written
to history.

### Changed

- Build against **libuvcpp 1.9.1**. The HTTP/2 terminal route uses
`uvcpp_web_app::websocket_connect()`, which is newer than the previous 1.8.2
SDK; configure now requires 1.9.1.

### Fixed

- **Terminal WebSocket over HTTP/2.** Chrome and Edge use RFC 8441 extended CONNECT when the
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ option(UVSCOPE_PACKAGE_RUNTIME "Install the libuvcpp runtime beside uvscope" ON)
# https://github.com/Antruly/libuvcpp/releases). No package manager or
# additional networking library is required.
# ---------------------------------------------------------------------------
set(UVCPP_ROOT "" CACHE PATH "Path to an extracted libuvcpp 1.8.2 SDK")
set(UVCPP_ROOT "" CACHE PATH "Path to an extracted libuvcpp 1.9.1 SDK")
set(_uvcpp_hints "")
if(UVCPP_ROOT)
list(APPEND _uvcpp_hints "${UVCPP_ROOT}")
Expand All @@ -46,21 +46,21 @@ find_library(UVCPP_LIBRARY
DOC "libuvcpp library")
if(NOT UVCPP_INCLUDE_DIR OR NOT UVCPP_LIBRARY)
message(FATAL_ERROR
"libuvcpp 1.8.2 was not found.\n"
"Download a release SDK and configure with -DUVCPP_ROOT=/path/to/libuvcpp-1.8.2-<platform>,\n"
"libuvcpp 1.9.1 was not found.\n"
"Download a release SDK and configure with -DUVCPP_ROOT=/path/to/libuvcpp-1.9.1-<platform>,\n"
"or set the UVCPP_ROOT environment variable. See docs/BUILDING.md.")
endif()
get_filename_component(UVCPP_LIBRARY_DIR "${UVCPP_LIBRARY}" DIRECTORY)
message(STATUS "libuvcpp headers: ${UVCPP_INCLUDE_DIR}")
message(STATUS "libuvcpp library: ${UVCPP_LIBRARY}")

# uvscope requires the 1.8.2 SDK: TLS peer chains, SOCKS5 session statistics,
# uvscope requires the 1.9.1 SDK: TLS peer chains, SOCKS5 session statistics,
# AF_UNSPEC resolution and the blocking-I/O deadline are all part of it. Fail
# here instead of silently building a runtime that is missing those paths.
set(_uvcpp_version_header "${UVCPP_INCLUDE_DIR}/uvcpp/uvcpp_version.h")
if(NOT EXISTS "${_uvcpp_version_header}")
message(FATAL_ERROR
"libuvcpp version header missing from ${UVCPP_INCLUDE_DIR}; use a 1.8.2 release SDK.")
"libuvcpp version header missing from ${UVCPP_INCLUDE_DIR}; use a 1.9.1 release SDK.")
endif()
file(STRINGS "${_uvcpp_version_header}" _uvcpp_version_major
REGEX "^#define UVCPP_VERSION_MAJOR ([0-9]+)$")
Expand All @@ -79,10 +79,10 @@ endif()
set(UVCPP_DETECTED_VERSION
"${UVCPP_VERSION_MAJOR}.${UVCPP_VERSION_MINOR}.${UVCPP_VERSION_PATCH}")
message(STATUS "libuvcpp version: ${UVCPP_DETECTED_VERSION}")
if(UVCPP_DETECTED_VERSION VERSION_LESS "1.8.2")
if(UVCPP_DETECTED_VERSION VERSION_LESS "1.9.1")
message(FATAL_ERROR
"libuvcpp ${UVCPP_DETECTED_VERSION} is too old; uvscope requires 1.8.2 or newer.\n"
"Rebuild the SDK with ./scripts/build-libuvcpp.sh or point UVCPP_ROOT at a 1.8.2 release.")
"libuvcpp ${UVCPP_DETECTED_VERSION} is too old; uvscope requires 1.9.1 or newer.\n"
"Rebuild the SDK with ./scripts/build-libuvcpp.sh or point UVCPP_ROOT at a 1.9.1 release.")
endif()

# libuvcpp.dll is required next to the executable on Windows. The archive's
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ include a screenshot at 1600×1000 (and a narrow viewport if relevant). Follow t

## libuvcpp changes

uvscope builds against the libuvcpp **v1.8.2** release SDK. One patch is currently carried on top
uvscope builds against the libuvcpp **v1.9.1** release SDK. One patch is currently carried on top
of that tag: `patches/upstream/0005-ws-client-handshake-headers.patch`, which adds
`uvcpp_ws_client::set_handshake_header()` so the backend WebSocket debugger can send
`Authorization`, `Origin`, `Cookie` and `Sec-WebSocket-Protocol` during the Upgrade request. The
earlier SNI, POSIX timeout, install-completeness and SOCKS5 stage patches were retired in
1.8.1/1.8.2; see [docs/LIBUVCPP_UPSTREAM.zh-CN.md](docs/LIBUVCPP_UPSTREAM.zh-CN.md).
1.8.1/1.8.2; v1.9.1 is required for `uvcpp_web_app::websocket_connect()` (HTTP/2 and HTTP/3
WebSockets). See [docs/LIBUVCPP_UPSTREAM.zh-CN.md](docs/LIBUVCPP_UPSTREAM.zh-CN.md).

If a new patch is needed, it must include:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Most tools stop at request/response. uvscope is built around the whole handshake
- **Local-first** — SQLite, server-side sessions, PBKDF2 password hashing, RBAC and a first-run
administrator flow. No telemetry, no cloud account, no external database.
- **One network stack** — every target connection is driven by
[libuvcpp](https://github.com/Antruly/libuvcpp) 1.8.2, from socket to UI.
[libuvcpp](https://github.com/Antruly/libuvcpp) 1.9.1, from socket to UI.
- **A UI that keeps context** — collapsible navigation, cached multi-tab workspaces, live
telemetry and an offline command library built with Vue 3, Pinia and Vite.

Expand Down Expand Up @@ -124,11 +124,11 @@ cd uvscope
./build/uvscope --port 8787 --open
```

`build.sh` clones the libuvcpp v1.8.2 release into `.deps/`, applies the one minimal upstream
`build.sh` clones the libuvcpp v1.9.1 release into `.deps/`, applies the one minimal upstream
patch shipped in `patches/upstream/` (WebSocket handshake headers), builds the frontend, then
builds uvscope and runs `--self-check`.

If you already have a libuvcpp 1.8.2 SDK:
If you already have a libuvcpp 1.9.1 SDK:

```sh
npm --prefix web ci && npm --prefix web run build
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Treat access to uvscope as equivalent to code execution with the daemon user's n

## Dependency vulnerabilities

uvscope pins libuvcpp 1.8.2 (release SDK, plus the minimal WebSocket handshake-header patch kept
uvscope pins libuvcpp 1.9.1 (release SDK, plus the minimal WebSocket handshake-header patch kept
in [`patches/upstream/`](patches/upstream/)). The release also publishes an SPDX SBOM, a
`SHA256SUMS` file and a Sigstore keyless signature over the checksums so consumers can audit and
verify what they run. If a dependency advisory applies, open a normal issue for non-sensitive
Expand Down
4 changes: 2 additions & 2 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ at the top level) plus `live`:
- The chain is returned even when verification fails (self-signed, expired, wrong host), so the
UI can inspect the certificate; `verified` is false and `verifyError` carries the OpenSSL text.
- `insecure: true` disables verification for the handshake itself.
- The build requires libuvcpp 1.8.2, which provides `peer_cert_chain_der`.
- The build requires libuvcpp 1.9.1, which provides `peer_cert_chain_der`.
- HTTP/3 is not supported by this probe; ALPN is reported when the build enables HTTP/2.

`POST /api/socks5/servers` binds a local SOCKS5 port. Leaving `username` and `password` empty
enables no-auth; providing both enables RFC 1929 username/password authentication. The password is
stored as a PBKDF2 hash and is never returned. SOCKS5 servers default to `127.0.0.1` and must be
moved to a LAN address explicitly. Sessions report the requested command, target, peer, status and
error. The libuvcpp 1.8.2 session-end callback adds `bytesClientToTarget`,
error. The libuvcpp 1.9.1 session-end callback adds `bytesClientToTarget`,
`bytesTargetToClient`, `udpDatagrams`, `udpBytes`, `durationMs`, `endedAt` and `endStatus`.

With `isolated: true` the server runs in a `--socks5-child` process. Its snapshot includes
Expand Down
6 changes: 3 additions & 3 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ persistence, protocol clients and the gateway runtimes. The SPA is a view over t
│ Socks5Manager │
│ └─ one libuv loop thread per running SOCKS5 server │
│ │
│ libuvcpp 1.8.2 │
│ libuvcpp 1.9.1 │
└───────────────────────────────┬─────────────────────────────────────┘
│
HTTP(S) / TCP / UDP / TLS targets
Expand Down Expand Up @@ -227,7 +227,7 @@ proxies(id PK, name, listen_host, listen_port, target, auto_start, tls, cert_pat
`set_socks5_proxy()` (CONNECT); UDP uses `uvcpp_socks5_client` with UDP ASSOCIATE.
- Target hostnames are passed to the proxy as `ATYP=DOMAIN`; no local resolution is performed.
- There is no direct fallback: any configured proxy failure ends the request.
- libuvcpp 1.8.2 exposes whether the last SOCKS5 failure happened while connecting to the proxy
- libuvcpp 1.9.1 exposes whether the last SOCKS5 failure happened while connecting to the proxy
or after the proxy replied, so `proxy_unreachable` and `target_rejected` are distinguishable.

## SOCKS5 server runtime
Expand Down Expand Up @@ -301,7 +301,7 @@ not an HTTP 500 for the API; it is a successful probe request whose `ok` is fals

## Dependencies

- **libuvcpp 1.8.2** — HTTP server/client, WebSocket, SQLite wrapper, WSDL/SOAP, SSL.
- **libuvcpp 1.9.1** — HTTP server/client, WebSocket, SQLite wrapper, WSDL/SOAP, SSL.
- **OpenSSL** — password hashing, certificate parsing and TLS (libuvcpp uses it for transport).
- **SQLite** — local state.
- **Vue 3 / Vite / Pinia / Vue Router** — SPA.
Expand Down
9 changes: 5 additions & 4 deletions docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ Node.js 20+ is required for the frontend.

## The libuvcpp SDK

uvscope requires the libuvcpp **1.8.2** release SDK. Earlier releases lack the fixes uvscope used
uvscope requires the libuvcpp **1.9.1** release SDK. Earlier releases lack the fixes uvscope used
to carry as local patches (TLS SNI, POSIX blocking-I/O timeouts, a complete `cmake --install`
tree and the SOCKS5 proxy failure stage); those are all part of 1.8.1/1.8.2. Configure fails
early when the detected SDK is older than 1.8.2.
tree and the SOCKS5 proxy failure stage); those are all part of 1.8.1/1.8.2. 1.9.1 is also
required for `uvcpp_web_app::websocket_connect()` (HTTP/2 and HTTP/3 WebSockets). Configure
fails early when the detected SDK is older than 1.9.1.

Build the SDK from the release tag:

```sh
./scripts/build-libuvcpp.sh
```

This clones `v1.8.2` into `.deps/libuvcpp-src`, applies the patches in
This clones `v1.9.1` into `.deps/libuvcpp-src`, applies the patches in
[`patches/upstream/`](../patches/upstream/) (currently the WebSocket handshake-header patch),
builds a lean runtime (HTTP/1.1 + HTTP/2, WebSocket, webapp, SSL, SQLite, WSDL, brotli) and
installs it to `.deps/libuvcpp`. A cached source
Expand Down
6 changes: 3 additions & 3 deletions patches/upstream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ The patches that used to live here were retired when libuvcpp **v1.8.2** was rel
| `0003-install-complete.patch` | v1.8.1 |
| `0004-socks5-proxy-stage.patch` | v1.8.2 (PR #42) |

One patch is currently carried on top of the v1.8.2 release:
One patch is currently carried on top of the v1.9.1 release:

| Patch | Topic |
| --- | --- |
| `0005-ws-client-handshake-headers.patch` | `uvcpp_ws_client::set_handshake_header()` so the backend WebSocket debugger can send `Authorization`, `Origin`, `Cookie` and `Sec-WebSocket-Protocol` during the Upgrade request |

uvscope builds against the release SDK (`scripts/build-libuvcpp.sh` clones `v1.8.2` and applies the
patch), and CMake rejects any SDK older than 1.8.2. See
uvscope builds against the release SDK (`scripts/build-libuvcpp.sh` clones `v1.9.1` and applies the
patch), and CMake rejects any SDK older than 1.9.1. See
[`docs/LIBUVCPP_UPSTREAM.zh-CN.md`](../../docs/LIBUVCPP_UPSTREAM.zh-CN.md) for the original
reproduction notes.

Expand Down
4 changes: 2 additions & 2 deletions scripts/build-libuvcpp.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Build the libuvcpp release runtime used by uvscope.
#
# uvscope requires libuvcpp 1.8.2 or newer; the fixes uvscope used to carry as
# uvscope requires libuvcpp 1.9.1 or newer; the fixes uvscope used to carry as
# local patches (TLS SNI, POSIX blocking-I/O timeouts, complete install tree,
# SOCKS5 proxy stage) are part of the released SDK. See
# docs/LIBUVCPP_UPSTREAM.zh-CN.md for the history.
Expand All @@ -11,7 +11,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SRC_DIR="${1:-${ROOT_DIR}/.deps/libuvcpp-src}"
PREFIX="${2:-${ROOT_DIR}/.deps/libuvcpp}"
JOBS="${JOBS:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)}"
LIBUVCPP_TAG="${LIBUVCPP_TAG:-v1.8.2}"
LIBUVCPP_TAG="${LIBUVCPP_TAG:-v1.9.1}"

mkdir -p "$(dirname "${PREFIX}")"
PREFIX="$(cd "$(dirname "${PREFIX}")" && pwd)/$(basename "${PREFIX}")"
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# One-command developer build: libuvcpp 1.8.2 SDK + Vue frontend + uvscope.
# One-command developer build: libuvcpp 1.9.1 SDK + Vue frontend + uvscope.
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand All @@ -21,7 +21,7 @@ sdk_is_current() {
patch="$(awk '/^#define UVCPP_VERSION_PATCH /{print $3; exit}' "${header}")"
[[ "${major}" =~ ^[0-9]+$ && "${minor}" =~ ^[0-9]+$ && "${patch}" =~ ^[0-9]+$ ]] || return 1
(( major > 1 || (major == 1 && (minor > 8 || (minor == 8 && patch >= 2))) )) || return 1
# The managed SDK enables HTTP/2 and brotli by default; a cached 1.8.2 tree built
# The managed SDK enables HTTP/2 and brotli by default; a cached 1.9.1 tree built
# without them must be rebuilt rather than silently dropping the features.
if [[ "${UVCPP_ENABLE_NGHTTP2:-ON}" == "ON" ]]; then
grep -q '^# define UVCPP_NGHTTP2_ENABLE 1$' "${prefix}/include/uvcpp/uvcpp_config.h" || return 1
Expand Down
2 changes: 1 addition & 1 deletion src/tls_probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct TlsProbeInput {
};

// Connects to an https:// URL and returns the peer certificate chain plus
// verification details. Requires libuvcpp 1.8.2 (peer_cert_chain_der); older
// verification details. Requires libuvcpp 1.9.1 (peer_cert_chain_der); older
// SDKs return a structured "unsupported" result.
nlohmann::json run_tls_probe(const TlsProbeInput& input);

Expand Down
Loading