Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
Efstratios Giannopoulos 2024-04-25 14:53:23 +03:00
commit bc073574c1
13 changed files with 468 additions and 370 deletions

View File

@ -1,7 +1,7 @@
###################### GENERAL ######################### ###################### GENERAL #########################
#User that is used to deploy the containers #User that is used to deploy the containers
DEPLOY_USER=root DEPLOY_USER=1000
DEPLOY_GROUP=1000
#version selections #version selections
PROXY_TAG=mainline-alpine PROXY_TAG=mainline-alpine
MAIN_APP_TAG=2.1.3 MAIN_APP_TAG=2.1.3
@ -10,10 +10,11 @@ ANNOTATION_APP_TAG=2.1.3
DOCX_APP_TAG=0.0.8 DOCX_APP_TAG=0.0.8
JSON_APP_TAG=0.0.6 JSON_APP_TAG=0.0.6
ZENODO_APP_TAG=2.0.4 ZENODO_APP_TAG=2.0.4
POSTGRES_TAG=16-alpine
ELK_VERSION=8.13.12 ELK_VERSION=8.13.12
KEYCLOAK_TAG=24.0.2 KEYCLOAK_TAG=24.0.2
RABBITMQ_TAG=3.13-management
GOTENBERG_TAG=8.4.0 GOTENBERG_TAG=8.4.0
POSTGRES_TAG=16-alpine
#Application configuration #Application configuration
DOCKER_REGISTRY=crepo.cite.gr/ DOCKER_REGISTRY=crepo.cite.gr/

View File

@ -1,153 +1,151 @@
version: "2.4"
services: services:
############################## PROXY ######################################## ############################## PROXY ########################################
opendmp.proxy: # opendmp.proxy:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
restart: unless-stopped # restart: unless-stopped
cpus: 1 # cpus: 1
mem_limit: 256m # mem_limit: 256m
ports: # ports:
- "${PROXY_APP_PORT}:8081" # - "${PROXY_APP_PORT}:8081"
- "${PROXY_MS_PORT}:8082" # - "${PROXY_MS_PORT}:8082"
env_file: # env_file:
- /proxy/proxy.env # - proxy/proxy.env
volumes: # volumes:
- /proxy/nginx.conf:/etc/nginx/nginx.conf # - proxy/nginx.conf:/etc/nginx/nginx.conf
- /proxy/ProxyNginx.conf:/etc/nginx/conf.d/default.conf # - proxy/ProxyNginx.conf:/etc/nginx/conf.d/default.conf
- /proxy/nginx-selfsigned.crt:/certifcates/cert.crt # - proxy/nginx-selfsigned.crt:/certifcates/cert.crt
- /proxy/nginx-selfsigned.key:/certifcates/key.key # - proxy/nginx-selfsigned.key:/certifcates/key.key
- /logs/proxy:/tmp/logs # - logs/proxy:/tmp/logs
networks: # networks:
- opendmp-proxy-network # - opendmp-proxy-network
############################## OPENDMP APP ################################# ############################## OPENDMP APP #################################
opendmp.backend: # opendmp.backend:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
restart: unless-stopped # restart: unless-stopped
cpus: 1 # cpus: 1
mem_limit: 2048m # mem_limit: 2048m
environment: # environment:
- PROFILE=${PROFILE} # - PROFILE=${PROFILE}
ports: # ports:
- "8080" # - "8080"
volumes: # volumes:
- /opendmp/backend/config:/config # - opendmp/backend/config:/config
- /opendmp/backend/certificates:/certificates # - opendmp/backend/certificates:/certificates
- /opendmp/backend/i18n:/i18n # - opendmp/backend/i18n:/i18n
- /opendmp/backend/material:/material # - opendmp/backend/material:/material
- /opendmp/backend/Semantics.json:/Semantics.json # - opendmp/backend/Semantics.json:/Semantics.json
- /storage/backend:/storage # - storage/backend:/storage
- /logs/backend:/logs # - logs/backend:/logs
networks: # networks:
- opendmp-proxy-network # - opendmp-proxy-network
- opendmp-backend-network # - opendmp-backend-network
- opendmp-plugins-network # - opendmp-plugins-network
- opendmp-gotenberg-shared-network # - opendmp-gotenberg-shared-network
- opendmp-elastic-shared-network # - opendmp-elastic-shared-network
- opendmp-keycloak-shared-network # - opendmp-keycloak-shared-network
- opendmp-postgres-shared-network # - opendmp-postgres-shared-network
- opendmp-rabbitmq-shared-network # - opendmp-rabbitmq-shared-network
opendmp.frontend: # opendmp.frontend:
restart: unless-stopped # restart: unless-stopped
cpus: 1 # cpus: 1
mem_limit: 2048m # mem_limit: 2048m
ports: # ports:
- "8080" # - "8080"
volumes: # volumes:
- /opendmp/webapp/config.json:/usr/share/nginx/html/assets/config/config.json # - opendmp/webapp/config.json:/usr/share/nginx/html/assets/config/config.json
- /opendmp/webapp/nginx.conf:/etc/nginx/nginx.conf # - opendmp/webapp/nginx.conf:/etc/nginx/nginx.conf
- /opendmp/webapp/WebAppNginx.conf:/etc/nginx/conf.d/default.conf # - opendmp/webapp/WebAppNginx.conf:/etc/nginx/conf.d/default.conf
networks: # networks:
- opendmp-proxy-network # - opendmp-proxy-network
opendmp.notification: # opendmp.notification:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
cpus: 1 # cpus: 1
mem_limit: 1024m # mem_limit: 1024m
restart: unless-stopped # restart: unless-stopped
ports: # ports:
- "8080" # - "8080"
environment: # environment:
- PROFILE=${PROFILE} # - PROFILE=${PROFILE}
volumes: # volumes:
- /opendmp/notification-api/config:/config # - opendmp/notification-api/config:/config
- /opendmp/notification-api/messages:/messages # - opendmp/notification-api/messages:/messages
- /opendmp/notification-api/notification_templates:/notification_templates # - opendmp/notification-api/notification_templates:/notification_templates
- /logs/notification-api:/logs # - logs/notification-api:/logs
networks: # networks:
- opendmp-proxy-network # - opendmp-proxy-network
- opendmp-backend-network # - opendmp-backend-network
- opendmp-plugins-network # - opendmp-plugins-network
- opendmp-rabbitmq-shared-network # - opendmp-rabbitmq-shared-network
- opendmp-keycloak-shared-network # - opendmp-keycloak-shared-network
- opendmp-postgres-shared-network # - opendmp-postgres-shared-network
opendmp.annotation: # opendmp.annotation:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
cpus: 1 # cpus: 1
mem_limit: 1024m # mem_limit: 1024m
restart: unless-stopped # restart: unless-stopped
ports: # ports:
- "8080" # - "8080"
environment: # environment:
- PROFILE=${PROFILE} # - PROFILE=${PROFILE}
volumes: # volumes:
- /opendmp/annotation-api/config:/config # - opendmp/annotation-api/config:/config
- /opendmp/annotation-api/messages:/messages # - opendmp/annotation-api/messages:/messages
- /logs/annotation-api:/logs # - logs/annotation-api:/logs
networks: # networks:
- opendmp-proxy-network # - opendmp-proxy-network
- opendmp-backend-network # - opendmp-backend-network
- opendmp-plugins-network # - opendmp-plugins-network
- opendmp-rabbitmq-shared-network # - opendmp-rabbitmq-shared-network
- opendmp-keycloak-shared-network # - opendmp-keycloak-shared-network
- opendmp-postgres-shared-network # - opendmp-postgres-shared-network
############################## FILE-TRANSFORMER ################################# # ############################## FILE-TRANSFORMER #################################
opendmp.file.transformer.docx: # opendmp.file.transformer.docx:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
restart: unless-stopped # restart: unless-stopped
cpus: 1 # cpus: 1
mem_limit: 1024m # mem_limit: 1024m
expose: # expose:
- "8080" # - "8080"
environment: # environment:
- SERVER_PORT=${SERVER_PORT} # - SERVER_PORT=${SERVER_PORT}
- PROFILE=${PROFILE} # - PROFILE=${PROFILE}
volumes: # volumes:
- /opendmp/file-transformer-docx/config:/config # - opendmp/file-transformer-docx/config:/config
- /logs/file-transformer-docx:/logs # - logs/file-transformer-docx:/logs
- /storage/file-transformer-docx:/storage # - storage/file-transformer-docx:/storage
networks: # networks:
- opendmp-backend-network # - opendmp-backend-network
- opendmp-plugins-network # - opendmp-plugins-network
- opendmp-gotenberg-shared-network # - opendmp-gotenberg-shared-network
opendmp.file.transformer.rdajson: # opendmp.file.transformer.rdajson:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
restart: unless-stopped # restart: unless-stopped
cpus: 1 # cpus: 1
mem_limit: 1024m # mem_limit: 1024m
expose: # expose:
- "8080" # - "8080"
environment: # environment:
- SERVER_PORT=${SERVER_PORT} # - SERVER_PORT=${SERVER_PORT}
- PROFILE=${PROFILE} # - PROFILE=${PROFILE}
volumes: # volumes:
- /opendmp/file-transformer-rda-json/config:/config # - opendmp/file-transformer-rda-json/config:/config
- /opendmp/file-transformer-rda-json/internal:/internal # - opendmp/file-transformer-rda-json/internal:/internal
- /logs/file-transformer-rda-json:/logs # - logs/file-transformer-rda-json:/logs
- /storage/file-transformer-rda-json:/storage # - storage/file-transformer-rda-json:/storage
networks: # networks:
- opendmp-backend-network # - opendmp-backend-network
- opendmp-plugins-network # - opendmp-plugins-network
############################## ZENODO ####################################### ############################## ZENODO #######################################
# opendmp.zenodo: # opendmp.zenodo:
# user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
# restart: unless-stopped # restart: unless-stopped
# cpus: 1 # cpus: 1
# mem_limit: 1024m # mem_limit: 1024m
@ -166,78 +164,76 @@ services:
############################## POSTGRES 16 ################################# ############################## POSTGRES 16 #################################
opendmp.postgres: opendmp.postgres:
user: ${DEPLOY_USER}:${DEPLOY_USER} user: ${DEPLOY_USER}:${DEPLOY_GROUP}
restart: unless-stopped restart: unless-stopped
mem_limit: 2048M mem_limit: 2048M
ports: ports:
# - "127.0.0.1:${POSTGRES_PORT}:5432" # - "127.0.0.1:${POSTGRES_PORT}:5432" # If you want to make it accessible locally only
- "${POSTGRES_PORT}:5432" - "${POSTGRES_PORT}:5432"
env_file: env_file:
- postgres/postgres.env - postgres/postgres.env
volumes: volumes:
- /postgres/opendmp_init.sql:/docker-entrypoint-initdb.d/opendmp_init.sql - ./storage/postgres/data:/var/lib/postgresql/data
- /postgres/keycloak_init.sql:/docker-entrypoint-initdb.d/keycloak_init.sql
- /storage/postgres/data:/var/lib/postgresql/data
networks: networks:
- opendmp-keycloak-shared-network - opendmp-postgres-shared-network
################################# ELK ################################################# ################################# ELK #################################################
opendmp.elasticsearch: # opendmp.elasticsearch:
user: ${DEPLOY_USER}:${DEPLOY_USER} # user: ${DEPLOY_USER}:${DEPLOY_GROUP}
group_add: # group_add:
- 0 # - 0
restart: unless-stopped # restart: unless-stopped
cpus: 2 # cpus: 2
mem_limit: 1024m # mem_limit: 1024m
env_file: # env_file:
- /elk/config-elk/elasticsearch/elastic.env # - elk/config-elk/elasticsearch/elastic.env
environment: # environment:
- "ES_JAVA_OPTS=-Xmx512m -Xms512m" # - "ES_JAVA_OPTS=-Xmx512m -Xms512m"
ulimits: # ulimits:
nproc: 65535 # nproc: 65535
memlock: # memlock:
soft: -1 # soft: -1
hard: -1 # hard: -1
volumes:
- /elk/config-elk/elasticsearch/certificates:/usr/share/elasticsearch/config/certificates
- /elk/config-elk/elasticsearch/config/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties:ro
- /elk/config-elk/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- /elk/data-elk/elasticsearch-data:/usr/share/elasticsearch/data
- /elk/data-elk/elasticsearch-log:/usr/share/elasticsearch/logs
expose:
- "9200"
- "9300"
networks:
- opendmp-elastic-network
- opendmp-elastic-shared-network
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certificates/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
# opendmp.logstash:
# volumes: # volumes:
# - /elk/data-elk/logstash-log:/usr/share/logstash/logs # - elk/config-elk/elasticsearch/certificates:/usr/share/elasticsearch/config/certificates
# - elk/config-elk/elasticsearch/config/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties:ro
# - elk/config-elk/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
# - elk/data-elk/elasticsearch-data:/usr/share/elasticsearch/data
# - elk/data-elk/elasticsearch-log:/usr/share/elasticsearch/logs
# expose:
# - "9200"
# - "9300"
# networks:
# - opendmp-elastic-network
# - opendmp-elastic-shared-network
# healthcheck:
# test: curl --cacert /usr/share/elasticsearch/config/certificates/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
# interval: 30s
# timeout: 10s
# retries: 5
opendmp.kibana: # # opendmp.logstash:
user: ${DEPLOY_USER}:${DEPLOY_USER} # # volumes:
restart: unless-stopped # # - /elk/data-elk/logstash-log:/usr/share/logstash/logs
cpus: 2
mem_limit: 1024m
environment:
- xpack.license.self_generated.type=basic
- xpack.security.enabled=true
volumes:
- /elk/config-elk/kibana/certificates:/usr/share/kibana/certificates
- /elk/config-elk/kibana/certificates/ca:/usr/share/kibana/certificate_authorities
- /elk/config-elk/kibana/config:/usr/share/kibana/config:ro
expose:
- "5601"
networks:
- opendmp-elastic-network
# opendmp.filebeat: # opendmp.kibana:
# user: ${DEPLOY_USER}:${DEPLOY_GROUP}
# restart: unless-stopped
# cpus: 2
# mem_limit: 1024m
# environment:
# - xpack.license.self_generated.type=basic
# - xpack.security.enabled=true
# volumes:
# - elk/config-elk/kibana/certificates:/usr/share/kibana/certificates
# - elk/config-elk/kibana/certificates/ca:/usr/share/kibana/certificate_authorities
# - elk/config-elk/kibana/config:/usr/share/kibana/config:ro
# expose:
# - "5601"
# networks:
# - opendmp-elastic-network
# # opendmp.filebeat:
############################## KEYCLOAK ############################################### ############################## KEYCLOAK ###############################################
@ -249,66 +245,72 @@ services:
security_opt: security_opt:
- seccomp:unconfined - seccomp:unconfined
env_file: env_file:
- /keycloak/keycloak.env - keycloak/keycloak.env
environment: environment:
- JAVA_OPTS_APPEND="-Djava.net.preferIPv4Stack=true" - JAVA_OPTS_APPEND="-Djava.net.preferIPv4Stack=true"
volumes: volumes:
- /logs/keycloak:/tmp/logs - logs/keycloak:/tmp/logs
- /keycloak/imports/opendmp-realm.json:/opt/keycloak/data/import/opendmp-realm.json - keycloak/imports/opendmp-realm.json:/opt/keycloak/data/import/opendmp-realm.json
- /keycloak/certs/keycloak-selfsigned.crt:/tmp/keycloak-selfsigned.crt:ro - keycloak/certs/keycloak-selfsigned.crt:/tmp/keycloak-selfsigned.crt:ro
- /keycloak/certs/keycloak-selfsigned.key:/tmp/keycloak-selfsigned.key:ro - keycloak/certs/keycloak-selfsigned.key:/tmp/keycloak-selfsigned.key:ro
expose: expose:
- "8443" - "8443"
networks: networks:
- opendmp-proxy-network - opendmp-proxy-network
- opendmp-postgres-shared-network
- opendmp-keycloak-shared-network - opendmp-keycloak-shared-network
############################## RABBITMQ ############################################### # ############################## RABBITMQ ###############################################
opendmp.rabbitmq: # opendmp.rabbitmq:
labels: # labels:
NAME: "rabbitmq" # NAME: "rabbitmq"
cpus: 1 # cpus: 1
mem_limit: 512m # mem_limit: 512m
restart: unless-stopped # restart: unless-stopped
expose: # expose:
- "15672" # - "15672"
- "5672" # - "5672"
env_file: # env_file:
- /rabbitmq/rabbitmq.env # - rabbitmq/rabbitmq.env
# volumes: # # volumes:
# - /rabbitmq/rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro # # - /rabbitmq/rabbitmq.config:/etc/rabbitmq/rabbitmq.config:ro
networks: # networks:
- opendmp-proxy-network # - opendmp-proxy-network
- opendmp-rabbitmq-shared-network # - opendmp-rabbitmq-shared-network
############################## GOTENBERG ############################################## # ############################## GOTENBERG ##############################################
opendmo.gotenberg: # opendmp.gotenberg:
mem_limit: 2048m # mem_limit: 2048m
restart: unless-stopped # restart: unless-stopped
expose: # expose:
- "3000" # - "3000"
hostname: gotenberg # hostname: gotenberg
env_file: # env_file:
- /gotenberg/gotenberg.env # - gotenberg/gotenberg.env
networks: # networks:
- opendmp-gotenberg-shared-network # - opendmp-gotenberg-shared-network
networks: networks:
opendmp-elastic-network:
name: opendmp-elastic-network
opendmp-proxy-network: opendmp-proxy-network:
name: opendmp-proxy-network
opendmp-backend-network: opendmp-backend-network:
name: opendmp-backend-network
opendmp-plugins-network: opendmp-plugins-network:
name: opendmp-plugins-network
opendmp-keycloak-shared-network: opendmp-keycloak-shared-network:
external: external: true
name: opendmp-keycloak-shared-network name: opendmp-keycloak-shared-network
opendmp-gotenberg-shared-network: opendmp-gotenberg-shared-network:
external: external: true
name: opendmp-gotenberg-shared-network name: opendmp-gotenberg-shared-network
opendmp-rabbitmq-shared-network: opendmp-rabbitmq-shared-network:
external: external: true
name: opendmp-rabbitmq-shared-network name: opendmp-rabbitmq-shared-network
opendmp-elastic-shared-network: opendmp-elastic-shared-network:
external: external: true
name: opendmp-elastic-shared-network name: opendmp-elastic-shared-network
opendmp-postgres-shared-network: opendmp-postgres-shared-network:
external: external: true
name: opendmp-postgres-shared-network name: opendmp-postgres-shared-network

View File

@ -1,52 +1,50 @@
version: "2.4"
services: services:
############################## PROXY ######################################## ############################## PROXY ########################################
opendmp.proxy: # opendmp.proxy:
container_name: opendmp.proxy # container_name: opendmp.proxy
image: nginx:${PROXY_TAG} # image: nginx:${PROXY_TAG}
############################## OPENDMP APP ################################# # ############################## OPENDMP APP #################################
opendmp.frontend: # opendmp.frontend:
container_name: opendmp.frontend # container_name: opendmp.frontend
image: ${DOCKER_REGISTRY}open-dmp-webapp:${MAIN_APP_TAG} # image: ${DOCKER_REGISTRY}open-dmp-webapp:${MAIN_APP_TAG}
depends_on: # depends_on:
- opendmp.backend # - opendmp.backend
- opendmp.notification # - opendmp.notification
- opendmp.annotation # - opendmp.annotation
opendmp.backend: # opendmp.backend:
container_name: opendmp.backend # container_name: opendmp.backend
image: ${DOCKER_REGISTRY}open-dmp-api:${MAIN_APP_TAG} # image: ${DOCKER_REGISTRY}open-dmp-api:${MAIN_APP_TAG}
depends_on: # depends_on:
- opendmp.postgres # - opendmp.postgres
opendmp.notification: # opendmp.notification:
container_name: opendmp.notification # container_name: opendmp.notification
image: ${DOCKER_REGISTRY}open-dmp-notification-api:${NOTIFICATION_APP_TAG} # image: ${DOCKER_REGISTRY}open-dmp-notification-api:${NOTIFICATION_APP_TAG}
depends_on: # depends_on:
- opendmp.postgres # - opendmp.postgres
opendmp.annotation: # opendmp.annotation:
container_name: opendmp.annotation # container_name: opendmp.annotation
image: ${DOCKER_REGISTRY}open-dmp-annotation-api:${ANNOTATION_APP_TAG} # image: ${DOCKER_REGISTRY}open-dmp-annotation-api:${ANNOTATION_APP_TAG}
depends_on: # depends_on:
- opendmp.postgres # - opendmp.postgres
############################## FILE-TRANSFORMERS ####################################### # ############################## FILE-TRANSFORMERS #######################################
opendmp.file.transformer.docx: # opendmp.file.transformer.docx:
container_name: opendmp.file.transformer.docx # container_name: opendmp.file.transformer.docx
image: ${DOCKER_REGISTRY}file-transformation-docx-api:${DOCX_APP_TAG} # image: ${DOCKER_REGISTRY}file-transformation-docx-api:${DOCX_APP_TAG}
depends_on: # depends_on:
- opendmp.backend # - opendmp.backend
opendmp.file.transformer.rdajson: # opendmp.file.transformer.rdajson:
container_name: opendmp.file.transformer.rdajson # container_name: opendmp.file.transformer.rdajson
image: ${DOCKER_REGISTRY}file-transformation-rda-json-api:${JSON_APP_TAG} # image: ${DOCKER_REGISTRY}file-transformation-rda-json-api:${JSON_APP_TAG}
depends_on: # depends_on:
- opendmp.backend # - opendmp.backend
################################ ZENODO ############################################### ################################ ZENODO ###############################################
# opendmp.zenodo: # opendmp.zenodo:
@ -59,57 +57,61 @@ services:
opendmp.postgres: opendmp.postgres:
container_name: opendmp.postgres container_name: opendmp.postgres
image: postgres:${POSTGRES_TAG} image: postgres:${POSTGRES_TAG}
build:
context: ./postgres/
args:
POSTGRES_TAG: $POSTGRES_TAG
################################# ELK ################################################# ################################# ELK #################################################
opendmp.elasticsearch: # opendmp.elasticsearch:
container_name: opendmp.elasticsearch # container_name: opendmp.elasticsearch
image: elasticsearch # image: elasticsearch
build:
context: /elk/elasticsearch/
args:
ELK_VERSION: $ELK_VERSION
# opendmp.logstash:
# container_name: opendmp.logstash
# image: logstash
# build: # build:
# context: /elk/logstash/ # context: /elk/elasticsearch/
# args:
# ELK_VERSION: $ELK_VERSION
# # opendmp.logstash:
# # container_name: opendmp.logstash
# # image: logstash
# # build:
# # context: /elk/logstash/
# # args:
# # ELK_VERSION: $ELK_VERSION
# # depends_on:
# # - opendmp.elasticsearch
# opendmp.kibana:
# container_name: opendmp.kibana
# image: kibana
# build:
# context: /elk/kibana/
# args: # args:
# ELK_VERSION: $ELK_VERSION # ELK_VERSION: $ELK_VERSION
# depends_on: # depends_on:
# - opendmp.elasticsearch # - opendmp.elasticsearch
opendmp.kibana: # # opendmp.filebeat:
container_name: opendmp.kibana # # container_name: opendmp.filebeat
image: kibana # # image: filebeat
build: # # build:
context: /elk/kibana/ # # context: /elk/filebeat/
args: # # args:
ELK_VERSION: $ELK_VERSION # # ELK_VERSION: $ELK_VERSION
depends_on: # # depends_on:
- opendmp.elasticsearch # # - opendmp.logstash
# opendmp.filebeat:
# container_name: opendmp.filebeat
# image: filebeat
# build:
# context: /elk/filebeat/
# args:
# ELK_VERSION: $ELK_VERSION
# depends_on:
# - opendmp.logstash
############################## KEYCLOAK ############################################### ############################## KEYCLOAK ###############################################
opendmp.keycloak: opendmp.keycloak:
container_name: opendmp.keycloak container_name: opendmp.keycloak
image: quay.io/keycloak/keycloak:${KEYCLOAK_TAG} image: quay.io/keycloak/keycloak:${KEYCLOAK_TAG}
############################## RABBITMQ ############################################### # ############################## RABBITMQ ###############################################
opendmp.rabbitmq: # opendmp.rabbitmq:
container_name: opendmp.rabbitmq # container_name: opendmp.rabbitmq
image: rabbitmq:${RABBITMQ_TAG} # image: rabbitmq:${RABBITMQ_TAG}
############################## GOTENBERG ############################################## # ############################## GOTENBERG ##############################################
opendmp.gotenberg: # opendmp.gotenberg:
image: gotenberg/gotenberg:${GOTENBERG_TAG} # image: gotenberg/gotenberg:${GOTENBERG_TAG}
container_name: opendmp.gotenberg # container_name: opendmp.gotenberg

View File

@ -0,0 +1,10 @@
ARG POSTGRES_TAG
ARG DEPLOY_USER
ARG DEPLOY_GROUP
FROM postgres:${POSTGRES_TAG}
COPY ./opendmp_init.sql /docker-entrypoint-initdb.d/
COPY ./keycloak_init.sql /docker-entrypoint-initdb.d/
COPY ./user_init.sql /docker-entrypoint-initdb.d/
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 5432
CMD ["postgres"]

Binary file not shown.

View File

@ -1,4 +1,4 @@
#################### POSTGRES ######################## #################### POSTGRES ########################
#POSTGRES_DB=keycloak POSTGRES_USER=postgres
POSTGRES_USER=admin
POSTGRES_PASSWORD=changeme POSTGRES_PASSWORD=changeme
PGDATA=/var/lib/postgresql/data/

View File

@ -0,0 +1,4 @@
CREATE USER keycloak_psql WITH PASSWORD 'keycloak-admin';
ALTER DATABASE keycloak OWNER TO keycloak_psql;
CREATE USER opendmp_psql WITH PASSWORD 'opendmp-admin';
ALTER DATABASE "opendmp-test" OWNER TO opendmp_psql;

View File

@ -976,29 +976,63 @@ public class DescriptionServiceImpl implements DescriptionService {
private @NotNull PropertyDefinitionPersist buildPropertyDefinitionPersist(PropertyDefinitionEntity data, eu.eudat.commons.types.descriptiontemplate.DefinitionEntity definition){ private @NotNull PropertyDefinitionPersist buildPropertyDefinitionPersist(PropertyDefinitionEntity data, eu.eudat.commons.types.descriptiontemplate.DefinitionEntity definition){
PropertyDefinitionPersist persist = new PropertyDefinitionPersist(); PropertyDefinitionPersist persist = new PropertyDefinitionPersist();
if (data == null) return persist; if (data == null) return persist;
List<UUID> referenceIds = this.calculateAllReferenceIdsFromData(data, definition);
List<ReferenceEntity> references = null;
if (!this.conventionService.isListNullOrEmpty(referenceIds)){
references = this.queryFactory.query(ReferenceQuery.class).ids(referenceIds).collect();
}
if (data.getFieldSets() != null && !data.getFieldSets().isEmpty()){ if (data.getFieldSets() != null && !data.getFieldSets().isEmpty()){
persist.setFieldSets(new HashMap<>()); persist.setFieldSets(new HashMap<>());
for (String key: data.getFieldSets().keySet()) { for (String key: data.getFieldSets().keySet()) {
FieldSetEntity fieldSetEntity = definition != null ? definition.getFieldSetById(key).stream().findFirst().orElse(null) : null; FieldSetEntity fieldSetEntity = definition != null ? definition.getFieldSetById(key).stream().findFirst().orElse(null) : null;
persist.getFieldSets().put(key, this.buildPropertyDefinitionFieldSetPersist(data.getFieldSets().get(key), fieldSetEntity)); persist.getFieldSets().put(key, this.buildPropertyDefinitionFieldSetPersist(data.getFieldSets().get(key), fieldSetEntity, references));
} }
} }
return persist; return persist;
} }
private @NotNull PropertyDefinitionFieldSetPersist buildPropertyDefinitionFieldSetPersist(PropertyDefinitionFieldSetEntity data, FieldSetEntity fieldSetEntity){ private List<UUID> calculateAllReferenceIdsFromData(PropertyDefinitionEntity data, eu.eudat.commons.types.descriptiontemplate.DefinitionEntity definition){
List<String> referenceIds = new ArrayList<>();
if (data.getFieldSets() != null && !data.getFieldSets().isEmpty()){
for (PropertyDefinitionFieldSetEntity fieldSet: data.getFieldSets().values()) {
if (!this.conventionService.isListNullOrEmpty(fieldSet.getItems()));
for (PropertyDefinitionFieldSetItemEntity item: fieldSet.getItems()) {
if (item.getFields() != null && !item.getFields().isEmpty());
for (String key: item.getFields().keySet()) {
if (definition.getFieldById(key).getFirst() != null && FieldType.isReferenceType(definition.getFieldById(key).getFirst().getData().getFieldType())){
if (!this.conventionService.isListNullOrEmpty(item.getFields().get(key).getTextListValue())){
referenceIds.addAll(item.getFields().get(key).getTextListValue());
}
}
}
}
}
}
if (!this.conventionService.isListNullOrEmpty(referenceIds)) {
referenceIds = referenceIds.stream().distinct().collect(Collectors.toList());
return referenceIds.stream().filter(x -> this.conventionService.isValidGuid(UUID.fromString(x))).collect(Collectors.toList()).stream().map(x -> UUID.fromString(x)).collect(Collectors.toList());
}
return null;
}
private @NotNull PropertyDefinitionFieldSetPersist buildPropertyDefinitionFieldSetPersist(PropertyDefinitionFieldSetEntity data, FieldSetEntity fieldSetEntity, List<ReferenceEntity> references){
PropertyDefinitionFieldSetPersist persist = new PropertyDefinitionFieldSetPersist(); PropertyDefinitionFieldSetPersist persist = new PropertyDefinitionFieldSetPersist();
if (data == null) return persist; if (data == null) return persist;
if (!this.conventionService.isListNullOrEmpty(data.getItems())){ if (!this.conventionService.isListNullOrEmpty(data.getItems())){
persist.setItems(new ArrayList<>()); persist.setItems(new ArrayList<>());
for (PropertyDefinitionFieldSetItemEntity itemsPersist: data.getItems()) { for (PropertyDefinitionFieldSetItemEntity itemsPersist: data.getItems()) {
persist.getItems().add(this.buildPropertyDefinitionFieldSetItemPersist(itemsPersist, fieldSetEntity)); persist.getItems().add(this.buildPropertyDefinitionFieldSetItemPersist(itemsPersist, fieldSetEntity, references));
} }
} }
return persist; return persist;
} }
private @NotNull PropertyDefinitionFieldSetItemPersist buildPropertyDefinitionFieldSetItemPersist(PropertyDefinitionFieldSetItemEntity data, FieldSetEntity fieldSetEntity){ private @NotNull PropertyDefinitionFieldSetItemPersist buildPropertyDefinitionFieldSetItemPersist(PropertyDefinitionFieldSetItemEntity data, FieldSetEntity fieldSetEntity, List<ReferenceEntity> references){
PropertyDefinitionFieldSetItemPersist persist = new PropertyDefinitionFieldSetItemPersist(); PropertyDefinitionFieldSetItemPersist persist = new PropertyDefinitionFieldSetItemPersist();
if (data == null) return persist; if (data == null) return persist;
if (data.getFields() != null && !data.getFields().isEmpty()){ if (data.getFields() != null && !data.getFields().isEmpty()){
@ -1006,14 +1040,14 @@ public class DescriptionServiceImpl implements DescriptionService {
persist.setComment(data.getComment()); persist.setComment(data.getComment());
persist.setFields(new HashMap<>()); persist.setFields(new HashMap<>());
for (String key: data.getFields().keySet()) { for (String key: data.getFields().keySet()) {
eu.eudat.commons.types.descriptiontemplate.FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getAllField().stream().findFirst().orElse(null) : null; eu.eudat.commons.types.descriptiontemplate.FieldEntity fieldEntity = fieldSetEntity != null ? fieldSetEntity.getFieldById(key).stream().findFirst().orElse(null) : null;
persist.getFields().put(key, this.buildFieldPersist(data.getFields().get(key), fieldEntity)); persist.getFields().put(key, this.buildFieldPersist(data.getFields().get(key), fieldEntity, references));
} }
} }
return persist; return persist;
} }
private @NotNull FieldPersist buildFieldPersist(FieldEntity data, eu.eudat.commons.types.descriptiontemplate.FieldEntity fieldEntity) { private @NotNull FieldPersist buildFieldPersist(FieldEntity data, eu.eudat.commons.types.descriptiontemplate.FieldEntity fieldEntity, List<ReferenceEntity> references) {
FieldType fieldType = fieldEntity != null && fieldEntity.getData() != null ? fieldEntity.getData().getFieldType() : FieldType.FREE_TEXT; FieldType fieldType = fieldEntity != null && fieldEntity.getData() != null ? fieldEntity.getData().getFieldType() : FieldType.FREE_TEXT;
FieldPersist persist = new FieldPersist(); FieldPersist persist = new FieldPersist();
@ -1023,7 +1057,17 @@ public class DescriptionServiceImpl implements DescriptionService {
else if (FieldType.isTextListType(fieldType)) persist.setTextListValue(data.getTextListValue()); else if (FieldType.isTextListType(fieldType)) persist.setTextListValue(data.getTextListValue());
else if (FieldType.isDateType(fieldType)) persist.setDateValue(persist.getDateValue()); else if (FieldType.isDateType(fieldType)) persist.setDateValue(persist.getDateValue());
else if (FieldType.isExternalIdentifierType(fieldType) && data.getExternalIdentifier() != null) persist.setExternalIdentifier(this.buildExternalIdentifierPersist(data.getExternalIdentifier())); else if (FieldType.isExternalIdentifierType(fieldType) && data.getExternalIdentifier() != null) persist.setExternalIdentifier(this.buildExternalIdentifierPersist(data.getExternalIdentifier()));
else if (FieldType.isReferenceType(fieldType) && fieldEntity != null ) persist.setTextListValue(data.getTextListValue()); else if (FieldType.isReferenceType(fieldType) && fieldEntity != null ) {
if (!this.conventionService.isListNullOrEmpty(data.getTextListValue()) && !this.conventionService.isListNullOrEmpty(references)){
List<UUID> referenceIdsInField = data.getTextListValue().stream().filter(x -> this.conventionService.isValidGuid(UUID.fromString(x))).collect(Collectors.toList()).stream().map(x -> UUID.fromString(x)).collect(Collectors.toList());
if (!this.conventionService.isListNullOrEmpty(referenceIdsInField)){
List<ReferenceEntity> referencesInField = references.stream().filter(x -> referenceIdsInField.contains(x.getId())).collect(Collectors.toList());
if (!this.conventionService.isListNullOrEmpty(referencesInField)){
persist.setReferences(this.buildReferencePersist(referencesInField));
}
}
}
}
return persist; return persist;
} }
@ -1036,4 +1080,25 @@ public class DescriptionServiceImpl implements DescriptionService {
persist.setType(data.getType()); persist.setType(data.getType());
return persist; return persist;
} }
private @NotNull List<ReferencePersist> buildReferencePersist(List<ReferenceEntity> referenceEntities){
List<ReferencePersist> referencesPersist = new ArrayList<>();
if (this.conventionService.isListNullOrEmpty(referenceEntities)) return referencesPersist;
for (ReferenceEntity entity: referenceEntities) {
ReferencePersist persist = new ReferencePersist();
persist.setId(entity.getId());
persist.setLabel(entity.getLabel());
persist.setDescription(entity.getDescription());
persist.setReference(entity.getReference());
persist.setSource(entity.getSource());
persist.setSourceType(entity.getSourceType());
persist.setTypeId(entity.getTypeId());
persist.setAbbreviation(entity.getAbbreviation());
referencesPersist.add(persist);
}
return referencesPersist;
}
} }

View File

@ -78,48 +78,64 @@
</div> </div>
</div> </div>
<div class="row editor-content"> <div class="row editor-content">
<div class="col-auto description-stepper"> <div class="col-12 col-md-3 pr-md-0">
<div class="stepper-back d-flex flex-direction-row"> <div class="stepper-back row">
<div class="d-flex align-items-center pr-2 back-to-dmp" (click)="backToDmp()"> <div class="col-auto d-flex align-items-center back-to-dmp" (click)="backToDmp()">
<mat-icon class="back-icon pointer">chevron_left</mat-icon> <mat-icon class="back-icon pointer">chevron_left</mat-icon>
<span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span> <span class="pointer">{{'DESCRIPTION-EDITOR.ACTIONS.BACK-TO' | translate}}</span>
</div> </div>
<div class="col-auto dmp-label ml-3">{{'DESCRIPTION-EDITOR.DMP' | translate}}</div> <div class="col-auto dmp-label ml-1">{{'DESCRIPTION-EDITOR.DMP' | translate}}</div>
</div>
<div class="row stepper-title"> <div class="col-auto"><span>{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</span></div></div>
<div class="row stepper-options" id="stepper-options">
<div class="col-12 stepper-list">
<div class="row" *ngIf="!descriptionInfoValid()">
<div (click)="table0fContents.onToCentrySelected()" class="col-12 main-info" [ngClass]="{'active': this.step === 0, 'text-danger': countErrorsOfBaseInfoPage > 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} <span *ngIf="countErrorsOfBaseInfoPage > 0">({{ countErrorsOfBaseInfoPage }})</span></div>
</div>
<div class="row" *ngIf="descriptionInfoValid()">
<div (click)="table0fContents.onToCentrySelected()" class="col-12 main-info" [ngClass]="{'active': this.step === 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} (<mat-icon class="done-icon">done</mat-icon>)</div>
</div> </div>
<div class="stepper-title">{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</div>
<div class="stepper-options" id="stepper-options">
<div class="col stepper-list">
<div (click)="table0fContents.onToCentrySelected()" *ngIf="!descriptionInfoValid()" class="main-info" [ngClass]="{'active': this.step === 0, 'text-danger': countErrorsOfBaseInfoPage > 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} <span *ngIf="countErrorsOfBaseInfoPage > 0">({{ countErrorsOfBaseInfoPage }})</span></div>
<div (click)="table0fContents.onToCentrySelected()" *ngIf="descriptionInfoValid()" class="main-info" [ngClass]="{'active': this.step === 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} (<mat-icon class="done-icon">done</mat-icon>)</div>
<div class="row toc-pane-container" #boundary> <div class="row toc-pane-container" #boundary>
<div #spacer></div> <div #spacer></div>
<div class="col-12">
<app-table-of-contents [visibilityRulesService]="visibilityRulesService" [selectedFieldsetId]="fieldsetIdWithFocus" #table0fContents [showErrors]="showtocentriesErrors" [TOCENTRY_ID_PREFIX]="TOCENTRY_ID_PREFIX" [hasFocus]="step > 0" [formGroup]="formGroup.get('properties')" [descriptionTemplate]="item.descriptionTemplate" *ngIf="formGroup" [links]="links" [boundary]="boundary" [spacer]="spacer" [isActive]="step !== 0" stickyThing (stepFound)="onStepFound($event)" (currentLinks)="getLinks($event)" (entrySelected)="changeStep($event.entry, $event.execute)" [pageToFieldSetMap]="pageToFieldSetMap"></app-table-of-contents> <app-table-of-contents [visibilityRulesService]="visibilityRulesService" [selectedFieldsetId]="fieldsetIdWithFocus" #table0fContents [showErrors]="showtocentriesErrors" [TOCENTRY_ID_PREFIX]="TOCENTRY_ID_PREFIX" [hasFocus]="step > 0" [formGroup]="formGroup.get('properties')" [descriptionTemplate]="item.descriptionTemplate" *ngIf="formGroup" [links]="links" [boundary]="boundary" [spacer]="spacer" [isActive]="step !== 0" stickyThing (stepFound)="onStepFound($event)" (currentLinks)="getLinks($event)" (entrySelected)="changeStep($event.entry, $event.execute)" [pageToFieldSetMap]="pageToFieldSetMap"></app-table-of-contents>
</div> </div>
</div> </div>
</div> </div>
<div class="stepper-actions"> </div>
<div mat-raised-button type="button" class="col-auto previous stepper-btn mr-2" [ngClass]="{'previous-disabled': this.step === 0}" (click)="previousStep()"> <div class="row mt-2 stepper-actions justify-content-around">
<div class="col-auto mb-1">
<div mat-raised-button type="button" class="previous stepper-btn mr-2" [ngClass]="{'previous-disabled': this.step === 0}" (click)="previousStep()">
<span class="material-icons">chevron_left</span> <span class="material-icons">chevron_left</span>
<div>{{'DESCRIPTION-EDITOR.TOC.PREVIOUS' | translate}}</div> <div>{{'DESCRIPTION-EDITOR.TOC.PREVIOUS' | translate}}</div>
</div> </div>
</div>
<div *ngIf="this.step < this.maxStep" mat-raised-button type="button" class="col-auto stepper-btn description-next ml-auto" (click)="nextStep()"> <div *ngIf="this.step < this.maxStep" class="col-auto mb-1">
<div mat-raised-button type="button" class="stepper-btn description-next ml-auto" (click)="nextStep()">
<div>{{'DESCRIPTION-EDITOR.TOC.NEXT' | translate}}</div> <div>{{'DESCRIPTION-EDITOR.TOC.NEXT' | translate}}</div>
<span class="material-icons">chevron_right</span> <span class="material-icons">chevron_right</span>
</div> </div>
<div *ngIf="!formGroup.get('descriptionTemplateId').value" mat-raised-button type="button" class="col-auto stepper-btn description-next next-disabled ml-auto"> </div>
<div *ngIf="!formGroup.get('descriptionTemplateId').value" class="col-auto mb-1">
<div mat-raised-button type="button" class="stepper-btn description-next next-disabled ml-auto">
<div>{{'DESCRIPTION-EDITOR.TOC.NEXT' | translate}}</div> <div>{{'DESCRIPTION-EDITOR.TOC.NEXT' | translate}}</div>
<span class="material-icons">chevron_right</span> <span class="material-icons">chevron_right</span>
</div> </div>
<button [disabled]="saving" (click)="saveAndClose()" *ngIf="(step === maxStep) && !isLocked && formGroup.get('descriptionTemplateId').value && !viewOnly" mat-raised-button type="button" class="col-auto stepper-btn add-description-btn ml-auto"> </div>
<div *ngIf="(step === maxStep) && !isLocked && formGroup.get('descriptionTemplateId').value && !viewOnly" class="col-auto mb-1">
<button [disabled]="saving" (click)="saveAndClose()" mat-raised-button type="button" class="col-auto stepper-btn add-description-btn ml-auto">
{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE-AND-CLOSE' | translate }} {{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE-AND-CLOSE' | translate }}
</button> </button>
</div> </div>
<div class="col-auto pr-0"> </div>
<div class="row">
<div class="col-12">
<app-form-progress-indication class="col-12" *ngIf="formGroup && !viewOnly" [formGroup]="formGroup" [isDescriptionEditor]="true"></app-form-progress-indication> <app-form-progress-indication class="col-12" *ngIf="formGroup && !viewOnly" [formGroup]="formGroup" [isDescriptionEditor]="true"></app-form-progress-indication>
</div> </div>
</div> </div>
<div class="col-auto form" id="description-editor-form"> </div>
<div class="col-12 col-md form" id="description-editor-form">
<app-description-base-fields-editor-component [hidden]="this.step !== 0" [formGroup]="formGroup" [description]="item" (formChanged)="formChanged()" (refresh)="fireRefreshDataEvent($event)"></app-description-base-fields-editor-component> <app-description-base-fields-editor-component [hidden]="this.step !== 0" [formGroup]="formGroup" [description]="item" (formChanged)="formChanged()" (refresh)="fireRefreshDataEvent($event)"></app-description-base-fields-editor-component>
<app-description-form <app-description-form
*ngIf="formGroup && formGroup.get('properties')" *ngIf="formGroup && formGroup.get('properties')"

View File

@ -280,7 +280,7 @@
height: calc(100vh - 600px); height: calc(100vh - 600px);
overflow-y: auto; overflow-y: auto;
.main-info { .main-info {
padding-left: .2rem; // padding-left: .2rem;
color: #21212194; color: #21212194;
font-weight: 400; font-weight: 400;
cursor: pointer; cursor: pointer;
@ -381,7 +381,7 @@
// width: calc(100% - 366px); // width: calc(100% - 366px);
position: relative; position: relative;
left: 362px; // left: 362px;
width: calc(100% - 366px); width: calc(100% - 366px);
overflow-y: auto; overflow-y: auto;
height: calc(100vh - 218px); height: calc(100vh - 218px);

View File

@ -74,7 +74,7 @@ span {
// width: 100%; // width: 100%;
// } // }
.internal-table{ // .internal-table{
max-width: 320px; // max-width: 320px;
min-width: 320px; // min-width: 320px;
} // }

View File

@ -114,7 +114,6 @@
</ol> </ol>
</div> </div>
</div> </div>
<!-- TODO -->
<div class="row justify-content-around" *ngIf="this.step !== 0"> <div class="row justify-content-around" *ngIf="this.step !== 0">
<div class="col-auto mb-1"> <div class="col-auto mb-1">
<div mat-raised-button type="button" class="previous stepper-btn mr-2" [ngClass]="{'previous-disabled': this.step === 1}" (click)="previousStep()"> <div mat-raised-button type="button" class="previous stepper-btn mr-2" [ngClass]="{'previous-disabled': this.step === 1}" (click)="previousStep()">
@ -129,7 +128,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- TODO -->
<div class="row" *ngIf="this.step !== 0"> <div class="row" *ngIf="this.step !== 0">
<div class="col-12"> <div class="col-12">
<app-dmp-form-progress-indication class="col-12" *ngIf="formGroup && !formGroup.disabled && !lockStatus" [formGroup]="formGroup"></app-dmp-form-progress-indication> <app-dmp-form-progress-indication class="col-12" *ngIf="formGroup && !formGroup.disabled && !lockStatus" [formGroup]="formGroup"></app-dmp-form-progress-indication>