server

package
v0.0.0-...-d2171c4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: EUPL-1.2 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(sessions sessionParser, repo *repository.Repository) echo.MiddlewareFunc

AuthMiddleware loads the user from the session cookie and sets it in the context.

func RequireAuth

func RequireAuth() echo.MiddlewareFunc

RequireAuth returns middleware that redirects to login if not authenticated. The original request URI is preserved as a ?next= query parameter.

func Run

func Run(ctx context.Context, cmd *cli.Command) error

Run starts the server with the given CLI command.

Types

type Assets

type Assets struct {
	CSSPath string
	JSPath  string
}

Assets holds paths to static assets.

type TLSMode

type TLSMode string

TLSMode represents the resolved TLS mode.

const (
	TLSModeOff        TLSMode = "off"
	TLSModeACME       TLSMode = "acme"
	TLSModeSelfSigned TLSMode = "selfsigned"
	TLSModeManual     TLSMode = "manual"
)

type TLSResult

type TLSResult struct {
	TLSConfig   *tls.Config
	CertManager *autocert.Manager // nil unless ACME mode
	HTTPHandler http.Handler      // For HTTP→HTTPS redirect (ACME only)
	Mode        TLSMode
}

TLSResult contains the resolved TLS configuration.

func SetupTLS

func SetupTLS(cfg *config.Config) (*TLSResult, error)

SetupTLS configures TLS based on the configuration.

Jump to

Keyboard shortcuts

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