Skip to content

Conversation

@michelroegl-brunner
Copy link
Member

Summary

This PR fixes several critical issues with SSH key handling and status checking:

🔧 SSH ED25519 Key Fixes

  • Fixed libcrypto error: SSH ED25519 keys now work properly by ensuring temporary key files end with a newline character
  • Fixed cleanup logic: Replaced with for directory cleanup to prevent EISDIR errors
  • Added timeout protection: SSH commands now have 30-second timeouts to prevent hanging connections

🔄 Status Check Improvements

  • Fixed endless loops: Removed problematic dependencies that caused continuous status checking
  • Added debouncing: Status checks are now debounced by 500ms to prevent excessive API calls
  • Better resource management: Added proper cleanup and prevented simultaneous status checks

🎯 UI/UX Enhancements

  • File upload support: Now accepts SSH keys without file extensions (Windows-generated keys)
  • Better key detection: Improved detection of OpenSSH format keys vs traditional PEM format
  • Enhanced error handling: Better error messages and validation for SSH key input

🧪 Testing

  • Tested with ED25519 keys generated on Windows (no extension)
  • Verified status checking no longer loops endlessly
  • Confirmed SSH operations complete successfully without resource leaks

📁 Files Changed

  • src/server/ssh-execution-service.js - Fixed key normalization and cleanup
  • src/server/ssh-service.js - Fixed key normalization
  • src/server/api/routers/installedScripts.ts - Added timeout protection
  • src/app/_components/InstalledScriptsTab.tsx - Fixed status check loops
  • src/app/_components/SSHKeyInput.tsx - Enhanced file upload and key detection

Resolves issues with SSH authentication failures and improves overall system stability.

- Fix SSH ED25519 key loading error by ensuring temporary key files end with newline
- Fix cleanup logic using rmdirSync instead of unlinkSync for directories
- Add timeout protection to prevent hanging SSH connections
- Fix endless status checking loops by removing problematic dependencies
- Add debouncing and proper cleanup for status checks
- Support file upload without extensions for Windows-generated keys
- Improve SSH key type detection for OpenSSH format keys

Resolves libcrypto errors and prevents resource leaks in SSH operations.
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner October 14, 2025 07:30
@michelroegl-brunner michelroegl-brunner changed the title Fix SSH ED25519 key loading and status check loops Fix SSH ED25519 key loading Oct 14, 2025
@michelroegl-brunner michelroegl-brunner linked an issue Oct 14, 2025 that may be closed by this pull request
@michelroegl-brunner michelroegl-brunner merged commit 0555e4c into main Oct 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSH Key 25519

1 participant