Repository navigation
Conversation
…ntegration Complete importable SDK, explicit compatibility and authentication hooks
…etime Rename deployment to compatibility and remove obsolete legacy settings. Bind cached state, controller operations and connections to the active session, preserve scoped gateway trust, and warn when version 1 configuration is loaded.
Keep JSON API requests on the controller origin, reject insecure CAS redirects and require the expected shortcut origin. Preserve structured controller errors while rejecting missing status codes and non-success HTTP responses.
Retain partial headers and payloads across read timeouts, deliver partial application data before truncation errors, and keep remote EOF sticky. Report actual payload bytes on failed writes and unblock blocked writers during Close.
Add light, dark and system themes, proxy address copying, compact connection details and trusted device controls. Show ten recent activities with a full history dialog, cover API and interaction regressions, and run panel tests in CI.
Extract ZIP entries through an os.Root so existing symlinks cannot redirect writes outside the destination. Cover traversal, external symlinks and normal nested entries with regression tests.
Treat an omitted HTTPS port and explicit :443 as the same origin, including host case differences. Use the same comparison for identity, controller and CAS redirects while preserving rejection of other hosts, ports and HTTPS downgrades. Cover the login completion regression observed against ShanghaiTech IDS.
Forward the shared Button ref to its DOM element for React 18 so Radix can position the theme dropdown and restore keyboard focus. Cover real theme menu selection, persistence, system changes and Escape focus restoration.
Use the Button destructive variant instead of competing default and custom color classes. Reduce destructive background opacity in dark mode and on hover, verified against the built UI alongside the main dialogs in both themes.
Enable logging comments independently of newline bytes and run the example through both LF and CRLF inputs. Remove an obsolete placeholder replacement.
…abled Add storage.strict_permissions, defaulting to warnings for permission inspection and restriction failures. Preserve content validation and I/O errors, pass the policy to credential and session storage, and verify existing files without changing their permissions. Keep best-effort private permissions for new files and preserve the setting during configuration migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDK 接口变更
模块与认证接口
模块路径从
geektrust改为github.com/ShanghaitechGeekPie/geektrust。公开入口包括client、auth和compatibility;下游需要更新依赖及 import,并适配以下定义。被移除的类型和方法未提供兼容别名。v0.2.1-rc1client.Authenticator/client.AuthenticatorFuncauth.IdentityProviderInfo(ctx) (auth.IdentityInfo, error)和Authenticate(ctx, *http.Client, auth.IdentityRequest) error;认证结果不再通过返回用户名表达client.PasskeyAuthenticator{Store: ...}auth.NewPasskey(store) (*auth.Passkey, error)auth.CredentialStore,再把 Passkey 放入Options.Auth.Identityclient.InspectPasskey/client.PasskeyInfoauth.InspectPasskey/auth.IdentityInfoOrigin对应Issuer,Username对应Subject,保留Kindclient.ValidatePasskeyauth.InspectPasskey,检查返回的 errorclient.BlobStoreauth.CredentialStore与client.SessionStoreLoad/Save签名保持不变;会话存储增加作用域及DeleteOptions.PromptSMS func(context.Context) (string, error)Options.Auth.OnChallenge auth.Handlerfunc(context.Context, auth.Challenge) (string, error),根据挑战类型处理输入IdentityInfo包含Issuer、Subject、Kind。SDK 在首次操作时读取身份元数据;同一 Client 的身份发生变化后,调用方需要创建新 Client。IdentityRequest.AllowInteraction告知身份提供方当前操作是否允许交互。短信挑战提供
ChallengeInfo.ID、Method、本地Deadline、可选的服务端ServerExpiresAt、LastFailure,以及Challenge.Resend func(context.Context) (auth.ChallengeInfo, error)。当前挑战方法为auth.SMS。取消、过期或替换后的挑战不可继续使用。Connect、Authenticate可以进入交互流程;后台检查、数据连接和解析遇到交互要求时返回auth.ErrInteractionRequired。client.Options字段变更ControllerURL、DeviceID、LoggerAuthenticatorAuth.Identityauth.IdentityProviderPromptSMSAuth.OnChallengeClientMode boolAuth.Mode client.SessionModefalse对应BrowserMode,true对应DesktopMode;SDK 的零值仍为BrowserModeLoginDomainAuth.LoginDomainPlatformCompatibility.Protocol.ControllerPlatformAppIDCompatibility.Fallbacks.ApplicationIDGateways []stringNetwork.AllowedGateways []string或Compatibility.Fallbacks.GatewaysDNS []stringDNS.Servers []netip.AddrDisableSystemResolver boolDNS.FallbackLookup指定额外解析来源TransportNetwork.ControlTransporthttp.RoundTripper类型DialContextNetwork.DialContextGatewayTLSConfigNetwork.GatewayTLS.Config*tls.Config类型,拒绝关闭证书验证GatewayTrustStoreNetwork.GatewayTLS.PinStore,配合ModeSessionStoreSessionStore,接口改为client.SessionStoreSessionScope隔离,并支持删除新增
Network.DialTimeout、Network.HTTPTimeout,以及CheckTarget func(context.Context, client.Target) error。Target包含Generation、Network、Host、IP、Port、Purpose;ApplicationTarget与DNSQueryTarget区分应用流量和基础 DNS 查询。该回调只能进一步限制访问权限。Compatibility.Protocol.Process可提供compatibility.ProcessMetadata{Name, Platform, Path}。Compatibility.Fallbacks.MissingGatewayGroup和StreamToL3分别控制缺少网关组时的兼容行为及流式 TCP 到 L3 的回退。空值语义:
Compatibility.Profile默认为compatibility.Auto,识别已知控制器,未知控制器使用Generic。也可显式选择ShanghaiTech、ECNU、Generic。Compatibility.Fallbacks == nil使用适配默认值;&compatibility.Fallbacks{}关闭全部兜底。上科大适配继续提供所需的证书身份及缺字段兜底;通用适配不会默认开启流式 TCP 到 L3 的回退。Network.AllowedGateways == nil不额外筛选;显式空列表拒绝全部线路。筛选作用于控制器或兼容适配得到的候选线路。DNS.Servers == nil使用控制器下发的 DNS;显式空列表禁用隧道 DNS。需要其他解析来源时提供DNS.FallbackLookup。存储与 TLS 信任定义
新的会话存储接口为:
SessionScope包含ControllerURL、IdentityIssuer、IdentitySubject、IdentityKind、DeviceID、Mode、LoginDomain。存储实现必须据此分开记录;Save必须原子且持久。SDK 在恢复前也会检查缓存归属。旧版本缺少作用域元数据的缓存会触发重新认证,不会直接复用旧 Cookie。原
GatewayTrustStore.LoadPin/SavePin改为:GatewayIdentity包含控制器 URL、网关地址和证书ServerName。默认VerifyCA使用 CA 校验;选择VerifyCAOrTOFU时必须提供PinStore。CA 校验成功时不强制检查 pin;未知 CA 的兜底仍检查证书身份、有效期及服务器用途,并要求存储原子完成检查或首次登记。Client 方法、状态及返回类型
Connect(ctx) (Info, error)/Authenticate(ctx) (Info, error)SessionInfo;保留Gateways、DNS、Resources,增加Generation、Username、DisplayNameInfo.Capabilitiesclient.ImplementedCapabilities();Capabilities.IPv4ICMP改名为IPv4ICMPEchoTransportInfoGateway、VirtualIPv4,增加GenerationEvents() <-chan EventStatus() Status和Subscribe(ctx) <-chan EventEvent{Kind, Time}/EventKind及其常量Event{Time, Status};根据Status.State处理Idle、Authenticating、Ready、InteractionRequired、Failed、ClosedExchangePacket(ctx, packet)/PacketTransportExchangeICMPEcho(ctx, packet);输入仍是完整 IPv4 包,仅支持未分片的 ICMP EchoDialContext/LookupContextHost/OpenTransport/NewDeviceID/Close新增接口:
ForgetSession(ctx) error:使当前会话失效并删除对应缓存。Shutdown(ctx) error:关闭 Client 并等待自有任务,调用方可用 context 限制等待。TrustedDevices(ctx) (TrustedDeviceList, error)、TrustCurrentDevice(ctx) error、UntrustDevices(ctx, ids) error、LogoutDevice(ctx, id) error:公开授信设备查询和管理能力。client.Error、ErrorInfo、ErrorKind:提供Kind、Op、Code、Message,支持errors.As;保留ErrClosed、ErrDenied、ErrDatagramTooLarge及errors.Is判断。Status快照包含Revision、Generation、State、Compatibility、Session、LastError。每个订阅者使用独立的有界队列,慢订阅者可能跳过中间状态,应以收到的最新快照为准。Ready表示控制器会话与当前资源可用,ImplementedCapabilities()表示实现范围,均不保证某个目标已获授权或已连通。New只验证和复制设置,首次操作才读取身份并启动会话工作。宿主仍负责凭据、设备 ID、持久化和外部网络对象的生命周期。SDK 不创建 TUN、监听器或目录,不修改系统路由、DNS 或 ACL。IPv6 目标仍未实现;UDP 保留数据报边界,payload 上限仍为 1372 字节。新 SDK 初始化示例
以下
credentials实现auth.CredentialStore,sessions实现新的client.SessionStore,prompt使用auth.Handler签名;controllerURL、deviceID由宿主提供。配置文件变更
版本 2 字段映射
新配置使用
config_version = 2,从顶层字段改为分组。上科大最小配置为:升级现有安装时应迁移旧配置,保留原设备 ID;上面的最小示例主要用于新安装。
v0.2.1-rc1配置config_version = 2base_urlcontroller.urlplatformcontroller.platformMac;允许其他合法的控制器协议值,不再只接受Maccontroller.compatibilityauto/shanghaitech/ecnu/generickeystoreauth.passkey.keystoredevice_idauth.device_idclient_typeauth.modeauto/client/browser;auto在上科大适配下选择client,其他适配选择browserlogin_domainauth.login_domainapp_idrouting.fallback_app_idgatewaysrouting.gateway_filterdnsdns.serversdns.strategyauto保留公共 DNS、系统 DNS、隧道 DNS 的既有顺序;controller只走控制器 DNS;system只用系统解析state_filestorage.state_filestorage.directory/session.enc,密钥仍为会话文件旁的.keystorage.directorystorage.strict_permissionsfalse,权限检查或设置问题输出警告;true时阻止操作。旧格式可使用新增的顶层strict_permissionslog_levellogging.leveldebug/info/warn/error[inbound.socks5] enabled/listen[proxy.socks5] listen127.0.0.1:1080;空字符串禁用[inbound.http] enabled/listen[proxy.http] listen127.0.0.1:8080;空字符串禁用[web] enabled/listen[web] listen127.0.0.1:8081;空字符串禁用,仍仅允许回环地址tls.gateway.server_name/tls.gateway.ca_file需要注意的行为差异
gateways会覆盖线路;版本 2 的gateway_filter只筛选已有候选线路。版本 2 省略gateway_filter表示不额外筛选,显式gateway_filter = []表示拒绝全部线路。listen = ""禁用代理或面板,不再使用enabled。旧格式仍识别原来的开关。config check查看警告。网关地址和 DNS 配置会执行更严格的校验,隧道 DNS 只接受 IPv4。init生成版本 2 配置;缺省设备身份只在启动客户端时创建。config check/show不创建身份或重写配置。VerifyCAOrTOFU和原子 pin 存储属于 SDK 接口。检查与迁移
migrate默认只输出预览。--write先创建config.toml.v1.bak,再替换配置并重新加载检查;已有备份不会被覆盖。原设备 ID、认证模式、凭据及会话路径会保留,迁移命令不会删除或重置 Passkey、签名计数器及原加密缓存。如果旧配置包含非空
gateways,自动迁移会拒绝执行,需要人工选择新的筛选规则。保留缓存文件不代表能直接恢复旧会话:旧缓存缺少新增的身份及控制器归属信息,首次升级连接需要重新认证。其他改动
1.26.8+;完整 Web 面板需要 Node22.22+。更新网络依赖及跨平台 CI。