Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureNginxAccess ¶ added in v1.4.0
EnsureNginxAccess adds the nginx worker user to the FeatherPanel system group and opens the root/data directories so nginx can traverse into server volumes.
Without this, FastDL returns 403/404 because volumes are created as 0700 owned by the featherpanel user while nginx runs as www-data (or nginx).
Returns true when a user was newly added to the group — the nginx process must be restarted (not only reloaded) for the new membership to apply.
func GenerateNginxConfig ¶
GenerateNginxConfig generates an nginx configuration file for FastDL based on enabled servers.
func HasFastDLEnabledServers ¶
HasFastDLEnabledServers checks if any servers have FastDL enabled.
func IsNginxInstalled ¶
func IsNginxInstalled() bool
IsNginxInstalled checks if nginx is installed and available on the system.
func RestartNginx ¶ added in v1.4.0
func RestartNginx() error
RestartNginx fully restarts nginx so new supplementary group memberships apply.
Types ¶
type FastDLHandler ¶
type FastDLHandler struct {
// contains filtered or unexported fields
}
FastDLHandler handles HTTP requests for the FastDL server.
func NewHandler ¶
func NewHandler(m *server.Manager, basePath string, cfg config.FastDLConfiguration) *FastDLHandler
NewHandler creates a new FastDL handler instance. NOTE: This is not used when FastDL uses nginx (which is the default). Kept for potential future use or if built-in server is re-enabled.
func (*FastDLHandler) ServeHTTP ¶
func (h *FastDLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles incoming HTTP requests.
type FastDLServer ¶
type FastDLServer struct {
BasePath string
ReadOnly bool
Listen string
Handler *FastDLHandler
// contains filtered or unexported fields
}
FastDLServer represents the FastDL HTTP server instance.
func New ¶
func New(m *server.Manager) *FastDLServer
New creates a new FastDL server instance. NOTE: This is not used when FastDL uses nginx (which is the default). Kept for potential future use or if built-in server is re-enabled.
func (*FastDLServer) GetListenAddress ¶
func (s *FastDLServer) GetListenAddress() string
GetListenAddress returns the address the server is listening on.
func (*FastDLServer) GetPort ¶
func (s *FastDLServer) GetPort() int
GetPort returns the port the server is listening on.
func (*FastDLServer) Run ¶
func (s *FastDLServer) Run() error
Run starts the FastDL HTTP server and begins listening for connections.