fastdl

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureNginxAccess added in v1.4.0

func EnsureNginxAccess() (membershipChanged bool, err error)

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

func GenerateNginxConfig(manager *server.Manager) error

GenerateNginxConfig generates an nginx configuration file for FastDL based on enabled servers.

func HasFastDLEnabledServers

func HasFastDLEnabledServers(manager *server.Manager) bool

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 ReloadNginx

func ReloadNginx() error

ReloadNginx attempts to reload nginx configuration.

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.

func (*FastDLServer) Shutdown

func (s *FastDLServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the FastDL server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址