v7.2: ServiceAuthToken management, backup/Server tab reorg, WIP warnings, map cleanup

This commit is contained in:
Reditus committed 2026-06-16 12:12:25 +01:00
1 parent a2d5af20c9
commit aee4028f5c
7 files changed
+294 -5

No files matched your search

+8
View File
@@ -9,6 +9,14 @@
<div id="backup-status" class="error-banner" style="display:none;"></div>
<div style="background:rgba(255,193,7,0.12);border:2px solid rgba(255,193,7,0.6);border-left:6px solid #ffc107;border-radius:8px;padding:14px 20px;margin-bottom:16px;">
<div style="font-size:14px;font-weight:700;color:#e8a317;margin-bottom:6px;">&#9888; WIP — Use with caution</div>
<div style="font-size:13px;color:var(--text);line-height:1.5;">
This feature is still experimental. Test on a non-production environment first.
Keep offline backups of anything critical before using restore.
</div>
</div>
<div style="background:rgba(220,38,38,0.12);border:2px solid rgba(220,38,38,0.6);border-left:6px solid #dc2626;border-radius:8px;padding:16px 20px;margin-bottom:20px;">
<div style="font-size:14px;font-weight:700;color:#ef4444;margin-bottom:8px;">&#9888; SECURITY WARNING</div>
<div style="font-size:13px;color:var(--text);line-height:1.6;">
-3
View File
@@ -63,9 +63,6 @@
<div class="map-summary-item"><strong id="summary-bases">0</strong><span>Bases</span></div>
</div>
</div>
<div class="map-notice">
&#9888; This page is still a work in progress - expect bugs and quirks. Base ownership names are inferred heuristically and may be inaccurate.
</div>
<div class="map-layout">
<div id="map-container">
<div class="map-credit">Map images sourced from <a href="https://awakening.wiki/" target="_blank" rel="noopener">awakening.wiki</a> — a massive thank you for their incredible work mapping Arrakis!</div>
+79
View File
@@ -233,6 +233,34 @@
</div>
</div>
<div class="card">
<div class="card-header">
<span>Funcom Service Auth Token <span style="font-size:10px;color:var(--warn);font-weight:400;">[WIP]</span></span>
<span id="sat-status" style="font-size:12px;color:var(--text-muted);"></span>
</div>
<div class="card-body">
<div style="margin-bottom:12px;padding:10px 12px;background:var(--warn-bg, #fff3cd);border:1px solid var(--warn-border, #ffc107);border-radius:6px;font-size:12px;line-height:1.5;color:var(--warn-text, #856404);">
<strong>⚠ WIP — Use with caution.</strong> This feature is still experimental.
Only use if you understand the risks. Backup your <code>*.yaml</code> files first.
</div>
<div style="margin-bottom:12px;padding:12px;background:var(--bg);border-radius:6px;font-size:13px;line-height:1.6;">
<strong style="color:var(--primary);">ServiceAuthToken</strong> — Used by the game server to authenticate with Funcom's live services.
If this token is regenerated by Funcom, paste the new JWT below and save.
All consuming pods must be restarted afterward.
</div>
<div style="margin-bottom:12px;">
<textarea id="sat-token" rows="4"
style="width:100%;padding:10px 12px;background:var(--bg-input);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:12px;font-family:monospace;resize:vertical;"
placeholder="Paste the new ServiceAuthToken JWT here..."></textarea>
</div>
<div style="display:flex;gap:8px;align-items:center;flex-wrap:wrap;">
<button id="sat-save-btn" onclick="saveServiceAuthToken()"
style="padding:8px 20px;background:var(--primary);color:#fff;border:none;border-radius:6px;cursor:pointer;font-size:13px;font-weight:600;">Save Token</button>
<span id="sat-message" style="font-size:12px;color:var(--text-muted);"></span>
</div>
</div>
</div>
<div class="card">
<div class="card-header" style="cursor:pointer;" onclick="document.getElementById('debug-section').classList.toggle('hidden');">
<span>🐛 Debug Logging</span>
@@ -784,5 +812,56 @@ loadDebugStatus();
// Auto-load battlegroup and pods once on page load, then require manual refresh
bgRefreshStatus();
refreshPods();
// ServiceAuthToken
async function saveServiceAuthToken() {
const token = document.getElementById('sat-token').value.trim();
const btn = document.getElementById('sat-save-btn');
const msg = document.getElementById('sat-message');
const status = document.getElementById('sat-status');
if (!token) {
msg.textContent = 'Please paste the new token first.';
msg.style.color = 'var(--danger)';
return;
}
if (!confirm('Are you sure you want to replace the ServiceAuthToken?\n\nThis will update the K8s secret and YAML file. All consuming pods must be restarted for the change to take effect.')) return;
if (!confirm('Are you absolutely sure? An incorrect token may break server connectivity with Funcom live services.')) return;
btn.disabled = true;
btn.textContent = 'Saving...';
msg.textContent = 'Updating token...';
msg.style.color = 'var(--text-muted)';
status.textContent = 'Updating...';
try {
const resp = await csrfFetch('/api/server/service-auth-token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token })
});
const data = await resp.json();
if (data.success) {
msg.textContent = data.message || 'Token updated successfully.';
msg.style.color = 'var(--success)';
status.textContent = 'Token saved';
status.style.color = 'var(--success)';
document.getElementById('sat-token').value = '';
} else {
msg.textContent = 'Error: ' + (data.error || 'Unknown error');
msg.style.color = 'var(--danger)';
status.textContent = 'Failed';
status.style.color = 'var(--danger)';
}
} catch (e) {
msg.textContent = 'Error: ' + e.message;
msg.style.color = 'var(--danger)';
status.textContent = 'Error';
status.style.color = 'var(--danger)';
}
btn.disabled = false;
btn.textContent = 'Save Token';
}
</script>
{% endblock %}