wurmlab / sequenceserver

Intuitive graphical web interface for running BLAST bioinformatics tool (i.e. have your own custom NCBI BLAST site!)
https://sequenceserver.com
GNU Affero General Public License v3.0
270 stars 112 forks source link

Improve IP/hostname detection on EC2 #488

Open yeban opened 4 years ago

yeban commented 4 years ago

SequenceServer shows private IP and URL of an EC2 instance on startup. I wonder if it is possible for it to be more accurate here.

yeban commented 3 years ago

AWS free tier can be used to debug this

tuxinaut commented 3 years ago

I wonder if it is possible for it to be more accurate here.

Would you mind to elaborate a bit further on this?

yeban commented 3 years ago

SequenceServer tries to detect the IP of the computer it is running on and constructs a URL from it for sharing, like "to share the setup with your colleagues, try using http://abc.def.ghi.jkl:4567". For this to be helpful, the IP SequenceServer detects should be the public IP.

AWS EC2 instances have both a public and private IP. Public IP is the one we use to ssh to the instance, etc. When running SequenceServer on an EC2 instance, we would like SequenceServer to detect the public IP and use that for showing the sharing URL, but it only detects the private IP.

Does that help?

tuxinaut commented 3 years ago

Does that help?

Thanks, it makes no more sense.

yeban commented 3 years ago

Well, the issue refers to a message displayed by SequenceServer on startup:

** SequenceServer is ready.
   Go to http://localhost:4570 in your browser and start BLASTing!
   To share your setup, try one of the following addresses. These
   may only work within your home, office, or university network.
     -  http://192.168.1.104:4570

We want the URL in the line http://192.168.1.104:4570 to use the public IP of the computer. IP detection code is here: https://github.com/wurmlab/sequenceserver/blob/master/lib/sequenceserver.rb#L253. I suppose if it is not possible to differentiate between public and private IP, we can display both.

tuxinaut commented 3 years ago

I'll give it a try :)