Documentation
¶
Overview ¶
Package server provides a custom SSH Git server implementation. This implementation uses golang.org/x/crypto/ssh directly for better control over the Git protocol and to avoid "remote end hung up unexpectedly" errors.
Package server provides SSH server implementation for Git operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitSSHConfig ¶
type GitSSHConfig struct {
Port int // SSH server port
HostKeyPath string // Path to SSH host key file
Logger zerolog.Logger // Logger for SSH operations
Storage storage.GitRepositoryStorage // Storage backend for repositories
// contains filtered or unexported fields
}
GitSSHConfig holds configuration for the custom Git SSH server. This replaces the old SSHConfig that used gliderlabs/ssh.
func (*GitSSHConfig) Configure ¶
func (c *GitSSHConfig) Configure() error
Configure sets up the custom Git SSH server.
func (*GitSSHConfig) NewServer ¶
func (c *GitSSHConfig) NewServer() error
NewServer starts the custom Git SSH server.
func (*GitSSHConfig) Shutdown ¶
func (c *GitSSHConfig) Shutdown() error
Shutdown gracefully stops the Git SSH server.
type GitSSHServer ¶
type GitSSHServer struct {
Port string // SSH server port (e.g., ":2222")
Logger zerolog.Logger // Logger for SSH operations
Storage storage.GitRepositoryStorage // Storage backend for repositories
HostKeyPath string // Path to SSH host key file
// contains filtered or unexported fields
}
Unlike generic SSH servers, this implementation handles the Git protocol directly.
func (*GitSSHServer) Configure ¶
func (s *GitSSHServer) Configure() error
Configure sets up the SSH server with proper Git protocol handling.
func (*GitSSHServer) Start ¶
func (s *GitSSHServer) Start() error
Start begins listening for SSH connections and handles Git operations.
func (*GitSSHServer) Stop ¶
func (s *GitSSHServer) Stop() error
Stop gracefully stops the SSH server.
type HttpConfig ¶
type HttpConfig struct {
Port int
HttpLogs bool
Fiber *fiber.App
Logger z.Logger
Storage storage.GitRepositoryStorage
}
func (*HttpConfig) Configure ¶
func (c *HttpConfig) Configure()
func (*HttpConfig) NewServer ¶
func (c *HttpConfig) NewServer() error
func (*HttpConfig) Shutdown ¶
func (c *HttpConfig) Shutdown() error
Shutdown gracefully shuts down the HTTP server
type SSHConfig ¶
type SSHConfig struct {
Port string // SSH server port (e.g., ":2222")
Logger zerolog.Logger // Logger for SSH operations
Storage storage.GitRepositoryStorage // Storage backend for repositories
Server *gliderssh.Server // The underlying SSH server instance
HostKeyPath string // Path to SSH host key file
}
SSHConfig holds configuration for the SSH server. It manages Git SSH protocol operations including authentication, repository access, and Git command execution.
func (*SSHConfig) Configure ¶
Configure sets up the SSH server with authentication handlers and Git command processing. It generates or loads the SSH host key and configures the server to handle Git operations.