Files
itflow/admin/modals/backup/backup_master_key.php
johnnyq dd160ef1d7 Rebuild Maintenance > Backup on the Update page's pattern: a status card at the top says when the last backup was made, what kind and when the next scheduled one is due, or instead that one is being made, the last one failed and why, the last good one is over 7 days old, none has been made yet, a queued one is stuck because cron isn't running, or there is no encryption key, with Back up now and Database only under it, and the page reloads itself every 10 seconds while a backup is being made except while an exported master key is showing; the backups list uses the standard list plumbing with sortable headers on date, type, size and status and the standard pager, no longer stops at the newest 100, shows who made each backup or that the schedule did, when it was last downloaded and why one failed, and a row menu copies its path on the server and its SHA-256 checksum, deletes a finished backup, takes a queued one off the queue or removes a failed or missing one, with the card left out when there are no backups; the schedule and retention card shows whether the Backup cron job is on and at what time, with Turn on and Change the time using the Cron page's enable_cron_job handler and cron_edit window; an At a glance column has the last Full Backup and Database Only, the schedule, retention, how many are kept and their size, free space, cron status and the backup folder; the encryption key is masked behind the eye with a copy button; the master key export moves to a new ajax modal, admin/modals/backup/backup_master_key.php, which asks for the password and says an encrypted copy is filed with the backups and every agent is notified, where the old window said the key was not written anywhere; delete_backup in admin/post/backup.php words its audit entry and message by the backup's status; no new CSS or JS; changelog entries added to 26.11.8
2026-11-13 01:14:10 -05:00

46 lines
2.3 KiB
PHP

<?php
/*
* Maintenance > Backup - export the credential vault's master key. It only exists unwrapped
* inside a session, so the admin's own password is asked for again and is what unwraps it
* (admin/post/backup.php, backup_master_key). The key is shown once on the page that
* follows, and an encrypted copy is filed with the backups.
*/
require_once '../../includes/modal_header.php';
ob_start();
?>
<div class="modal-header bg-dark">
<h5 class="modal-title"><i class="fas fa-fw fa-key me-2"></i>Export the master key</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
<div class="modal-body">
<p class="fw-semibold mb-2">This key opens every credential saved in ITFlow.</p>
<ul class="small mb-3 ps-3">
<li>It is shown once, on the next page - copy it somewhere as safe as the credentials themselves.</li>
<li>An encrypted copy is filed with the backups, opened with the backup encryption key.</li>
<li>You only need it if every user's password is lost. A restored backup brings the vault back by itself.</li>
<li>Exporting it is logged, and every agent gets a notification that you did.</li>
</ul>
<label class="form-label" for="backupMasterKeyPassword">Your password <strong class="text-danger">*</strong></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-fw fa-lock"></i></span>
<input type="password" class="form-control" data-toggle="password" name="password" id="backupMasterKeyPassword" placeholder="To confirm it's you" autocomplete="current-password" required autofocus>
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
</div>
</div>
<div class="modal-footer">
<button type="submit" name="backup_master_key" class="btn btn-primary text-bold"><i class="fas fa-fw fa-key me-2"></i>Show the master key</button>
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fas fa-times me-2"></i>Cancel</button>
</div>
</form>
<?php
require_once "../../../includes/modal_footer.php";