diff --git a/.gitignore b/.gitignore index bcb5b7e6f1f..a0e0a5919e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -web/dist/app/app +# Ev: this is temporary +assets/docker # Compiled binaries, Object files, Static and Dynamic libs (Shared Objects) out diff --git a/lib/service/cfg.go b/lib/service/cfg.go index c25864ae7ab..4ecb271f5f4 100644 --- a/lib/service/cfg.go +++ b/lib/service/cfg.go @@ -57,6 +57,10 @@ type Config struct { // via multiple reverse tunnels Proxy ProxyConfig + // Unique UUID of this host (it will be known via this UUID within + // a teleport cluster). It's automatically generated on 1st start + HostUUID string + // Console writer to speak to a user Console io.Writer } diff --git a/lib/service/service.go b/lib/service/service.go index bcd68272917..af9bd0ec727 100644 --- a/lib/service/service.go +++ b/lib/service/service.go @@ -76,6 +76,12 @@ func NewTeleport(cfg Config) (Supervisor, error) { } } + // read or generate a host UUID for this node + cfg.HostUUID, err = utils.ReadOrMakeHostUUID(cfg.DataDir) + if err != nil { + return nil, trace.Wrap(err) + } + // if user started auth and another service (without providing the auth address for // that service, the address of the in-process auth will be used if cfg.Auth.Enabled && len(cfg.AuthServers) == 0 { diff --git a/lib/srv/srv.go b/lib/srv/srv.go index 0b9d246e876..67c85424d0e 100644 --- a/lib/srv/srv.go +++ b/lib/srv/srv.go @@ -160,11 +160,11 @@ func New(addr utils.NetAddr, advertiseIP net.IP, options ...ServerOption) (*Server, error) { + // read the host UUID: uuid, err := utils.ReadOrMakeHostUUID(dataDir) if err != nil { return nil, trace.Wrap(err) } - log.Infof("node UUID: %v", uuid) s := &Server{ addr: addr, diff --git a/web/dist/app/app b/web/dist/app/app index 8aaec0d3130..13a90ff41eb 120000 --- a/web/dist/app/app +++ b/web/dist/app/app @@ -1 +1 @@ -/Users/ekontsevoy/go/src/github.com/gravitational/teleport/web/dist/app \ No newline at end of file +/home/ekontsevoy/go/src/github.com/gravitational/teleport/web/dist/app \ No newline at end of file