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