Skip to content

Commit 47a0941

Browse files
mustard-mhroboquat
authored andcommitted
[supervisor] welcome message for ssh conn
1 parent aae154b commit 47a0941

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

components/supervisor/pkg/supervisor/ssh.go

Lines changed: 19 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,21 @@ 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. Try the following commands to get started:
235+
236+
gp tasks list List all your defined tasks in .gitpod.yml
237+
gp tasks attach Attach your terminal to a workspace task
238+
239+
gp ports list Lists workspace ports and their states
240+
gp stop Stop current workspace
241+
gp help To learn about the gp CLI commands
242+
243+
For more information, see the Gitpod documentation: https://gitpod.io/docs
244+
`)
245+
246+
if err := ioutil.WriteFile("/etc/motd", msg, 0o644); err != nil {
247+
log.WithError(err).Error("write /etc/motd failed")
248+
}
249+
}

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)