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

#2270: External DB Support #2457

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DarioGii
Copy link

Description

Please provide a summary of the changes, including relevant motivation and context.

Closes #(issue_number)

Checklist

  • I have read the Contribution Guidelines
  • I have performed a self-review of my own code
  • I have attached images of the change if it is UI based
  • I have commented my code, particularly in hard-to-understand areas
  • If my code has heavily changed functionality I have updated relevant docs on Stirling-PDFs doc repo
  • My changes generate no new warnings
  • I have read the section Add New Translation Tags (for new translation tags only)

@DarioGii DarioGii requested a review from Frooodle as a code owner December 15, 2024 13:20
@DarioGii DarioGii linked an issue Dec 15, 2024 that may be closed by this pull request
1 task
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 15, 2024
@github-actions github-actions bot added Java Pull requests that update Java code Front End Issues or pull requests related to front-end development Back End Issues related to back-end development Docker Pull requests that update Docker code Security Security-related issues or pull requests API API-related issues or pull requests labels Dec 15, 2024
@dosubot dosubot bot added the enhancement New feature or request label Dec 15, 2024
logger.info("Navigate to {}", url);
}

private static String[] getActiveProfile(String[] args) {
Copy link
Author

Choose a reason for hiding this comment

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

Sets the active profile(s). Will be set to default if nothing is selected

Copy link
Author

@DarioGii DarioGii Dec 15, 2024

Choose a reason for hiding this comment

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

This class sets the DB configuration. All other classes will use this to connect to the DB

private Datasource datasource;
}

@Data
Copy link
Author

@DarioGii DarioGii Dec 15, 2024

Choose a reason for hiding this comment

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

New Datasource class. Will pick up configuration from the settings.yml

private String password;
}

public enum Driver {
Copy link
Author

Choose a reason for hiding this comment

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

New Driver class

@@ -85,6 +86,11 @@ system:
customHTMLFiles: false # enable to have files placed in /customFiles/templates override the existing template HTML files
tessdataDir: /usr/share/tessdata # path to the directory containing the Tessdata files. This setting is relevant for Windows systems. For Windows users, this path should be adjusted to point to the appropriate directory where the Tessdata files are stored.
enableAnalytics: undefined # set to 'true' to enable analytics, set to 'false' to disable analytics; for enterprise users, this is set to true
datasource:
Copy link
Author

Choose a reason for hiding this comment

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

Configure the DB connection here

@@ -41,19 +39,21 @@ spring.mvc.async.request-timeout=${SYSTEM_CONNECTIONTIMEOUTMILLISECONDS:1200000}
#spring.thymeleaf.prefix=file:/customFiles/templates/,classpath:/templates/
#spring.thymeleaf.cache=false

spring.datasource.url=jdbc:h2:file:./configs/stirling-pdf-DB-2.3.232;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
Copy link
Member

Choose a reason for hiding this comment

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

We should support and still default to using a DB file for ease of adoption and use of users,
We should still allow H2 file connection and ensure this is the default type
But still offer it to users for postgres etc

@@ -85,6 +86,11 @@ system:
customHTMLFiles: false # enable to have files placed in /customFiles/templates override the existing template HTML files
tessdataDir: /usr/share/tessdata # path to the directory containing the Tessdata files. This setting is relevant for Windows systems. For Windows users, this path should be adjusted to point to the appropriate directory where the Tessdata files are stored.
enableAnalytics: undefined # set to 'true' to enable analytics, set to 'false' to disable analytics; for enterprise users, this is set to true
datasource:
url: jdbc:postgresql://db:5432/stirling_pdf
driver: postgresql
Copy link
Member

Choose a reason for hiding this comment

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

add comment stating the other driver types, example URLs etc

private String url;
private Driver driver;
private String username;
private String password;
Copy link
Member

Choose a reason for hiding this comment

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

password needs @ToString.Exclude to avoid logging

@github-actions github-actions bot added Documentation Improvements or additions to documentation Translation Github labels Dec 20, 2024
Copy link
Contributor

🚀 Translation Verification Summary

🔄 Reference Branch: pr-branch

📃 File Check: messages_ar_AR.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_az_AZ.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_bg_BG.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_ca_CA.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_cs_CZ.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_da_DK.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_de_DE.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_el_GR.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_en_US.properties

  1. Test Status:Passed
  2. Test Status:Passed

📃 File Check: messages_es_ES.properties

  1. Test Status:Passed
  2. Test Status:Passed

✅ Overall Check Status: Success

Thanks @DarioGii for your help in keeping the translations up to date.

@DarioGii DarioGii force-pushed the 2270-feature-request-external-db-support branch from d0e3ae9 to 46da009 Compare December 20, 2024 17:22
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Dec 20, 2024
@github-actions github-actions bot removed Documentation Improvements or additions to documentation Front End Issues or pull requests related to front-end development Docker Pull requests that update Docker code Translation API API-related issues or pull requests labels Dec 20, 2024
@github-actions github-actions bot removed the Github label Dec 20, 2024
@DarioGii DarioGii force-pushed the 2270-feature-request-external-db-support branch from 46da009 to 3584156 Compare December 22, 2024 09:03
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 22, 2024
@github-actions github-actions bot added Front End Issues or pull requests related to front-end development Docker Pull requests that update Docker code API API-related issues or pull requests labels Dec 22, 2024
@DarioGii DarioGii force-pushed the 2270-feature-request-external-db-support branch from 7dad36c to 2ec6c98 Compare December 22, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API-related issues or pull requests Back End Issues related to back-end development Docker Pull requests that update Docker code enhancement New feature or request Front End Issues or pull requests related to front-end development Java Pull requests that update Java code Security Security-related issues or pull requests size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: External DB support
2 participants