Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MountOn ¶ added in v1.4.0
func MountOn(app *fiber.App, prefix string, cfg *ServerConfig) error
MountOn registers the WebUI routes on an existing Fiber app at the given path prefix. This allows hosting the WebUI on the same port as another service (e.g. the S3 API server). The prefix must start with "/" and must not be empty or just "/".
Types ¶
type Option ¶
type Option func(*Server)
Option sets various options for NewServer()
func WithClientIPHeader ¶ added in v1.10.0
WithClientIPHeader records the client address from the named proxy header in the standalone WebUI request log. The accepted values are clientip.ClientIPHeaderForwardedFor and clientip.ClientIPHeaderRealIP; an empty value (the default) keeps the socket peer address. The header is only honoured from a peer listed in WithTrustedProxies. When the WebUI is mounted on another server's port (MountOn), that server's settings apply instead.
func WithPathPrefix ¶ added in v1.4.0
WithPathPrefix mounts the entire web UI under the given path prefix
func WithSocketPerm ¶ added in v1.4.1
WithSocketPerm sets the file-mode permissions applied to file-backed UNIX domain sockets after binding. It has no effect on TCP/IP or abstract namespace sockets.
func WithTrustedProxies ¶ added in v1.10.0
func WithTrustedProxies(trusted clientip.TrustedProxies) Option
WithTrustedProxies sets the peers whose client IP header is trusted, as parsed by clientip.ParseTrustedProxies. It only has an effect together with WithClientIPHeader.
type Server ¶
type Server struct {
CertStorage *netutil.CertStorage
// contains filtered or unexported fields
}
Server is the main GUI server
func NewServer ¶
func NewServer(cfg *ServerConfig, opts ...Option) (*Server, error)
NewServer creates a new GUI server instance
func (*Server) ServeMultiPort ¶ added in v1.3.0
ServeMultiPort creates listeners for multiple address specifications and serves on all of them simultaneously. This supports listening on multiple addresses.
type ServerConfig ¶
type ServerConfig struct {
Gateways []string // S3 API gateways
AdminGateways []string // Admin API gateways (defaults to Gateways if empty)
// IAMGateways are standalone IAM service (versitygw iam) endpoints, used
// to seed the WebUI's optional IAM endpoint field. Unlike AdminGateways
// there is no fallback to Gateways: the IAM service is a separate
// process, so empty means "no IAM endpoint to offer".
IAMGateways []string
Region string
CORSOrigin string
}
ServerConfig holds the server configuration