mirror of
https://github.com/itflow-org/itflow
synced 2026-09-04 22:05:12 +00:00
Initial migration from AdminLTE 3 to 4, bootstrap 4 to 5
This commit is contained in:
@@ -33,15 +33,15 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
unset($_SESSION['backup_master_key_reveal']);
|
||||
?>
|
||||
<div class="alert alert-warning">
|
||||
<h5><i class="fas fa-fw fa-key mr-2"></i>Master encryption key</h5>
|
||||
<h5><i class="fas fa-fw fa-key me-2"></i>Master encryption key</h5>
|
||||
<p class="mb-2">Shown once. Refreshing this page will not show it again.</p>
|
||||
<input type="text" class="form-control text-monospace" value="<?= escapeHtml($master_key_reveal) ?>" readonly onclick="this.select();">
|
||||
<input type="text" class="form-control font-monospace" value="<?= escapeHtml($master_key_reveal) ?>" readonly onclick="this.select();">
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($backup_key === '') { ?>
|
||||
<div class="alert alert-danger">
|
||||
<h5><i class="fas fa-fw fa-exclamation-triangle mr-2"></i>No backup encryption key</h5>
|
||||
<h5><i class="fas fa-fw fa-exclamation-triangle me-2"></i>No backup encryption key</h5>
|
||||
ITFlow could not write a backup encryption key to <strong>config.php</strong>, so it cannot produce an encrypted backup.
|
||||
Make config.php writable by the web server user and reload this page, or add a line like
|
||||
<code>$config_backup_key = '<32 random characters>';</code> to it yourself.
|
||||
@@ -50,26 +50,26 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
|
||||
<?php if (!$cron_is_running) { ?>
|
||||
<div class="alert alert-danger">
|
||||
<h5><i class="fas fa-fw fa-exclamation-triangle mr-2"></i>Cron is not running</h5>
|
||||
<h5><i class="fas fa-fw fa-exclamation-triangle me-2"></i>Cron is not running</h5>
|
||||
Backups are built by the cron dispatcher, not by your browser. Until cron is running, anything you
|
||||
start here will sit in the queue. See <a href="cron.php">Maintenance > Cron</a>.
|
||||
</div>
|
||||
<?php } elseif ($config_enable_cron == 0) { ?>
|
||||
<div class="alert alert-warning">
|
||||
<i class="fas fa-fw fa-exclamation-circle mr-2"></i>Cron is switched off in
|
||||
<i class="fas fa-fw fa-exclamation-circle me-2"></i>Cron is switched off in
|
||||
<a href="cron.php">Maintenance > Cron</a>.
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-cloud-upload-alt mr-2"></i>Create a Backup</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-cloud-upload-alt me-2"></i>Create a Backup</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<?php if ($pending_count > 0) { ?>
|
||||
<div class="alert alert-info">
|
||||
<i class="fas fa-fw fa-spinner mr-2"></i><strong><?= $pending_count ?></strong> backup<?= $pending_count == 1 ? ' is' : 's are' ?>
|
||||
<i class="fas fa-fw fa-spinner me-2"></i><strong><?= $pending_count ?></strong> backup<?= $pending_count == 1 ? ' is' : 's are' ?>
|
||||
queued or building. You will get a notification when ready - this page does not refresh itself.
|
||||
</div>
|
||||
<?php } ?>
|
||||
@@ -81,7 +81,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<h5>Full Backup</h5>
|
||||
<p class="text-muted small">The database and everything in the uploads folder. This is the one to keep.</p>
|
||||
<a class="btn btn-primary <?= $backup_key === '' ? 'disabled' : '' ?>" href="post.php?queue_backup=full&csrf_token=<?= $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-play mr-2"></i>Start
|
||||
<i class="fas fa-fw fa-play me-2"></i>Start
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,7 +91,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<h5>Database Only</h5>
|
||||
<p class="text-muted small">Just the SQL dump. Much smaller and much quicker, but no attachments or documents.</p>
|
||||
<a class="btn btn-primary <?= $backup_key === '' ? 'disabled' : '' ?>" href="post.php?queue_backup=database&csrf_token=<?= $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-play mr-2"></i>Start
|
||||
<i class="fas fa-fw fa-play me-2"></i>Start
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,8 +100,8 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<i class="fas fa-fw fa-3x fa-key text-dark mb-3"></i>
|
||||
<h5>Master Key</h5>
|
||||
<p class="text-muted small">The credential vault key. Only needed if every user password is lost - a normal restore recovers the vault on its own.</p>
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#masterKeyModal">
|
||||
<i class="fas fa-fw fa-key mr-2"></i>Export
|
||||
<button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#masterKeyModal">
|
||||
<i class="fas fa-fw fa-key me-2"></i>Export
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,7 +112,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-archive mr-2"></i>Backups</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-archive me-2"></i>Backups</h3>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
@@ -124,7 +124,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<th>Size</th>
|
||||
<th>Source</th>
|
||||
<th>Status</th>
|
||||
<th class="text-right">Action</th>
|
||||
<th class="text-end">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -153,7 +153,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<br><small class="text-danger"><?= escapeHtml($backup['backup_error']) ?></small>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<td class="text-end">
|
||||
<?php if ($status === 'Complete') { ?>
|
||||
<a class="btn btn-sm btn-primary" href="backup_download.php?backup_id=<?= $backup_id ?>&csrf_token=<?= $_SESSION['csrf_token'] ?>">
|
||||
<i class="fas fa-fw fa-download"></i>
|
||||
@@ -173,11 +173,11 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-lock mr-2"></i>Encryption Key</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-lock me-2"></i>Encryption Key</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-warning mb-3">
|
||||
<i class="fas fa-fw fa-exclamation-triangle mr-2"></i>
|
||||
<i class="fas fa-fw fa-exclamation-triangle me-2"></i>
|
||||
<strong>Write this down and keep it somewhere other than this server.</strong>
|
||||
Every backup is encrypted with it, and without it a backup cannot be restored - not by you,
|
||||
not by anyone. It is stored in config.php and never in the database, which is what stops a
|
||||
@@ -186,12 +186,10 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
|
||||
<?php if ($backup_key !== '') { ?>
|
||||
<div class="input-group col-md-6 px-0">
|
||||
<input type="text" class="form-control text-monospace" value="<?= escapeHtml($backup_key) ?>" readonly onclick="this.select();">
|
||||
<div class="input-group-append">
|
||||
<input type="text" class="form-control font-monospace" value="<?= escapeHtml($backup_key) ?>" readonly onclick="this.select();">
|
||||
<button class="btn btn-secondary" type="button" onclick="navigator.clipboard.writeText('<?= escapeHtml($backup_key) ?>');">
|
||||
<i class="fas fa-fw fa-copy"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
@@ -204,43 +202,43 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
|
||||
<div class="card card-dark mb-3">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-clock mr-2"></i>Scheduled Backups & Retention</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-clock me-2"></i>Scheduled Backups & Retention</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="post.php" method="POST" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="row g-2">
|
||||
<div class="mb-3 col-md-4">
|
||||
<label>Scheduled backup type</label>
|
||||
<select class="form-control" name="config_backup_cron_type">
|
||||
<option <?= $config_backup_cron_type === 'full' ? 'selected' : '' ?> value="full">Full Backup</option>
|
||||
<option <?= $config_backup_cron_type === 'database' ? 'selected' : '' ?> value="database">Database Only</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="mb-3 col-md-4">
|
||||
<label>Keep backups for (days)</label>
|
||||
<input type="number" class="form-control" name="config_backup_retention_days" min="0" value="<?= intval($config_backup_retention_days) ?>">
|
||||
<small class="text-muted">0 disables age-based deletion.</small>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="mb-3 col-md-4">
|
||||
<label>Keep at most (per type)</label>
|
||||
<input type="number" class="form-control" name="config_backup_retention_count" min="1" value="<?= intval($config_backup_retention_count) ?>">
|
||||
<small class="text-muted">Counted separately for each type. The newest of each is never deleted.</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" name="edit_backup_settings" class="btn btn-primary"><i class="fas fa-fw fa-check mr-2"></i>Save</button>
|
||||
<button type="submit" name="edit_backup_settings" class="btn btn-primary"><i class="fas fa-fw fa-check me-2"></i>Save</button>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="mb-0">
|
||||
<?php if (!empty($backup_job) && intval($backup_job['cron_job_enabled']) === 1) { ?>
|
||||
<i class="fas fa-fw fa-check text-success mr-2"></i>Scheduled backups run daily at
|
||||
<i class="fas fa-fw fa-check text-success me-2"></i>Scheduled backups run daily at
|
||||
<strong><?= escapeHtml(substr((string)$backup_job['cron_job_daily_at'], 0, 5)) ?></strong>.
|
||||
<?php } else { ?>
|
||||
<i class="fas fa-fw fa-times text-danger mr-2"></i>Scheduled backups are switched off.
|
||||
<i class="fas fa-fw fa-times text-danger me-2"></i>Scheduled backups are switched off.
|
||||
<?php } ?>
|
||||
Turn them on or change the time in <a href="cron.php">Maintenance > Cron</a>.
|
||||
</p>
|
||||
@@ -253,7 +251,7 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-3">
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-undo mr-2"></i>Restoring</h3>
|
||||
<h3 class="card-title"><i class="fas fa-fw fa-undo me-2"></i>Restoring</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Restoring replaces the database and the uploads folder with what is in the archive. It cannot be done from here, on purpose - a running install is the wrong place to be dropping its own tables from a browser.</p>
|
||||
@@ -267,8 +265,8 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fas fa-fw fa-key mr-2"></i>Export Master Key</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
<h5 class="modal-title"><i class="fas fa-fw fa-key me-2"></i>Export Master Key</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="post.php" method="POST" autocomplete="off">
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
@@ -276,13 +274,13 @@ if (!empty($_SESSION['backup_master_key_reveal'])) {
|
||||
<div class="alert alert-warning">
|
||||
This key decrypts every credential in this install. It is shown on screen and is not written anywhere.
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="mb-3">
|
||||
<label>Confirm your account password</label>
|
||||
<input type="password" class="form-control" name="password" autocomplete="new-password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="backup_master_key" class="btn btn-primary"><i class="fas fa-fw fa-key mr-2"></i>Show Master Key</button>
|
||||
<button type="submit" name="backup_master_key" class="btn btn-primary"><i class="fas fa-fw fa-key me-2"></i>Show Master Key</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user