Skip to content

Commit a0003d0

Browse files
committed
[supervisor] welcome message for ssh conn
1 parent 30d4249 commit a0003d0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

components/supervisor/pkg/supervisor/ssh.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"bufio"
99
"context"
1010
"fmt"
11+
"io/ioutil"
1112
"net"
1213
"os"
1314
"os/exec"
@@ -228,3 +229,22 @@ func configureSSHDefaultDir(cfg *Config) {
228229
log.WithError(err).Error("write .bashrc failed")
229230
}
230231
}
232+
233+
func configureSSHMessageOfTheDay() {
234+
msg := []byte(`Welcome to Gitpod - Always ready to code. You can use commands below to be more productive.
235+
236+
gp tasks list List all your defined tasks in .gitpod.yml
237+
gp tasks attach Attach to a workspace task
238+
239+
gp ports list Lists workspace ports and their states
240+
gp timeout extend Extend timeout of current workspace
241+
gp top Display usage of workspace resources (CPU and memory)
242+
gp stop Stop current workspace
243+
244+
Use gp help to learn more about gp CLI. Visit also https://gitpod.io/docs
245+
`)
246+
247+
if err := ioutil.WriteFile("/etc/motd", msg, 0o644); err != nil {
248+
log.WithError(err).Error("write /etc/motd failed")
249+
}
250+
}

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ func startSSHServer(ctx context.Context, cfg *Config, wg *sync.WaitGroup, childP
12351235
return
12361236
}
12371237
configureSSHDefaultDir(cfg)
1238+
configureSSHMessageOfTheDay()
12381239
err = ssh.listenAndServe()
12391240
if err != nil {
12401241
log.WithError(err).Error("err starting SSH server")

0 commit comments

Comments
 (0)