Browse Source

Pass session environment variables to command

master v0.1.1
Trevor Slocum 2 years ago
parent
commit
6c5d6ee83e
  1. 3
      CHANGELOG
  2. 3
      CONFIGURATION.md
  3. 1
      pkg/gate/portal.go

3
CHANGELOG

@ -1,2 +1,5 @@
0.1.1:
- Pass session environment variables to command
0.1.0:
- Initial release

3
CONFIGURATION.md

@ -26,8 +26,9 @@ portals:
command: ps -aux
host:
- localhost:19003
- :19004 # Expose port 19004 to the internet
system monitor:
command: htop
host:
- localhost:19004
- localhost:19005
```

1
pkg/gate/portal.go

@ -61,6 +61,7 @@ func NewPortal(name string, address string, command []string) (*Portal, error) {
}
cmd := exec.CommandContext(cmdCtx, command[0], args...)
cmd.Env = sshSession.Environ()
cmd.Env = append(cmd.Env, fmt.Sprintf("TERM=%s", ptyReq.Term))
f, err := pty.Start(cmd)

Loading…
Cancel
Save