mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Allow SSH server port to be configured at runtime
This commit is contained in:
parent
95f961ba58
commit
05aeec0e9b
@ -17,7 +17,8 @@ import (
|
||||
)
|
||||
|
||||
type BoringProxyConfig struct {
|
||||
WebUiDomain string `json:"webui_domain"`
|
||||
WebUiDomain string `json:"webui_domain"`
|
||||
SshServerPort int `json:"ssh_server_port"`
|
||||
}
|
||||
|
||||
type SmtpConfig struct {
|
||||
@ -36,6 +37,7 @@ type BoringProxy struct {
|
||||
func Listen() {
|
||||
flagSet := flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
||||
adminDomain := flagSet.String("admin-domain", "", "Admin Domain")
|
||||
sshServerPort := flagSet.Int("ssh-server-port", 22, "SSH Server Port")
|
||||
flagSet.Parse(os.Args[2:])
|
||||
|
||||
webUiDomain := *adminDomain
|
||||
@ -47,7 +49,10 @@ func Listen() {
|
||||
webUiDomain = strings.TrimSpace(text)
|
||||
}
|
||||
|
||||
config := &BoringProxyConfig{WebUiDomain: webUiDomain}
|
||||
config := &BoringProxyConfig{
|
||||
WebUiDomain: webUiDomain,
|
||||
SshServerPort: *sshServerPort,
|
||||
}
|
||||
|
||||
certmagic.DefaultACME.DisableHTTPChallenge = true
|
||||
//certmagic.DefaultACME.DisableTLSALPNChallenge = true
|
||||
|
@ -83,7 +83,7 @@ func (m *TunnelManager) RequestCreateTunnel(tunReq Tunnel) (Tunnel, error) {
|
||||
}
|
||||
|
||||
tunReq.ServerAddress = m.config.WebUiDomain
|
||||
tunReq.ServerPort = 22
|
||||
tunReq.ServerPort = m.config.SshServerPort
|
||||
tunReq.ServerPublicKey = ""
|
||||
tunReq.Username = m.user.Username
|
||||
tunReq.TunnelPort = port
|
||||
|
Loading…
Reference in New Issue
Block a user