Skip to content

Commit

Permalink
(docs) Add info logs for exit cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
agrim123 committed Dec 22, 2020
1 parent 4c6261f commit 9e2b5ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ Gatekeeper provides basic authentication, authorization and notifier (default is

Checkout usage of gatekeeper [here](https://github.com/agrim123/gatekeeper-cli).

A sample run of gatekeeper
```bash
$ gatekeeper run-plan service1 shell
[SUCCESS] | Authenticated as agrim
[SUCCESS] | Authorized `agrim` to perform `service1 shell`
[INFO] | Executing plan: service1 shell
[INFO] | Spawning shell for <user>@<host>
[INFO] 🔐 | Reading private key
<spawned shell>
```

### Future prospects

Gatekeeper is not limited to only providing shell access, it can used to run deploy commands, as a proxy intermediary, currently the config is entirely file based but can be extended to a database for easy updates and more observability, can be used to run restricted commands on the local system which otherwise unprivileged user cannot run and many more.
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/services/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (r *Remote) SpawnShell() error {
// Ctrl-C exists the shell
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func(session *ssh.Session) {
logger.Info("Started shell. Press %s to exit", logger.Bold("Ctrl+C"))
<-c
logger.Info("Ctrl+C pressed. Exiting remote shell")
session.Signal(ssh.SIGTERM)
Expand Down

0 comments on commit 9e2b5ce

Please sign in to comment.