diff --git a/containers/libreportal/frontend/css/backup.css b/containers/libreportal/frontend/css/backup.css index 4212c5d..5eb2ad0 100755 --- a/containers/libreportal/frontend/css/backup.css +++ b/containers/libreportal/frontend/css/backup.css @@ -739,6 +739,71 @@ padding: 20px 22px; } +/* SSH key card (sftp locations). LibrePortal holds the private key; only the + public key is shown — that's what goes in the remote's authorized_keys. */ +.backup-ssh-key-card { + margin-top: 14px; + padding: 14px; + border: 1px solid rgba(var(--text-rgb), 0.10); + border-radius: 10px; + background: rgba(var(--text-rgb), 0.03); +} + +.backup-ssh-key-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; +} + +.backup-ssh-key-title { + font-weight: 600; + font-size: 0.95rem; +} + +.backup-ssh-key-status { + font-size: 0.8rem; + font-weight: 600; + padding: 2px 8px; + border-radius: 999px; +} + +.backup-ssh-key-status.ok { + color: var(--accent); + background: rgba(var(--accent-rgb), 0.12); +} + +.backup-ssh-key-status.none { + color: rgba(var(--text-rgb), 0.6); + background: rgba(var(--text-rgb), 0.08); +} + +.backup-ssh-pubkey, +.backup-ssh-keyinput { + width: 100%; + box-sizing: border-box; + font-family: var(--font-mono, monospace); + font-size: 0.8rem; + line-height: 1.4; + padding: 8px 10px; + border: 1px solid rgba(var(--text-rgb), 0.12); + border-radius: 8px; + background: var(--card-bg); + color: var(--text-primary); + resize: vertical; +} + +.backup-ssh-pubkey { + word-break: break-all; +} + +.backup-ssh-key-actions { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 10px; +} + .backup-form-footer { display: flex; justify-content: flex-end; diff --git a/containers/libreportal/frontend/js/components/backup/backup-page.js b/containers/libreportal/frontend/js/components/backup/backup-page.js index 67648a2..27e7dd8 100644 --- a/containers/libreportal/frontend/js/components/backup/backup-page.js +++ b/containers/libreportal/frontend/js/components/backup/backup-page.js @@ -209,6 +209,15 @@ class BackupPage { return; } + const sshSave = e.target.closest('[data-action="ssh-key-save"]'); + if (sshSave) { this.saveBackupSshKey(parseInt(sshSave.dataset.loc, 10)); return; } + const sshGen = e.target.closest('[data-action="ssh-key-generate"]'); + if (sshGen) { this.generateBackupSshKey(parseInt(sshGen.dataset.loc, 10)); return; } + const sshDel = e.target.closest('[data-action="ssh-key-delete"]'); + if (sshDel) { this.deleteBackupSshKey(parseInt(sshDel.dataset.loc, 10)); return; } + const sshCopy = e.target.closest('[data-action="ssh-key-copy"]'); + if (sshCopy) { this.copyBackupSshKey(parseInt(sshCopy.dataset.loc, 10)); return; } + const locTab = e.target.closest('[data-action="loc-tab"]'); if (locTab) { const tabIdx = locTab.dataset.loc; @@ -704,7 +713,7 @@ class BackupPage {
Add this public key to the remote server's ~/.ssh/authorized_keys:
Paste an existing private key, or generate one and we'll show the public key to add on the remote.
+ +