Skip to content

Commit

Permalink
install: make sure runtime configuration is ok (host privkey exists)
Browse files Browse the repository at this point in the history
  • Loading branch information
joonas-fi committed Dec 25, 2021
1 parent f166c96 commit c895557
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/function22/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ func installEntrypoint() *cobra.Command {
Args: cobra.NoArgs,
Run: func(_ *cobra.Command, _ []string) {
osutil.ExitIfError(func() error {
hostKeyExists, err := osutil.Exists(defaultHostKeyFile)
if err != nil {
return err
}

if !hostKeyExists { // pro-tip
return errors.New("host key doesn't exist. create it by running $ " + os.Args[0] + " host-key-generate")
}

if allowedUsers == "" {
return errors.New("you need to specify allowed-users")
}
Expand Down

0 comments on commit c895557

Please sign in to comment.