diff --git a/cmd/templaterender/render.go b/cmd/templaterender/render.go index 55b0bf9..a414ea7 100644 --- a/cmd/templaterender/render.go +++ b/cmd/templaterender/render.go @@ -51,9 +51,21 @@ func main() { return templates2.UsageTab(access) } + usageInputs := templates2.UsageInputs{ + Id: "myid", + SshKeys: []string{"a", "b"}, + ErrorMessages: []string{}, + RemoteShells: map[string]bool{templates2.POWERSHELL: true}, + LocalShells: nil, + } + shellUsage := func() templ.Component { + return templates2.ShellUsageTab(access, usageInputs) + } + render(dir, "fullindex.html", fullindex) render(dir, "index.html", templates2.AboutTab) render(dir, "usage.html", usage) + render(dir, "shellusage.html", shellUsage) render(dir, "downloads.html", templates2.Downloads) render(dir, "sessions-none.html", func() templ.Component { diff --git a/pkg/server/templates/basepage.templ b/pkg/server/templates/basepage.templ index d0cb04d..57a7d15 100644 --- a/pkg/server/templates/basepage.templ +++ b/pkg/server/templates/basepage.templ @@ -16,10 +16,13 @@ templ BasePage(tab int) { + + +
This is what you run on a remote server, typically in your continuous integration job.
if usageInputs.RemoteShells[BASH] { -{addSshKeys(BASH, usageInputs.SshKeys)} - curl --fail-with-body http{access.Secure}://{access.BaseUrl}/downloads/agent > agent{` - chmod 755 agent - `}./agent --id {usageInputs.Id} ws{access.Secure}://{access.BaseUrl}{` - rm -f agent - `}+
{addSshKeys(CMD, usageInputs.SshKeys)} - curl --fail-with-body http{access.Secure}://{access.BaseUrl}/downloads/agent.exe > agent.exe{` - `}agent --id {usageInputs.Id} ws{access.Secure}://{access.BaseUrl}{` - del agent.exe - `}+
{addSshKeys(POWERSHELL, usageInputs.SshKeys)} - curl --fail-with-body http{access.Secure}://{access.BaseUrl}/downloads/agent.exe > agent.exe{` - `}agent --id {usageInputs.Id} ws{access.Secure}://{access.BaseUrl}{` - del agent.exe - `}+
@@ -61,10 +60,13 @@ templ AgentUsage(access models.ConvergeAccess, usageInputs UsageInputs) { by the same user that started the agent.
-{` - `}ssh -oServerAliveInterval=10 -oProxyCommand="wsproxy ws{access.Secure}://{access.BaseUrl}/client/{usageInputs.Id}" { access.Username }{"@localhost"} {` - `}sftp -oServerAliveInterval=10 -oProxyCommand="wsproxy ws{access.Secure}://{access.BaseUrl}/client/{usageInputs.Id}" { access.Username }{"@localhost"} {` - `}+
This requires the wsproxy
utility which is available in the
downloads section. This utility must be downloaded
@@ -76,49 +78,44 @@ templ AgentUsage(access models.ConvergeAccess, usageInputs UsageInputs) {
way to connect. In this method, a local port forwarder is started that forwards a local port
to the webserver. Then you can start an ssh client that connects to the local tcp port.
{` - `}ssh -oServerAliveInterval=10 -p 10000 { access.Username }{"@localhost"} {` - `}sftp -oServerAliveInterval=10 -p 10000 { access.Username }{"@localhost"} {` - `}+
This requires the tcptows
utility which is available in the
downloads section. The utility must be started beforehand
using:
{` - `}tcptows ws{access.Secure}://{access.BaseUrl}/client/{usageInputs.Id} {` - `}tcptows ws{access.Secure}://{access.BaseUrl}/client/{usageInputs.Id} {` - `}+
{` - # cd back to the agent directory - cd $agentdir - - # prevent logout when last user exits - touch $agentdir/.hold - `}+
{` - # cd back to the agent directory - cd %agentdir% - - # prevent logout when last user exits - echo > %agentdir%\.hold - `}+
{` - # cd back to the agent directory - cd $env:agentdir - - # prevent logout when last user exits - $null > $env:agentdir\.hold - `}+
@@ -145,6 +142,7 @@ templ Usage(access models.ConvergeAccess) {
" + this.innerHTML + "
"; + console.log("html=" + html); + this.innerHTML = html; + } +} + +customElements.define('code-sample', CodeSampleComponent); + diff --git a/static/js/custom.js b/static/js/custom.js new file mode 100644 index 0000000..06db985 --- /dev/null +++ b/static/js/custom.js @@ -0,0 +1,2 @@ + +import './copy-to-clipboard.js'; \ No newline at end of file