sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.76k stars 706 forks source link

Offline access to Sharelatex #2001

Open Apidcloud opened 8 years ago

Apidcloud commented 8 years ago

Good evening,

After successfully installing sandstorm and sharelatex I thought I would still be able to use the editor when offline. That doesn't seem the case.

Why is that? I am aware that sandstorm needs to use DNS (internal IP in my case) to reach the apps, but I was hoping it worked like docker, where the 'apps' installation within the local server means you can still use them offline.

Thanks!

paulproteus commented 8 years ago

Hi Luis!

If you're using an internal IP address, you will still need wildcard DNS, which for the case of xip.io, is a third-party service. If you want that to work entirely independent of any third-party services, you can run your own little wildcard DNS service. To do that, you can set up something like this: http://stackoverflow.com/questions/22313142/wildcard-subdomains-with-dnsmasq

I hope that helps! Let us know.

Apidcloud commented 8 years ago

Thanks for answering, @paulproteus

I access sandstorm from by browser with 192.168.121.128:6080 and my wildcard_host is *.192.168.121.128.xip.io:6080

Thus, in my case, should dnsmasq configuration be: address=/anyname.dev/192.168.121.128:6080 ?

If that's the case, then would wildcard_host become: *.192.168.121.128.anyname.dev:6080?

Thanks for the help!

paulproteus commented 8 years ago

In your case, wildcard_host would become *.anyname.dev:6080 !

Apidcloud commented 8 years ago

Ah, right. And I'm missing a dot in the beginning of address right? Should be like: address=/.anyname.dev/192.168.121.128:6080 instead of address=/anyname.dev/192.168.121.128:6080

Thanks again!

paulproteus commented 8 years ago

I believe that is right! ​

Apidcloud commented 8 years ago

I have installed dnsmasq in my ubuntu 14.04 virtual machine and tried the following configuration: http://pastebin.com/Vf9wESi8

But when I try to sudo /etc/init.d/dnsmasq restart the terminal prints out Restarting DNS forwarder and DHCP server configuration syntax check [fail]

Am I missing something?

As a side note, for some reason I am able to ping something.dev. Weird?

Edit: I guess the wildcard_host is enabling the ping. But I still can't open the grains from the browser - current wildcard_host: *.dev:6080

It seems that the address syntax wasn't right due to the port, as when I tried to run sudo service dnsmasq start I got the following message: dnsmasq: bad address at line 69 of /etc/dnsmasq.conf

If the address is just /.dev/192.168.121.128 it doesn't complain. But that doesn't solve the entire problem.

Thanks

paulproteus commented 8 years ago

In this line:

address=/.dev/192.168.121.128:6080

you should instead set it as:

address=/.anyname.dev/192.168.121.128

That is, two changes:

  1. Remove the port number
  2. Specify the hostname, not just the domain name (anyname.dev vs. dev)
Apidcloud commented 8 years ago

Still no luck.

Which entries (from dnsmasq) should be uncommented? only address?

Based on your feedback I updated wildcard_host to *.anyname.dev:6080 (sandstorm conf).

paulproteus commented 8 years ago

Hey @frigginglorious,

Any chance you have written up those dnsmasq + sandstorm docs yet? I am pretty sure that our friend @Apidcloud could use them! If not, any chance you're interested in helping here, and using the experience to drive your doc writing?

Apidcloud commented 8 years ago

I dont know if this helps but the dev tools from chrome show this error: ERR_ICANN_NAME_COLLISION

Which doesn't happen (I believe!) when using xip.io

paulproteus commented 8 years ago

Oh, interesting​. Try using "local" instead of "dev"

Apidcloud commented 8 years ago

You mean at both wildcard_host and dnsmasq confs? Changing both to anyname.local produces the following error instead: net::ERR_NAME_NOT_RESOLVED

paulproteus commented 8 years ago

Oops, right, *.local has special meaning for mdns.

How about:

.dev => .sandstorm

or

.dev => .development

or

.dev => .mycloud

The ICANN thing suggests that .dev is going to be a new global top level domain and Chrome wants to prevent you from accidentally conflicting with it.

Apidcloud commented 8 years ago

Still the same net::ERR_NAME_NOT_RESOLVED

frigginglorious commented 8 years ago

@paulproteus I was at it for hours last night trying to figure this out, and I just started back at it tonight! bind9 seems promising. I had no luck with mdns stuff using avahi-daemon, and no luck with using dnsmasq either :(

I'm rocking ubuntu 16.04 in a typical home network type situation.

Woah, I didn't think about the ICANN thing. @Apidcloud it sounds like you're trying to do, in a basic sense, exactly what I'm going for. Any progress on your end?

I'm messing with my router config, having it point to SS server computer on the network as a DNS server, with poor results so far. I'm afraid I mostly don't know what I'm doing. Trial and error!

Apidcloud commented 8 years ago

@frigginglorious Not yet. I will try to get back to it tonight.