PharmaLedger-IMI / fgt-workspace

UC3 Finished Goods Traceability
MIT License
5 stars 3 forks source link

Request for explicit proxy support #122

Open joaoluis-pdm opened 2 years ago

joaoluis-pdm commented 2 years ago

Jean-Baptiste MARCILLE-ext requested explicit proxy support, to resolve issue with:

...
10.131.4.1:8080 - [2022-09-16T19:08:24.308Z] GET:/ 200 1.221ms
[POST] https://fgt.pharmaledger.pdmfc.com/bricking/traceability/put-brick Error: connect ETIMEDOUT 213.63.130.240:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  errno: -110,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '[213.63.130.240](http://213.63.130.240/)',
  port: 443
}
...

19 de setembro de 2022 07:08

· curl -k –noproxy ‘*’ -XGET https://fgt.pharmaledger.pdmfc.com/ fails because of a timeout

· curl -k -XGET https://fgt.pharmaledger.pdmfc.com/ indeed returns the homepage (http(s)_proxy environment variables are set in the pod and curl uses them)

19 de setembro de 2022 14:39

What I can do is forward your question to the OpenDSU team, so I am sending this email to Sinica.

What is the proper way to configure and run an apihub so that all OpenDSU operations use an explicit http(s) proxy for some domains ? (Seems that nodejs does not honor the http(s)_proxy environment variables transparently).

joaoluis-pdm commented 2 years ago
The OpenDSU team suggested the following workaround:

    create a new proxy service http://my-proxy/*  statically configured to proxy all requests to [https://fgt.pharmaledger.pdmfc.com/](https://fgt.pharmaledger.pdmfc.com/any-path)* (adjust local name, port number, etc, as needed.)
    (This could be done creating a new pod to run nginx or apache or other proxy software of your preference, in the same network as your MAH pod).
    inside the MAH runing container files, the file /fgt-workspace/apihub-root/external-volume/config/bdns.hosts should currently have

"traceability": {
    "replicas": [],
    "brickStorages": [
      "https://fgt.pharmaledger.pdmfc.com"
    ],
    "mqEndpoints": [
       "https://fgt.pharmaledger.pdmfc.com/"
    ],
    "anchoringServices": [
      "https://fgt.pharmaledger.pdmfc.com/"
    ],
    "notifications": [
      "https://fgt.pharmaledger.pdmfc.com/"
    ]
  },

Replace those entries with

"traceability": {
    "replicas": [],
    "brickStorages": [
      "http://my-proxy"
    ],
    "mqEndpoints": [
       "http://my-proxy/"
    ],
    "anchoringServices": [
      "http://my-proxy/"
    ],
    "notifications": [
      "http://my-proxy/"
    ]
  },

(I guess that this can be done on your private helm-charts configuration files).

Best regards,