Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Use ngrok to share websites #88

Closed
stevenrombauts opened this issue Dec 9, 2016 · 8 comments · Fixed by #142
Closed

Use ngrok to share websites #88

stevenrombauts opened this issue Dec 9, 2016 · 8 comments · Fixed by #142
Assignees
Labels
Milestone

Comments

@stevenrombauts
Copy link
Member

stevenrombauts commented Dec 9, 2016

Since support for vagrant share has been withdrawn and users encouraged to go down the ngrok route, there has been a problem sharing sites via -host-header=rewrite.

ngrok http joomla.box 80

Works perfectly fine for users wanting to share their site via joomla.box/testing... addresses but if you wanted to share direct access to the site testing.test this didn't work so well.

ngrok http -host-header=rewrite testing.test:80

The site would load, but then all subsequent url clicks meant urls would be written to http://testing.test meaning the site would revert back to local server and this would not be available to the guest viewing the site.

@stevenrombauts stevenrombauts added this to the v1.5.0 milestone Dec 9, 2016
@stevenrombauts stevenrombauts modified the milestones: v1.5.0, 1.6 Nov 8, 2017
@yiendos yiendos self-assigned this May 8, 2019
@yiendos yiendos added the feature label May 8, 2019
@yiendos yiendos assigned yiendos and unassigned yiendos May 8, 2019
@yiendos
Copy link
Member

yiendos commented May 9, 2019

@stevenrombauts we seem to be phasing out vagrant share in favour of ngrok elsewhere:

vagrant share --http 81
Vagrant Share now defaults to using the `ngrok` driver.
The `classic` driver has been deprecated.

For more information about the `ngrok` driver, please
refer to the documentation:

  https://www.vagrantup.com/docs/share/

I've tested ngrok with the joomlatools-vagrant box:

ngrok http joomla.box:80

From outside the box correctly routes the user to the joomla.box dashboard. Simply running:

ngrok http 80

from outside the box routes the user to their host server... which makes sense.

If we wanted users to run ngrok http 80 and land up at the dashboard it would make sense to install the ngrok drivers in the box... that way the default localhost:80 that was shared was the box and hot host machine.

Thoughts?

@stevenrombauts
Copy link
Member Author

@yiendos I'm not in favour of installing this on the box. It's supposed to be run from the host machine and then pointed at the right hostname and port. If you want to use https support or any other paid feature, you also don't want to be duplicating your configuration to both box and host.

It would also mean we have to manage documentation for something that is clearly explained on its own website, but we would then require a different way of using it. Eg. on the box you won't be able to point to custom subdomains (like joomlatools.test if you create a 'joomlatools' site) because it won't resolve. (joomla.box will resolve but only because we added it to the hosts file explicitly on the box).

I'm really just in favour of using it how its supposed to:

  • ngrok http joomla.box:80
  • ngrok http whatevercustomsite.test:80

There are other tools out there to do these things and everybody already uses his or her preferred method anyway, I think.

@stevenrombauts
Copy link
Member Author

stevenrombauts commented May 9, 2019

This ticket is still related to the old Vagrant Share option, so I suggest we close this. We don't have the issue anymore because ngrok can perfectly share the dashboard now.

@yiendos
Copy link
Member

yiendos commented May 10, 2019

@stevenrombauts check makes sense, ngrok is the way to go forward. We should update any references to vagrant share in the documentation:
https://github.com/joomlatools/joomlatools-vagrant#sharing-access-to-the-box

@stevenrombauts
Copy link
Member Author

@yiendos Apologies, I opened your README link from the email and updated it in master: https://github.com/joomlatools/joomlatools-vagrant/blob/master/README.md#sharing-access-to-the-box 🤦‍♂️

@yiendos
Copy link
Member

yiendos commented May 10, 2019

@stevenrombauts opps I'll watch out for that easter egg functionality :)

@stevenrombauts
Copy link
Member Author

@yiendos Feel free to merge your text as you want, I like the introduction :)

@yiendos
Copy link
Member

yiendos commented May 13, 2019

Update following discussions on Slack - Friday 10th May 2019

**paul [12:47 PM]**
Just looking at the readme changes on master

`ngrok http -host-header=rewrite mysite.test:80`
this doesn't work so well, initially the site loads as expected
but then all subsequent links are to local site references `mysite.test`
so consequently you break out of the ngrok session

**steven [12:48 PM]**
won’t the same happen if you go to joomla.box/mysite/ via ngrok either?

**paul [12:49 PM]**
if you go through `joomla.box` links remain `joomla.box/mysite`
if you provide `ngrok http mysite.test:80`
and then amend the vhost to have a server alias of `*ngrok` the links work again

**steven [12:49 PM]**
right because of the host header, I see
not if you add it to multiple I guess
because how can apache know which site you want to see

**paul [12:50 PM]**
no then I suppose it's what ever vhost is loaded in preference
but if it only appears in one vhost then the correct site gets loaded

**steven [12:52 PM]**
setting $live_site to the ngrok URL in confiugration.php should also solve it, that seems most easiest solution? (edited) 
crap no it doesn’t on my end
I thought live_site would always overwrite it
ok good point, this doesn’t work
back to your original idea then
if we install ngrok on the server, we could create a `box` command to share a site. Using that command we can start `ngrok` and set the *.ngrok.io wildcard as ServerAlias

yiendos added a commit that referenced this issue May 13, 2019
@yiendos yiendos changed the title Ensure vagrant share defaults to joomla.box Improve sharing of joomla.box websites May 14, 2019
yiendos added a commit that referenced this issue May 14, 2019
yiendos added a commit that referenced this issue May 20, 2019
@stevenrombauts stevenrombauts changed the title Improve sharing of joomla.box websites Use ngrok to share websites Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants