Commit Graph

7 Commits

Author SHA1 Message Date
ZacharyZcR bfd441e1f3 Fix SSH host metrics authentication bug after credential changes
Problem: When users changed host authentication credentials, the main SSH
connection worked fine, but metrics collection failed with "All configured
authentication methods failed" error.

Root Cause: The metrics collection system (server-stats.ts) had its own
separate authentication implementation that only supported legacy password/key
fields and didn't integrate with the credential-based authentication system.

Solution:
- Remove duplicate HostRecord type, use unified SSHHostWithCredentials
- Import and use ssh-host.service for consistent credential resolution
- Update fetchAllHosts() to properly resolve credentials using getHostWithCredentials()
- Enhance buildSshConfig() with same authentication logic as main connections
- Add proper error handling for missing credentials
- Support both credential-based and legacy authentication methods

Benefits:
- Eliminates authentication logic duplication (follows "good taste" principle)
- Metrics collection now works after changing host credentials
- Uses single source of truth for credential resolution
- Maintains backward compatibility with legacy authentication
- Better error messages for debugging authentication issues

Now both main SSH connections and metrics collection use the same robust
authentication system, eliminating the authentication divergence that caused
the metrics failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 15:42:43 +08:00
LukeGus d46fafb421 Update status refreshing to have a better interval and updated sidebar UI 2025-08-31 23:58:00 -05:00
LukeGus 9130eb68a8 Improve server stats and tunnel stability 2025-08-27 22:58:08 -05:00
LukeGus 487919cedc Improve File Manger UI scaling, fix file manager disconnect, disable more than one file manager at a time. 2025-08-27 22:17:28 -05:00
LukeGus d88c890ba7 Reduce automatic pinging 2025-08-27 11:34:38 -05:00
LukeGus c1d06028c3 Format code 2025-08-18 00:13:21 -05:00
LukeGus 981705e81d Made server.tsx work with ssh tunnels and server stats. Moved admin settings. 2025-08-17 01:56:47 -05:00