maxheld83 / byod

make life easier with r projects and docker
MIT License
0 stars 0 forks source link

avoid user name and password in docker call #12

Open maxheld83 opened 5 years ago

maxheld83 commented 5 years ago

ideally, we should avoid the password (and implicit) username in this call alltogether docker run -e PASSWORD=yourpassword --rm -p 8787:8787 rocker/verse.

It doesn't make much sense to have a password for a local thing.

This would depend on RStudio server (the application running the website) whether that is even possible.

If not, hacking around it might be a good plan b.

maxheld83 commented 5 years ago

this question has probably already been addressed somewhere, because every local user of RStudio Server will face this problem.

Ch1pzZz commented 5 years ago

https://forums.docker.com/t/how-to-share-windows-drives-with-a-user-without-password/22933/6 so this was the closest I found to the actual problem. The person tried to set up a user without a passsword and failed to do so. Docker apparently commented on this by saying "will be a feature in future releases"... but since the post was in dec.2016 and I didn´t find any articles on how to do it in the most recent version I assume it might actually not be possible.

One could try to "auto-set" the username & password to something trivial like "DockerHost" (also a suggestion from the post) to work around the issue. For the use in this seminar (and cases where you only communicate with your own device) this should be a useful solution ?! @maxheld83 let me know what you think and maybe I can try to find a way to code this auto-setting for starters (since I`m a little overwhelmed by how little I actually know about this it kinda hopefully seems to be something doable)

maxheld83 commented 5 years ago

I think the root problem here is in RStudio Server, which is the software that is hosting the website where people can actually use R (the stuff you see at localhost::8787 when this script runs). Apparently, this server sometimes/always? needs a password and username, which makes a lot of sense when this is on an open network. It doesn't make sense though if it is just running locally, and I would guess that since a lot of people use rstudio that way, that there's probably a way to make rstudio server work without any username and password and just open the instance right away.

Then we could also get rid of that in the script.

It's all a bit of a russian-doll kind of a situation which layers upon layers of software :) Welcome to open source :).

The docs for RStudio server pro are here: https://docs.rstudio.com/ide/server-pro/

We're here only using RStudio Server open source (not pro), but I would think that the docs in this regard are the same. Perhaps there is another place with docs.

You might also want to check out the rocker project repos: https://github.com/rocker-org They are the ones who build the container around Rstudio server here, and i'd guess that there's already an issue around this minor inconvenience somewhere in their repos.

maxheld83 commented 5 years ago

I think this might be the repo where this is discussed, but I couldn't find any mentioning of it: https://github.com/rocker-org/rocker/issues

Probably best not to raise an issue there, but first research inside of rstudio server whether that is even possible to login without username and password.

Ch1pzZz commented 4 years ago

https://stackoverflow.com/questions/47541007/how-to-i-bypass-the-login-page-on-rstudio

will try this later.

Ch1pzZz commented 4 years ago

Müsste man noch ins Script einbauen und mal laufen lassen. Ich hoffe es entsteht durch den "pfad" in der Zeile kein problem... Wo genau denkst du @maxheld83 müsste man den snipsel denn sinnvollerweise einfügen? Meine Vermutung war das einfach in launch einzubauen als ersten command?

maxheld83 commented 4 years ago

Seems like the above s-o solution might not work as per the answers? Not sure. https://stackoverflow.com/questions/47541007/how-to-i-bypass-the-login-page-on-rstudio

maxheld83 commented 4 years ago

the above s-o solution works by changing the underlying Dockerfile (or building a new one on top). This is also possible, but might be overkill here. Using the parameters to docker run it should be possible to achieve the same results by appending or overwriting the defaults in the Dockerfile. For example, you can overwrite CMD by just passing a command as the last argument in a docker run call. For details, consult the docker run docs: https://docs.docker.com/engine/reference/run/

Ch1pzZz commented 4 years ago

https://docs.docker.com/engine/reference/commandline/login/

Leider weiß ich nicht so recht was mit STDIN gemeint ist, wird dabei ein automatisches Passwort vergeben? Wenn man den Docker docs folgt ist der login also nicht umgänglich ohne wie in der anderen Reccourse am dockerfile zu schrauben, was ich mir definitiv nicht zutraue >< Kannst du mit diesem Link etwas mehr anfangen?