From 674cbbf3848ec98ebc6a9374fd942668bd954b82 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:10:28 +0200 Subject: [PATCH 01/16] Remove unused module on the frontend --- dmp-frontend/package.json | 1 - dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts | 4 ++-- dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 12b85564e..020f2a1e1 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -31,7 +31,6 @@ "file-saver": "^2.0.5", "moment": "^2.29.1", "moment-timezone": "^0.5.33", - "ng-dialog-animation": "^9.0.4", "ng2-dragula": "^2.1.1", "ngx-cookie-service": "^12.0.3", "ngx-cookieconsent": "^2.2.3", diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index f825230d6..cc207f142 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -28,7 +28,7 @@ import { DmpCriteriaDialogComponent } from './criteria/dmp-criteria-dialog.compo import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; -import { NgDialogAnimationService } from "ng-dialog-animation"; +//import { NgDialogAnimationService } from "ng-dialog-animation"; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; @@ -75,7 +75,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread private dmpService: DmpService, private router: Router, private route: ActivatedRoute, - public dialogAnimation: NgDialogAnimationService, + //public dialogAnimation: NgDialogAnimationService, public dialog: MatDialog, public enumUtils: EnumUtils, private language: TranslateService, diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts index dc73b4f76..be0a5c30e 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts @@ -9,7 +9,7 @@ import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { RouterModule } from '@angular/router'; import { CloneDialogModule } from '../clone/clone-dialog/clone-dialog.module'; -import { NgDialogAnimationService } from 'ng-dialog-animation'; +//import { NgDialogAnimationService } from 'ng-dialog-animation'; @NgModule({ imports: [ @@ -27,7 +27,7 @@ import { NgDialogAnimationService } from 'ng-dialog-animation'; DmpOverviewComponent ], providers: [ - NgDialogAnimationService + //NgDialogAnimationService ] }) export class DmpOverviewModule { } From 4c651c6200e24252fcaf9da6ad33ad0a138773b3 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:55:44 +0200 Subject: [PATCH 02/16] Replace the old application.properties with application.yml --- .../config/application-devel.properties | 96 -------- .../resources/config/application-devel.yml | 59 +++++ .../config/application-production.properties | 100 -------- .../config/application-production.yml | 33 +++ .../config/application-staging.properties | 90 ------- .../resources/config/application-staging.yml | 34 +++ .../resources/config/application.properties | 123 ---------- .../src/main/resources/config/application.yml | 227 ++++++++++++++++++ 8 files changed, 353 insertions(+), 409 deletions(-) delete mode 100644 dmp-backend/web/src/main/resources/config/application-devel.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-devel.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application-production.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-production.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application-staging.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-staging.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application.properties create mode 100644 dmp-backend/web/src/main/resources/config/application.yml diff --git a/dmp-backend/web/src/main/resources/config/application-devel.properties b/dmp-backend/web/src/main/resources/config/application-devel.properties deleted file mode 100644 index 396776273..000000000 --- a/dmp-backend/web/src/main/resources/config/application-devel.properties +++ /dev/null @@ -1,96 +0,0 @@ -dmp.domain = http://localhost:4200 - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url= -database.username= -database.password= -spring.datasource.maxIdle=10 -spring.datasource.minIdle=5 -spring.datasource.maxActive=10 - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = localhost -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################ELK OVERRIDES CONFIGURATIONS########## -http-logger.server-address = http://localhost:31311 - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://localhost:3000/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=configurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## -email.invite=classpath:templates/email/email.html -email.confirmation=classpath:templates/email/emailConfirmation.html -email.merge=classpath:templates/email/emailMergeConfirmation.html - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace= - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=http://localhost:4200/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.redirect_uri=http://localhost:4200/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id=APP-766DI5LP8T75FC4R -orcid.login.client_secret=f6ddc717-f49e-4bce-b302-2e479b226a24 -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=http://localhost:4200/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://sandbox.zenodo.org/api/ -zenodo.access_token= -zenodo.login.access_token_url=https://sandbox.zenodo.org/oauth/token -zenodo.login.client_id= -zenodo.login.client_secret= -zenodo.login.redirect_uri=http://localhost:4200/login/external/zenodo - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=dmp-frontend/src/assets/i18n/ - -#############LOGGING######### -logging.config=classpath:logging/logback-${spring.profiles.active}.xml - -#############PROMETHEUS######### -endpoints.prometheus.sensitive: false \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-devel.yml b/dmp-backend/web/src/main/resources/config/application-devel.yml new file mode 100644 index 000000000..354385426 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-devel.yml @@ -0,0 +1,59 @@ +dmp: + domain: http://localhost:4200 + +####################PERSISTENCE OVERRIDES CONFIGURATIONS########## +spring: + datasource: + maxIdle: 10 + minIdle: 5 + maxActive: 10 + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: localhost + port: 9200 + +####################ELK OVERRIDES CONFIGURATIONS########## +http-logger: + server-address: http://localhost:31311 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://localhost:3000/ + +####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## +email: + invite: classpath:templates/email/email.html + confirmation: classpath:templates/email/emailConfirmation.html + merge: classpath:templates/email/emailMergeConfirmation.html + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + redirect_uri: http://localhost:4200/login/linkedin + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + redirect_uri: http://localhost:4200/login/twitter + +#############ORCID CONFIGURATIONS######### +orcid: + login: + redirect_uri: http://localhost:4200/login/external/orcid + +#############ZENODO CONFIGURATIONS######### +zenodo: + login: + access_token_url: https://sandbox.zenodo.org/oauth/token + redirect_uri: http://localhost:4200/login/external/zenodo + +#############LANGUAGE CONFIGURATION######### +language: + path: dmp-frontend/src/assets/i18n/ + +#############PROMETHEUS######### +endpoints: + prometheus: + sensitive: false \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-production.properties b/dmp-backend/web/src/main/resources/config/application-production.properties deleted file mode 100644 index 971e6be43..000000000 --- a/dmp-backend/web/src/main/resources/config/application-production.properties +++ /dev/null @@ -1,100 +0,0 @@ -dmp.domain = https://opendmp.eu - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url=jdbc:postgresql://dmp-db:5432/dmptool -database.username=dmptool -database.password=CHANGEME - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = tags-elastic-search -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://docsbox-web/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host= -spring.mail.username= -spring.mail.password= -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false -spring.mail.properties.mail.smtp.starttls.enable=true - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace=opendmp - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=https://opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=https://opendmp.eu/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=https://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id= -orcid.login.client_secret= -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=https://opendmp.eu/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############SPRING DATASOURCE CONFIGURATIONS######### -spring.datasource.maxIdle: 10 -spring.datasource.max-active: 70 -spring.datasource.max-wait: 10000 -spring.datasource.validationQuery: select 1 -spring.datasource.removeAbandoned: true -spring.datasource.removeAbandonedTimeout: 1 -spring.datasource.logAbandoned: true -spring.datasource.testOnBorrow: true -spring.datasource.testOnConnect: false -spring.datasource.testWhileIdle: false - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://zenodo.org/api/ -zenodo.access_token= - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-production.yml b/dmp-backend/web/src/main/resources/config/application-production.yml new file mode 100644 index 000000000..01ddeaf21 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-production.yml @@ -0,0 +1,33 @@ +dmp: + domain: https://opendmp.eu + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: tags-elastic-search + port: 9200 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://docsbox-web/ + +#############SPRING DATASOURCE CONFIGURATIONS######### +spring: + datasource: + maxIdle: 10 + max-active: 70 + max-wait: 10000 + validationQuery: select 1 + removeAbandoned: true + removeAbandonedTimeout: 1 + logAbandoned: true + testOnBorrow: true + testOnConnect: false + testWhileIdle: false + +#############CONTACT EMAIL CONFIGURATIONS######### +contact_email.mail= + +#############LANGUAGE CONFIGURATION######### +language: + path: i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-staging.properties b/dmp-backend/web/src/main/resources/config/application-staging.properties deleted file mode 100644 index 8bafc9971..000000000 --- a/dmp-backend/web/src/main/resources/config/application-staging.properties +++ /dev/null @@ -1,90 +0,0 @@ -dmp.domain = https://devel.opendmp.eu - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url=jdbc:postgresql://dmp-db:5432/dmptool -database.username=dmptool -database.password=CHANGEME - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = tags-elastic-search -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://docsbox-web/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################INVITATION MAIL CONFIGURATIONS############## -####################GENERIC MAIL CONFIGURATIONS################# -mail.subject=Invitation to DMP Plan {dmpname} -mail.from=opendmp-dev@cite.gr - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host=hermes.local.cite.gr -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace=opendmp - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=https://devel.opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=https://devel.opendmp.eu/login/twitter - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=https://devel.opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id= -orcid.login.client_secret= -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=https://opendmp.eu/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://sandbox.zenodo.org/api/ -zenodo.access_token= - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-staging.yml b/dmp-backend/web/src/main/resources/config/application-staging.yml new file mode 100644 index 000000000..2df177074 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-staging.yml @@ -0,0 +1,34 @@ +dmp: + domain: https://devel.opendmp.eu + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: tags-elastic-search + port: 9200 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://docsbox-web/ + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + redirect_uri: https://devel.opendmp.eu/login/linkedin + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + redirect_uri: https://devel.opendmp.eu/login/twitter + +#############B2 ACCESS CONFIGURATIONS######### +b2access: + externallogin: + redirect_uri: https://devel.opendmp.eu/api/oauth/authorized/b2access + +#############ZENODO CONFIGURATIONS######### +zenodo: + url: https://sandbox.zenodo.org/api/ + +language: + path: i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application.properties b/dmp-backend/web/src/main/resources/config/application.properties deleted file mode 100644 index e6d2f9a93..000000000 --- a/dmp-backend/web/src/main/resources/config/application.properties +++ /dev/null @@ -1,123 +0,0 @@ -server.port=8081 -server.tomcat.max-threads = 20 -server.tomcat.max-connections = 10000 -logging.file=/logs/spring-boot-logging.log -spring.profiles.active=devel -eu.eudat.logic.proxy.allowed.host=https://eestore.paas2.uninett.no - -####################Metrics############## -management.endpoint.metrics.enabled=false -management.metrics.enable.http=false -management.metrics.enable.jvm=false -management.metrics.enable.jdbc=false -management.metrics.enable.tomcat=false -management.metrics.enable.logback=false -management.metrics.enable.hikaricp=false -management.metrics.enable.cache=false -management.endpoints.web.base-path=/ -management.endpoints.web.exposure.include=prometheus -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - -####################INVITATION MAIL CONFIGURATIONS############## -####################GENERIC MAIL CONFIGURATIONS################# -mail.subject=Invitation to DMP Plan {dmpname} -mail.from=opendmp-dev@cite.gr - -####################DATASET TEMPLATE MAIL CONFIGURATIONS################# -admin.mail.subject=You have been invited to the Dataset Template {templateName} - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host=hermes.local.cite.gr -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false -spring.mail.properties.mail.smtp.starttls.enable=false - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## -email.invite=file:templates/email/email.html -email.confirmation=file:templates/email/emailConfirmation.html -email.merge=file:templates/email/emailMergeConfirmation.html -email.dataset.template=file:templates/email/emailAdmin.html - -#############LOGIN CONFIGURATIONS######### -#############GENERIC LOGIN CONFIGURATIONS######### -autouser.root.email= -autouser.root.password= -autouser.root.username= - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace= - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=http://opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=http://opendmp.eu/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############DYNAMIC PROJECT CONFIGURATIONS######### -project.configuration.project.name = Project -project.configuration.funder.name = Funder -project.configuration.grant.name = Grant - -#############HTTP LOGGER DELAY CONFIGURATIONS######### -http-logger.initial-delay = 0 -http-logger.delay = 10 - -##########################PERISTENCE########################################## -#############GENERIC DATASOURCE CONFIGURATIONS######### -database.driver-class-name=org.postgresql.Driver -database.lock-fail-interval=120000 - -##########################MISC########################################## -#############USER GUIDE######### -userguide.path=user-guide/ - -#############NOTIFICATION######### -notification.rateInterval=30000 -notification.maxRetries=10 -notification.modified.subject=[OpenDMP] The {name} has been modified -notification.publish.subject=[OpenDMP] The {name} has been published -notification.finalised.subject=[OpenDMP] The {name} has been finalised -notification.modifiedFinalised.subject=[OpenDMP] The {name} has been modified and finalised - -#############LOGGING######### -logging.config=classpath:logging/logback-${spring.profiles.active}.xml - -#############TEMP######### -temp.temp=tmp/ -file.storage=uploads/ -spring.servlet.multipart.max-file-size=10MB -spring.servlet.multipart.max-request-size=10MB - -#############ZENODO######### -zenodo.affiliation=ARGOS -zenodo.community=argos \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application.yml b/dmp-backend/web/src/main/resources/config/application.yml new file mode 100644 index 000000000..4c35e4cd4 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application.yml @@ -0,0 +1,227 @@ +server: + port: 8081 + tomcat: + max-threads: 20 + max-connections: 10000 + +eu: + eudat: + logic: + proxy: + allowed: + host: https://eestore.paas2.uninett.no + +####################Metrics############## +management: + endpoint: + metrics: + enabled: false + prometheus: + enabled: true + metrics: + enable: + http: false + jvm: false + jdbc: false + tomcat: false + logback: false + hikaricp: false + cache: false + export: + prometheus: + enabled: true + endpoints: + web: + base-path: / + exposure: + include: prometheus + +####################INVITATION MAIL CONFIGURATIONS############## +####################GENERIC MAIL CONFIGURATIONS################# +mail: + subject: "Invitation to DMP Plan {dmpname}" + from: opendmp-dev@cite.gr + +####################DATASET TEMPLATE MAIL CONFIGURATIONS################# +admin: + mail: + subject: "You have been invited to the Dataset Template {templateName}" + +####################SPRING MAIL CONFIGURATIONS################# +spring: + mail: + default-encoding: UTF-8 + host: hermes.local.cite.gr + username: ${SPRING_MAIL_USER:} + password: ${SPRING_MAIL_PASS:} + port: 25 + protocol: smtp + test-connection: false + properties: + mail: + smtp: + auth: false + starttls: + enable: false + servlet: + multipart: + max-file-size: 10MB + max-request-size: 10MB + +####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## +configuration: + externalUrls: externalUrls/ExternalUrls.xml + rda: RDACommonStandards.txt + h2020template: documents/h2020.docx + configurable_login_providers: ConfigurableLoginProviders.json + doi_funder: DOI_Funder.json + +####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## +email: + invite: file:templates/email/email.html + confirmation: file:templates/email/emailConfirmation.html + merge: file:templates/email/emailMergeConfirmation.html + dataset: + template: file:templates/email/emailAdmin.html + +#############LOGIN CONFIGURATIONS######### +#############GENERIC LOGIN CONFIGURATIONS######### +autouser: + root: + email: ${AUTOUSER_EMAIL:} + password: ${AUTOUSER_PASS:} + username: ${AUTOUSER_NAME:} + +#############FACEBOOK LOGIN CONFIGURATIONS######### +facebook: + login: + clientId: ${FACEBOOK_CLIENT_ID:} + clientSecret: ${FACEBOOK_CLIENT_SECRET:} + namespace: ${FACEBOOK_NAMESPACE:} + +#############GOOGLE LOGIN CONFIGURATIONS######### +google: + login: + clientId: ${GOOGLE_CLIENT_ID:} + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + clientId: ${LINKEDIN_CLIENT_ID:} + clientSecret: ${LINKEDIN_CLIENT_SECRET:} + redirect_uri: http://opendmp.eu/login/linkedin + user_info_url: https://api.linkedin.com/v2/me + user_email: https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) + access_token_url: https://www.linkedin.com/uas/oauth2/accessToken + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + clientId: ${TWITTER_CLIENT_ID:} + clientSecret: ${TWITTER_CLIENT_SECRET:} + redirect_uri: http://opendmp.eu/login/twitter + +#############B2 ACCESS CONFIGURATIONS######### +b2access: + externallogin: + user_info_url: https://b2access-integration.fz-juelich.de:443/oauth2/userinfo + access_token_url: https://b2access-integration.fz-juelich.de:443/oauth2/token + redirect_uri: http://opendmp.eu/api/oauth/authorized/b2access + clientid: ${B2ACCESS_CLIENT_ID:} + clientSecret: ${B2ACCESS_CLIENT_SECRET:} + +#############ORCID CONFIGURATIONS######### +orcid: + login: + client_id: ${ORCID_CLIENT_ID:} + client_secret: ${ORCID_CLIENT_SECRET:} + access_token_url: https://orcid.org/oauth/token + redirect_uri: https://opendmp.eu/login/external/orcid + +#############OPENAIRE CONFIGURATIONS######### +openaire: + login: + client_id: ${OPENAIRE_CLIENT_ID:} + client_secret: ${OPENAIRE_CLIENT_SECRET:} + access_token_url: ${OPENAIRE_TOKEN_URL:} + redirect_uri: ${OPENAIRE_REFRESH_URL:} + user_info_url: ${OPENAIRE_INFO_URL:} + +#############ZENODO CONFIGURATIONS######### +zenodo: + url: https://sandbox.zenodo.org/api/ + access_token: ${ZENODO_ACCESS_TOKEN:} + login: + access_token_url: https://zenodo.org/oauth/token + client_id: ${ZENODO_CLIENT_ID:} + client_secret: ${ZENODO_CLIENT_SECRET:} + redirect_uri: https://opendmp.eu/login/external/zenodo + affiliation: ARGOS + community: argos + +#############DYNAMIC PROJECT CONFIGURATIONS######### +project: + configuration: + project: + name: Project + funder: + name: Funder + grant: + name: Grant + +#############HTTP LOGGER DELAY CONFIGURATIONS######### +http-logger: + initial-delay: 0 + delay: 10 + +##########################PERISTENCE########################################## +#############GENERIC DATASOURCE CONFIGURATIONS######### +database: + driver-class-name: org.postgresql.Driver + lock-fail-interval: 120000 + url: ${DB_URL:} + username: ${DB_USER:} + password: ${DB_PASS:} + +##########################MISC########################################## +#############USER GUIDE######### +userguide: + path: user-guide/ + +#############NOTIFICATION######### +notification: + rateInterval: 30000 + maxRetries: 10 + modified: + subject: "[OpenDMP] The {name} has been modified" + publish: + subject: "[OpenDMP] The {name} has been published" + finalised: + subject: "[OpenDMP] The {name} has been finalised" + modifiedFinalised: + subject: "[OpenDMP] The {name} has been modified and finalised" + +#############LOGGING######### +logging: + config: classpath:logging/logback-${spring.profiles.active}.xml + +#############TEMP######### +temp: + temp: tmp/ +file: + storage: uploads/ + +####################ELASTIIC SEARCH TAGS CONFIGURATIONS########## +elasticsearch: + username: elastic + password: ${ELASTIC_PASS:} + index: dmps + +#############CONTACT EMAIL CONFIGURATIONS######### +contact_email: + mail: ${CONTACT_EMAIL:} + +#############CONFIRMATION EMAIL CONFIGURATIONS######### +conf_email: + expiration_time_seconds: 14400 + subject: "OpenDMP email confirmation" \ No newline at end of file From 6e8794af1d8c61c410e7452cefa24c70027c6474 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:59:15 +0200 Subject: [PATCH 03/16] Minor improvement over logstash pipeline --- .../pipeline/open_dmp_send_to_elastic.conf | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf b/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf index 8b0f9fe02..2dd830467 100644 --- a/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf +++ b/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf @@ -2,18 +2,11 @@ input { pipeline { address => open_dmp_send_to_elastic } } -filter { -} - output { elasticsearch { hosts => "elasticsearch:9200" + index => "opendmp.logs" user => elastic - password => - index =>"opendmp.logs" - #manage_template => true - #template => "/usr/share/logstash/templates/audit/openDMP.json" - #template_name => "cite.elas.openDMP-audit*" - #template_overwrite => true - } -} \ No newline at end of file + password => "" + } +} From ac4886b47747bf2135f10d076195036fb3a4b070 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 17:20:39 +0200 Subject: [PATCH 04/16] Remove unreliable plugin update on logstash --- ELK.Docker/logstash/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ELK.Docker/logstash/Dockerfile b/ELK.Docker/logstash/Dockerfile index 2effcf094..2b2323ae6 100644 --- a/ELK.Docker/logstash/Dockerfile +++ b/ELK.Docker/logstash/Dockerfile @@ -16,5 +16,5 @@ FROM docker.elastic.co/logstash/logstash:${ELK_VERSION} # Add your logstash plugins setup here # Example: RUN logstash-plugin install logstash-filter-json -RUN logstash-plugin update logstash-input-beats -RUN logstash-plugin update logstash-filter-grok \ No newline at end of file +#RUN logstash-plugin update logstash-input-beats +#RUN logstash-plugin update logstash-filter-grok From f20cacc312eaf5432409c34c50781c441c1e7780 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:10:28 +0200 Subject: [PATCH 05/16] Remove unused module on the frontend --- dmp-frontend/package.json | 1 - dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts | 4 ++-- dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 12b85564e..020f2a1e1 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -31,7 +31,6 @@ "file-saver": "^2.0.5", "moment": "^2.29.1", "moment-timezone": "^0.5.33", - "ng-dialog-animation": "^9.0.4", "ng2-dragula": "^2.1.1", "ngx-cookie-service": "^12.0.3", "ngx-cookieconsent": "^2.2.3", diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index f825230d6..cc207f142 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -28,7 +28,7 @@ import { DmpCriteriaDialogComponent } from './criteria/dmp-criteria-dialog.compo import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; -import { NgDialogAnimationService } from "ng-dialog-animation"; +//import { NgDialogAnimationService } from "ng-dialog-animation"; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; @@ -75,7 +75,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread private dmpService: DmpService, private router: Router, private route: ActivatedRoute, - public dialogAnimation: NgDialogAnimationService, + //public dialogAnimation: NgDialogAnimationService, public dialog: MatDialog, public enumUtils: EnumUtils, private language: TranslateService, diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts index dc73b4f76..be0a5c30e 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts @@ -9,7 +9,7 @@ import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { RouterModule } from '@angular/router'; import { CloneDialogModule } from '../clone/clone-dialog/clone-dialog.module'; -import { NgDialogAnimationService } from 'ng-dialog-animation'; +//import { NgDialogAnimationService } from 'ng-dialog-animation'; @NgModule({ imports: [ @@ -27,7 +27,7 @@ import { NgDialogAnimationService } from 'ng-dialog-animation'; DmpOverviewComponent ], providers: [ - NgDialogAnimationService + //NgDialogAnimationService ] }) export class DmpOverviewModule { } From 54173dc5b94c9ecf72bcfa6ed0adbefc3de372fe Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:55:44 +0200 Subject: [PATCH 06/16] Replace the old application.properties with application.yml --- .../config/application-devel.properties | 96 -------- .../resources/config/application-devel.yml | 59 +++++ .../config/application-production.properties | 100 -------- .../config/application-production.yml | 33 +++ .../config/application-staging.properties | 90 ------- .../resources/config/application-staging.yml | 34 +++ .../resources/config/application.properties | 123 ---------- .../src/main/resources/config/application.yml | 227 ++++++++++++++++++ 8 files changed, 353 insertions(+), 409 deletions(-) delete mode 100644 dmp-backend/web/src/main/resources/config/application-devel.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-devel.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application-production.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-production.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application-staging.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-staging.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application.properties create mode 100644 dmp-backend/web/src/main/resources/config/application.yml diff --git a/dmp-backend/web/src/main/resources/config/application-devel.properties b/dmp-backend/web/src/main/resources/config/application-devel.properties deleted file mode 100644 index 396776273..000000000 --- a/dmp-backend/web/src/main/resources/config/application-devel.properties +++ /dev/null @@ -1,96 +0,0 @@ -dmp.domain = http://localhost:4200 - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url= -database.username= -database.password= -spring.datasource.maxIdle=10 -spring.datasource.minIdle=5 -spring.datasource.maxActive=10 - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = localhost -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################ELK OVERRIDES CONFIGURATIONS########## -http-logger.server-address = http://localhost:31311 - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://localhost:3000/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=configurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## -email.invite=classpath:templates/email/email.html -email.confirmation=classpath:templates/email/emailConfirmation.html -email.merge=classpath:templates/email/emailMergeConfirmation.html - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace= - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=http://localhost:4200/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.redirect_uri=http://localhost:4200/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id=APP-766DI5LP8T75FC4R -orcid.login.client_secret=f6ddc717-f49e-4bce-b302-2e479b226a24 -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=http://localhost:4200/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://sandbox.zenodo.org/api/ -zenodo.access_token= -zenodo.login.access_token_url=https://sandbox.zenodo.org/oauth/token -zenodo.login.client_id= -zenodo.login.client_secret= -zenodo.login.redirect_uri=http://localhost:4200/login/external/zenodo - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=dmp-frontend/src/assets/i18n/ - -#############LOGGING######### -logging.config=classpath:logging/logback-${spring.profiles.active}.xml - -#############PROMETHEUS######### -endpoints.prometheus.sensitive: false \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-devel.yml b/dmp-backend/web/src/main/resources/config/application-devel.yml new file mode 100644 index 000000000..354385426 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-devel.yml @@ -0,0 +1,59 @@ +dmp: + domain: http://localhost:4200 + +####################PERSISTENCE OVERRIDES CONFIGURATIONS########## +spring: + datasource: + maxIdle: 10 + minIdle: 5 + maxActive: 10 + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: localhost + port: 9200 + +####################ELK OVERRIDES CONFIGURATIONS########## +http-logger: + server-address: http://localhost:31311 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://localhost:3000/ + +####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## +email: + invite: classpath:templates/email/email.html + confirmation: classpath:templates/email/emailConfirmation.html + merge: classpath:templates/email/emailMergeConfirmation.html + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + redirect_uri: http://localhost:4200/login/linkedin + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + redirect_uri: http://localhost:4200/login/twitter + +#############ORCID CONFIGURATIONS######### +orcid: + login: + redirect_uri: http://localhost:4200/login/external/orcid + +#############ZENODO CONFIGURATIONS######### +zenodo: + login: + access_token_url: https://sandbox.zenodo.org/oauth/token + redirect_uri: http://localhost:4200/login/external/zenodo + +#############LANGUAGE CONFIGURATION######### +language: + path: dmp-frontend/src/assets/i18n/ + +#############PROMETHEUS######### +endpoints: + prometheus: + sensitive: false \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-production.properties b/dmp-backend/web/src/main/resources/config/application-production.properties deleted file mode 100644 index 971e6be43..000000000 --- a/dmp-backend/web/src/main/resources/config/application-production.properties +++ /dev/null @@ -1,100 +0,0 @@ -dmp.domain = https://opendmp.eu - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url=jdbc:postgresql://dmp-db:5432/dmptool -database.username=dmptool -database.password=CHANGEME - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = tags-elastic-search -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://docsbox-web/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host= -spring.mail.username= -spring.mail.password= -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false -spring.mail.properties.mail.smtp.starttls.enable=true - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace=opendmp - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=https://opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=https://opendmp.eu/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=https://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id= -orcid.login.client_secret= -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=https://opendmp.eu/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############SPRING DATASOURCE CONFIGURATIONS######### -spring.datasource.maxIdle: 10 -spring.datasource.max-active: 70 -spring.datasource.max-wait: 10000 -spring.datasource.validationQuery: select 1 -spring.datasource.removeAbandoned: true -spring.datasource.removeAbandonedTimeout: 1 -spring.datasource.logAbandoned: true -spring.datasource.testOnBorrow: true -spring.datasource.testOnConnect: false -spring.datasource.testWhileIdle: false - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://zenodo.org/api/ -zenodo.access_token= - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-production.yml b/dmp-backend/web/src/main/resources/config/application-production.yml new file mode 100644 index 000000000..01ddeaf21 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-production.yml @@ -0,0 +1,33 @@ +dmp: + domain: https://opendmp.eu + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: tags-elastic-search + port: 9200 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://docsbox-web/ + +#############SPRING DATASOURCE CONFIGURATIONS######### +spring: + datasource: + maxIdle: 10 + max-active: 70 + max-wait: 10000 + validationQuery: select 1 + removeAbandoned: true + removeAbandonedTimeout: 1 + logAbandoned: true + testOnBorrow: true + testOnConnect: false + testWhileIdle: false + +#############CONTACT EMAIL CONFIGURATIONS######### +contact_email.mail= + +#############LANGUAGE CONFIGURATION######### +language: + path: i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-staging.properties b/dmp-backend/web/src/main/resources/config/application-staging.properties deleted file mode 100644 index 8bafc9971..000000000 --- a/dmp-backend/web/src/main/resources/config/application-staging.properties +++ /dev/null @@ -1,90 +0,0 @@ -dmp.domain = https://devel.opendmp.eu - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url=jdbc:postgresql://dmp-db:5432/dmptool -database.username=dmptool -database.password=CHANGEME - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = tags-elastic-search -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://docsbox-web/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################INVITATION MAIL CONFIGURATIONS############## -####################GENERIC MAIL CONFIGURATIONS################# -mail.subject=Invitation to DMP Plan {dmpname} -mail.from=opendmp-dev@cite.gr - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host=hermes.local.cite.gr -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace=opendmp - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=https://devel.opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=https://devel.opendmp.eu/login/twitter - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=https://devel.opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id= -orcid.login.client_secret= -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=https://opendmp.eu/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://sandbox.zenodo.org/api/ -zenodo.access_token= - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-staging.yml b/dmp-backend/web/src/main/resources/config/application-staging.yml new file mode 100644 index 000000000..2df177074 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-staging.yml @@ -0,0 +1,34 @@ +dmp: + domain: https://devel.opendmp.eu + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: tags-elastic-search + port: 9200 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://docsbox-web/ + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + redirect_uri: https://devel.opendmp.eu/login/linkedin + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + redirect_uri: https://devel.opendmp.eu/login/twitter + +#############B2 ACCESS CONFIGURATIONS######### +b2access: + externallogin: + redirect_uri: https://devel.opendmp.eu/api/oauth/authorized/b2access + +#############ZENODO CONFIGURATIONS######### +zenodo: + url: https://sandbox.zenodo.org/api/ + +language: + path: i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application.properties b/dmp-backend/web/src/main/resources/config/application.properties deleted file mode 100644 index e6d2f9a93..000000000 --- a/dmp-backend/web/src/main/resources/config/application.properties +++ /dev/null @@ -1,123 +0,0 @@ -server.port=8081 -server.tomcat.max-threads = 20 -server.tomcat.max-connections = 10000 -logging.file=/logs/spring-boot-logging.log -spring.profiles.active=devel -eu.eudat.logic.proxy.allowed.host=https://eestore.paas2.uninett.no - -####################Metrics############## -management.endpoint.metrics.enabled=false -management.metrics.enable.http=false -management.metrics.enable.jvm=false -management.metrics.enable.jdbc=false -management.metrics.enable.tomcat=false -management.metrics.enable.logback=false -management.metrics.enable.hikaricp=false -management.metrics.enable.cache=false -management.endpoints.web.base-path=/ -management.endpoints.web.exposure.include=prometheus -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - -####################INVITATION MAIL CONFIGURATIONS############## -####################GENERIC MAIL CONFIGURATIONS################# -mail.subject=Invitation to DMP Plan {dmpname} -mail.from=opendmp-dev@cite.gr - -####################DATASET TEMPLATE MAIL CONFIGURATIONS################# -admin.mail.subject=You have been invited to the Dataset Template {templateName} - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host=hermes.local.cite.gr -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false -spring.mail.properties.mail.smtp.starttls.enable=false - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## -email.invite=file:templates/email/email.html -email.confirmation=file:templates/email/emailConfirmation.html -email.merge=file:templates/email/emailMergeConfirmation.html -email.dataset.template=file:templates/email/emailAdmin.html - -#############LOGIN CONFIGURATIONS######### -#############GENERIC LOGIN CONFIGURATIONS######### -autouser.root.email= -autouser.root.password= -autouser.root.username= - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace= - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=http://opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=http://opendmp.eu/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############DYNAMIC PROJECT CONFIGURATIONS######### -project.configuration.project.name = Project -project.configuration.funder.name = Funder -project.configuration.grant.name = Grant - -#############HTTP LOGGER DELAY CONFIGURATIONS######### -http-logger.initial-delay = 0 -http-logger.delay = 10 - -##########################PERISTENCE########################################## -#############GENERIC DATASOURCE CONFIGURATIONS######### -database.driver-class-name=org.postgresql.Driver -database.lock-fail-interval=120000 - -##########################MISC########################################## -#############USER GUIDE######### -userguide.path=user-guide/ - -#############NOTIFICATION######### -notification.rateInterval=30000 -notification.maxRetries=10 -notification.modified.subject=[OpenDMP] The {name} has been modified -notification.publish.subject=[OpenDMP] The {name} has been published -notification.finalised.subject=[OpenDMP] The {name} has been finalised -notification.modifiedFinalised.subject=[OpenDMP] The {name} has been modified and finalised - -#############LOGGING######### -logging.config=classpath:logging/logback-${spring.profiles.active}.xml - -#############TEMP######### -temp.temp=tmp/ -file.storage=uploads/ -spring.servlet.multipart.max-file-size=10MB -spring.servlet.multipart.max-request-size=10MB - -#############ZENODO######### -zenodo.affiliation=ARGOS -zenodo.community=argos \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application.yml b/dmp-backend/web/src/main/resources/config/application.yml new file mode 100644 index 000000000..4c35e4cd4 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application.yml @@ -0,0 +1,227 @@ +server: + port: 8081 + tomcat: + max-threads: 20 + max-connections: 10000 + +eu: + eudat: + logic: + proxy: + allowed: + host: https://eestore.paas2.uninett.no + +####################Metrics############## +management: + endpoint: + metrics: + enabled: false + prometheus: + enabled: true + metrics: + enable: + http: false + jvm: false + jdbc: false + tomcat: false + logback: false + hikaricp: false + cache: false + export: + prometheus: + enabled: true + endpoints: + web: + base-path: / + exposure: + include: prometheus + +####################INVITATION MAIL CONFIGURATIONS############## +####################GENERIC MAIL CONFIGURATIONS################# +mail: + subject: "Invitation to DMP Plan {dmpname}" + from: opendmp-dev@cite.gr + +####################DATASET TEMPLATE MAIL CONFIGURATIONS################# +admin: + mail: + subject: "You have been invited to the Dataset Template {templateName}" + +####################SPRING MAIL CONFIGURATIONS################# +spring: + mail: + default-encoding: UTF-8 + host: hermes.local.cite.gr + username: ${SPRING_MAIL_USER:} + password: ${SPRING_MAIL_PASS:} + port: 25 + protocol: smtp + test-connection: false + properties: + mail: + smtp: + auth: false + starttls: + enable: false + servlet: + multipart: + max-file-size: 10MB + max-request-size: 10MB + +####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## +configuration: + externalUrls: externalUrls/ExternalUrls.xml + rda: RDACommonStandards.txt + h2020template: documents/h2020.docx + configurable_login_providers: ConfigurableLoginProviders.json + doi_funder: DOI_Funder.json + +####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## +email: + invite: file:templates/email/email.html + confirmation: file:templates/email/emailConfirmation.html + merge: file:templates/email/emailMergeConfirmation.html + dataset: + template: file:templates/email/emailAdmin.html + +#############LOGIN CONFIGURATIONS######### +#############GENERIC LOGIN CONFIGURATIONS######### +autouser: + root: + email: ${AUTOUSER_EMAIL:} + password: ${AUTOUSER_PASS:} + username: ${AUTOUSER_NAME:} + +#############FACEBOOK LOGIN CONFIGURATIONS######### +facebook: + login: + clientId: ${FACEBOOK_CLIENT_ID:} + clientSecret: ${FACEBOOK_CLIENT_SECRET:} + namespace: ${FACEBOOK_NAMESPACE:} + +#############GOOGLE LOGIN CONFIGURATIONS######### +google: + login: + clientId: ${GOOGLE_CLIENT_ID:} + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + clientId: ${LINKEDIN_CLIENT_ID:} + clientSecret: ${LINKEDIN_CLIENT_SECRET:} + redirect_uri: http://opendmp.eu/login/linkedin + user_info_url: https://api.linkedin.com/v2/me + user_email: https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) + access_token_url: https://www.linkedin.com/uas/oauth2/accessToken + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + clientId: ${TWITTER_CLIENT_ID:} + clientSecret: ${TWITTER_CLIENT_SECRET:} + redirect_uri: http://opendmp.eu/login/twitter + +#############B2 ACCESS CONFIGURATIONS######### +b2access: + externallogin: + user_info_url: https://b2access-integration.fz-juelich.de:443/oauth2/userinfo + access_token_url: https://b2access-integration.fz-juelich.de:443/oauth2/token + redirect_uri: http://opendmp.eu/api/oauth/authorized/b2access + clientid: ${B2ACCESS_CLIENT_ID:} + clientSecret: ${B2ACCESS_CLIENT_SECRET:} + +#############ORCID CONFIGURATIONS######### +orcid: + login: + client_id: ${ORCID_CLIENT_ID:} + client_secret: ${ORCID_CLIENT_SECRET:} + access_token_url: https://orcid.org/oauth/token + redirect_uri: https://opendmp.eu/login/external/orcid + +#############OPENAIRE CONFIGURATIONS######### +openaire: + login: + client_id: ${OPENAIRE_CLIENT_ID:} + client_secret: ${OPENAIRE_CLIENT_SECRET:} + access_token_url: ${OPENAIRE_TOKEN_URL:} + redirect_uri: ${OPENAIRE_REFRESH_URL:} + user_info_url: ${OPENAIRE_INFO_URL:} + +#############ZENODO CONFIGURATIONS######### +zenodo: + url: https://sandbox.zenodo.org/api/ + access_token: ${ZENODO_ACCESS_TOKEN:} + login: + access_token_url: https://zenodo.org/oauth/token + client_id: ${ZENODO_CLIENT_ID:} + client_secret: ${ZENODO_CLIENT_SECRET:} + redirect_uri: https://opendmp.eu/login/external/zenodo + affiliation: ARGOS + community: argos + +#############DYNAMIC PROJECT CONFIGURATIONS######### +project: + configuration: + project: + name: Project + funder: + name: Funder + grant: + name: Grant + +#############HTTP LOGGER DELAY CONFIGURATIONS######### +http-logger: + initial-delay: 0 + delay: 10 + +##########################PERISTENCE########################################## +#############GENERIC DATASOURCE CONFIGURATIONS######### +database: + driver-class-name: org.postgresql.Driver + lock-fail-interval: 120000 + url: ${DB_URL:} + username: ${DB_USER:} + password: ${DB_PASS:} + +##########################MISC########################################## +#############USER GUIDE######### +userguide: + path: user-guide/ + +#############NOTIFICATION######### +notification: + rateInterval: 30000 + maxRetries: 10 + modified: + subject: "[OpenDMP] The {name} has been modified" + publish: + subject: "[OpenDMP] The {name} has been published" + finalised: + subject: "[OpenDMP] The {name} has been finalised" + modifiedFinalised: + subject: "[OpenDMP] The {name} has been modified and finalised" + +#############LOGGING######### +logging: + config: classpath:logging/logback-${spring.profiles.active}.xml + +#############TEMP######### +temp: + temp: tmp/ +file: + storage: uploads/ + +####################ELASTIIC SEARCH TAGS CONFIGURATIONS########## +elasticsearch: + username: elastic + password: ${ELASTIC_PASS:} + index: dmps + +#############CONTACT EMAIL CONFIGURATIONS######### +contact_email: + mail: ${CONTACT_EMAIL:} + +#############CONFIRMATION EMAIL CONFIGURATIONS######### +conf_email: + expiration_time_seconds: 14400 + subject: "OpenDMP email confirmation" \ No newline at end of file From 6ddf8103f2e16312cc4766c8bedf52281c2c2de0 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:59:15 +0200 Subject: [PATCH 07/16] Minor improvement over logstash pipeline --- .../pipeline/open_dmp_send_to_elastic.conf | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf b/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf index 8b0f9fe02..2dd830467 100644 --- a/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf +++ b/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf @@ -2,18 +2,11 @@ input { pipeline { address => open_dmp_send_to_elastic } } -filter { -} - output { elasticsearch { hosts => "elasticsearch:9200" + index => "opendmp.logs" user => elastic - password => - index =>"opendmp.logs" - #manage_template => true - #template => "/usr/share/logstash/templates/audit/openDMP.json" - #template_name => "cite.elas.openDMP-audit*" - #template_overwrite => true - } -} \ No newline at end of file + password => "" + } +} From 765ddf752a99b0fc353d726f0a7d05216279a0cf Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 17:20:39 +0200 Subject: [PATCH 08/16] Remove unreliable plugin update on logstash --- ELK.Docker/logstash/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ELK.Docker/logstash/Dockerfile b/ELK.Docker/logstash/Dockerfile index 2effcf094..2b2323ae6 100644 --- a/ELK.Docker/logstash/Dockerfile +++ b/ELK.Docker/logstash/Dockerfile @@ -16,5 +16,5 @@ FROM docker.elastic.co/logstash/logstash:${ELK_VERSION} # Add your logstash plugins setup here # Example: RUN logstash-plugin install logstash-filter-json -RUN logstash-plugin update logstash-input-beats -RUN logstash-plugin update logstash-filter-grok \ No newline at end of file +#RUN logstash-plugin update logstash-input-beats +#RUN logstash-plugin update logstash-filter-grok From ed7cd0f852d2b8af6b19585cb89603700cce0c78 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 29 Mar 2022 10:55:49 +0300 Subject: [PATCH 09/16] Fix issue with DMP json export if it have been imported from json --- .../eu/eudat/logic/managers/DataManagementPlanManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 7c41f2f65..94abaf691 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -96,6 +96,7 @@ import java.util.stream.Stream; @Component public class DataManagementPlanManager { private static final Logger logger = LoggerFactory.getLogger(DataManagementPlanManager.class); + private static final ObjectMapper objectMapper = new ObjectMapper(); private final Map notificationPaths = Stream.of(new Object[][] { {NotificationType.DMP_MODIFIED, "/plans/edit"}, @@ -1739,6 +1740,9 @@ public class DataManagementPlanManager { UserInfo me = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId()); dmp.setModified(new Date()); dmp.setCreator(me); + Map extraProperties = objectMapper.readValue(dmp.getExtraProperties(), HashMap.class); + extraProperties.put("contact", me.getId().toString()); + dmp.setExtraProperties(objectMapper.writeValueAsString(extraProperties)); dmp.setVersion(0); dmp.setStatus((short)0); dmp.setGroupId(UUID.randomUUID()); From 57420c140314be2c9117810d6d4d650a59c946c4 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:10:28 +0200 Subject: [PATCH 10/16] Remove unused module on the frontend --- dmp-frontend/package.json | 1 - dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts | 4 ++-- dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 12b85564e..020f2a1e1 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -31,7 +31,6 @@ "file-saver": "^2.0.5", "moment": "^2.29.1", "moment-timezone": "^0.5.33", - "ng-dialog-animation": "^9.0.4", "ng2-dragula": "^2.1.1", "ngx-cookie-service": "^12.0.3", "ngx-cookieconsent": "^2.2.3", diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index f825230d6..cc207f142 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -28,7 +28,7 @@ import { DmpCriteriaDialogComponent } from './criteria/dmp-criteria-dialog.compo import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service'; import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants'; -import { NgDialogAnimationService } from "ng-dialog-animation"; +//import { NgDialogAnimationService } from "ng-dialog-animation"; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; @@ -75,7 +75,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread private dmpService: DmpService, private router: Router, private route: ActivatedRoute, - public dialogAnimation: NgDialogAnimationService, + //public dialogAnimation: NgDialogAnimationService, public dialog: MatDialog, public enumUtils: EnumUtils, private language: TranslateService, diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts index dc73b4f76..be0a5c30e 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.module.ts @@ -9,7 +9,7 @@ import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { RouterModule } from '@angular/router'; import { CloneDialogModule } from '../clone/clone-dialog/clone-dialog.module'; -import { NgDialogAnimationService } from 'ng-dialog-animation'; +//import { NgDialogAnimationService } from 'ng-dialog-animation'; @NgModule({ imports: [ @@ -27,7 +27,7 @@ import { NgDialogAnimationService } from 'ng-dialog-animation'; DmpOverviewComponent ], providers: [ - NgDialogAnimationService + //NgDialogAnimationService ] }) export class DmpOverviewModule { } From 063491ef21013d5ab63f0a646f8841b3f6875118 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:55:44 +0200 Subject: [PATCH 11/16] Replace the old application.properties with application.yml --- .../config/application-devel.properties | 96 -------- .../resources/config/application-devel.yml | 59 +++++ .../config/application-production.properties | 100 -------- .../config/application-production.yml | 33 +++ .../config/application-staging.properties | 90 ------- .../resources/config/application-staging.yml | 34 +++ .../resources/config/application.properties | 123 ---------- .../src/main/resources/config/application.yml | 227 ++++++++++++++++++ 8 files changed, 353 insertions(+), 409 deletions(-) delete mode 100644 dmp-backend/web/src/main/resources/config/application-devel.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-devel.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application-production.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-production.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application-staging.properties create mode 100644 dmp-backend/web/src/main/resources/config/application-staging.yml delete mode 100644 dmp-backend/web/src/main/resources/config/application.properties create mode 100644 dmp-backend/web/src/main/resources/config/application.yml diff --git a/dmp-backend/web/src/main/resources/config/application-devel.properties b/dmp-backend/web/src/main/resources/config/application-devel.properties deleted file mode 100644 index 396776273..000000000 --- a/dmp-backend/web/src/main/resources/config/application-devel.properties +++ /dev/null @@ -1,96 +0,0 @@ -dmp.domain = http://localhost:4200 - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url= -database.username= -database.password= -spring.datasource.maxIdle=10 -spring.datasource.minIdle=5 -spring.datasource.maxActive=10 - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = localhost -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################ELK OVERRIDES CONFIGURATIONS########## -http-logger.server-address = http://localhost:31311 - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://localhost:3000/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=configurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## -email.invite=classpath:templates/email/email.html -email.confirmation=classpath:templates/email/emailConfirmation.html -email.merge=classpath:templates/email/emailMergeConfirmation.html - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace= - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=http://localhost:4200/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.redirect_uri=http://localhost:4200/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id=APP-766DI5LP8T75FC4R -orcid.login.client_secret=f6ddc717-f49e-4bce-b302-2e479b226a24 -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=http://localhost:4200/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://sandbox.zenodo.org/api/ -zenodo.access_token= -zenodo.login.access_token_url=https://sandbox.zenodo.org/oauth/token -zenodo.login.client_id= -zenodo.login.client_secret= -zenodo.login.redirect_uri=http://localhost:4200/login/external/zenodo - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=dmp-frontend/src/assets/i18n/ - -#############LOGGING######### -logging.config=classpath:logging/logback-${spring.profiles.active}.xml - -#############PROMETHEUS######### -endpoints.prometheus.sensitive: false \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-devel.yml b/dmp-backend/web/src/main/resources/config/application-devel.yml new file mode 100644 index 000000000..354385426 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-devel.yml @@ -0,0 +1,59 @@ +dmp: + domain: http://localhost:4200 + +####################PERSISTENCE OVERRIDES CONFIGURATIONS########## +spring: + datasource: + maxIdle: 10 + minIdle: 5 + maxActive: 10 + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: localhost + port: 9200 + +####################ELK OVERRIDES CONFIGURATIONS########## +http-logger: + server-address: http://localhost:31311 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://localhost:3000/ + +####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## +email: + invite: classpath:templates/email/email.html + confirmation: classpath:templates/email/emailConfirmation.html + merge: classpath:templates/email/emailMergeConfirmation.html + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + redirect_uri: http://localhost:4200/login/linkedin + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + redirect_uri: http://localhost:4200/login/twitter + +#############ORCID CONFIGURATIONS######### +orcid: + login: + redirect_uri: http://localhost:4200/login/external/orcid + +#############ZENODO CONFIGURATIONS######### +zenodo: + login: + access_token_url: https://sandbox.zenodo.org/oauth/token + redirect_uri: http://localhost:4200/login/external/zenodo + +#############LANGUAGE CONFIGURATION######### +language: + path: dmp-frontend/src/assets/i18n/ + +#############PROMETHEUS######### +endpoints: + prometheus: + sensitive: false \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-production.properties b/dmp-backend/web/src/main/resources/config/application-production.properties deleted file mode 100644 index 971e6be43..000000000 --- a/dmp-backend/web/src/main/resources/config/application-production.properties +++ /dev/null @@ -1,100 +0,0 @@ -dmp.domain = https://opendmp.eu - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url=jdbc:postgresql://dmp-db:5432/dmptool -database.username=dmptool -database.password=CHANGEME - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = tags-elastic-search -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://docsbox-web/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host= -spring.mail.username= -spring.mail.password= -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false -spring.mail.properties.mail.smtp.starttls.enable=true - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace=opendmp - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=https://opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=https://opendmp.eu/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=https://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id= -orcid.login.client_secret= -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=https://opendmp.eu/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############SPRING DATASOURCE CONFIGURATIONS######### -spring.datasource.maxIdle: 10 -spring.datasource.max-active: 70 -spring.datasource.max-wait: 10000 -spring.datasource.validationQuery: select 1 -spring.datasource.removeAbandoned: true -spring.datasource.removeAbandonedTimeout: 1 -spring.datasource.logAbandoned: true -spring.datasource.testOnBorrow: true -spring.datasource.testOnConnect: false -spring.datasource.testWhileIdle: false - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://zenodo.org/api/ -zenodo.access_token= - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-production.yml b/dmp-backend/web/src/main/resources/config/application-production.yml new file mode 100644 index 000000000..01ddeaf21 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-production.yml @@ -0,0 +1,33 @@ +dmp: + domain: https://opendmp.eu + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: tags-elastic-search + port: 9200 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://docsbox-web/ + +#############SPRING DATASOURCE CONFIGURATIONS######### +spring: + datasource: + maxIdle: 10 + max-active: 70 + max-wait: 10000 + validationQuery: select 1 + removeAbandoned: true + removeAbandonedTimeout: 1 + logAbandoned: true + testOnBorrow: true + testOnConnect: false + testWhileIdle: false + +#############CONTACT EMAIL CONFIGURATIONS######### +contact_email.mail= + +#############LANGUAGE CONFIGURATION######### +language: + path: i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-staging.properties b/dmp-backend/web/src/main/resources/config/application-staging.properties deleted file mode 100644 index 8bafc9971..000000000 --- a/dmp-backend/web/src/main/resources/config/application-staging.properties +++ /dev/null @@ -1,90 +0,0 @@ -dmp.domain = https://devel.opendmp.eu - -####################PERSISTENCE OVERRIDES CONFIGURATIONS########## -database.url=jdbc:postgresql://dmp-db:5432/dmptool -database.username=dmptool -database.password=CHANGEME - -####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## -elasticsearch.host = tags-elastic-search -elasticsearch.port = 9200 -elasticsearch.username=elastic -elasticsearch.password= -elasticsearch.index=dmps - -####################PDF OVERRIDES CONFIGURATIONS########## -pdf.converter.url=http://docsbox-web/ - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################INVITATION MAIL CONFIGURATIONS############## -####################GENERIC MAIL CONFIGURATIONS################# -mail.subject=Invitation to DMP Plan {dmpname} -mail.from=opendmp-dev@cite.gr - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host=hermes.local.cite.gr -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace=opendmp - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=https://devel.opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=https://devel.opendmp.eu/login/twitter - -#############CONFIRMATION EMAIL CONFIGURATIONS######### -conf_email.expiration_time_seconds=14400 -conf_email.subject=OpenDMP email confirmation - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=https://devel.opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############ORCID CONFIGURATIONS######### -orcid.login.client_id= -orcid.login.client_secret= -orcid.login.access_token_url=https://orcid.org/oauth/token -orcid.login.redirect_uri=https://opendmp.eu/login/external/orcid - -#############OPENAIRE CONFIGURATIONS######### -openaire.login.client_id= -openaire.login.client_secret= -openaire.login.access_token_url= -openaire.login.redirect_uri= -openaire.login.user_info_url= - -#############ZENODO CONFIGURATIONS######### -zenodo.url=https://sandbox.zenodo.org/api/ -zenodo.access_token= - -#############CONTACT EMAIL CONFIGURATIONS######### -contact_email.mail= - -language.path=i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application-staging.yml b/dmp-backend/web/src/main/resources/config/application-staging.yml new file mode 100644 index 000000000..2df177074 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application-staging.yml @@ -0,0 +1,34 @@ +dmp: + domain: https://devel.opendmp.eu + +####################ELASTIIC SEARCH TAGS OVERRIDES CONFIGURATIONS########## +elasticsearch: + host: tags-elastic-search + port: 9200 + +####################PDF OVERRIDES CONFIGURATIONS########## +pdf: + converter: + url: http://docsbox-web/ + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + redirect_uri: https://devel.opendmp.eu/login/linkedin + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + redirect_uri: https://devel.opendmp.eu/login/twitter + +#############B2 ACCESS CONFIGURATIONS######### +b2access: + externallogin: + redirect_uri: https://devel.opendmp.eu/api/oauth/authorized/b2access + +#############ZENODO CONFIGURATIONS######### +zenodo: + url: https://sandbox.zenodo.org/api/ + +language: + path: i18n/ \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application.properties b/dmp-backend/web/src/main/resources/config/application.properties deleted file mode 100644 index e6d2f9a93..000000000 --- a/dmp-backend/web/src/main/resources/config/application.properties +++ /dev/null @@ -1,123 +0,0 @@ -server.port=8081 -server.tomcat.max-threads = 20 -server.tomcat.max-connections = 10000 -logging.file=/logs/spring-boot-logging.log -spring.profiles.active=devel -eu.eudat.logic.proxy.allowed.host=https://eestore.paas2.uninett.no - -####################Metrics############## -management.endpoint.metrics.enabled=false -management.metrics.enable.http=false -management.metrics.enable.jvm=false -management.metrics.enable.jdbc=false -management.metrics.enable.tomcat=false -management.metrics.enable.logback=false -management.metrics.enable.hikaricp=false -management.metrics.enable.cache=false -management.endpoints.web.base-path=/ -management.endpoints.web.exposure.include=prometheus -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - -####################INVITATION MAIL CONFIGURATIONS############## -####################GENERIC MAIL CONFIGURATIONS################# -mail.subject=Invitation to DMP Plan {dmpname} -mail.from=opendmp-dev@cite.gr - -####################DATASET TEMPLATE MAIL CONFIGURATIONS################# -admin.mail.subject=You have been invited to the Dataset Template {templateName} - -####################SPRING MAIL CONFIGURATIONS################# -spring.mail.default-encoding=UTF-8 -spring.mail.host=hermes.local.cite.gr -spring.mail.port=25 -spring.mail.protocol=smtp -spring.mail.test-connection=false -spring.mail.properties.mail.smtp.auth=false -spring.mail.properties.mail.smtp.starttls.enable=false - -####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## -configuration.externalUrls=externalUrls/ExternalUrls.xml -configuration.rda=RDACommonStandards.txt -configuration.h2020template=documents/h2020.docx -configuration.configurable_login_providers=ConfigurableLoginProviders.json -configuration.doi_funder=DOI_Funder.json - -####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## -email.invite=file:templates/email/email.html -email.confirmation=file:templates/email/emailConfirmation.html -email.merge=file:templates/email/emailMergeConfirmation.html -email.dataset.template=file:templates/email/emailAdmin.html - -#############LOGIN CONFIGURATIONS######### -#############GENERIC LOGIN CONFIGURATIONS######### -autouser.root.email= -autouser.root.password= -autouser.root.username= - -#############FACEBOOK LOGIN CONFIGURATIONS######### -facebook.login.clientId= -facebook.login.clientSecret= -facebook.login.namespace= - -#############GOOGLE LOGIN CONFIGURATIONS######### -google.login.clientId= - -#############LINKEDIN LOGIN CONFIGURATIONS######### -linkedin.login.clientId= -linkedin.login.clientSecret= -linkedin.login.redirect_uri=http://opendmp.eu/login/linkedin -linkedin.login.user_info_url=https://api.linkedin.com/v2/me -linkedin.login.user_email=https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) -linkedin.login.access_token_url=https://www.linkedin.com/uas/oauth2/accessToken - -#############TWITTER LOGIN CONFIGURATIONS######### -twitter.login.clientId= -twitter.login.clientSecret= -twitter.login.redirect_uri=http://opendmp.eu/login/twitter - -#############B2 ACCESS CONFIGURATIONS######### -b2access.externallogin.user_info_url=https://b2access-integration.fz-juelich.de:443/oauth2/userinfo -b2access.externallogin.access_token_url=https://b2access-integration.fz-juelich.de:443/oauth2/token -b2access.externallogin.redirect_uri=http://opendmp.eu/api/oauth/authorized/b2access -b2access.externallogin.clientid= -b2access.externallogin.clientSecret= - -#############DYNAMIC PROJECT CONFIGURATIONS######### -project.configuration.project.name = Project -project.configuration.funder.name = Funder -project.configuration.grant.name = Grant - -#############HTTP LOGGER DELAY CONFIGURATIONS######### -http-logger.initial-delay = 0 -http-logger.delay = 10 - -##########################PERISTENCE########################################## -#############GENERIC DATASOURCE CONFIGURATIONS######### -database.driver-class-name=org.postgresql.Driver -database.lock-fail-interval=120000 - -##########################MISC########################################## -#############USER GUIDE######### -userguide.path=user-guide/ - -#############NOTIFICATION######### -notification.rateInterval=30000 -notification.maxRetries=10 -notification.modified.subject=[OpenDMP] The {name} has been modified -notification.publish.subject=[OpenDMP] The {name} has been published -notification.finalised.subject=[OpenDMP] The {name} has been finalised -notification.modifiedFinalised.subject=[OpenDMP] The {name} has been modified and finalised - -#############LOGGING######### -logging.config=classpath:logging/logback-${spring.profiles.active}.xml - -#############TEMP######### -temp.temp=tmp/ -file.storage=uploads/ -spring.servlet.multipart.max-file-size=10MB -spring.servlet.multipart.max-request-size=10MB - -#############ZENODO######### -zenodo.affiliation=ARGOS -zenodo.community=argos \ No newline at end of file diff --git a/dmp-backend/web/src/main/resources/config/application.yml b/dmp-backend/web/src/main/resources/config/application.yml new file mode 100644 index 000000000..4c35e4cd4 --- /dev/null +++ b/dmp-backend/web/src/main/resources/config/application.yml @@ -0,0 +1,227 @@ +server: + port: 8081 + tomcat: + max-threads: 20 + max-connections: 10000 + +eu: + eudat: + logic: + proxy: + allowed: + host: https://eestore.paas2.uninett.no + +####################Metrics############## +management: + endpoint: + metrics: + enabled: false + prometheus: + enabled: true + metrics: + enable: + http: false + jvm: false + jdbc: false + tomcat: false + logback: false + hikaricp: false + cache: false + export: + prometheus: + enabled: true + endpoints: + web: + base-path: / + exposure: + include: prometheus + +####################INVITATION MAIL CONFIGURATIONS############## +####################GENERIC MAIL CONFIGURATIONS################# +mail: + subject: "Invitation to DMP Plan {dmpname}" + from: opendmp-dev@cite.gr + +####################DATASET TEMPLATE MAIL CONFIGURATIONS################# +admin: + mail: + subject: "You have been invited to the Dataset Template {templateName}" + +####################SPRING MAIL CONFIGURATIONS################# +spring: + mail: + default-encoding: UTF-8 + host: hermes.local.cite.gr + username: ${SPRING_MAIL_USER:} + password: ${SPRING_MAIL_PASS:} + port: 25 + protocol: smtp + test-connection: false + properties: + mail: + smtp: + auth: false + starttls: + enable: false + servlet: + multipart: + max-file-size: 10MB + max-request-size: 10MB + +####################CONFIGURATION FILES OVERRIDES CONFIGURATIONS########## +configuration: + externalUrls: externalUrls/ExternalUrls.xml + rda: RDACommonStandards.txt + h2020template: documents/h2020.docx + configurable_login_providers: ConfigurableLoginProviders.json + doi_funder: DOI_Funder.json + +####################EMAIL FILE TEMPLATES OVERRIDES CONFIGURATIONS########## +email: + invite: file:templates/email/email.html + confirmation: file:templates/email/emailConfirmation.html + merge: file:templates/email/emailMergeConfirmation.html + dataset: + template: file:templates/email/emailAdmin.html + +#############LOGIN CONFIGURATIONS######### +#############GENERIC LOGIN CONFIGURATIONS######### +autouser: + root: + email: ${AUTOUSER_EMAIL:} + password: ${AUTOUSER_PASS:} + username: ${AUTOUSER_NAME:} + +#############FACEBOOK LOGIN CONFIGURATIONS######### +facebook: + login: + clientId: ${FACEBOOK_CLIENT_ID:} + clientSecret: ${FACEBOOK_CLIENT_SECRET:} + namespace: ${FACEBOOK_NAMESPACE:} + +#############GOOGLE LOGIN CONFIGURATIONS######### +google: + login: + clientId: ${GOOGLE_CLIENT_ID:} + +#############LINKEDIN LOGIN CONFIGURATIONS######### +linkedin: + login: + clientId: ${LINKEDIN_CLIENT_ID:} + clientSecret: ${LINKEDIN_CLIENT_SECRET:} + redirect_uri: http://opendmp.eu/login/linkedin + user_info_url: https://api.linkedin.com/v2/me + user_email: https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~)) + access_token_url: https://www.linkedin.com/uas/oauth2/accessToken + +#############TWITTER LOGIN CONFIGURATIONS######### +twitter: + login: + clientId: ${TWITTER_CLIENT_ID:} + clientSecret: ${TWITTER_CLIENT_SECRET:} + redirect_uri: http://opendmp.eu/login/twitter + +#############B2 ACCESS CONFIGURATIONS######### +b2access: + externallogin: + user_info_url: https://b2access-integration.fz-juelich.de:443/oauth2/userinfo + access_token_url: https://b2access-integration.fz-juelich.de:443/oauth2/token + redirect_uri: http://opendmp.eu/api/oauth/authorized/b2access + clientid: ${B2ACCESS_CLIENT_ID:} + clientSecret: ${B2ACCESS_CLIENT_SECRET:} + +#############ORCID CONFIGURATIONS######### +orcid: + login: + client_id: ${ORCID_CLIENT_ID:} + client_secret: ${ORCID_CLIENT_SECRET:} + access_token_url: https://orcid.org/oauth/token + redirect_uri: https://opendmp.eu/login/external/orcid + +#############OPENAIRE CONFIGURATIONS######### +openaire: + login: + client_id: ${OPENAIRE_CLIENT_ID:} + client_secret: ${OPENAIRE_CLIENT_SECRET:} + access_token_url: ${OPENAIRE_TOKEN_URL:} + redirect_uri: ${OPENAIRE_REFRESH_URL:} + user_info_url: ${OPENAIRE_INFO_URL:} + +#############ZENODO CONFIGURATIONS######### +zenodo: + url: https://sandbox.zenodo.org/api/ + access_token: ${ZENODO_ACCESS_TOKEN:} + login: + access_token_url: https://zenodo.org/oauth/token + client_id: ${ZENODO_CLIENT_ID:} + client_secret: ${ZENODO_CLIENT_SECRET:} + redirect_uri: https://opendmp.eu/login/external/zenodo + affiliation: ARGOS + community: argos + +#############DYNAMIC PROJECT CONFIGURATIONS######### +project: + configuration: + project: + name: Project + funder: + name: Funder + grant: + name: Grant + +#############HTTP LOGGER DELAY CONFIGURATIONS######### +http-logger: + initial-delay: 0 + delay: 10 + +##########################PERISTENCE########################################## +#############GENERIC DATASOURCE CONFIGURATIONS######### +database: + driver-class-name: org.postgresql.Driver + lock-fail-interval: 120000 + url: ${DB_URL:} + username: ${DB_USER:} + password: ${DB_PASS:} + +##########################MISC########################################## +#############USER GUIDE######### +userguide: + path: user-guide/ + +#############NOTIFICATION######### +notification: + rateInterval: 30000 + maxRetries: 10 + modified: + subject: "[OpenDMP] The {name} has been modified" + publish: + subject: "[OpenDMP] The {name} has been published" + finalised: + subject: "[OpenDMP] The {name} has been finalised" + modifiedFinalised: + subject: "[OpenDMP] The {name} has been modified and finalised" + +#############LOGGING######### +logging: + config: classpath:logging/logback-${spring.profiles.active}.xml + +#############TEMP######### +temp: + temp: tmp/ +file: + storage: uploads/ + +####################ELASTIIC SEARCH TAGS CONFIGURATIONS########## +elasticsearch: + username: elastic + password: ${ELASTIC_PASS:} + index: dmps + +#############CONTACT EMAIL CONFIGURATIONS######### +contact_email: + mail: ${CONTACT_EMAIL:} + +#############CONFIRMATION EMAIL CONFIGURATIONS######### +conf_email: + expiration_time_seconds: 14400 + subject: "OpenDMP email confirmation" \ No newline at end of file From 9c9919fd8567a2a79c4b2db7f41ab627c4c7e7bf Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 15:59:15 +0200 Subject: [PATCH 12/16] Minor improvement over logstash pipeline --- .../pipeline/open_dmp_send_to_elastic.conf | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf b/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf index 8b0f9fe02..2dd830467 100644 --- a/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf +++ b/ELK.Docker/shared/config-elk/logstash/pipeline/open_dmp_send_to_elastic.conf @@ -2,18 +2,11 @@ input { pipeline { address => open_dmp_send_to_elastic } } -filter { -} - output { elasticsearch { hosts => "elasticsearch:9200" + index => "opendmp.logs" user => elastic - password => - index =>"opendmp.logs" - #manage_template => true - #template => "/usr/share/logstash/templates/audit/openDMP.json" - #template_name => "cite.elas.openDMP-audit*" - #template_overwrite => true - } -} \ No newline at end of file + password => "" + } +} From 3fff5e1d2ee63cb63faed08ecc1ca27e6d8f2d5c Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 21 Mar 2022 17:20:39 +0200 Subject: [PATCH 13/16] Remove unreliable plugin update on logstash --- ELK.Docker/logstash/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ELK.Docker/logstash/Dockerfile b/ELK.Docker/logstash/Dockerfile index 2effcf094..2b2323ae6 100644 --- a/ELK.Docker/logstash/Dockerfile +++ b/ELK.Docker/logstash/Dockerfile @@ -16,5 +16,5 @@ FROM docker.elastic.co/logstash/logstash:${ELK_VERSION} # Add your logstash plugins setup here # Example: RUN logstash-plugin install logstash-filter-json -RUN logstash-plugin update logstash-input-beats -RUN logstash-plugin update logstash-filter-grok \ No newline at end of file +#RUN logstash-plugin update logstash-input-beats +#RUN logstash-plugin update logstash-filter-grok From cf1b2489a36e27fba1ccb07679042d5d9ed64ea0 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 29 Mar 2022 11:30:56 +0300 Subject: [PATCH 14/16] Fix critical issue with xml import --- .../java/eu/eudat/logic/managers/DataManagementPlanManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 94abaf691..9ab9ff5fc 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -1679,7 +1679,7 @@ public class DataManagementPlanManager { if (dataManagementPlans.get(0).getPublicDate() != null) { extraPropertiesMap.put("publicDate", dataManagementPlans.get(0).getPublicDate()); } - if (dataManagementPlans.get(0).getCosts() != null) { + if (dataManagementPlans.get(0).getCosts() != null && !dataManagementPlans.get(0).getCosts().isEmpty()) { extraPropertiesMap.put("costs", mapper.readValue(dataManagementPlans.get(0).getCosts(), ArrayList.class)); } dm.setExtraProperties(extraPropertiesMap); From 2666568fab7aafa3394c0019c175e1c499c5e66b Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 29 Mar 2022 15:11:55 +0300 Subject: [PATCH 15/16] Make Dataset Validation checker to no longer be exception depedant --- .../java/eu/eudat/controllers/Datasets.java | 10 +++++----- .../eudat/logic/managers/DatasetManager.java | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java index c788adea7..94a17913b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Datasets.java @@ -291,12 +291,12 @@ public class Datasets extends BaseController { @RequestMapping(method = RequestMethod.GET, value = {"/{id}/validate"}, produces = "application/json") public @ResponseBody ResponseEntity> validate(@PathVariable(value = "id") UUID id, Principal principal) throws Exception { - try { - Dataset dataset = datasetManager.getEntitySingle(id); - datasetManager.checkDatasetValidation(dataset); + Dataset dataset = datasetManager.getEntitySingle(id); + String failedField = datasetManager.checkDatasetValidation(dataset); + if (failedField == null) { return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE).message("Valid")); - } catch (Exception datasetWizardCannotUnlockException) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.ERROR_MESSAGE).message(datasetWizardCannotUnlockException.getMessage())); + } else { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.ERROR_MESSAGE).message("Field value of " + failedField + " must be filled.")); } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java index a4d5d8bff..871c59e3c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DatasetManager.java @@ -587,8 +587,12 @@ public class DatasetManager { if (this.apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().getClient() != null) { this.getTagsFromProfile(datasetWizardModel, dataset); } - if (datasetWizardModel.getStatus() == (int) Dataset.Status.FINALISED.getValue()) - checkDatasetValidation(dataset); + if (datasetWizardModel.getStatus() == (int) Dataset.Status.FINALISED.getValue()) { + String failedField = checkDatasetValidation(dataset); + if (failedField != null) { + throw new Exception("Field value of " + failedField + " must be filled."); + } + } UserInfo userInfo = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build(); dataset.setCreator(userInfo); @@ -683,7 +687,7 @@ public class DatasetManager { } - public void checkDatasetValidation(Dataset dataset) throws Exception { + public String checkDatasetValidation(Dataset dataset) throws Exception { List datasetProfileValidators = new LinkedList<>(); DatasetProfile profile = apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(dataset.getProfile().getId()); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); @@ -712,11 +716,17 @@ public class DatasetManager { visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules()); + String failedField = null; + for (String validator : datasetProfileValidators) { if (obj.has(validator) && isNullOrEmpty(obj.getString(validator)) && isElementVisible(nodeList, validator, visibilityRuleService)) { - throw new Exception("Field value of " + validator + " must be filled."); + //throw new Exception("Field value of " + validator + " must be filled."); + failedField = validator; + break; } } + + return failedField; } private boolean isNullOrEmpty(String value) { From 2c00dab4503bae41f77a1b70d56b21ff009b1946 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 29 Mar 2022 15:12:56 +0300 Subject: [PATCH 16/16] Make DMP export to be more consistent with the DMP shown on the front end UI --- .../managers/DataManagementPlanManager.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 9ab9ff5fc..53279f756 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -1220,9 +1220,12 @@ public class DataManagementPlanManager { wordBuilder.addParagraphContent("Datasets", document, ParagraphStyle.HEADER1, BigInteger.ZERO); // Space below Datasets. XWPFParagraph parBreakDatasets = document.createParagraph(); + final Boolean isFinalized = dmpEntity.getStatus() == DMP.DMPStatus.FINALISED.getValue(); + final Boolean isPublic = dmpEntity.isPublic(); dmpEntity.getDataset().stream() .filter(item -> item.getStatus() != Dataset.Status.CANCELED.getValue()) .filter(item -> item.getStatus() != Dataset.Status.DELETED.getValue()) + .filter(item -> !isPublic && !isFinalized || item.getStatus() == Dataset.Status.FINALISED.getValue()) .forEach(datasetEntity -> { Map properties = new HashMap<>(); if (datasetEntity.getProperties() != null) { @@ -1348,7 +1351,13 @@ public class DataManagementPlanManager { eu.eudat.data.entities.DMP dmp = databaseRepository.getDmpDao().find(UUID.fromString(id)); if (!dmp.isPublic() && dmp.getUsers().stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId()).collect(Collectors.toList()).size() == 0) throw new UnauthorisedException(); - List datasets = dmp.getDataset().stream().filter(dataset -> dataset.getStatus() != Dmp.DMPStatus.DELETED.getValue()).collect(Collectors.toList()); + final Boolean isFinalized = dmp.getStatus() == DMP.DMPStatus.FINALISED.getValue(); + final Boolean isPublic = dmp.isPublic(); + List datasets = dmp.getDataset().stream() + .filter(dataset -> dataset.getStatus() != Dataset.Status.DELETED.getValue() && + dataset.getStatus() != Dataset.Status.CANCELED.getValue()) + .filter(dataset -> !isPublic && !isFinalized || dataset.getStatus() == Dataset.Status.FINALISED.getValue()) + .collect(Collectors.toList()); /*String fileName = dmp.getLabel(); fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");*/ String uuid = UUID.randomUUID().toString(); @@ -1499,6 +1508,13 @@ public class DataManagementPlanManager { if (!dmp.isPublic() && dmp.getUsers().stream().noneMatch(userInfo -> userInfo.getUser().getId() == principal.getId())) throw new UnauthorisedException(); // RDAExportModel rdaExportModel = new RDAExportModel().fromDataModel(dmp, datasetManager, principal); + final Boolean isFinalized = dmp.getStatus() == DMP.DMPStatus.FINALISED.getValue(); + final Boolean isPublic = dmp.isPublic(); + dmp.setDataset(dmp.getDataset().stream() + .filter(dataset -> dataset.getStatus() != Dataset.Status.DELETED.getValue() && + dataset.getStatus() != Dataset.Status.CANCELED.getValue()) + .filter(dataset -> !isPublic && !isFinalized || dataset.getStatus() == Dataset.Status.FINALISED.getValue()) + .collect(Collectors.toSet())); String result = rdaManager.convertToRDA(dmp); /*ObjectMapper mapper = new ObjectMapper();