Use PanelDomain in help texts
This commit is contained in:
parent
6b3460c702
commit
9a3e508ce8
4 changed files with 12 additions and 9 deletions
|
|
@ -41,7 +41,8 @@ type HTTPConfig struct {
|
|||
PhpMyAdmin validators.NullableBool `yaml:"phpmyadmin" validate:"bool" default:"false"`
|
||||
}
|
||||
|
||||
func (hcfg HTTPConfig) PublicTopDomain() string {
|
||||
// PanelDomain is the domain name where the control panel runs.
|
||||
func (hcfg HTTPConfig) PanelDomain() string {
|
||||
// if we have panel domain enabled, then return it
|
||||
if hcfg.Panel.Set && hcfg.Panel.Value {
|
||||
return hcfg.PrimaryDomain
|
||||
|
|
@ -81,7 +82,7 @@ func (hcfg HTTPConfig) optionalURL(domain string, enabled validators.NullableBoo
|
|||
func (hcfg HTTPConfig) JoinPath(elem ...string) *url.URL {
|
||||
u := url.URL{
|
||||
Scheme: "http",
|
||||
Host: hcfg.PublicTopDomain(),
|
||||
Host: hcfg.PanelDomain(),
|
||||
Path: "/",
|
||||
}
|
||||
if hcfg.HTTPSEnabled() {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ type SSHTemplateContext struct {
|
|||
Keys []models.Keys
|
||||
|
||||
Domain string // domain name of the distillery
|
||||
PanelDomain string // domain name of the panel
|
||||
Port uint16 // public port of the distillery ssh servers
|
||||
|
||||
Slug string // slug of the wisski
|
||||
|
|
@ -62,7 +63,8 @@ func (panel *UserPanel) sshRoute(ctx context.Context) http.Handler {
|
|||
return sc, err
|
||||
}
|
||||
|
||||
sc.Domain = panel.Config.HTTP.PublicTopDomain()
|
||||
sc.Domain = panel.Config.HTTP.PrimaryDomain
|
||||
sc.PanelDomain = panel.Config.HTTP.PanelDomain()
|
||||
sc.Port = panel.Config.Listen.SSHPort
|
||||
|
||||
// pick the first domain that the user has access to as an example
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
From a Linux (or Mac, or Windows 11) command line you may use:
|
||||
</p>
|
||||
<code class="copy">
|
||||
ssh -J {{ .Domain }}:{{ .Port }} www-data@{{ .Hostname }}
|
||||
ssh -J {{ .PanelDomain }}:{{ .Port }} www-data@{{ .Hostname }}
|
||||
</code>
|
||||
<p>
|
||||
You may also place the following into your <code>$HOME/.ssh/config</code> file:
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
User www-data
|
||||
Host {{ .Domain }}.proxy
|
||||
User www-data
|
||||
Hostname {{ .Domain }}
|
||||
Hostname {{ .PanelDomain }}
|
||||
Port {{ .Port }}
|
||||
</pre>
|
||||
</code>
|
||||
|
|
@ -110,7 +110,7 @@ Host {{ .Domain }}.proxy
|
|||
</p>
|
||||
<code class="copy">
|
||||
<pre>
|
||||
ssh -p {{ .Port }} {{ .Domain }} -L 7200:triplestore:7200
|
||||
ssh -p {{ .Port }} {{ .PanelDomain }} -L 7200:triplestore:7200
|
||||
</pre>
|
||||
</code>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ func (ssh2 *SSH2) handleConnection(session ssh.Session) {
|
|||
{"${SLUG}", slug},
|
||||
{"${HOSTNAME}", slug + "." + ssh2.Config.HTTP.PrimaryDomain},
|
||||
|
||||
{"${DOMAIN}", ssh2.Config.HTTP.PublicTopDomain()},
|
||||
{"${DOMAIN}", ssh2.Config.HTTP.PanelDomain()},
|
||||
{"${PORT}", strconv.FormatUint(uint64(ssh2.Config.Listen.SSHPort), 10)},
|
||||
|
||||
{"${HELP_URL}", ssh2.Config.HTTP.JoinPath("user", "ssh").String()},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue