Documentation ¶
Index ¶
- func Listen()
- func MakeSSHKeyPair() (string, string, error)
- type AlertData
- type Api
- func (a *Api) CreateToken(tokenData TokenData, params url.Values) (string, error)
- func (a *Api) CreateTunnel(tokenData TokenData, params url.Values) (*Tunnel, error)
- func (a *Api) CreateUser(tokenData TokenData, params url.Values) error
- func (a *Api) DeleteClient(tokenData TokenData, ownerId, clientId string) error
- func (a *Api) DeleteSshKey(tokenData TokenData, params url.Values) error
- func (a *Api) DeleteToken(tokenData TokenData, params url.Values) error
- func (a *Api) DeleteTunnel(tokenData TokenData, params url.Values) error
- func (a *Api) DeleteUser(tokenData TokenData, params url.Values) error
- func (a *Api) GetSshKeys(tokenData TokenData) map[string]SshKey
- func (a *Api) GetTunnel(tokenData TokenData, params url.Values) (Tunnel, error)
- func (a *Api) GetTunnels(tokenData TokenData) map[string]Tunnel
- func (a *Api) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *Api) SetClient(tokenData TokenData, params url.Values, ownerId, clientId string) error
- type Auth
- type Client
- type ClientConfig
- type Config
- type ConfirmData
- type Database
- func (d *Database) AddSshKey(id string, key SshKey) error
- func (d *Database) AddToken(owner string) (string, error)
- func (d *Database) AddUser(username string, isAdmin bool) error
- func (d *Database) DeleteSshKey(id string)
- func (d *Database) DeleteTokenData(token string)
- func (d *Database) DeleteTunnel(domain string)
- func (d *Database) DeleteUser(username string)
- func (d *Database) GetSshKey(id string) (SshKey, bool)
- func (d *Database) GetSshKeys() map[string]SshKey
- func (d *Database) GetTokenData(token string) (TokenData, bool)
- func (d *Database) GetTokens() map[string]TokenData
- func (d *Database) GetTunnel(domain string) (Tunnel, bool)
- func (d *Database) GetTunnels() map[string]Tunnel
- func (d *Database) GetUser(username string) (User, bool)
- func (d *Database) GetUsers() map[string]User
- func (d *Database) SetTokenData(token string, tokenData TokenData)
- func (d *Database) SetTunnel(domain string, tun Tunnel)
- func (d *Database) SetUser(username string, user User) error
- type DbClient
- type HeadData
- type IndexData
- type LoadingData
- type LoginData
- type LoginRequest
- type MenuData
- type PassthroughListener
- type ProxyConn
- func (c ProxyConn) Close() error
- func (c ProxyConn) CloseWrite() error
- func (c ProxyConn) LocalAddr() net.Addr
- func (c ProxyConn) Read(p []byte) (int, error)
- func (c ProxyConn) RemoteAddr() net.Addr
- func (c ProxyConn) SetDeadline(t time.Time) error
- func (c ProxyConn) SetReadDeadline(t time.Time) error
- func (c ProxyConn) SetWriteDeadline(t time.Time) error
- func (c ProxyConn) Write(p []byte) (int, error)
- type ReqResult
- type Server
- type SmtpConfig
- type SshKey
- type TokenData
- type TokensData
- type Tunnel
- type TunnelManager
- type TunnelsData
- type User
- type UsersData
- type WebUiHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeSSHKeyPair ¶
Adapted from https://stackoverflow.com/a/34347463/943814 MakeSSHKeyPair make a pair of public and private keys for SSH access. Public key is encoded in the format for inclusion in an OpenSSH authorized_keys file. Private Key generated is PEM encoded
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) CreateToken ¶
func (*Api) CreateTunnel ¶
func (*Api) DeleteClient ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Authorized ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config *ClientConfig) (*Client, error)
type ClientConfig ¶
type ClientConfig struct { ServerAddr string `json:"serverAddr,omitempty"` Token string `json:"token,omitempty"` ClientName string `json:"clientName,omitempty"` User string `json:"user,omitempty"` CertDir string `json:"certDir,omitempty"` AcmeEmail string `json:"acmeEmail,omitempty"` DnsServer string `json:"dnsServer,omitempty"` }
type ConfirmData ¶
type Database ¶
type Database struct { Tokens map[string]TokenData `json:"tokens"` Tunnels map[string]Tunnel `json:"tunnels"` Users map[string]User `json:"users"` SshKeys map[string]SshKey `json:"ssh_keys"` // contains filtered or unexported fields }
func NewDatabase ¶
func (*Database) DeleteSshKey ¶
func (*Database) DeleteTokenData ¶
func (*Database) DeleteTunnel ¶
func (*Database) DeleteUser ¶
func (*Database) GetSshKeys ¶
func (*Database) GetTunnels ¶
func (*Database) SetTokenData ¶
type LoadingData ¶
type LoginRequest ¶
type LoginRequest struct {
Email string
}
type PassthroughListener ¶
type PassthroughListener struct {
// contains filtered or unexported fields
}
func NewPassthroughListener ¶
func NewPassthroughListener() *PassthroughListener
func (*PassthroughListener) Addr ¶
func (f *PassthroughListener) Addr() net.Addr
func (*PassthroughListener) Close ¶
func (f *PassthroughListener) Close() error
func (*PassthroughListener) PassConn ¶
func (f *PassthroughListener) PassConn(conn net.Conn)
type ProxyConn ¶
type ProxyConn struct {
// contains filtered or unexported fields
}
This type creates a new net.Conn that's the same as an old one, except a new reader is provided. So it proxies every method except Read. I'm sure there's a cleaner way to do this...
func (ProxyConn) Close ¶
TODO: is this safe? Will it actually close properly, or does it need to be connected to the reader somehow?
func (ProxyConn) CloseWrite ¶
func (ProxyConn) RemoteAddr ¶
type TokensData ¶
type Tunnel ¶
type Tunnel struct { Owner string `json:"owner"` Domain string `json:"domain"` SshKey string `json:"ssh_key"` ServerAddress string `json:"server_address"` ServerPort int `json:"server_port"` ServerPublicKey string `json:"server_public_key"` Username string `json:"username"` TunnelPort int `json:"tunnel_port"` TunnelPrivateKey string `json:"tunnel_private_key"` ClientName string `json:"client_name"` ClientAddress string `json:"client_address"` ClientPort int `json:"client_port"` AllowExternalTcp bool `json:"allow_external_tcp"` AuthUsername string `json:"auth_username"` AuthPassword string `json:"auth_password"` CssId string `json:"css_id"` TlsTermination string `json:"tls_termination"` }
type TunnelManager ¶
type TunnelManager struct {
// contains filtered or unexported fields
}
func NewTunnelManager ¶
func NewTunnelManager(config *Config, db *Database, certConfig *certmagic.Config) *TunnelManager
func (*TunnelManager) DeleteTunnel ¶
func (m *TunnelManager) DeleteTunnel(domain string) error
func (*TunnelManager) GetTunnels ¶
func (m *TunnelManager) GetTunnels() map[string]Tunnel
func (*TunnelManager) RequestCreateTunnel ¶
func (m *TunnelManager) RequestCreateTunnel(tunReq Tunnel) (Tunnel, error)
type WebUiHandler ¶
type WebUiHandler struct {
// contains filtered or unexported fields
}
func NewWebUiHandler ¶
func NewWebUiHandler(config *Config, db *Database, api *Api, auth *Auth, tunMan *TunnelManager) *WebUiHandler
Source Files ¶
Click to show internal directories.
Click to hide internal directories.