Repository navigation
Fix: Accept Hermes addresses typed without https:// - #67
Conversation
An address without a scheme (myhost.ts.net, 100.88.1.2:8642) used to fail with "Enter the server address". It now gets one: http:// for loopback, .local, private and Tailscale IPs, https:// otherwise. Applies to both the API server and the web UI address; the plain-http rules for sign-in are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughHermes API and dashboard address handling now adds a scheme when none is supplied. Local addresses use HTTP, and other addresses use HTTPS. Explicit schemes remain unchanged. Tests cover inferred schemes, ports, profile paths, and URL rejection. ChangesHermes URL normalization
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Merge Risk: 🔵 Low · up to Scheme-free IPv6 loopback addresses may not connect to an HTTP-only Hermes server. This narrow case can be fixed in follow-up; the PR is otherwise mergeable. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Address auto-detection can mistake certain public hostnames for private IP addresses and silently select unencrypted HTTP. This can expose credentials and conversation traffic to network interception. Exposure requires configuring an affected address; ordinary public hostnames still default to HTTPS. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
rayl15
left a comment
There was a problem hiding this comment.
Thanks, this is a clear win for the first-run experience. withScheme keeps a typed scheme, isUnencryptedRemote is behaviour-preserving (I checked each branch of the new isLocalHost against the old switch), and the dashboard base gets the same treatment, with the plain-http-to-a-public-host rule still enforced.
Two non-blocking nits for a later pass:
- The two
TextFieldplaceholders inHermesSettingsViewstill readhttps://hermes.example.com. Now that the scheme is optional,hermes.example.comwould match what the new error message teaches. - A dot-less host (
hermes-box,nuc) is almost always a LAN machine without a certificate, so defaulting it tohttp://like.localwould help. Likewise a*.ts.nethost typed with an explicit port is probably nottailscale serve(which answers on 443), sohttpis the better guess there.
Merging.
* Fix: Better scheme guesses for Hermes addresses Follow-up to the #67 review: - A dot-less host (nuc, hermes-box) is a LAN machine: it gets http:// and counts as local, like .local names, so its web UI can sign in. - A *.ts.net name typed with a port gets http:// (tailscale serve answers https on 443, so a port means the server itself). - The address fields' placeholders drop https://, matching the error message. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Fix: Don't trust dot-less Hermes hosts for plain http A dot-less name still gets http:// as the guess, but it no longer counts as local: it can also resolve through a search domain. So the API key warning shows for it and the web UI can't sign in over http, as before this PR. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
What & why
Found during the live API-key check reported on #65. A Hermes address typed without a scheme (
myhost.ts.net,100.88.1.2:8642) failed with "Enter the server address, e.g. https://hermes.example.com." It's easy to trip on, since most people type just the host.Both Hermes address fields (the API server, and the web UI for username & password) now add the scheme themselves:
http://for loopback,.local, private (RFC 1918) and Tailscale (100.64.0.0/10) IPs, where servers rarely have a certificate. The Hermes API server listens on plain http by default.https://for everything else, including*.ts.net(whattailscale servegives you).A scheme the user typed is kept. The plain-http rule from #63 is unchanged: no sign-in over plain http to a public host, and the API key warning still shows. The private-range check moved into
isLocalHostso both paths share it. The leftover error now says what a valid address looks like.How it was tested
iPhone 16 Pro Max, iOS 27.2.
testAddressWithoutSchemeGetsOnecovers host names,*.ts.net, Tailscale and LAN IPs with a port and profile path, the web UI base, and keeping a typed scheme.HermesTests: 25 tests, 0 failures on the device. API-key mode was also checked live against my Hermes server (result on Store API keys in the Keychain instead of settings.json #65).Checklist
xcodegen generateif files were added/removed (no files added)Breaking changes
None. Addresses that worked before parse the same way.
Notes for reviewers
No layout changes, only an error message's wording, so no screenshots.
🤖 Generated with Claude Code
Summary by CodeRabbit