Documentation ¶
Overview ¶
Package doorway is the HTTP frontend on a shanhu instance.
Index ¶
Constants ¶
View Source
const HomeHost = "~"
HomeHost is the destination mapping that maps to doorway's internal administration server.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Server is the config for the http server. // This also includes the reverse proxy. Server *ServerConfig // TLSProxy is the configuration for the TLS proxy. TLSProxy *TLSProxyConfig // HTTPServer is the config for the http server part. HTTPServer *HTTPServerConfig // Local address to listen on. LocalAddr string Fabrics *FabricsConfig // Config for dialing fabrics. FabricsIdentity Identity // Identity for dialing fabrics. // Alternative fabrics dialer. FabricsDialer *fabdial.Dialer // TLSConfig is for the TLS config for serving the service via https. // If not specified, autocert from Letsencrypt will be used. TLSConfig *tls.Config // ListenDone is the callback function when listen is done. ListenDone func() }
Config is the config of a doorway.
func ConfigFromHome ¶
ConfigFromHome reads Config from the given directories.
type FabricsConfig ¶
type FabricsConfig struct { User string Host string `json:",omitempty"` // Default using fabrics.homedrive.io InsecurelyDialTo string `json:",omitempty"` }
FabricsConfig has the configuration for connecting HomeDrive Fabrics. This config is JSON marshallable.
type HTTPServerConfig ¶
type HTTPServerConfig struct { // Address to listen on. Addr string // When the host is an IP or a ".local" address, forward to this service. LocalMapping string }
HTTPServerConfig is the configuration for the http redirection service.
type Identity ¶
type Identity interface { // Load loads the identity private key. Returns errcode.NotFound error // if key is not yet provisioned. Load(ctx context.Context) ([]byte, error) }
Identity provides an identity for dialing fabrics.
func NewFileIdentity ¶
NewFileIdentity loads a private key from a file.
type ServerConfig ¶
type ServerConfig struct { HostMap map[string]string AutoCertCache autocert.Cache Home aries.Service ManualCerts map[string]*tls.Certificate IPWhitelist []string }
ServerConfig is the config for serving the reverse proxy server.
type TLSProxyConfig ¶
type TLSProxyConfig struct { // For these domains, forward the TCP connection directly. Forward map[string]string // Enables private mode. In private mode, unless listed // in PublicWhitelist, only connections for ACME ALPN challenges are // accepted. PrivateMode bool // Make these sites publicly accessible via fabrics. Public []string }
TLSProxyConfig is the configuration for the TLS proxy.
Click to show internal directories.
Click to hide internal directories.