mercure-imaging / mercure

mercure DICOM Orchestrator
https://mercure-imaging.org
MIT License
67 stars 32 forks source link

receiver.sh and getdcmtags update for SenderIP filtering possibility #53

Closed alipairon closed 1 year ago

alipairon commented 1 year ago

In case anyone is looking for a method to incorporate an IP filtering possibility into the 'Rules', it's not overly complicated. It can be achieved with the following steps:

  1. Update and recompile getdcmtags by incorporating the following changes:

    • In the static section, add: static OFString helperSenderIP = "";

    • In the INSERTTAG section, add: INSERTTAG("SenderIP", helperSenderIP, "127.0.0.1");

    • After the section where other helpers are declared, add: helperSenderIP = OFString(argv[6]);

  2. Modify the storescp start string in receiver.sh as follows:

    storescp --fork --promiscuous $transfer_syntax_option -od "$incoming" -dhl +uf -xcr "$binary $incoming/#f #a #c$bookkeeper$bookkeeper_api_key #r" $port

    By adding -dhl, you instruct storescp not to resolve DNS names, and by appending "#r at the end of the getdcmtags launch string, storescp will supply the sender IP address.

  3. Don't forget to replace the existing main.cpp file of getdcmtags with the newly edited one. This step is essential for the new tag to be included in the list of available tags on the 'Rules' page.

Hope this helps somebody.

tblock79 commented 1 year ago

Thank you for sharing this information! Moving it to the Discussion Board, as it's not a bug or issue.