sequenceserver icon indicating copy to clipboard operation
sequenceserver copied to clipboard

Improve IP/hostname detection on EC2

Open yeban opened this issue 5 years ago • 6 comments

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 avatar Oct 06 '20 12:10 yeban

AWS free tier can be used to debug this

yeban avatar Oct 15 '20 08:10 yeban

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

Would you mind to elaborate a bit further on this?

tuxinaut avatar Oct 24 '20 22:10 tuxinaut

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?

yeban avatar Oct 25 '20 09:10 yeban

Does that help?

Thanks, it makes no more sense.

tuxinaut avatar Oct 25 '20 19:10 tuxinaut

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.

yeban avatar Oct 26 '20 12:10 yeban

I'll give it a try :)

tuxinaut avatar Oct 26 '20 23:10 tuxinaut