Add system update feature, git-ignore local configs, and fix homepage request logging

- Exclude config.json and admin.json in .gitignore so live settings/passwords are never overwritten by git
- Auto-generate config.json and admin.json with defaults if missing
- Add config.json.example and admin.json.example reference templates
- Add System Update page (/admin/update) in Admin Console to pull updates via Git with 1 click
- Log effective page name in index.php instead of literal 'auto'
- Add extra HAProxy/PFSense proxy headers to RequestLogger::getClientIp()
This commit is contained in:
2026-07-28 17:26:34 +02:00
parent e2d9ddd516
commit 62dd7ddb9c
10 changed files with 205 additions and 10 deletions
+56
View File
@@ -0,0 +1,56 @@
<h2 class="mb-4"><i class="bi bi-cloud-arrow-down"></i> Systeem Update</h2>
<?php if (!empty($updateOutput)): ?>
<div class="card shadow-sm mb-4">
<div class="card-header bg-dark text-white">
<i class="bi bi-terminal"></i> Update Resultaten
</div>
<div class="card-body bg-dark text-light p-3">
<pre class="m-0 text-light" style="font-family: monospace; font-size: 0.9rem;"><?= htmlspecialchars($updateOutput) ?></pre>
</div>
</div>
<?php endif; ?>
<div class="card shadow-sm mb-4">
<div class="card-header">
<i class="bi bi-info-circle"></i> Systeeminformatie
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 mb-3">
<strong>Huidige CMS Versie:</strong>
<span class="badge bg-primary ms-2"><?= htmlspecialchars($cmsVersion ?? '1.7.1') ?></span>
</div>
<div class="col-md-6 mb-3">
<strong>Configuratiestatus:</strong>
<span class="badge bg-success ms-2"><i class="bi bi-check-circle"></i> Lokaal afgeschermd (Git-safe)</span>
</div>
</div>
<p class="text-muted small mb-0">
Lokale configuratiebestanden (zoals <code>config.json</code> en <code>admin.json</code>) zijn uitgesloten van Git.
Hierdoor blijven je instellingen, wachtwoorden en content veilig behouden tijdens het bijwerken.
</p>
</div>
</div>
<div class="card shadow-sm mb-4">
<div class="card-header">
<i class="bi bi-arrow-repeat"></i> CodePress CMS Bijwerken
</div>
<div class="card-body">
<p>Haal automatisch de nieuwste CMS updates op via het Git repository.</p>
<?php if (!empty($gitBranch)): ?>
<div class="mb-3">
<small class="text-muted">Git branch: <code><?= htmlspecialchars($gitBranch) ?></code></small>
</div>
<?php endif; ?>
<form method="POST" action="/admin/update">
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($csrf) ?>">
<button type="submit" class="btn btn-primary btn-lg" onclick="return confirm('Weet je zeker dat je het systeem wilt bijwerken naar de nieuwste versie?')">
<i class="bi bi-cloud-download"></i> Systeem nu bijwerken
</button>
</form>
</div>
</div>