From 9a3436edb5d30238502c5848c2c68eeedcc018d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Thu, 9 Apr 2020 22:35:00 +1200 Subject: [PATCH] Remove display of SK in logs, disable hypervisor TLS by default. --- cmd/skyconf/skyconf.go | 2 +- cmd/skyimager-gui/assets/.idea/.gitignore | 2 ++ cmd/skyimager-gui/assets/.idea/assets.iml | 9 +++++++++ cmd/skyimager-gui/assets/.idea/misc.xml | 6 ++++++ cmd/skyimager-gui/assets/.idea/modules.xml | 8 ++++++++ cmd/skyimager-gui/assets/.idea/vcs.xml | 6 ++++++ pkg/boot/params.go | 7 ++++--- pkg/prepconf/prepare.go | 5 ++--- 8 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 cmd/skyimager-gui/assets/.idea/.gitignore create mode 100644 cmd/skyimager-gui/assets/.idea/assets.iml create mode 100644 cmd/skyimager-gui/assets/.idea/misc.xml create mode 100644 cmd/skyimager-gui/assets/.idea/modules.xml create mode 100644 cmd/skyimager-gui/assets/.idea/vcs.xml diff --git a/cmd/skyconf/skyconf.go b/cmd/skyconf/skyconf.go index ab41dfe4..f9c78736 100644 --- a/cmd/skyconf/skyconf.go +++ b/cmd/skyconf/skyconf.go @@ -100,7 +100,7 @@ func tempFile() (*os.File, error) { return nil, err } name := filepath.Join(os.TempDir(), fmt.Sprintf("skyconf-%d-%d.log", os.Getpid(), time.Now().Unix())) - return os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0644) + return os.OpenFile(name, os.O_WRONLY|os.O_CREATE, 0644) //nolint:gosec } func makeLogger() (*log.Logger, *os.File) { diff --git a/cmd/skyimager-gui/assets/.idea/.gitignore b/cmd/skyimager-gui/assets/.idea/.gitignore new file mode 100644 index 00000000..5c98b428 --- /dev/null +++ b/cmd/skyimager-gui/assets/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/cmd/skyimager-gui/assets/.idea/assets.iml b/cmd/skyimager-gui/assets/.idea/assets.iml new file mode 100644 index 00000000..5e764c4f --- /dev/null +++ b/cmd/skyimager-gui/assets/.idea/assets.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/cmd/skyimager-gui/assets/.idea/misc.xml b/cmd/skyimager-gui/assets/.idea/misc.xml new file mode 100644 index 00000000..28a804d8 --- /dev/null +++ b/cmd/skyimager-gui/assets/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/cmd/skyimager-gui/assets/.idea/modules.xml b/cmd/skyimager-gui/assets/.idea/modules.xml new file mode 100644 index 00000000..e2d63b96 --- /dev/null +++ b/cmd/skyimager-gui/assets/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/cmd/skyimager-gui/assets/.idea/vcs.xml b/cmd/skyimager-gui/assets/.idea/vcs.xml new file mode 100644 index 00000000..c2365ab1 --- /dev/null +++ b/cmd/skyimager-gui/assets/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pkg/boot/params.go b/pkg/boot/params.go index 63714eaa..d414bb5a 100644 --- a/pkg/boot/params.go +++ b/pkg/boot/params.go @@ -199,9 +199,10 @@ func (bp Params) PrintEnvs(w io.Writer) error { if err := PrintEnv(w, LocalPKENV, pk.String()); err != nil { return err } - if err := PrintEnv(w, LocalSKENV, bp.LocalSK.String()); err != nil { - return err - } + // TODO(evanlinjin): We may need to re-enable this in the future. + //if err := PrintEnv(w, LocalSKENV, bp.LocalSK.String()); err != nil { + // return err + //} } if len(bp.HypervisorPKs) > 0 { list := "(" diff --git a/pkg/prepconf/prepare.go b/pkg/prepconf/prepare.go index bbadf9af..c435df37 100644 --- a/pkg/prepconf/prepare.go +++ b/pkg/prepconf/prepare.go @@ -37,7 +37,7 @@ func Prepare(logger *log.Logger, conf Config, bp boot.Params) error { ensureExists := func(name string, genConfig genFn) error { //// Do nothing if file exists. if _, err := os.Stat(name); err == nil { - conf, err := ioutil.ReadFile(name) + conf, err := ioutil.ReadFile(name) //nolint:gosec if err == nil { logger.Printf("Contents of %q: %q", name, string(conf)) } @@ -171,8 +171,7 @@ func generateHypervisorConfig(conf Config, bp boot.Params) (interface{}, error) out.DmsgDiscovery = skyenv.DefaultDmsgDiscAddr out.DmsgPort = skyenv.DmsgHypervisorPort out.HTTPAddr = ":8000" - out.EnableTLS = true - // TODO(evanlinjin): Pass filenames as cli args in 'skyconf'. + out.EnableTLS = false // TODO(evanlinjin): TLS is disabled due to a bug in the skyminer Router. out.TLSCertFile = conf.TLSCert out.TLSKeyFile = conf.TLSKey err = GenCert(out.TLSCertFile, out.TLSKeyFile)