Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the 'sanitize' system for backup restores to the web GUI #15296

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

uberbrady
Copy link
Collaborator

@uberbrady uberbrady commented Aug 14, 2024

We built the 'sanitize' system for doing backup restores, but really only exposed it in the CLI. We've even gone through some passes to improve it, somewhat, and so it's getting better. It's probably time to start exposing it in the UI.

Because we are changing a battle-tested system and adding some highly experimental features to it, I thought the checkbox for whether you're using it should default to 'off' - but there's a new .env-var that you can set to make the default be 'on'.

Additionally, while I was going through the Javascript code that handles the 'restore' and 'delete' buttons, I simplified it a bit, making it shorter and more readable.

I'm marking this as draft because there are still some other fixes I want to sneak in there before it's ready. Namely, I need to fully test a backup that has prefixes, and I need to figure out why a local backup I have on my machine only runs with 'clean' mode turned off.

But I thought at least getting this up would give @snipe a chance to see how it looks and make suggestions on UI changes.

Copy link

what-the-diff bot commented Aug 14, 2024

PR Summary

  • Enhanced Security Configuration Through Environment Variables
    Introduced an option (SANITIZE_BY_DEFAULT=false) in the sample environment configuration file. This allows for easier customization of your app's security settings.

  • Improvements to Settings Controller
    The postRestore function in the SettingsController now accepts a Request object, providing it with more information about the client request. It also optionally sanitizes data (cleans sensitive information) before restoring from backups, based on a new input parameter.

  • Expansion of Backup Configuration Options
    We've included a new sanitize_by_default option in the backup configuration. With this, the system can be configured to automatically sanitize backups.

  • Performance and Security Upgrades to snipeit.js
    Made the web app more efficient by removing redundant variables and consolidating event handling. Before an action as critical as restore, it now factors in whether the app is locked or not, adding another layer of security.

  • Wider Language Support for Backup Procedures
    Added additional language support by including translations for new backup related strings, making backup instructions clearer for non-English speakers.

  • User Interface Enhancements for Backup/Restore
    Introduced a new interactive dialogue to confirm restore actions. Users can now choose to clean the backup before restoration straight from the interface. Also, streamlined event handling for buttons in the backup settings page for improved user interaction.

Note: This summary might not cover all minor changes made. Please ensure to review the actual code changes for complete accuracy.

.env.example Outdated Show resolved Hide resolved
@uberbrady uberbrady marked this pull request as ready for review August 21, 2024 19:34
@snipe snipe merged commit ec0b9b1 into snipe:develop Aug 22, 2024
8 of 9 checks passed
snipe added a commit that referenced this pull request Aug 22, 2024
snipe added a commit that referenced this pull request Aug 22, 2024
FlorentDotMe pushed a commit to TelecomsSansFrontieres/snipe-it that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants