Ok this commit is rather large for a seemingly "simple" problem. In
reality, the problem isn't simple.
Changes:
1. I refactored lib/service/service.go : I created a new structure called
TeleportProcess. It wraps the configuration and various callbacks together.
It made the code in that file MUCH easier to follow because functions
do not require 5+ parameters anymore.
2. Created loginToAuthService() method which is now used in two places:
1. On start-up
2. Immediately after registration.
This way both actions can be combined in the same loop, so if
_either_ one succeeds, the daemon successfuly starts.
3. Added support for multiple auth servers. Everywhere in our code we
always go for conf.AuthServers[0].Addr. So at least in this code
there's a proper loop.
4. Added a nicer logging around "failed to join the cluster", where I
suggest to try --token flag when it's missing.
5. Fixed tests broken by other commits (unrelated to this)
Fixes#210
1. `--name` setting is passed through into AuthServer as "AuthServiceName".
This will be used in UIs when there are multiple clusters, and also
in places like Google Authenticator
2. `tctl nodes ls` now lists both host name and host UUID
3. Changed `--name` setting to `--nodename` to be consistent with the
config file.
Closes#194
`web.SSHAgentLogin(proxyAddr string)` expects proxyAddr string to be a
URL, while everywhere else we address servers by host:port pair.
Because of that, `--proxy=host` sytax was broken.
Three changes:
- Sample configuration is no longer a dump of a string constant. It's
generated using the same data structure used for configuration
parsing. This guarantees that 'teleport configure' will always dump a
valid sample config file.
- Added a unit test which validates sample configuration and verifies
its correctness
- MakeSampleConfig() does not return an error anymore. It will
default to 'localhost' with error logged instead of failing. It
makes no sense to fail when generating an example. Also this makes
code cleaner.