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

Preparation for Switching to a New Database Version #1521

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

Ludy87
Copy link
Contributor

@Ludy87 Ludy87 commented Jul 4, 2024

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

  1. Gradle Build File Updates (build.gradle)
    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.
  2. Clean URL Interceptor (CleanUrlInterceptor.java)
    New URL Parameter: The parameter infoMessage has been added to the list of ignored URL parameters.
  3. New Interface for Database Backups (DatabaseBackupInterface.java)
    New Methods: The interface defines methods for exporting, importing, checking, and listing database backups.
  4. Initial Security Setup (InitialSecuritySetup.java)
    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.
  5. User Service (UserService.java)
    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.
  6. Database Backup Helper (DatabaseBackupHelper.java)
    Backup and Restore Functionality: Implementation of methods for exporting and importing database backups, as well as managing backup files.
  7. Scheduled Tasks for Database Backups (ScheduledTasks.java)
    Scheduled Backups: A daily scheduled task has been added to automatically create database backups.
  8. Database API Controller (DatabaseController.java)
    New Endpoints: Endpoints for importing, deleting, and downloading database backup files have been added.
  9. User API Controller (UserController.java)
    Exception Handling: Methods have been updated to handle IO-related exceptions.
  10. Database Web Controller (DatabaseWebController.java)
    New Controller: A new controller to manage database imports and exports through the web interface.
  11. File Info Utility Class (FileInfo.java)
    New Utility Class: A class for handling file information, such as file size and creation date.
  12. Internationalization (messages_*.properties)
    New Entries: Additional entries for database import/export functionality in various language files.
  13. HTML Template for Database Management (database.html)
    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:

  • I have read the Contribution Guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

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)

@Ludy87 Ludy87 requested a review from Frooodle as a code owner July 4, 2024 17:52
Copy link
Member

@Frooodle Frooodle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change API calls to admin only

@Frooodle Frooodle merged commit be05db2 into Stirling-Tools:main Jul 5, 2024
3 checks passed
@Ludy87 Ludy87 deleted the preparation_database branch August 19, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants