openstf/setup-examples

Is it possible that stf login page can be visited by external network?

Closed this issue · 4 comments

I follow setup-examples instructions and now I am able to see STF on http://stf.example.org in my own computer. Is it possible that I can also visit this STF site in other computers via exernal network? If yes, can you give me a guide? Thank you very much!

well there is one way to do this, but I will not suggest you to do this as this example was written just to give a basic idea about STF setup.

You can do this by forwarding your host 8080 port to guest's (core-01) port 80.

Add below line into your vagrantfile

if node[:name] == 'core-01'
  ...
  ...
  config.vm.network "forwarded_port", guest: 80, host: 8080
end

Restart vagrant by vagrant reload

Now, other people will be able to access STF from your IP (If your firewall allow others to access your IP). Go to someone else machine and open http://$YOUR_IP:8080

Thank you, this way is really helpful, i wil try it in my environment.
We want to deploy STF in real servers, other machines can access STF link by external network. You mentioned that you didn't suggest to do this by the setup-example, may i know the reason, is there any functions that this way can not support?
As I have little experience on docker and systemd, if we don't use setup-example, then which way do you recommend? Thanks.

setup-examples was written to give people better understanding of STF deployment. In reality, you should not be using Vagrant and Virtualbox for deployment. Vagrant is only to mimic linux OS on mac.

In reality, you should be deploying on machines having linux installed on Bare Metal. Deployment.md explains this in detail.

I added below line into my vagrantfile and restarted vagrant, still couldn't open stf site with http://$MY_IP:65517 using other machines which were via internal network (there's no firewall). The browser's address automatically changed to be http://172.17.8.101/auth/mock/ but the webpage displayed "connection timeout". Is this issue related with the setting of config.vm.network : private_network or config.vm.network: public_network? Appreciate if you can give some guidence. Thanks!

if node[:name] == 'core-01'
...
...
config.vm.network "forwarded_port", guest: 80, host: 65517
end