ssh: Update help page and allow service forwarding

This commit is contained in:
Tom Wiesing 2023-04-12 13:42:27 +02:00
parent eacd59bb1b
commit 85c63f24a9
No known key found for this signature in database
9 changed files with 166 additions and 41 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/assets"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/templating"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/ssh2"
"github.com/FAU-CDI/wisski-distillery/internal/models"
"github.com/gliderlabs/ssh"
"github.com/rs/zerolog"
@ -38,6 +39,9 @@ type SSHTemplateContext struct {
Slug string // slug of the wisski
Hostname string // hostname of an example wisski
// Services are the special services reachable via ssh
Services []ssh2.Intercept
}
func (panel *UserPanel) sshRoute(ctx context.Context) http.Handler {
@ -75,6 +79,8 @@ func (panel *UserPanel) sshRoute(ctx context.Context) http.Handler {
return sc, err
}
sc.Services = panel.Dependencies.SSH2.Intercepts()
return sc, nil
})
}