sandstorm-io/vagrant-spk

vagrant-spk shouldn't use Sandstorm's default port

ocdtrekkie opened this issue · 10 comments

@abliss specified he has one machine for Sandstorm and vagrant-spk dev. Since Sandstorm defaults to port 6080 and vagrant-spk uses port 6080, it can mean you have to shut down one to use the other. This could be easily avoided, there's really no reason for vagrant-spk to use port 6080. If you do spk dev and vagrant-spk dev on the same machine there's a good chance you'll have your sandstorm dev server interfering with your vagrant-spk and vice versa for really no good reason.

Perhaps we could adjust vagrant-spk to use port 6090 which is not listed in IANA as a registered port.

Question to answer: Is there a programmatic/silent install way to select a different port when installing Sandstorm, and is that why it does this at present?

Yup. Currently it's install.sh -d -e but we could change this by going install.sh -d -e -p 6090 in vagrant-spk (and then presumably editing everywhere else in this repo and the dev docs it specifies 6080).

There is actually a lot of discussion of port conflict in https://docs.sandstorm.io/en/latest/vagrant-spk/packaging-tutorial/ regarding stopping a local Sandstorm server first, shutting down other vagrant-spk instances, etc. and specifies very blatantly that vagrant-spk ALWAYS uses port 6080.

Which is to say, I wonder if anyone would have a very strong opinion against changing this, because there's definitely been plenty of running into it in the past. Maybe @paulproteus or @zarvox has an enlightening historical opinion.

In #19, Asheesh suggested some possible solutions. But I think we could reduce "sandstorm or another vagrant-spk instance is already using port 6080" to just "another vagrant-spk instance is already using port 6090" by giving it it's own port.

Adam's solution here: dwrensha/gitweb-sandstorm@47bc94b#diff-55b3c64db8162c25e7425d87429d0bf8R36 is lovingly straightforward as it leaves everything in the VM on 6080, and we will only use 6090 on the host, where conflicts occur.

I'll do this, but I need to make sure I update any commentary and documentation at the same time.

@paulproteus Yeah, I don't think we'll need to use that here though. We can install Sandstorm using port 6090 inside the VM and also pass port 6090 through the VM as 6090, and ensure we know anyone talking about 6080 is talking Sandstorm and 6090 is talking vagrant-spk.

And neither will be changed for existing users, who will get the existing functionality, unless they use upgradevm, which replaces both the Vagrantfile and the global-setup where Sandstorm is installed into the VM.