diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index dacf69da..6dc24800 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -2,25 +2,26 @@ - + " master_key + pgpass simpleworklist - - - + - - - - - + + + + + + + diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 75961aff..48c78ed0 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -6,6 +6,9 @@ true org.postgresql.Driver jdbc:postgresql://localhost:5432/simpleworklist + + + \ No newline at end of file diff --git a/src/main/resources/docker-compose.yml b/docker-compose.yml similarity index 100% rename from src/main/resources/docker-compose.yml rename to docker-compose.yml diff --git a/etc/db/setup-postgresql-account-and-db.sql b/etc/db/setup-postgresql-account-and-db.sql index 97fc0614..87669e54 100644 --- a/etc/db/setup-postgresql-account-and-db.sql +++ b/etc/db/setup-postgresql-account-and-db.sql @@ -1,28 +1,20 @@ CREATE ROLE simpleworklist LOGIN PASSWORD 'simpleworklistpwd' SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION; + GRANT pg_monitor TO simpleworklist; GRANT pg_read_all_settings TO simpleworklist; GRANT pg_read_all_stats TO simpleworklist; GRANT pg_signal_backend TO simpleworklist; GRANT pg_stat_scan_tables TO simpleworklist; -CREATE ROLE simpleworklistref LOGIN - PASSWORD 'simpleworklistrefpwd' - SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION; -GRANT pg_monitor TO simpleworklistref; -GRANT pg_read_all_settings TO simpleworklistref; -GRANT pg_read_all_stats TO simpleworklistref; -GRANT pg_signal_backend TO simpleworklistref; -GRANT pg_stat_scan_tables TO simpleworklistref; - CREATE TABLESPACE tablespace_simpleworklist OWNER tw LOCATION '/opt/postgresql/tablespace_simpleworklist'; -CREATE TABLESPACE tablespace_simpleworklist - OWNER tw - LOCATION 'C:\tablespace_pg\simpleworklist'; +-- CREATE TABLESPACE tablespace_simpleworklist +-- OWNER tw +-- LOCATION 'C:\tablespace_pg\simpleworklist'; ALTER TABLESPACE tablespace_simpleworklist OWNER TO simpleworklist; @@ -34,7 +26,7 @@ CREATE DATABASE simpleworklist CONNECTION LIMIT = -1; CREATE DATABASE simpleworklistref - WITH OWNER = simpleworklistref + WITH OWNER = simpleworklist ENCODING = 'UTF8' TABLESPACE = tablespace_simpleworklist CONNECTION LIMIT = -1; diff --git a/liquibase.properties b/liquibase.properties new file mode 100644 index 00000000..3cd87adb --- /dev/null +++ b/liquibase.properties @@ -0,0 +1,11 @@ +changeLogFile=src/main/resources/db/liquibase-changelog.xml +diffChangeLogFile=src/main/resources/db/liquibase-diff-changelog.xml +classpath=target/dependency/postgresql-42.5.1.jar +driver=org.postgresql.Driver +url=jdbc:postgresql://localhost:5432/simpleworklist +username=simpleworklist +password=simpleworklistpwd +referenceDriver=org.postgresql.Driver +referenceUrl=jdbc:postgresql://localhost:5432/simpleworklistref +referenceUsername=simpleworklist +referencePassword=simpleworklistpwd diff --git a/pom.xml b/pom.xml index aa326e54..6ec8a2a1 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ - 11 + 17 3.6.3 ${version.java} ${version.java} @@ -113,6 +113,10 @@ 3.0.0-M7 1.13.0 + + 42.5.1 + ${project.basedir}/liquibase.properties + 1.5.2 1.2022.6 @@ -314,7 +318,12 @@ org.postgresql postgresql - 42.5.0 + 42.5.1 + + + net.sf.saxon + saxon-dom + 8.7 @@ -682,10 +691,18 @@ thymeleaf-testing test + + javax.xml.bind + jaxb-api + org.postgresql postgresql + + net.sf.saxon + saxon-dom + com.zaxxer HikariCP @@ -1096,11 +1113,12 @@ ${project.basedir}/build.sh ${project.basedir}/etc/run.sh ${project.basedir}/etc/bash/psql.sh - ${project.basedir}/src/main/resources/docker-compose.yml ${project.basedir}/etc/docker-start.sh ${project.basedir}/etc/docker-stop.sh + ${project.basedir}/docker-compose.yml ${project.basedir}/etc/sql/db-createdb-and-user-linux.sql ${project.basedir}/etc/sql/db-createdb-and-user-win10.sql + ${project.basedir}/liquibase.properties @@ -1331,6 +1349,20 @@ org.apache.maven.plugins maven-pmd-plugin + + org.liquibase + liquibase-maven-plugin + + liquibase.properties + + + + org.postgresql + postgresql + ${version.org.postgresql} + + + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 546a984b..deda881c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -11,7 +11,7 @@ spring: config: name: simpleworklist liquibase: - enabled: false + enabled: true devtools: livereload: enabled: ${SIMPLEWORKLIST_DEV_TESTING} @@ -33,7 +33,7 @@ spring: generate-ddl: true database-platform: POSTGRESQL hibernate: - #ddl-auto: create-drop update + #ddl-auto: create-drop update validate ddl-auto: ${BLOODMONEY_HIBERNATE_DDL_AUTO} naming: implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl @@ -152,7 +152,8 @@ spring: log-dir: transaction-logs/tx-logs-simpleworklist jpa: hibernate: - ddl-auto: update + #ddl-auto: create-drop update validate + ddl-auto: validate server: port: ${PORT} compression: diff --git a/src/main/resources/db/liquibase-changelog.xml b/src/main/resources/db/liquibase-changelog.xml new file mode 100644 index 00000000..3673b64f --- /dev/null +++ b/src/main/resources/db/liquibase-changelog.xml @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/db/liquibase-diff-changelog.xml b/src/main/resources/db/liquibase-diff-changelog.xml new file mode 100644 index 00000000..c14480fb --- /dev/null +++ b/src/main/resources/db/liquibase-diff-changelog.xml @@ -0,0 +1,9 @@ + + + + diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml new file mode 100644 index 00000000..e7adb242 --- /dev/null +++ b/src/test/resources/application-test.yml @@ -0,0 +1,4 @@ +spring: + config: + activate: + on-profile: default diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml deleted file mode 100644 index 966d75d2..00000000 --- a/src/test/resources/application.yml +++ /dev/null @@ -1,184 +0,0 @@ -server: - port: ${SIMPLEWORKLIST_PORT} - error: - path: /fehler - compression: - enabled: false - min-response-size: 2048 - servlet: - context-path: "/simpleworklist" -spring: - config: - name: simpleworklist - liquibase: - enabled: false - devtools: - livereload: - enabled: ${SIMPLEWORKLIST_DEV_TESTING} - application: - admin: - enabled: ${SIMPLEWORKLIST_DEV_TESTING} - datasource: - url: jdbc:postgresql://${SIMPLEWORKLIST_DS_HOST}:${SIMPLEWORKLIST_DS_PORT}/${SIMPLEWORKLIST_DS_DB} - username: ${SIMPLEWORKLIST_DS_USR} - password: ${SIMPLEWORKLIST_DS_PWD} - driverClassName: org.postgresql.Driver - jpa: - show-sql: true - open-in-view: true - generate-ddl: true - hibernate: - ddl-auto: ${SIMPLEWORKLIST_JPA_DLL_AUTO} - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQL95Dialect - temp: - use_jdbc_metadata_defaults: false - search: - default: - indexBase: ~/.config/simpleworklist - session: - store-type: jdbc - jdbc: - initialize-schema: always - thymeleaf: - cache: false - main: - allow-bean-definition-overriding: true - sql: - init: - platform: postgresql - continue-on-error: true -org: - woehlke: - java: - simpleworklist: - mail: - host: ${SIMPLEWORKLIST_MAIL_SMTP_HOST} - port: ${SIMPLEWORKLIST_MAIL_SMTP_PORT} - username: ${SIMPLEWORKLIST_MAIL_SMTP_USERNAME} - password: ${SIMPLEWORKLIST_MAIL_SMTP_PASSWORD} - auth: true - sslEnable: true - socketFactoryPort: 465 - socketFactoryClass: javax.net.ssl.SSLSocketFactory - registration: - maxRetries: 5 - ttlEmailVerificationRequest: 86400000 - urlHost: ${SIMPLEWORKLIST_URL_APP_HOST} - mailFrom: ${SIMPLEWORKLIST_MAIL_FROM} - webMvc: - controllerPageSize: 10 - staticResourceHandler: - - "/css" - - "/img" - - "/js" - dynamicResourceHandler: - - "/webjars" - webSecurity: - strengthBCryptPasswordEncoder: 10 - # iterations: ${SIMPLEWORKLIST_USER_ITERATIONS} - # hashWidth: ${SIMPLEWORKLIST_USER_HASH_WIDTH} - # secret: ${SIMPLEWORKLIST_USER_SECRET} - loginProcessingUrl: "/j_spring_security_check" - logoutUrl: "/user/logout" - cookieNamesToClear: - - "JSESSIONID" - invalidateHttpSession: true - defaultSuccessUrl: "/" - failureForwardUrl: "/user/login?login_error=1" - usernameParameter: "j_username" - passwordParameter: "j_password" - loginPage: "/user/login" - antPatternsPublic: - - "/webjars/**" - - "/css/**" - - "/img/**" - - "/js/**" - - "/favicon.ico" - - "/user/login*" - - "/user/register*" - - "/user/register/**" - - "/user/register/confirm/**" - - "/user/resetPassword*" - - "/user/resetPassword/**" - - "/user/resetPassword/confirm/**" - - "/error*" -logging: - level: - root: INFO - javax: INFO - jakartaee: INFO - com: - atomikos: INFO - org: - thymeleaf: - dialect: - springdata: INFO - apache: - commons: - logging: WARN - h2: INFO - springframework: - data: - jdbc: INFO - jpa: INFO - relational: INFO - security: - web: INFO - context: INFO - boot: INFO - beans: INFO - jdbc: INFO - orm: INFO - session: WARN - test: INFO - mock: WARN - transaction: INFO - jca: INFO - web: INFO - remoting: INFO - http: INFO - expression: INFO - util: INFO - lang: INFO - core: INFO - cglib: WARN - hibernate: - sql: INFO - query: INFO - mapping: INFO - jpa: INFO - id: INFO - graph: INFO - cfg: INFO - service: INFO - result: INFO - engine: - internal: WARN - ch: - qos: WARN - woehlke: - java: - simpleworklist: INFO ---- -spring: - datasource: - url: jdbc:postgresql://localhost:5432/simpleworklist - profiles: - active: default -logging: - level: - root: INFO - org: - springframework: INFO - hibernate: - SQL: INFO - engine: - internal: WARN - ch: - qos: WARN - postgresql: WARN - woehlke: - java: - simpleworklist: INFO