Add internal user backup functionality to Security & Update page #4942
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive internal user backup functionality for WLED as requested in issue #4941. The feature allows users to create and restore backups of their configuration and custom files directly on the device filesystem.
Features Added
Backend Implementation:
file.cpp
withbku.
prefix format (e.g.,/bku.cfg.json
)Frontend Implementation:
Supported File Types
/cfg.json
) - Device reboots automatically after restore/presets.json
) - User effect presets and playlists/palette0.json
to/palette9.json
) - Up to 10 custom color palettes/ledmap1.json
to/ledmap15.json
+/2d-gaps.json
) - LED mapping and 2D matrix gap filesAPI Endpoints
POST /backup/{type}
- Creates internal backup for specified typePOST /restore/{type}
- Restores from internal backupGET /backup/status
- Returns JSON status of existing backupsAll endpoints require settings PIN authentication for security.
Technical Details
The implementation follows existing WLED patterns and conventions:
Internal backups are stored on the device filesystem and will be lost if the device is factory reset or reflashed, making them ideal for temporary backup scenarios or quick rollback operations.
Fixes #4941.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.