Preparation for Switching to a New Database Version #1521
Merged
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.
Description
This pull request includes extensive changes and additions that serve as a preparation for switching to a new version of the database software. The changes aim to enhance data security, improve database backup management, and facilitate the migration to a newer version of the H2 database.
Details of Changes
Added Exclusions: Certain paths and files are now excluded if DOCKER_ENABLE_SECURITY is set to false. This includes files such as DatabaseController.java and DatabaseWebController.java.
H2 Database Dependency: A commented line for a newer version of the H2 database (2.2.224) has been added to facilitate future updates.
New URL Parameter: The parameter infoMessage has been added to the list of ignored URL parameters.
New Methods: The interface defines methods for exporting, importing, checking, and listing database backups.
Database Backup Integration: The init method has been updated to consider database backups. If backups are present, the database will be imported automatically.
Logging Changes: Logging is now performed using Lombok's @slf4j.
Database Backup Integration: Various methods have been updated to create a database backup after changes.
Logging Changes: Logging is now performed using Lombok's @slf4j.
Backup and Restore Functionality: Implementation of methods for exporting and importing database backups, as well as managing backup files.
Scheduled Backups: A daily scheduled task has been added to automatically create database backups.
New Endpoints: Endpoints for importing, deleting, and downloading database backup files have been added.
Exception Handling: Methods have been updated to handle IO-related exceptions.
New Controller: A new controller to manage database imports and exports through the web interface.
New Utility Class: A class for handling file information, such as file size and creation date.
New Entries: Additional entries for database import/export functionality in various language files.
New Template: An HTML page for managing database imports and exports through the web interface.
Conclusion
These changes are a crucial step towards a stable and secure transition to a newer version of the H2 database. They improve data integrity and enable easy management and restoration of database backups. If you have any questions or comments about these changes, please feel free to reach out.
Checklist:
Contributor License Agreement
By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under the MPL 2.0 (Mozilla Public License Version 2.0) license.
(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)