Skip to content

Commit

Permalink
[supervisor] welcome message for ssh conn
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Jun 20, 2022
1 parent 15dc675 commit 9fbb0d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/supervisor/pkg/supervisor/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"bufio"
"context"
"fmt"
"io/ioutil"
"net"
"os"
"os/exec"
Expand Down Expand Up @@ -229,3 +230,21 @@ func configureSSHDefaultDir(cfg *Config) {
log.WithError(err).Error("write ~/.ssh/rc failed")
}
}

func configureSSHMessageOfTheDay() {
msg := []byte(`Welcome to Gitpod - Always ready to code. You can use commands below to be more productive.
gp tasks list List all your defined tasks in .gitpod.yml
gp tasks attach Attach to a workspace task
gp ports list Lists workspace ports and their states
gp timeout extend Extend timeout of current workspace
gp top Display usage of workspace resources (CPU and memory)
gp stop Stop current workspace
Use gp help to learn more about gp CLI. Visit also https://gitpod.io/docs`)

if err := ioutil.WriteFile("/etc/motd", msg, 0o644); err != nil {
log.WithError(err).Error("write /etc/motd failed")
}
}
1 change: 1 addition & 0 deletions components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,7 @@ func startSSHServer(ctx context.Context, cfg *Config, wg *sync.WaitGroup, childP
return
}
configureSSHDefaultDir(cfg)
configureSSHMessageOfTheDay()
err = ssh.listenAndServe()
if err != nil {
log.WithError(err).Error("err starting SSH server")
Expand Down

0 comments on commit 9fbb0d1

Please sign in to comment.