Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcmeConfig ¶
type AcmeConfig struct {
// directory to save the certificates, le_certs default
CacheDir string `mapstructure:"cache_dir"`
// User email, mandatory
Email string `mapstructure:"email"`
// supported values: http-01, tlsalpn-01
ChallengeType string `mapstructure:"challenge_type"`
// The alternate port to use for the ACME HTTP challenge
AltHTTPPort int `mapstructure:"alt_http_port"`
// The alternate port to use for the ACME TLS-ALPN
AltTLSALPNPort int `mapstructure:"alt_tlsalpn_port"`
// Use LE production endpoint or staging
UseProductionEndpoint bool `mapstructure:"use_production_endpoint"`
// Domains to obtain certificates
Domains []string `mapstructure:"domains"`
}
func (*AcmeConfig) InitDefaults ¶
func (ac *AcmeConfig) InitDefaults() error
type Cidrs ¶
Cidrs is a slice of IPNet addresses
func ParseCIDRs ¶
ParseCIDRs parse IPNet addresses and return slice of its
type FCGI ¶
type FCGI struct {
// Address and port to handle as http server.
Address string
}
FCGI for FastCGI server.
type HTTP ¶
type HTTP struct {
// Host and port to handle as http server.
Address string `mapstructure:"address"`
// AccessLogs turn on/off, logged at Info log level, default: false
AccessLogs bool `mapstructure:"access_logs"`
// Pool configures worker pool.
Pool *pool.Config `mapstructure:"pool"`
// InternalErrorCode used to override default 500 (InternalServerError) http code
InternalErrorCode uint64 `mapstructure:"internal_error_code"`
// SSLConfig defines https server options.
SSLConfig *SSL `mapstructure:"ssl"`
// FCGIConfig configuration. You can use FastCGI without HTTP server.
FCGIConfig *FCGI `mapstructure:"fcgi"`
// HTTP2Config configuration
HTTP2Config *HTTP2 `mapstructure:"http2"`
// Uploads configures uploads configuration.
Uploads *Uploads `mapstructure:"uploads"`
// MaxRequestSize specified max size for payload body in megabytes, set 0 to unlimited.
MaxRequestSize uint64 `mapstructure:"max_request_size"`
// TrustedSubnets declare IP subnets which are allowed to set ip using X-Real-Ip and X-Forwarded-For
TrustedSubnets []string `mapstructure:"trusted_subnets"`
// Env is environment variables passed to the http pool
Env map[string]string
// List of the middleware names (order will be preserved)
Middleware []string
// slice of net.IPNet
Cidrs Cidrs
}
HTTP configures RoadRunner HTTP server.
func (*HTTP) EnableACME ¶
func (*HTTP) EnableFCGI ¶
EnableFCGI is true when FastCGI server must be enabled.
func (*HTTP) EnableHTTP ¶
EnableHTTP is true when http server must run.
func (*HTTP) InitDefaults ¶
InitDefaults must populate HTTP values using given HTTP source. Must return error if HTTP is not valid.
type HTTP2 ¶
type HTTP2 struct {
// H2C enables HTTP/2 over TCP
H2C bool
// MaxConcurrentStreams defaults to 128.
MaxConcurrentStreams uint32 `mapstructure:"max_concurrent_streams"`
}
HTTP2 HTTP/2 server customizations.
func (*HTTP2) InitDefaults ¶
InitDefaults sets default values for HTTP/2 configuration.
type SSL ¶
type SSL struct {
// Address to listen as HTTPS server, defaults to 0.0.0.0:443.
Address string
// ACME configuration
Acme *AcmeConfig `mapstructure:"acme"`
// Redirect when enabled forces all http connections to switch to https.
Redirect bool
// Key defined private server key.
Key string
// Cert is https certificate.
Cert string
// Root CA file
RootCA string `mapstructure:"root_ca"`
Port int
// contains filtered or unexported fields
}
SSL defines https server configuration.
func (*SSL) InitDefaults ¶
type Uploads ¶
type Uploads struct {
// Dir contains name of directory to control access to.
Dir string `mapstructure:"dir"`
// Forbid specifies list of file extensions which are forbidden for access.
// Example: .php, .exe, .bat, .htaccess and etc.
Forbid []string `mapstructure:"forbid"`
// Allowed files
Allow []string `mapstructure:"allow"`
// internal
Forbidden map[string]struct{} `mapstructure:"-"`
Allowed map[string]struct{} `mapstructure:"-"`
}
Uploads describes file location and controls access to them.
func (*Uploads) InitDefaults ¶
InitDefaults sets missing values to their default values.
Click to show internal directories.
Click to hide internal directories.