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
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ jobs:
node --import tsx tools/package-browser-client.ts
version="${GITHUB_REF_NAME#v}"
archive="abridge-client-browser-$version-linux.tar.gz"
cp -- ".local/release/browser-client/$archive" dist/releases/
installer="install-browser-client.sh"
cp -- ".local/release/browser-client/$archive" ".local/release/browser-client/$installer" dist/releases/
cd dist/releases
test "$(tar -xOf "$archive" abridge-client-browser/version)" = "$version"
bash -n "$installer"
sha256sum -- "$archive" > "$archive.sha256"
sha256sum -- "$installer" > "$installer.sha256"
- name: Build portable unsigned macOS candidate
if: runner.os == 'macOS'
run: npm run package:macos -- --reuse-build
Expand Down Expand Up @@ -94,6 +97,7 @@ jobs:
dist/releases/*.tgz
dist/releases/abridge-browser-*.zip
dist/releases/abridge-client-browser-*.tar.gz*
dist/releases/install-browser-client.sh*
dist/releases/aBridge-*-android.apk
if-no-files-found: error
retention-days: 14
Expand Down Expand Up @@ -184,12 +188,15 @@ jobs:
checksums+=("$archive.sha256")
done
browser_archive="abridge-client-browser-$version-linux.tar.gz"
mv -- "$GITHUB_WORKSPACE/release/$browser_archive" "$GITHUB_WORKSPACE/release/$browser_archive.sha256" .
archives+=("$browser_archive")
checksums+=("$browser_archive.sha256")
installer="install-browser-client.sh"
mv -- "$GITHUB_WORKSPACE/release/$browser_archive" "$GITHUB_WORKSPACE/release/$browser_archive.sha256" \
"$GITHUB_WORKSPACE/release/$installer" "$GITHUB_WORKSPACE/release/$installer.sha256" .
archives+=("$browser_archive" "$installer")
checksums+=("$browser_archive.sha256" "$installer.sha256")
sha256sum --check --strict -- "${checksums[@]}"
cp -- "${archives[@]}" "$GITHUB_WORKSPACE/release/"
cp -- "${archives[@]}" "$installer.sha256" "$GITHUB_WORKSPACE/release/"
sha256sum -- "${archives[@]}" > "$GITHUB_WORKSPACE/release/SHA256SUMS"
(cd "$GITHUB_WORKSPACE/release" && sha256sum --check --strict SHA256SUMS)
- name: Verify Windows release assets
working-directory: release
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions apps/agent/cmd/abridge-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func endpoint(name, value string) string {
if err != nil || u.Host == "" || (u.Scheme != "https" && u.Scheme != "http") || u.User != nil || u.Fragment != "" || u.RawQuery != "" {
log.Fatalf("%s must be an HTTP(S) service URL", name)
}
if u.Scheme == "http" && !strings.EqualFold(u.Hostname(), "localhost") && !net.ParseIP(u.Hostname()).IsLoopback() {
log.Printf("Warning: %s uses unencrypted HTTP. Credentials and requests are sent without TLS.", name)
}
return value
}

Expand Down
31 changes: 30 additions & 1 deletion apps/agent/cmd/abridge-agent/model_settings_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package main

import "testing"
import (
"bytes"
"log"
"strings"
"testing"
)

func TestModelSettingsUsesSystemDeepSeekKeyOnlyForOfficialEndpoint(t *testing.T) {
env := map[string]string{"DEEPSEEK_API_KEY": "system-test-value"}
Expand All @@ -16,3 +21,27 @@ func TestModelSettingsUsesSystemDeepSeekKeyOnlyForOfficialEndpoint(t *testing.T)
t.Fatal("custom model endpoint must require its own credentials")
}
}

func TestEndpointSupportsHTTPAndWarnsForRemoteCleartext(t *testing.T) {
for _, test := range []struct {
address string
warn bool
}{
{"http://bridge.example:8765/mcp", true},
{"http://127.0.0.1:8765/mcp", false},
{"https://bridge.example/mcp", false},
} {
t.Run(test.address, func(t *testing.T) {
var stderr bytes.Buffer
previous := log.Writer()
log.SetOutput(&stderr)
t.Cleanup(func() { log.SetOutput(previous) })
if endpoint("ABRIDGE_MCP_URL", test.address) != test.address {
t.Fatal("endpoint changed the configured address")
}
if strings.Contains(stderr.String(), "unencrypted HTTP") != test.warn {
t.Fatalf("unexpected transport warning: %q", stderr.String())
}
})
}
}
2 changes: 1 addition & 1 deletion apps/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The client reports screen-off and locked states separately. Screen and input cap

To unbind, open **设置 → 解除设备绑定** and confirm. The app stops accepting operations and returns to the connection form immediately. When connected, it also requests revocation from the server. If the app cannot confirm revocation, remove the old device in the server console.

Use HTTPS for remote connections. If you enter an HTTP address, the app asks you to confirm it because the key and device traffic will travel without encryption. The confirmation applies to the saved address, and a device bound over HTTPS keeps using HTTPS.
The app accepts HTTP and HTTPS server addresses. When you enter an HTTP address, the app asks you to confirm that the key and device traffic will travel without encryption. The confirmation applies to the saved address, and a device bound over HTTPS keeps using HTTPS.

To update the signed app, go to **设置 → 检查更新**. Open the downloaded APK and follow the Android installer. [Android release process](../../docs/releasing.md#android)

Expand Down
22 changes: 20 additions & 2 deletions apps/browser-client/abridge-client-browser
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ from playwright.sync_api import Error, sync_playwright
INSTALLATION = Path(__file__).resolve().parent
MAX_MESSAGE = 8192
FAILED = {"status": "failed"}
LOOPBACK_HOSTS = {"localhost", "127.0.0.1", "::1"}


class BindingMissing(ValueError):
Expand All @@ -43,14 +44,31 @@ def valid_origin(origin: str, allow_http: bool = False) -> str:
or origin != f"{url.scheme}://{authority}"
or any(c.isspace() or c in "%\\@*" for c in host)
or url.scheme not in {"https", "http"}
or (url.scheme == "http" and not allow_http and host not in {"localhost", "127.0.0.1", "::1"})
or (url.scheme == "http" and not allow_http and host not in LOOPBACK_HOSTS)
):
raise ValueError("invalid server origin")
if port == (443 if url.scheme == "https" else 80):
return f"{url.scheme}://{address}"
return origin


def bind_origin(server: str, *, private_stdin: bool, allow_http: bool) -> str:
"""交互绑定先确认远端 HTTP,私有输入使用显式确认参数。"""
origin = valid_origin(server, allow_http=True)
url = urlsplit(origin)
if url.scheme != "http" or url.hostname in LOOPBACK_HOSTS:
return origin
print(f"HTTP 会明文传输设备凭证和操作数据:{origin}", file=sys.stderr)
if not allow_http:
if private_stdin or not sys.stdin.isatty():
sys.exit("请在交互终端确认,或为此地址显式指定 --allow-http。")
print("继续使用 HTTP?[y/N] ", end="", file=sys.stderr, flush=True)
answer = sys.stdin.readline(32)
if not answer.endswith("\n") or answer.strip().lower() not in {"y", "yes"}:
sys.exit("已取消 HTTP 绑定。")
return origin


class NoRedirect(urllib.request.HTTPRedirectHandler):
"""禁止跟随携带凭据的请求重定向。"""

Expand Down Expand Up @@ -471,7 +489,7 @@ def main() -> None:
if bundled_browser.exists():
os.environ["PLAYWRIGHT_BROWSERS_PATH"] = str(bundled_browser)
if args.action == "bind":
origin = valid_origin(args.server, args.allow_http)
origin = bind_origin(args.server, private_stdin=args.stdin, allow_http=args.allow_http)
if not args.stdin and not sys.stdin.isatty():
raise ValueError("binding requires a terminal or private stdin")
key = sys.stdin.readline(MAX_MESSAGE).strip() if args.stdin else getpass.getpass("Browser Device Key: ")
Expand Down
Loading
Loading