Username:Password config in readme.md not clear
It took me a while to understand that "hello" and "world" are the http basic auth username and passwords.
{
"users": {
"hello": "world"
},
...
I also got confused as to what "users" was supposed to mean. At first I thought it wanted my linux username and password, so maybe it could open the terminal as that linux user. It is not apparent it is asking it for HTTP Basic Auth.
Basically, the "users" attribute in the config.json defines different logins to tty.js itself (some form of basic auth). If you set up the files as in the example you used, if you'll go to your localhost:8080, tty.js will ask for a username and a password. It won't allow you to use a terminal otherwise.
It's also recommended that you sha1 your username and password. So instead of doing:
"users": {
"hello": "world"
}
it is recommended to do:
"users": {
"hashedUsernameHello": "hasedPasswordWorld"
}
On ubuntu, you can use the following function to hash1 your user and pass:
function sha1()
{
echo -n $1 | sha1sum | awk '{print $1}'
}
add it to your .bashrc file or just replace the first $1 with your username or password to sha1 them.
It doesn't pass the username to the terminal itself to my understanding.
https://github.com/chjj/tty.js/pull/157 pull request