From 86f737ff937d83322cc02c8c35cba4d77756166b Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Mon, 9 Jan 2017 02:38:29 -0800 Subject: [PATCH] Rename bootcfg code references to matchbox * Change config drectory to /etc/matchbox * Change data-path to /var/lib/matchbox * Change assets-path to /var/lib/matchbox/assets --- cmd/bootcfg/main.go | 18 +++++++++--------- matchbox/cli/root.go | 10 +++++----- matchbox/client/client.go | 2 +- matchbox/client/doc.go | 4 ++-- matchbox/http/doc.go | 2 +- matchbox/http/handlers.go | 2 +- matchbox/http/server.go | 2 +- matchbox/rpc/doc.go | 2 +- matchbox/rpc/errors.go | 4 ++-- matchbox/rpc/groups.go | 2 +- matchbox/rpc/grpc.go | 2 +- matchbox/rpc/ignition.go | 2 +- matchbox/rpc/profiles.go | 2 +- matchbox/rpc/rpcpb/rpc.proto | 2 +- matchbox/rpc/select.go | 2 +- matchbox/server/doc.go | 2 +- matchbox/server/server.go | 6 +++--- matchbox/server/serverpb/doc.go | 2 +- matchbox/server/serverpb/messages.proto | 2 +- matchbox/sign/doc.go | 2 +- matchbox/storage/doc.go | 2 +- matchbox/storage/fs_test.go | 2 +- matchbox/version/version.go | 2 +- 23 files changed, 39 insertions(+), 39 deletions(-) diff --git a/cmd/bootcfg/main.go b/cmd/bootcfg/main.go index 009e2547..134ba737 100644 --- a/cmd/bootcfg/main.go +++ b/cmd/bootcfg/main.go @@ -41,17 +41,17 @@ func main() { }{} flag.StringVar(&flags.address, "address", "127.0.0.1:8080", "HTTP listen address") flag.StringVar(&flags.rpcAddress, "rpc-address", "", "RPC listen address") - flag.StringVar(&flags.dataPath, "data-path", "/var/lib/bootcfg", "Path to data directory") - flag.StringVar(&flags.assetsPath, "assets-path", "/var/lib/bootcfg/assets", "Path to static assets") + flag.StringVar(&flags.dataPath, "data-path", "/var/lib/matchbox", "Path to data directory") + flag.StringVar(&flags.assetsPath, "assets-path", "/var/lib/matchbox/assets", "Path to static assets") // Log levels https://github.com/Sirupsen/logrus/blob/master/logrus.go#L36 flag.StringVar(&flags.logLevel, "log-level", "info", "Set the logging level") // gRPC Server TLS - flag.StringVar(&flags.certFile, "cert-file", "/etc/bootcfg/server.crt", "Path to the server TLS certificate file") - flag.StringVar(&flags.keyFile, "key-file", "/etc/bootcfg/server.key", "Path to the server TLS key file") + flag.StringVar(&flags.certFile, "cert-file", "/etc/matchbox/server.crt", "Path to the server TLS certificate file") + flag.StringVar(&flags.keyFile, "key-file", "/etc/matchbox/server.key", "Path to the server TLS key file") // TLS Client Authentication - flag.StringVar(&flags.caFile, "ca-file", "/etc/bootcfg/ca.crt", "Path to the CA verify and authenticate client certificates") + flag.StringVar(&flags.caFile, "ca-file", "/etc/matchbox/ca.crt", "Path to the CA verify and authenticate client certificates") // Signing flag.StringVar(&flags.keyRingPath, "key-ring-path", "", "Path to a private keyring file") @@ -62,11 +62,11 @@ func main() { // parse command-line and environment variable arguments flag.Parse() - if err := flagutil.SetFlagsFromEnv(flag.CommandLine, "BOOTCFG"); err != nil { + if err := flagutil.SetFlagsFromEnv(flag.CommandLine, "MATCHBOX"); err != nil { log.Fatal(err.Error()) } // restrict OpenPGP passphrase to pass via environment variable only - passphrase := os.Getenv("BOOTCFG_PASSPHRASE") + passphrase := os.Getenv("MATCHBOX_PASSPHRASE") if flags.version { fmt.Println(version.Version) @@ -132,7 +132,7 @@ func main() { // gRPC Server (feature disabled by default) if flags.rpcAddress != "" { - log.Infof("Starting bootcfg gRPC server on %s", flags.rpcAddress) + log.Infof("Starting matchbox gRPC server on %s", flags.rpcAddress) log.Infof("Using TLS server certificate: %s", flags.certFile) log.Infof("Using TLS server key: %s", flags.keyFile) log.Infof("Using CA certificate: %s to authenticate client certificates", flags.caFile) @@ -163,7 +163,7 @@ func main() { ArmoredSigner: armoredSigner, } httpServer := web.NewServer(config) - log.Infof("Starting bootcfg HTTP server on %s", flags.address) + log.Infof("Starting matchbox HTTP server on %s", flags.address) err = http.ListenAndServe(flags.address, httpServer.HTTPHandler()) if err != nil { log.Fatalf("failed to start listening: %v", err) diff --git a/matchbox/cli/root.go b/matchbox/cli/root.go index 47ea18ff..54a68b49 100644 --- a/matchbox/cli/root.go +++ b/matchbox/cli/root.go @@ -14,8 +14,8 @@ var ( // RootCmd is the base bootcmd command. RootCmd = &cobra.Command{ Use: "bootcmd", - Short: "A command line client for the bootcfg service.", - Long: `A CLI for the bootcfg Service + Short: "A command line client for the matchbox service.", + Long: `A CLI for the matchbox Service To get help about a resource or command, run "bootcmd help resource"`, } @@ -32,10 +32,10 @@ To get help about a resource or command, run "bootcmd help resource"`, func init() { RootCmd.PersistentFlags().StringSliceVar(&globalFlags.endpoints, "endpoints", []string{"127.0.0.1:8081"}, "gRPC Endpoints") // gRPC TLS Server Verification - RootCmd.PersistentFlags().StringVar(&globalFlags.caFile, "ca-file", "/etc/bootcfg/ca.crt", "Path to the CA bundle to verify certificates of TLS servers") + RootCmd.PersistentFlags().StringVar(&globalFlags.caFile, "ca-file", "/etc/matchbox/ca.crt", "Path to the CA bundle to verify certificates of TLS servers") // gRPC TLS Client Authentication - RootCmd.PersistentFlags().StringVar(&globalFlags.certFile, "cert-file", "/etc/bootcfg/client.crt", "Path to the client TLS certificate file") - RootCmd.PersistentFlags().StringVar(&globalFlags.keyFile, "key-file", "/etc/bootcfg/client.key", "Path to the client TLS key file") + RootCmd.PersistentFlags().StringVar(&globalFlags.certFile, "cert-file", "/etc/matchbox/client.crt", "Path to the client TLS certificate file") + RootCmd.PersistentFlags().StringVar(&globalFlags.keyFile, "key-file", "/etc/matchbox/client.key", "Path to the client TLS key file") cobra.EnablePrefixMatching = true } diff --git a/matchbox/client/client.go b/matchbox/client/client.go index 0cab7cd5..7b7cf0b2 100644 --- a/matchbox/client/client.go +++ b/matchbox/client/client.go @@ -26,7 +26,7 @@ type Config struct { TLS *tls.Config } -// Client provides a bootcfg client RPC session. +// Client provides a matchbox client RPC session. type Client struct { Groups rpcpb.GroupsClient Profiles rpcpb.ProfilesClient diff --git a/matchbox/client/doc.go b/matchbox/client/doc.go index 3d597aa7..dcae15da 100644 --- a/matchbox/client/doc.go +++ b/matchbox/client/doc.go @@ -1,6 +1,6 @@ -// Package client provides the bootcfg gRPC client. +// Package client provides the matchbox gRPC client. // -// Create a bootcfg gRPC client using `client.New`: +// Create a matchbox gRPC client using `client.New`: // // cfg := &client.Config{ // Endpoints: []string{"127.0.0.1:8081"}, diff --git a/matchbox/http/doc.go b/matchbox/http/doc.go index 43001401..b7dae4c5 100644 --- a/matchbox/http/doc.go +++ b/matchbox/http/doc.go @@ -1,2 +1,2 @@ -// Package http provides the bootcfg HTTP server +// Package http provides the matchbox HTTP server package http diff --git a/matchbox/http/handlers.go b/matchbox/http/handlers.go index 5bccff95..d8cbb87d 100644 --- a/matchbox/http/handlers.go +++ b/matchbox/http/handlers.go @@ -18,7 +18,7 @@ func homeHandler() http.Handler { http.NotFound(w, req) return } - fmt.Fprintf(w, "bootcfg\n") + fmt.Fprintf(w, "matchbox\n") } return http.HandlerFunc(fn) } diff --git a/matchbox/http/server.go b/matchbox/http/server.go index e508459b..de3f78bb 100644 --- a/matchbox/http/server.go +++ b/matchbox/http/server.go @@ -47,7 +47,7 @@ func (s *Server) HTTPHandler() http.Handler { chain := func(next ContextHandler) http.Handler { return s.logRequest(NewHandler(next)) } - // bootcfg version + // matchbox version mux.Handle("/", s.logRequest(homeHandler())) // Boot via GRUB mux.Handle("/grub", chain(s.selectProfile(s.core, s.grubHandler()))) diff --git a/matchbox/rpc/doc.go b/matchbox/rpc/doc.go index d46c3153..f075eb2f 100644 --- a/matchbox/rpc/doc.go +++ b/matchbox/rpc/doc.go @@ -1,2 +1,2 @@ -// Package rpc provides the bootcfg gRPC server +// Package rpc provides the matchbox gRPC server package rpc diff --git a/matchbox/rpc/errors.go b/matchbox/rpc/errors.go index 6d789959..59813111 100644 --- a/matchbox/rpc/errors.go +++ b/matchbox/rpc/errors.go @@ -10,8 +10,8 @@ import ( var ( // work around go vet false positive https://github.com/grpc/grpc-go/issues/90 grpcErrorf = grpc.Errorf - errNoMatchingGroup = grpcErrorf(codes.NotFound, "bootcfg: No matching Group") - errNoMatchingProfile = grpcErrorf(codes.NotFound, "bootcfg: No matching Profile") + errNoMatchingGroup = grpcErrorf(codes.NotFound, "matchbox: No matching Group") + errNoMatchingProfile = grpcErrorf(codes.NotFound, "matchbox: No matching Profile") ) // grpcError transforms an error into a gRPC errors with canonical error codes. diff --git a/matchbox/rpc/groups.go b/matchbox/rpc/groups.go index 250b8a0e..9e4d8afd 100644 --- a/matchbox/rpc/groups.go +++ b/matchbox/rpc/groups.go @@ -8,7 +8,7 @@ import ( pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) -// groupServer takes a bootcfg Server and implements a gRPC GroupsServer. +// groupServer takes a matchbox Server and implements a gRPC GroupsServer. type groupServer struct { srv server.Server } diff --git a/matchbox/rpc/grpc.go b/matchbox/rpc/grpc.go index ae8560dd..446ee730 100644 --- a/matchbox/rpc/grpc.go +++ b/matchbox/rpc/grpc.go @@ -10,7 +10,7 @@ import ( "github.com/coreos/coreos-baremetal/matchbox/server" ) -// NewServer wraps the bootcfg Server to return a new gRPC Server. +// NewServer wraps the matchbox Server to return a new gRPC Server. func NewServer(s server.Server, tls *tls.Config) *grpc.Server { var opts []grpc.ServerOption if tls != nil { diff --git a/matchbox/rpc/ignition.go b/matchbox/rpc/ignition.go index 59b6c90c..9888fc09 100644 --- a/matchbox/rpc/ignition.go +++ b/matchbox/rpc/ignition.go @@ -8,7 +8,7 @@ import ( pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) -// ignitionServer takes a bootcfg Server and implements a gRPC IgnitionServer. +// ignitionServer takes a matchbox Server and implements a gRPC IgnitionServer. type ignitionServer struct { srv server.Server } diff --git a/matchbox/rpc/profiles.go b/matchbox/rpc/profiles.go index f5fc4dd9..962c8c0d 100644 --- a/matchbox/rpc/profiles.go +++ b/matchbox/rpc/profiles.go @@ -8,7 +8,7 @@ import ( pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) -// profileServer takes a bootcfg Server and implements a gRPC ProfilesServer. +// profileServer takes a matchbox Server and implements a gRPC ProfilesServer. type profileServer struct { srv server.Server } diff --git a/matchbox/rpc/rpcpb/rpc.proto b/matchbox/rpc/rpcpb/rpc.proto index bec6631b..fcaa36fa 100644 --- a/matchbox/rpc/rpcpb/rpc.proto +++ b/matchbox/rpc/rpcpb/rpc.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package rpcpb; -import "github.com/coreos/coreos-baremetal/bootcfg/server/serverpb/messages.proto"; +import "github.com/coreos/coreos-baremetal/matchbox/server/serverpb/messages.proto"; service Groups { // Create a Group. diff --git a/matchbox/rpc/select.go b/matchbox/rpc/select.go index 01c9b484..4bcfa1be 100644 --- a/matchbox/rpc/select.go +++ b/matchbox/rpc/select.go @@ -8,7 +8,7 @@ import ( pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) -// selectServer wraps a bootcfg Server to be suitable for gRPC registration. +// selectServer wraps a matchbox Server to be suitable for gRPC registration. type selectServer struct { srv server.Server } diff --git a/matchbox/server/doc.go b/matchbox/server/doc.go index 53d48b64..38324655 100644 --- a/matchbox/server/doc.go +++ b/matchbox/server/doc.go @@ -1,2 +1,2 @@ -// Package server is a bootcfg library package for implementing servers. +// Package server is a matchbox library package for implementing servers. package server diff --git a/matchbox/server/server.go b/matchbox/server/server.go index fa487ea6..b9704179 100644 --- a/matchbox/server/server.go +++ b/matchbox/server/server.go @@ -13,11 +13,11 @@ import ( // Possible service errors var ( - ErrNoMatchingGroup = errors.New("bootcfg: No matching Group") - ErrNoMatchingProfile = errors.New("bootcfg: No matching Profile") + ErrNoMatchingGroup = errors.New("matchbox: No matching Group") + ErrNoMatchingProfile = errors.New("matchbox: No matching Profile") ) -// Server defines a bootcfg server lib. +// Server defines the matchbox server interface. type Server interface { // SelectGroup returns the Group matching the given labels. SelectGroup(context.Context, *pb.SelectGroupRequest) (*storagepb.Group, error) diff --git a/matchbox/server/serverpb/doc.go b/matchbox/server/serverpb/doc.go index cd7299dd..966fe1eb 100644 --- a/matchbox/server/serverpb/doc.go +++ b/matchbox/server/serverpb/doc.go @@ -1,2 +1,2 @@ -// Package serverpb provides bootcfg message types. +// Package serverpb provides matchbox message types. package serverpb diff --git a/matchbox/server/serverpb/messages.proto b/matchbox/server/serverpb/messages.proto index 4f1eb101..88bdd758 100644 --- a/matchbox/server/serverpb/messages.proto +++ b/matchbox/server/serverpb/messages.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package serverpb; -import "github.com/coreos/coreos-baremetal/bootcfg/storage/storagepb/storage.proto"; +import "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb/storage.proto"; message SelectGroupRequest { map labels = 1; diff --git a/matchbox/sign/doc.go b/matchbox/sign/doc.go index 72ed11f7..cbef65f0 100644 --- a/matchbox/sign/doc.go +++ b/matchbox/sign/doc.go @@ -1,2 +1,2 @@ -// Package sign adds signatures to bootcfg responses. +// Package sign adds signatures to matchbox responses. package sign diff --git a/matchbox/storage/doc.go b/matchbox/storage/doc.go index 5783d2a0..76107447 100644 --- a/matchbox/storage/doc.go +++ b/matchbox/storage/doc.go @@ -1,2 +1,2 @@ -// Package storage defines bootcfg's storage and object types. +// Package storage defines matchbox's storage and object types. package storage diff --git a/matchbox/storage/fs_test.go b/matchbox/storage/fs_test.go index b033257d..aeedb436 100644 --- a/matchbox/storage/fs_test.go +++ b/matchbox/storage/fs_test.go @@ -21,7 +21,7 @@ func TestDir(t *testing.T) { {"d/e/ff", "d/e/ff"}, {"d/e/ff/../gg", "d/e/gg"}, } - tdir, err := ioutil.TempDir("", "bootcfg") + tdir, err := ioutil.TempDir("", "matchbox") assert.Nil(t, err) defer os.RemoveAll(tdir) diff --git a/matchbox/version/version.go b/matchbox/version/version.go index e58b2e12..3d231e5d 100644 --- a/matchbox/version/version.go +++ b/matchbox/version/version.go @@ -1,4 +1,4 @@ -// Package version provides the bootcfg version. +// Package version provides the matchbox version. package version // Version provided by compile time -ldflags.