pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
154 stars 24 forks source link

Could not use oauth in RStudio server #51

Closed behrica closed 9 years ago

behrica commented 9 years ago

Calling droplets() for the first time in a fresh RStudio server opens a browser Windows to connect to digitalocean to request autorisation.

This fails as the URL contains localhost: http://localhost:1410/?code=5259890fe5e0735b6009db423e84ee65b5a974cd2a3409f2d72a695269f2dc3b&state=OpaC2JA2vt

which does not work a remote RStudio server. Replacing by hand "localhost" with the server IP did not work in my case neither.

To set the DO_PAT environment variable I did not try, because I was not sure how to set it, as RStudio runs via docker...

I would say that a package expecting to have set environment variables is a bit problematic in docker based RStudio installations. Maybe there should be an other way to set the token.

sckott commented 9 years ago

@behrica What's the use case for setting up an Rstudio server instance, then using analogsea?

behrica commented 9 years ago

Let´s assume somebody has no access to a local R installation and cannot get it neither, due to whatever reason. He is in the worst case situation, he has only web browser and restricted internet access on ports 443 and 80.

RStudio server can be the solution of his company to give him "R in the cloud" without any installation / change on local PC. So they do so.

Now this person would like to work with an RStudio docker image from a college and want to get it installed on digiatalocean.

So he would use analogsea on his RStudio server in the cloud (as he has no other access to R). Currently he cannot use it, because he needs a working ssh on the machine on which he runs analogsea. (But to this RStudo in the cloud he has only the RStudio web access, so he cannot configure ssh or set environment variables)

Is this use case too extreme... Maybe, but it would allow somebody, who ONLY has a browser and internet access on port 80 and 443 to work with RStudio on docker in the cloud. If we get this working, then it works for everybody.

hadley commented 9 years ago

@behrica that doesn't seem like a compelling use case to me - if the company doesn't let him use ssh or install R, I doubt they will be happy with him sending data outside of the company to a cloud server.

(You can always set env vars from within R by using Sys.setenv())