internal/dis/component/ssh: Shorten help text
This commit is contained in:
parent
ed00ef7aff
commit
0c888eab1c
2 changed files with 22 additions and 41 deletions
|
|
@ -2,6 +2,7 @@ package config
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/tkw1536/pkglib/collection"
|
||||
|
|
@ -23,6 +24,20 @@ type HTTPConfig struct {
|
|||
CertbotEmail string `yaml:"certbot_email" validate:"email"`
|
||||
}
|
||||
|
||||
// JoinPath returns the root public url joined with the provided parts.
|
||||
func (hcfg HTTPConfig) JoinPath(elem ...string) *url.URL {
|
||||
u := url.URL{
|
||||
Scheme: "http",
|
||||
Host: hcfg.PrimaryDomain,
|
||||
Path: "/",
|
||||
}
|
||||
if hcfg.HTTPSEnabled() {
|
||||
u.Scheme = "https"
|
||||
}
|
||||
|
||||
return u.JoinPath(elem...)
|
||||
}
|
||||
|
||||
// TCPMuxCommand generates a command line for the sslh executable.
|
||||
func (hcfg HTTPConfig) TCPMuxCommand(addr string, http string, https string, ssh string) string {
|
||||
if hcfg.HTTPSEnabled() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue