internal/dis/component/ssh: Shorten help text

This commit is contained in:
Tom Wiesing 2023-03-15 11:26:03 +01:00
parent ed00ef7aff
commit 0c888eab1c
No known key found for this signature in database
2 changed files with 22 additions and 41 deletions

View file

@ -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() {