@@ -327,13 +327,16 @@ class BackupService {
327327 // PBS supports PBS_PASSWORD and PBS_REPOSITORY environment variables for non-interactive login
328328 const repository = `root@pam@${ pbsIp } :${ pbsDatastore } ` ;
329329
330- // Escape password for shell safety (single quotes)
330+ // Escape password and fingerprint for shell safety (single quotes)
331331 const escapedPassword = credential . pbs_password . replace ( / ' / g, "'\\''" ) ;
332-
333- // Use PBS_PASSWORD environment variable for non-interactive authentication
334- // Auto-accept fingerprint by piping "y" to stdin
335- // PBS will use PBS_PASSWORD env var if available, avoiding interactive prompt
336- const fullCommand = `echo "y" | PBS_PASSWORD='${ escapedPassword } ' PBS_REPOSITORY='${ repository } ' timeout 10 proxmox-backup-client login --repository ${ repository } 2>&1` ;
332+ const fingerprint = credential . pbs_fingerprint ?. trim ( ) ?? '' ;
333+ const escapedFingerprint = fingerprint ? fingerprint . replace ( / ' / g, "'\\''" ) : '' ;
334+ const envParts = [ `PBS_PASSWORD='${ escapedPassword } '` , `PBS_REPOSITORY='${ repository } '` ] ;
335+ if ( escapedFingerprint ) {
336+ envParts . push ( `PBS_FINGERPRINT='${ escapedFingerprint } '` ) ;
337+ }
338+ const envStr = envParts . join ( ' ' ) ;
339+ const fullCommand = `${ envStr } timeout 10 proxmox-backup-client login --repository ${ repository } 2>&1` ;
337340
338341 console . log ( `[BackupService] Logging into PBS: ${ repository } ` ) ;
339342
@@ -419,9 +422,12 @@ class BackupService {
419422
420423 // Build full repository string: root@pam @<IP>:<DATASTORE>
421424 const repository = `root@pam@${ pbsIp } :${ pbsDatastore } ` ;
422-
425+ const fingerprint = credential . pbs_fingerprint ?. trim ( ) ?? '' ;
426+ const escapedFingerprint = fingerprint ? fingerprint . replace ( / ' / g, "'\\''" ) : '' ;
427+ const snapshotEnvParts = escapedFingerprint ? [ `PBS_FINGERPRINT='${ escapedFingerprint } '` ] : [ ] ;
428+ const snapshotEnvStr = snapshotEnvParts . length ? snapshotEnvParts . join ( ' ' ) + ' ' : '' ;
423429 // Use correct command: snapshot list ct/<CT_ID> --repository <full_repo_string>
424- const command = `timeout 30 proxmox-backup-client snapshot list ct/${ ctId } --repository ${ repository } 2>&1 || echo "PBS_ERROR"` ;
430+ const command = `${ snapshotEnvStr } timeout 30 proxmox-backup-client snapshot list ct/${ ctId } --repository ${ repository } 2>&1 || echo "PBS_ERROR"` ;
425431 let output = '' ;
426432
427433 console . log ( `[BackupService] Discovering PBS backups for CT ${ ctId } on repository ${ repository } ` ) ;
0 commit comments