Skip to content

Commit c895557

Browse files
committed
install: make sure runtime configuration is ok (host privkey exists)
1 parent f166c96 commit c895557

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/function22/helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ func installEntrypoint() *cobra.Command {
2525
Args: cobra.NoArgs,
2626
Run: func(_ *cobra.Command, _ []string) {
2727
osutil.ExitIfError(func() error {
28+
hostKeyExists, err := osutil.Exists(defaultHostKeyFile)
29+
if err != nil {
30+
return err
31+
}
32+
33+
if !hostKeyExists { // pro-tip
34+
return errors.New("host key doesn't exist. create it by running $ " + os.Args[0] + " host-key-generate")
35+
}
36+
2837
if allowedUsers == "" {
2938
return errors.New("you need to specify allowed-users")
3039
}

0 commit comments

Comments
 (0)