From c0ab503b57b13c9d47d1f91cfde518817a4cad9c Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Wed, 15 Apr 2026 01:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/xboard/service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/service/xboard/service.go b/service/xboard/service.go index 52a00c77..6a89b671 100644 --- a/service/xboard/service.go +++ b/service/xboard/service.go @@ -626,7 +626,7 @@ func (s *Service) setupNode() error { ssOptions.Users = []option.ShadowsocksUser{{ Password: base64.StdEncoding.EncodeToString(dummyKey), }} - s.logger.Info("Xboard SS2022 setup. Method: ", method, " ServerKey (PSK) used directly from panel") + s.logger.Info("Xboard SS2022 setup. Method: ", method, " ServerKey(PSK): ", serverKey) } else { // Legacy SS: password-based ssOptions.Password = serverKey @@ -892,7 +892,12 @@ func (s *Service) syncUsers() { // V2bX approach for SS2022 user key: // Take first keyLen bytes of UUID, then base64 encode if isSS2022 { + originalKey := key key = ss2022UserKey(key, ss2022KeyLen) + if len(newUsers) == 0 { + // Log first user's key derivation for debugging + s.logger.Info("SS2022 user key derivation: UUID[:", ss2022KeyLen, "]=", originalKey[:min(ss2022KeyLen, len(originalKey))], " → uPSK=", key) + } } newUsers[u.Email] = userData{