From 33e8afb29279a77d20dd94af6aa73c78c88cad89 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 15 Aug 2017 13:12:10 +0100 Subject: [PATCH 1/5] cmd: Use the proper packet.net go bindings again The support for always PXE has been merged. Signed-off-by: Rolf Neugebauer --- src/cmd/linuxkit/run_packet.go | 2 +- src/cmd/linuxkit/vendor.conf | 1 + .../{bzub => packethost}/packngo/LICENSE.txt | 0 .../{bzub => packethost}/packngo/README.md | 0 .../{bzub => packethost}/packngo/devices.go | 21 ++++++++++--------- .../{bzub => packethost}/packngo/email.go | 0 .../packngo/facilities.go | 0 .../{bzub => packethost}/packngo/ip.go | 0 .../packngo/operatingsystems.go | 0 .../{bzub => packethost}/packngo/packngo.go | 0 .../{bzub => packethost}/packngo/plans.go | 0 .../{bzub => packethost}/packngo/projects.go | 0 .../{bzub => packethost}/packngo/rate.go | 0 .../{bzub => packethost}/packngo/sshkeys.go | 0 .../{bzub => packethost}/packngo/timestamp.go | 0 .../{bzub => packethost}/packngo/user.go | 0 .../{bzub => packethost}/packngo/utils.go | 0 .../{bzub => packethost}/packngo/volumes.go | 0 18 files changed, 13 insertions(+), 11 deletions(-) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/LICENSE.txt (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/README.md (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/devices.go (90%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/email.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/facilities.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/ip.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/operatingsystems.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/packngo.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/plans.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/projects.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/rate.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/sshkeys.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/timestamp.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/user.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/utils.go (100%) rename src/cmd/linuxkit/vendor/github.com/{bzub => packethost}/packngo/volumes.go (100%) diff --git a/src/cmd/linuxkit/run_packet.go b/src/cmd/linuxkit/run_packet.go index 3aa0eff45..7c8b0d464 100644 --- a/src/cmd/linuxkit/run_packet.go +++ b/src/cmd/linuxkit/run_packet.go @@ -13,7 +13,7 @@ import ( "path/filepath" "strings" - "github.com/bzub/packngo" // TODO(rn): Update to official once iPXE is merged + "github.com/packethost/packngo" log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" diff --git a/src/cmd/linuxkit/vendor.conf b/src/cmd/linuxkit/vendor.conf index 86941c2d7..ac3ed2b4b 100644 --- a/src/cmd/linuxkit/vendor.conf +++ b/src/cmd/linuxkit/vendor.conf @@ -13,6 +13,7 @@ github.com/gophercloud/gophercloud 2804b72cf099b41d2e25c8afcca786f9f962ddee github.com/jmespath/go-jmespath bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d github.com/mitchellh/go-ps 4fdf99ab29366514c69ccccddab5dc58b8d84062 github.com/moby/hyperkit a82b409a87f12fa3306813410c37f4eed270efac +github.com/packethost/packngo 9d9409c8c09de7695281e900a776cca03676026a github.com/radu-matei/azure-sdk-for-go 3b12823551999669c9a325a32472508e0af7978e github.com/radu-matei/azure-vhd-utils e52754d5569d2a643a7775f72ff2a6cf524f4c25 github.com/rn/iso9660wrap 4606f848a055435cdef85305960b0e1bb788d506 diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/LICENSE.txt b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/LICENSE.txt similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/LICENSE.txt rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/LICENSE.txt diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/README.md b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/README.md similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/README.md rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/README.md diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/devices.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/devices.go similarity index 90% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/devices.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/devices.go index a6552d5d5..a016f6757 100644 --- a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/devices.go +++ b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/devices.go @@ -48,16 +48,17 @@ func (d Device) String() string { // DeviceCreateRequest type used to create a Packet device type DeviceCreateRequest struct { - HostName string `json:"hostname"` - Plan string `json:"plan"` - Facility string `json:"facility"` - OS string `json:"operating_system"` - BillingCycle string `json:"billing_cycle"` - ProjectID string `json:"project_id"` - UserData string `json:"userdata"` - Tags []string `json:"tags"` - IPXEScriptUrl string `json:"ipxe_script_url,omitempty"` - AlwaysPXE bool `json:"always_pxe,omitempty"` + HostName string `json:"hostname"` + Plan string `json:"plan"` + Facility string `json:"facility"` + OS string `json:"operating_system"` + BillingCycle string `json:"billing_cycle"` + ProjectID string `json:"project_id"` + UserData string `json:"userdata"` + Tags []string `json:"tags"` + IPXEScriptUrl string `json:"ipxe_script_url,omitempty"` + PublicIPv4SubnetSize int `json:"public_ipv4_subnet_size,omitempty"` + AlwaysPXE bool `json:"always_pxe,omitempty"` } func (d DeviceCreateRequest) String() string { diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/email.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/email.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/email.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/email.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/facilities.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/facilities.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/facilities.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/facilities.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/ip.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/ip.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/ip.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/ip.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/operatingsystems.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/operatingsystems.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/operatingsystems.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/operatingsystems.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/packngo.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/packngo.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/packngo.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/packngo.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/plans.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/plans.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/plans.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/plans.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/projects.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/projects.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/projects.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/projects.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/rate.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/rate.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/rate.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/rate.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/sshkeys.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/sshkeys.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/sshkeys.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/sshkeys.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/timestamp.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/timestamp.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/timestamp.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/timestamp.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/user.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/user.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/user.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/user.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/utils.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/utils.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/utils.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/utils.go diff --git a/src/cmd/linuxkit/vendor/github.com/bzub/packngo/volumes.go b/src/cmd/linuxkit/vendor/github.com/packethost/packngo/volumes.go similarity index 100% rename from src/cmd/linuxkit/vendor/github.com/bzub/packngo/volumes.go rename to src/cmd/linuxkit/vendor/github.com/packethost/packngo/volumes.go From fced67dab82eea1628f24217188a966e3fc48bca Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Mon, 14 Aug 2017 16:40:16 +0100 Subject: [PATCH 2/5] cmd: Add a -serve command to the packet.net backend The -serve command starts a local HTTP server which serves the kernel and initrd files. The server can then easily be made available via ngrok or other means. Signed-off-by: Rolf Neugebauer --- src/cmd/linuxkit/run_packet.go | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/src/cmd/linuxkit/run_packet.go b/src/cmd/linuxkit/run_packet.go index 7c8b0d464..d8622fec0 100644 --- a/src/cmd/linuxkit/run_packet.go +++ b/src/cmd/linuxkit/run_packet.go @@ -2,6 +2,7 @@ package main import ( "bufio" + "context" "encoding/json" "flag" "fmt" @@ -9,9 +10,12 @@ import ( "net" "net/http" "os" + "os/signal" "os/user" + "path" "path/filepath" "strings" + "time" "github.com/packethost/packngo" log "github.com/sirupsen/logrus" @@ -60,6 +64,7 @@ func runPacket(args []string) { hostNameFlag := flags.String("hostname", packetDefaultHostname, "Hostname of new instance (or "+packetHostnameVar+")") nameFlag := flags.String("img-name", "", "Overrides the prefix used to identify the files. Defaults to [name] (or "+packetNameVar+")") alwaysPXE := flags.Bool("always-pxe", true, "Reboot from PXE every time.") + serveFlag := flags.String("serve", "", "Serve local files via the http port specified, e.g. ':8080'.") consoleFlag := flags.Bool("console", true, "Provide interactive access on the console.") if err := flags.Parse(args); err != nil { log.Fatal("Unable to parse args") @@ -98,6 +103,19 @@ func runPacket(args []string) { cmdline = string(c) } + // Serve files with a local http server + var httpServer *http.Server + if *serveFlag != "" { + fs := serveFiles{[]string{fmt.Sprintf("%s-kernel", name), fmt.Sprintf("%s-initrd.img", name)}} + httpServer = &http.Server{Addr: ":8080", Handler: http.FileServer(fs)} + go func() { + log.Infof("Listening on http://%s\n", *serveFlag) + if err := httpServer.ListenAndServe(); err != nil { + log.Infof("http server exited with: %v", err) + } + }() + } + // Build the iPXE script // Note, we *append* the -cmdline. iXPE booting will // need the first set of "kernel-params" and we don't want to @@ -150,6 +168,23 @@ func runPacket(args []string) { } else { log.Printf("Machine booting") log.Printf("Access the console with: ssh %s@%s", d.ID, sshHost) + + // if the serve option is present, wait till 'ctrl-c' is hit. + // Otherwise we wouldn't serve the files + if *serveFlag != "" { + stop := make(chan os.Signal, 1) + signal.Notify(stop, os.Interrupt) + log.Printf("Hit ctrl-c to stop http server") + <-stop + } + } + + // Stop the http server before exiting + if *serveFlag != "" { + log.Printf("Shutting down http server...") + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + httpServer.Shutdown(ctx) } } @@ -267,3 +302,35 @@ func sshHostKey(host string) (ssh.PublicKey, error) { } return hostKey, nil } + +// This implements a http.FileSystem which only responds to specific files. +type serveFiles struct { + files []string +} + +// Open implements the Open method for the serveFiles FileSystem +// implementation. +// It converts both the name from the URL and the files provided in +// the serveFiles structure into cleaned, absolute filesystem path and +// only returns the file if the requested name matches one of the +// files in the list. +func (fs serveFiles) Open(name string) (http.File, error) { + cwd, err := os.Getwd() + if err != nil { + return nil, err + } + + name = filepath.Join(cwd, filepath.FromSlash(path.Clean("/"+name))) + for _, fn := range fs.files { + fn = filepath.Join(cwd, filepath.FromSlash(path.Clean("/"+fn))) + if name == fn { + f, err := os.Open(fn) + if err != nil { + return nil, err + } + log.Infof("Serving: %s", fn) + return f, nil + } + } + return nil, fmt.Errorf("File %s not found", name) +} From 306a7f4be68f5adb2b0470be33df2f183ca602df Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Mon, 14 Aug 2017 16:53:09 +0100 Subject: [PATCH 3/5] docs: Update Packet.net documentation Signed-off-by: Rolf Neugebauer --- docs/platform-packet.md | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/docs/platform-packet.md b/docs/platform-packet.md index a00d3f8bb..a9afcba0e 100644 --- a/docs/platform-packet.md +++ b/docs/platform-packet.md @@ -24,47 +24,25 @@ packet --help` for the options and environment variables. ## Boot - - LinuxKit on Packet boots the `kernel+initrd` output from moby via [iPXE](https://help.packet.net/technical/infrastructure/custom-ipxe). iPXE -booting requires a HTTP server on which you can store your images. At -the moment there is no builtin support for this, although we are -working on this too. +booting requires a HTTP server on which you can store your images. The +`-base-url` option specifies the URL to the HTTP server. -A simple way to host files is via a simple local http server written in Go, e.g.: +If you don't have a public HTTP server at hand, you can use the +`-serve` option. This will create a local HTTP server which can either +be run on another Packet machine or be made accessible with tools +like [ngrok](https://ngrok.com/). -```Go -package main - -import ( - "log" - "net/http" -) - -func main() { - // Simple static webserver: - log.Fatal(http.ListenAndServe(":8080", http.FileServer(http.Dir(".")))) -} -``` - -and then `go run` this in the directory with the `kernel+initrd`. - -The web server must be accessible from Packet. You can either run the -server on another Packet machine, or use tools -like [ngrok](https://ngrok.com/) to make it accessible via a reverse -proxy. - -You then specify the location of your http server using the -`-base-url` command line option. For example, to boot the -toplevel [linuxkit.yml](../linuxkit.yml) example: +For example, to boot the toplevel [linuxkit.yml](../linuxkit.yml) +example with a local HTTP server: ```sh moby build linuxkit.yml # run the web server # run 'ngrok http 8080' in another window -PACKET_API_KEY= linuxkit run packet -base-url http://9b828514.ngrok.io -project-id linuxkit +PACKET_API_KEY= linuxkit run packet -serve :8080 -base-url http://9b828514.ngrok.io -project-id linuxkit ``` **Note**: It may take several minutes to deploy a new server. If you From 2590c66511c1636f3ba7e38c95856c65e6b2abc2 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 15 Aug 2017 13:52:16 +0100 Subject: [PATCH 4/5] cmd: Remove the packet machine when done Adds a new option, '-keep' which will keep the machine around, but by default remove the machine when done. Signed-off-by: Rolf Neugebauer --- src/cmd/linuxkit/run_packet.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/cmd/linuxkit/run_packet.go b/src/cmd/linuxkit/run_packet.go index d8622fec0..6bf148760 100644 --- a/src/cmd/linuxkit/run_packet.go +++ b/src/cmd/linuxkit/run_packet.go @@ -66,6 +66,7 @@ func runPacket(args []string) { alwaysPXE := flags.Bool("always-pxe", true, "Reboot from PXE every time.") serveFlag := flags.String("serve", "", "Serve local files via the http port specified, e.g. ':8080'.") consoleFlag := flags.Bool("console", true, "Provide interactive access on the console.") + keepFlag := flags.Bool("keep", false, "Keep the machine after exiting/poweroff.") if err := flags.Parse(args); err != nil { log.Fatal("Unable to parse args") } @@ -95,6 +96,10 @@ func runPacket(args []string) { osType := "custom_ipxe" billing := "hourly" + if !*keepFlag && !*consoleFlag { + log.Fatalf("Combination of keep=%t and console=%t makes little sense", *keepFlag, *consoleFlag) + } + // Read kernel command line var cmdline string if c, err := ioutil.ReadFile(prefix + "-cmdline"); err != nil { @@ -148,26 +153,26 @@ func runPacket(args []string) { Tags: tags, AlwaysPXE: *alwaysPXE, } - d, _, err := client.Devices.Create(&req) + dev, _, err := client.Devices.Create(&req) if err != nil { log.Fatal(err) } - b, err := json.MarshalIndent(d, "", " ") + b, err := json.MarshalIndent(dev, "", " ") if err != nil { log.Fatal(err) } // log response json if in verbose mode log.Debugf("%s\n", string(b)) - sshHost := "sos." + d.Facility.Code + ".packet.net" + sshHost := "sos." + dev.Facility.Code + ".packet.net" if *consoleFlag { // Connect to the serial console - if err := sshSOS(d.ID, sshHost); err != nil { + if err := sshSOS(dev.ID, sshHost); err != nil { log.Fatal(err) } } else { log.Printf("Machine booting") - log.Printf("Access the console with: ssh %s@%s", d.ID, sshHost) + log.Printf("Access the console with: ssh %s@%s", dev.ID, sshHost) // if the serve option is present, wait till 'ctrl-c' is hit. // Otherwise we wouldn't serve the files @@ -186,6 +191,13 @@ func runPacket(args []string) { defer cancel() httpServer.Shutdown(ctx) } + + if !*keepFlag { + if _, err := client.Devices.Delete(dev.ID); err != nil { + log.Fatalf("Unable to delete device: %v", err) + } + } + } // validateHTTPURL does a sanity check that a URL returns a 200 or 300 response From 7ae9fab6b660cef86e5ac299a3c7f2a4d50a6f08 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 15 Aug 2017 14:29:30 +0100 Subject: [PATCH 5/5] cmd: Unify Logging for packet backend Be less verbose when running. Signed-off-by: Rolf Neugebauer --- src/cmd/linuxkit/run_packet.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cmd/linuxkit/run_packet.go b/src/cmd/linuxkit/run_packet.go index 6bf148760..5657e36a6 100644 --- a/src/cmd/linuxkit/run_packet.go +++ b/src/cmd/linuxkit/run_packet.go @@ -114,7 +114,7 @@ func runPacket(args []string) { fs := serveFiles{[]string{fmt.Sprintf("%s-kernel", name), fmt.Sprintf("%s-initrd.img", name)}} httpServer = &http.Server{Addr: ":8080", Handler: http.FileServer(fs)} go func() { - log.Infof("Listening on http://%s\n", *serveFlag) + log.Debugf("Listening on http://%s\n", *serveFlag) if err := httpServer.ListenAndServe(); err != nil { log.Infof("http server exited with: %v", err) } @@ -161,9 +161,10 @@ func runPacket(args []string) { if err != nil { log.Fatal(err) } - // log response json if in verbose mode log.Debugf("%s\n", string(b)) + log.Printf("Machine booting...") + sshHost := "sos." + dev.Facility.Code + ".packet.net" if *consoleFlag { // Connect to the serial console @@ -171,7 +172,6 @@ func runPacket(args []string) { log.Fatal(err) } } else { - log.Printf("Machine booting") log.Printf("Access the console with: ssh %s@%s", dev.ID, sshHost) // if the serve option is present, wait till 'ctrl-c' is hit. @@ -186,7 +186,7 @@ func runPacket(args []string) { // Stop the http server before exiting if *serveFlag != "" { - log.Printf("Shutting down http server...") + log.Debugf("Shutting down http server...") ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() httpServer.Shutdown(ctx) @@ -202,7 +202,7 @@ func runPacket(args []string) { // validateHTTPURL does a sanity check that a URL returns a 200 or 300 response func validateHTTPURL(url string) { - log.Printf("Validating URL: %s", url) + log.Infof("Validating URL: %s", url) resp, err := http.Head(url) if err != nil { log.Fatal(err) @@ -210,11 +210,11 @@ func validateHTTPURL(url string) { if resp.StatusCode >= 400 { log.Fatal("Got a non 200- or 300- HTTP response code: %s", resp) } - log.Printf("OK: %d response code", resp.StatusCode) + log.Debugf("OK: %d response code", resp.StatusCode) } func sshSOS(user, host string) error { - log.Printf("console: ssh %s@%s", user, host) + log.Debugf("console: ssh %s@%s", user, host) hostKey, err := sshHostKey(host) if err != nil { @@ -340,7 +340,7 @@ func (fs serveFiles) Open(name string) (http.File, error) { if err != nil { return nil, err } - log.Infof("Serving: %s", fn) + log.Debugf("Serving: %s", fn) return f, nil } }