diff --git a/cmd/vetinari-server/main.go b/cmd/vetinari-server/main.go index b1e894d2df..a029254715 100644 --- a/cmd/vetinari-server/main.go +++ b/cmd/vetinari-server/main.go @@ -4,7 +4,6 @@ import ( _ "expvar" "flag" "fmt" - "log" "net/http" _ "net/http/pprof" "os" @@ -18,6 +17,7 @@ import ( _ "github.com/docker/vetinari/auth/token" "github.com/docker/vetinari/config" "github.com/docker/vetinari/server" + "github.com/docker/vetinari/signer" ) // DebugAddress is the debug server address to listen on @@ -54,9 +54,9 @@ func main() { signal.Notify(sigTerm, syscall.SIGTERM) var trust signed.TrustService - if conf.TrustServiceConf.Type == "remote" { + if conf.TrustService.Type == "remote" { logrus.Info("[Vetinari Server] : Using remote signing service") - trust = newRufusSigner(conf.TrustServiceConf.Hostname, conf.TrustServiceConf.Port, conf.TrustServiceConf.TLSCAFile) + trust = signer.NewRufusSigner(conf.TrustService.Hostname, conf.TrustService.Port, conf.TrustService.TLSCAFile) } else { logrus.Info("[Vetinari Server] : Using local signing service") trust = signed.NewEd25519() diff --git a/server/rufus_trust.go b/signer/rufus_trust.go similarity index 97% rename from server/rufus_trust.go rename to signer/rufus_trust.go index 9666428f2d..b64095f3e5 100644 --- a/server/rufus_trust.go +++ b/signer/rufus_trust.go @@ -1,4 +1,4 @@ -package server +package signer import ( "errors" @@ -19,7 +19,7 @@ type RufusSigner struct { sClient pb.SignerClient } -func newRufusSigner(hostname string, port string, tlscafile string) *RufusSigner { +func NewRufusSigner(hostname string, port string, tlscafile string) *RufusSigner { var opts []grpc.DialOption netAddr := net.JoinHostPort(hostname, port) creds, err := credentials.NewClientTLSFromFile(tlscafile, hostname)