server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Overview

Package server is Fundarr's HTTP API and the web UI it serves.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(pw string) string

HashPassword makes a PHC string, for the `fundarr hash-password` command.

Types

type AuthConfig

type AuthConfig struct {
	Mode string // "password", "oidc", "proxy" or "none"

	// Fixed credentials from the environment; when empty, the ones created
	// in the UI (stored in Credentials) are used.
	Username     string
	PasswordHash string // argon2id PHC string
	Credentials  credentials

	ProxyHeader string // proxy mode: header carrying the user (Remote-User)

	OIDCIssuer       string
	OIDCClientID     string
	OIDCClientSecret string
	OIDCAllowedSubs  []string
	OIDCAllowedMails []string
	// PublicURL is where users reach Fundarr (for the OIDC redirect).
	PublicURL string
	// OIDCAutoRedirect sends signed-out visitors straight to the provider:
	// with a session there, they come back signed in without a click.
	OIDCAutoRedirect bool

	SessionKey []byte
	SessionTTL time.Duration
}

Auth modes, like the *arr apps:

  • password: a username and password created in the UI on first launch (or fixed by FUNDARR_PASSWORD_HASH);
  • oidc: any OpenID Connect provider, with an allowlist;
  • proxy: a reverse proxy authenticates and passes the user in a header;
  • none: no login at all.

type Config

type Config struct {
	Engine  *engine.Engine
	Auth    AuthConfig
	Static  fs.FS // the built UI; nil in tests
	Version string
	Log     *slog.Logger
	// Background is the context syncs started from the UI run in.
	Background context.Context
	// Demo: the data is made up (FUNDARR_DEMO); nothing reaches a platform.
	Demo bool
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg Config) (*Server, error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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