diff --git a/bus-gateway/.env.example b/bus-gateway/.env.example index 1bd63b7..8a36577 100644 --- a/bus-gateway/.env.example +++ b/bus-gateway/.env.example @@ -1,4 +1,4 @@ -BASE_URL=localhost +NODO_BASE_URL=localhost # Bus FHIR (base, usado como fallback si no se definen MPI_URL o DOCUMENT_REGISTRY_URL) BUS_URL=http://bus-host:8080 diff --git a/bus-gateway/config/index.js b/bus-gateway/config/index.js index eda38d6..2174148 100644 --- a/bus-gateway/config/index.js +++ b/bus-gateway/config/index.js @@ -37,7 +37,7 @@ const config = { // VHL token and document TTL in seconds (default: 7 days). ttl: parseInt(process.env.VHL_TOKEN_TTL || '604800', 10), }, - baseURL: process.env.BASE_URL || 'http://localhost', + baseURL: process.env.NODO_BASE_URL || 'http://localhost', debug: process.env.BUS_DEBUG === 'true', }; diff --git a/bus-gateway/services/vhlIssue.js b/bus-gateway/services/vhlIssue.js index eb0723f..affa604 100644 --- a/bus-gateway/services/vhlIssue.js +++ b/bus-gateway/services/vhlIssue.js @@ -65,7 +65,7 @@ async function fetchIPSBundle(patientId) { */ async function issueVHL({ patientId, pin }) { if (!config.vhl.baseUrl) { - throw createError(500, 'VHL_BASE_URL is not configured'); + throw createError(500, 'VHL_NODO_BASEURL is not configured'); } const bundle = await fetchIPSBundle(patientId); diff --git a/docker-compose.yml b/docker-compose.yml index ecf133d..d8cec09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,44 @@ services: retries: 5 command: -p 5433 + gdhcn-validator-service: + container_name: gdhcn-validator-service + image: createchile/gdhcn-validator_backend:v1.1 + ports: + - 8182:8080 + secrets: + - signature-cert + - signature-key + - dsc-key + environment: + - POSTGRES_DB=gdhcn-validator + - SERVER_PORT=8080 + - SPRING_DATASOURCE_URL=jdbc:postgresql://gdhcn-db:5432/gdhcn-validator + - SPRING_DATASOURCE_USERNAME=root + - SPRING_DATASOURCE_PASSWORD=root + - TNG_TLS_PEM=/run/secrets/signature-cert + - TNG_TLS_KEY=/run/secrets/signature-key + - TNG_DSC_PRIVATEKEY=/run/secrets/dsc-key + - TNG_COUNTRY=XJ + - TNG_DSC_PRIVATEKEY_KID=I1BAX8FATLs= + - GDHCN_BASEURL=${NODO_BASE_URL}/gdhcn + networks: + - hapi-network + volumes: + - ./json:/json + + gdhcn-db: + image: postgres:16-alpine + restart: always + volumes: + - db-data:/var/lib/postgresql/data + networks: + - hapi-network + environment: + - POSTGRES_DB=gdhcn-validator + - POSTGRES_USER=root + - POSTGRES_PASSWORD=root + bus-gateway: build: context: ./bus-gateway @@ -83,9 +121,15 @@ volumes: hapi-data: name: hapi-data driver: local - secrets: ssl_cert: file: ${SSL_CERT_PATH:-./certs/server.crt} ssl_key: file: ${SSL_KEY_PATH:-./certs/server.key} + signature-cert: + file: ${SIGNATURE_CERT_PATH:-./certs/signature.crt} + signature-key: + file: ${SIGNATURE_KEY_PATH:-./certs/signature.key} + dsc-key: + file: ${SSL_DCC_KEY_PATH:-./certs/dcc.key} + \ No newline at end of file diff --git a/nginx/http.conf b/nginx/http.conf index b9d56b4..aae77e3 100644 --- a/nginx/http.conf +++ b/nginx/http.conf @@ -66,6 +66,14 @@ http { proxy_read_timeout 90s; } + location /gdhcn/ { + proxy_pass http://gdhcn-validator-service:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 90s; + } # Todo lo demás va a hapi-fhir location / { proxy_pass http://hapi_fhir; diff --git a/nginx/https.conf b/nginx/https.conf index 66eaa68..9b895e7 100644 --- a/nginx/https.conf +++ b/nginx/https.conf @@ -82,6 +82,15 @@ http { proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 90s; } + + location /gdhcn/ { + proxy_pass http://gdhcn-validator-service:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 90s; + } # Todo lo demás va a hapi-fhir location / { proxy_pass http://hapi_fhir;