mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-01-19 00:07:17 +01:00
2270: Adding postgresql
This commit is contained in:
parent
fb61fea3e4
commit
6b07439798
@ -300,7 +300,7 @@ dependencies {
|
||||
|
||||
implementation 'com.unboundid.product.scim2:scim2-sdk-client:2.3.5'
|
||||
// Don't upgrade h2database
|
||||
runtimeOnly "com.h2database:h2:2.3.232"
|
||||
runtimeOnly "org.postgresql:postgresql:42.7.4"
|
||||
constraints {
|
||||
implementation "org.opensaml:opensaml-core:$openSamlVersion"
|
||||
implementation "org.opensaml:opensaml-saml-api:$openSamlVersion"
|
||||
|
@ -20,6 +20,7 @@ public class InitialSecuritySetup {
|
||||
|
||||
@Autowired private ApplicationProperties applicationProperties;
|
||||
|
||||
// todo: wip add Postgres here
|
||||
@Autowired private DatabaseBackupInterface databaseBackupHelper;
|
||||
|
||||
@PostConstruct
|
||||
|
@ -115,6 +115,7 @@ public class DatabaseBackupHelper implements DatabaseBackupInterface {
|
||||
return executeDatabaseScript(Paths.get(backupList.get(0).getFilePath()));
|
||||
}
|
||||
|
||||
// fixMe: Needs to check the type of DB before executing script
|
||||
@Override
|
||||
public void exportDatabase() throws IOException {
|
||||
// Check if the backup directory exists, and create it if it does not
|
||||
|
@ -6,6 +6,7 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.sql.Driver;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -247,6 +248,28 @@ public class ApplicationProperties {
|
||||
private String tessdataDir;
|
||||
private Boolean enableAlphaFunctionality;
|
||||
private String enableAnalytics;
|
||||
private Datasource datasource;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Datasource {
|
||||
private String url;
|
||||
private Driver driver;
|
||||
private String username;
|
||||
private String password;
|
||||
}
|
||||
|
||||
public enum Driver {
|
||||
H2("h2"),
|
||||
POSTGRESQL("postgresql"),
|
||||
ORACLE("oracle"),
|
||||
MY_SQL("mysql");
|
||||
|
||||
private final String driverName;
|
||||
|
||||
Driver(String driverName) {
|
||||
this.driverName = driverName;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
|
@ -41,13 +41,14 @@ 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
|
||||
spring.datasource.driver-class-name=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/stirling-pdf-DB
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=
|
||||
spring.h2.console.enabled=false
|
||||
spring.jpa.generate-ddl=true
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
server.servlet.session.timeout: 30m
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
|
||||
server.servlet.session.timeout=30m
|
||||
# Change the default URL path for OpenAPI JSON
|
||||
springdoc.api-docs.path=/v1/api-docs
|
||||
|
||||
|
@ -85,6 +85,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://localhost:5432/stirling-pdf-DB
|
||||
driver: postgresql
|
||||
username: postgres
|
||||
password:
|
||||
|
||||
ui:
|
||||
appName: '' # application's visible name
|
||||
|
Loading…
Reference in New Issue
Block a user