[PR #163] [MERGED] fix: implement persistent SSH key storage with key generation #223

Closed
opened 2025-11-20 04:13:36 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/163
Author: @michelroegl-brunner
Created: 10/16/2025
Status: Merged
Merged: 10/16/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix/ssh_keys


📝 Commits (4)

  • 94e97a7 fix: implement persistent SSH key storage with key generation
  • 4c3b66a Delete
  • 15ffa98 Delete scripts/ct/debian.sh
  • 6580f31 Delete scripts/install/debian-install.sh

📊 Changes

13 files changed (+695 additions, -269 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 src/app/_components/HelpModal.tsx (+8 -1)
src/app/_components/PublicKeyModal.tsx (+147 -0)
📝 src/app/_components/ServerForm.tsx (+117 -23)
📝 src/app/_components/ServerList.tsx (+61 -0)
src/app/api/servers/[id]/public-key/route.ts (+64 -0)
📝 src/app/api/servers/[id]/route.ts (+6 -13)
src/app/api/servers/generate-keypair/route.ts (+32 -0)
📝 src/app/api/servers/route.ts (+6 -13)
📝 src/server/database.js (+149 -9)
📝 src/server/ssh-execution-service.js (+21 -179)
📝 src/server/ssh-service.js (+75 -29)
📝 src/types/server.ts (+6 -2)

📄 Description

🐛 Fix: SSH Key Authentication Issues

Problem

  • SSH key authentication was failing with 'error in libcrypto' during script execution
  • Temporary key files were causing race conditions and corruption
  • Confusing 'both' authentication option was causing user confusion
  • No way to generate SSH keys within the application

Solution

  • Persistent Key Storage: Keys are now stored in data/ssh-keys/ directory
  • Key Generation: Added 'Generate Key Pair' button for automatic ED25519 key creation
  • Public Key Viewing: Added 'View Public Key' button with copy-to-clipboard functionality
  • Simplified Auth: Removed 'both' option, now only supports 'password' OR 'key'
  • Enhanced UX: Hide manual key input when key pair is generated
  • Database Migration: Added ssh_key_path and key_generated columns
  • API Endpoints: New endpoints for key generation and public key retrieval

Technical Changes

  • Fixed 'error in libcrypto' by eliminating temporary file race conditions
  • Added persistent SSH key file management with proper permissions (0600/0644)
  • Updated database schema with proper migrations
  • Enhanced UI/UX with conditional rendering and success feedback
  • Added comprehensive error handling and type safety

Testing

  • Build compiles successfully
  • All TypeScript errors resolved
  • Key generation and viewing functionality working
  • Copy-to-clipboard with fallback support

Resolves SSH authentication failures during script execution.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/163 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 10/16/2025 **Status:** ✅ Merged **Merged:** 10/16/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/ssh_keys` --- ### 📝 Commits (4) - [`94e97a7`](https://github.com/community-scripts/ProxmoxVE-Local/commit/94e97a7366b51d8a6e8a907b70d6b2196df36bdf) fix: implement persistent SSH key storage with key generation - [`4c3b66a`](https://github.com/community-scripts/ProxmoxVE-Local/commit/4c3b66a26b51fc32f081a029321a2265bb121755) Delete - [`15ffa98`](https://github.com/community-scripts/ProxmoxVE-Local/commit/15ffa98ea8b8aadef7c99ca84fd139e4b8cede7e) Delete scripts/ct/debian.sh - [`6580f31`](https://github.com/community-scripts/ProxmoxVE-Local/commit/6580f3100a20ed1659cbf8d9903522f9ae9fb25a) Delete scripts/install/debian-install.sh ### 📊 Changes **13 files changed** (+695 additions, -269 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `src/app/_components/HelpModal.tsx` (+8 -1) ➕ `src/app/_components/PublicKeyModal.tsx` (+147 -0) 📝 `src/app/_components/ServerForm.tsx` (+117 -23) 📝 `src/app/_components/ServerList.tsx` (+61 -0) ➕ `src/app/api/servers/[id]/public-key/route.ts` (+64 -0) 📝 `src/app/api/servers/[id]/route.ts` (+6 -13) ➕ `src/app/api/servers/generate-keypair/route.ts` (+32 -0) 📝 `src/app/api/servers/route.ts` (+6 -13) 📝 `src/server/database.js` (+149 -9) 📝 `src/server/ssh-execution-service.js` (+21 -179) 📝 `src/server/ssh-service.js` (+75 -29) 📝 `src/types/server.ts` (+6 -2) </details> ### 📄 Description ## 🐛 Fix: SSH Key Authentication Issues ### Problem - SSH key authentication was failing with 'error in libcrypto' during script execution - Temporary key files were causing race conditions and corruption - Confusing 'both' authentication option was causing user confusion - No way to generate SSH keys within the application ### Solution - ✅ **Persistent Key Storage**: Keys are now stored in `data/ssh-keys/` directory - ✅ **Key Generation**: Added 'Generate Key Pair' button for automatic ED25519 key creation - ✅ **Public Key Viewing**: Added 'View Public Key' button with copy-to-clipboard functionality - ✅ **Simplified Auth**: Removed 'both' option, now only supports 'password' OR 'key' - ✅ **Enhanced UX**: Hide manual key input when key pair is generated - ✅ **Database Migration**: Added `ssh_key_path` and `key_generated` columns - ✅ **API Endpoints**: New endpoints for key generation and public key retrieval ### Technical Changes - Fixed 'error in libcrypto' by eliminating temporary file race conditions - Added persistent SSH key file management with proper permissions (0600/0644) - Updated database schema with proper migrations - Enhanced UI/UX with conditional rendering and success feedback - Added comprehensive error handling and type safety ### Testing - ✅ Build compiles successfully - ✅ All TypeScript errors resolved - ✅ Key generation and viewing functionality working - ✅ Copy-to-clipboard with fallback support Resolves SSH authentication failures during script execution. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:13:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE-Local#223