From 92504f4130e95b897225574b4c6dc5cc57c047af Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Mon, 29 Jul 2024 19:16:48 +0200 Subject: [PATCH] Split up the main page into different parts. --- cmd/templaterender/render.go | 9 +++-- pkg/templates/about.templ | 64 +++++++++++++++++------------------ pkg/templates/downloads.templ | 2 +- pkg/templates/index.templ | 4 +-- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/cmd/templaterender/render.go b/cmd/templaterender/render.go index b63f5ad..54dd66e 100644 --- a/cmd/templaterender/render.go +++ b/cmd/templaterender/render.go @@ -4,6 +4,7 @@ import ( "context" "converge/pkg/templates" "github.com/a-h/templ" + "log" "os" "path/filepath" ) @@ -23,17 +24,21 @@ type Rendering struct { func render(dir string, name string, params Params, render RenderFunc) { fname := filepath.Join(dir, name) + log.Printf("Writing to %s", fname) f, err := os.Create(fname) if err != nil { panic(err) } defer f.Close() - render(params.secure, params.host, params.username).Render(context.Background(), f) + err = render(params.secure, params.host, params.username).Render(context.Background(), f) + if err != nil { + panic(err) + } } func main() { - dir := "html" + dir := "html/docs" params := Params{ secure: "s", diff --git a/pkg/templates/about.templ b/pkg/templates/about.templ index dfe830f..951b0e8 100644 --- a/pkg/templates/about.templ +++ b/pkg/templates/about.templ @@ -3,42 +3,42 @@ package templates templ About() {

About

-

- Converge is a utility for troubleshooting builds on continuous integration servers. - It solves a common problem where the cause of job failure is difficult to determine. - This is complicated further by the fact that build jobs are usually run on a build - farm where there is no access to the build agents or in more modern envrionments when - jobs are run in ephemeral containers. -

+

+ Converge is a utility for troubleshooting builds on continuous integration servers. + It solves a common problem where the cause of job failure is difficult to determine. + This is complicated further by the fact that build jobs are usually run on a build + farm where there is no access to the build agents or in more modern envrionments when + jobs are run in ephemeral containers. +

-

- With Converge it is possible to get remote shell access to such jobs. This works - by configuring the build job to connect to a Converge server using an agent program. - The agent program can be downloaded from within the CI job using curl or wget. - Next, an end-user can connect to the Converge server, a rendez-vous server, that connects - the client and server together. -

+

+ With Converge it is possible to get remote shell access to such jobs. This works + by configuring the build job to connect to a Converge server using an agent program. + The agent program can be downloaded from within the CI job using curl or wget. + Next, an end-user can connect to the Converge server, a rendez-vous server, that connects + the client and server together. +

-

- The setup is such that the connection from client (end-user) to server (agent on CI job) - is end-to-end encrypted. The Converge server itself is no more than a bitpipe which pumps - data between client and agent. -

+

+ The setup is such that the connection from client (end-user) to server (agent on CI job) + is end-to-end encrypted. The Converge server itself is no more than a bitpipe which pumps + data between client and agent. +

-

- Both ssh and sftp are supported. Multiple shells are also allowed. -

+

+ Both ssh and sftp are supported. Multiple shells are also allowed. +

-

- There is a timeout mechanism in the agent such that jobs do not hang indefinitely - waiting for a connection. This mechanism is useful to make sure build agents do not keep - build agents occupied for a long time. By default, the agent exits with status 0 when - the first client exits after logging in. This behavior as well as general expiry can be - controlled from within a shell session by touching a .hold file. After logging in, the - user can control expiry of the session as instructed by messages in the ssh session. - When the timeout of a session is near the user is informed about this with messages - in the shell. -

+

+ There is a timeout mechanism in the agent such that jobs do not hang indefinitely + waiting for a connection. This mechanism is useful to make sure build agents do not keep + build agents occupied for a long time. By default, the agent exits with status 0 when + the first client exits after logging in. This behavior as well as general expiry can be + controlled from within a shell session by touching a .hold file. After logging in, the + user can control expiry of the session as instructed by messages in the ssh session. + When the timeout of a session is near the user is informed about this with messages + in the shell. +

} diff --git a/pkg/templates/downloads.templ b/pkg/templates/downloads.templ index fcc7b94..f6b5e8f 100644 --- a/pkg/templates/downloads.templ +++ b/pkg/templates/downloads.templ @@ -18,7 +18,7 @@ templ Downloads() { agent The agent to run inside aa CI job - agent + agent agent.exe diff --git a/pkg/templates/index.templ b/pkg/templates/index.templ index d9c1a71..d72f33d 100644 --- a/pkg/templates/index.templ +++ b/pkg/templates/index.templ @@ -5,14 +5,14 @@ templ Index(secure string, host string, username string) { - Converge -