Include env settings snapshot in full data backup

Docker deployments have no .env file — settings live in container env
vars — so the export now writes env-snapshot.env (dotenv format) into
the data dir from a whitelist of portable keys (admin password, Resend
keys, webhook URLs, etc.) before archiving. Machine-specific vars
(PORT, NODE_ENV, SITEFORGE_DATA_DIR, ALLOW_INSECURE_COOKIES, build
metadata) are excluded. Values are not applied automatically on
restore; the file documents what to set on the new server.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-07-07 13:12:51 -04:00
parent 0406cdb9dc
commit f5e98826be
2 changed files with 50 additions and 1 deletions
+1 -1
View File
@@ -818,7 +818,7 @@ export function AnalyticsPanel({
{/* Full Data Backup (entire /data folder — server migration) */}
<div className="admin-stats-head admin-stats-head--visitors">
<h2>Full Data Backup</h2>
<p>Download every persisted file site content, uploads, study accounts, notes, progress, questions, analytics as one archive, or restore that archive on this or a new server.</p>
<p>Download every persisted file site content, uploads, study accounts, notes, progress, questions, analytics plus a snapshot of server settings (env-snapshot.env) as one archive, or restore that archive on this or a new server. The archive contains secrets like the admin password and API keys, so keep it private. Restored settings are not applied automatically copy them into the new server&apos;s environment.</p>
</div>
<div className="admin-actions admin-actions--maintenance">
<button type="button" className="btn-admin-reset" onClick={onDownloadFullBackup} disabled={fullBackupBusy}>