Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions to run in docker #32

Merged
merged 10 commits into from
Dec 7, 2021

Conversation

frostming
Copy link
Collaborator

@frostming frostming commented Dec 6, 2021

I don't know which container registry you prefer, I choose GitHub packages in the PR.

readme.md Show resolved Hide resolved
readme.md Show resolved Hide resolved
@frostming
Copy link
Collaborator Author

So for saving users' trouble, I suggest that we commit the ssh keys in git, so users can just start a docker, then ssh into it (always).

If I understand correctly the .ssh/id_rsa must be exposed to the client for connecting, right? So user must prepare three parts: 1) a docker container, 2) a config file 3) the private key?

@laixintao
Copy link
Collaborator

If I understand correctly the .ssh/id_rsa must be exposed to the client for connecting, right?

Yes

So user must prepare three parts: 1) a docker container, 2) a config file 3) the private key?

Yes, but by default, users can use the default config (and we should keep it runnable always) and dev_datadir/.ssh/id_rsa to ssh in. so (2) and (3) can be provider by us by default. (maybe including -v dev_datadir:dev_datadir in docker start command?

@frostming
Copy link
Collaborator Author

frostming commented Dec 7, 2021

(maybe including -v dev_datadir:dev_datadir in docker start command?

Yes, but since dev_datadir can't be auto-generated before starting the server, this directory must be prepared by the users.

It would be better if there are no manual steps except for a config file.

Maybe we can let users prepare the private key and paste the public key to the authorized_key themselves. No room for automation here because this information must be provided by the users. No need to mount dev_datadir, the contents of this directory should be all lobbyboy-generated. Or alternatively, use a default password for connection instead of key pairs.

@laixintao
Copy link
Collaborator

Or alternatively, use a default password for connection instead of key pairs.

I prefer this, commit default username/password and key pairs to repo, in dev_datadir. https://github.com/lobbyboy-ssh/lobbyboy/tree/main/dev_datadir . Since the main goal of the readme is only a quick taste, not a secure, complete setup.

So one can start it with a single docker command without configuring anything.

But we must warn user to change default credentials before deploying them to production.

@frostming
Copy link
Collaborator Author

Just added a default password to the config template and remove the built-in authorized key.

But the warning message cannot be printed on the client-side, I didn't find a better way for doing this.

@laixintao
Copy link
Collaborator

But the warning message cannot be printed on the client-side, I didn't find a better way for doing this.

Yes, but I don't think this will be a problem.

Since the warning should be printed to stderr when lobbyboy starts (there is no "client" to print, when the server just started, right?)

@@ -39,8 +39,11 @@ def check_channel_request(self, kind, channel_id):
return paramiko.common.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED

def check_auth_password(self, username, password):
# TODO load config file every time.
if (username == "foo") and (password == "bar"):
logger.warning(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh there is the "warning" you are talking about.

Yes, here the ssh connection is not established yet, so we can not send anything to users.

If you want, you have to use some kind of global vars (or some private variable of Server instance) to indicate the client was actually auth-ed by password.

@laixintao
Copy link
Collaborator

looks good to me now! no private keys builtin, very well

🍨

@laixintao laixintao merged commit 334b0d2 into lobbyboy-ssh:main Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants