config

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads server settings from flags and environment variables.

Index

Constants

This section is empty.

Variables

View Source
var DefaultTMDBKey = ""

DefaultTMDBKey is the project's own TMDB key, linked into official builds with -ldflags "-X github.com/yeixio/matinee/internal/config.DefaultTMDBKey=...", so posters work without users registering a key. MATINEE_TMDB_KEY overrides it.

Functions

func GameRunner added in v0.2.7

func GameRunner(gamesDir string) string

GameRunner is the path of matinee-game-runner in a games folder (matinee-game-runner.exe on Windows).

func ParseSize added in v0.2.4

func ParseSize(s string) (int64, error)

ParseSize reads a size such as 50Gi, 45G, 500Mi or 1073741824 (bytes), as Kubernetes writes them; "" is 0.

Types

type Config

type Config struct {
	Addr          string        // HTTP listen address
	DataDir       string        // SQLite database (when used), image cache and transcode scratch space
	FFmpegPath    string        // ffmpeg binary
	FFprobePath   string        // ffprobe binary
	ScanInterval  time.Duration // periodic library rescan; 0 disables it
	WatchPoll     time.Duration // how often folders on network shares are checked for new files, until an admin picks
	TMDBKey       string        // themoviedb.org API key or read token; empty disables online metadata
	RatingCountry string        // whose age ratings to use, such as US or GB
	DatabaseURL   string        // postgres:// URL; empty uses SQLite in DataDir
	MediaRoot     string        // where the folder picker starts when adding a library
	MusicBrainz   bool          // look up artists and albums on MusicBrainz (no key needed)
	OpenLibrary   bool          // look up audiobook covers and author photos on Open Library (no key needed)
	Wikidata      bool          // look up movies' and shows' awards on Wikidata (no key needed)
	Wikipedia     bool          // look up games' summaries on Wikipedia and genres on Wikidata (no key needed)
	Discovery     bool          // announce the server on the local network so the apps find it
	ServerName    string        // the name the apps show for this server
	PublicURL     string        // the address the apps should connect to; empty uses this host's IP and port
	HomeAddr      string        // a second listen address only for the home network; empty means Addr serves both
	RemoteAddr    string        // HTTPS listen address for remote access (internal/remote); empty means the server doesn't offer it
	ConnectURL    string        // the service the apps find this server through when its address changes (internal/connect); empty for none
	BillingURL    string        // where that service's subscription is bought; empty for a service that needs none
	Plugins       bool          // run plugins (internal/plugin)
	// PodcastsHomeNetwork lets podcast feeds and episodes come from the home
	// network too, not only the internet.
	PodcastsHomeNetwork bool
	PluginCatalog       string // where the list of official plugins is; empty for none
	// On SIGTERM the server first tells players it's restarting and waits
	// DrainDelay (so a load balancer stops sending it requests), then gives
	// requests in flight up to ShutdownTimeout to finish.
	DrainDelay      time.Duration
	ShutdownTimeout time.Duration
	// CacheLimit is how much the volume the data folder is on may hold, when
	// that's less than its disk (a Kubernetes emptyDir's sizeLimit); 0 for
	// none. Transcodes keep within it (see stream.SpaceLimit).
	CacheLimit int64
	// GamesDir has matinee-game-runner and its emulators (cores/); "" for
	// a server that doesn't play games. GamesPort is the UDP port games
	// stream through, 0 for any; GamesPublicIPs the addresses players
	// reach it at, when the server can't see its own.
	GamesDir       string
	GamesPort      int
	GamesPublicIPs []string
	// GameHost is a game host's address (cmd/matinee-gamehost), where PC
	// games are played, and GameHostToken what it asks for.
	GameHost, GameHostToken string
}

func Load

func Load(args []string) (Config, error)

Load reads flags, falling back to MATINEE_* environment variables, then defaults.

func (Config) BackupDir added in v0.2.0

func (c Config) BackupDir() string

BackupDir holds copies of a SQLite database (internal/backup).

func (Config) Database

func (c Config) Database() string

Database is what store.Open takes: the PostgreSQL URL, or the SQLite file.

func (Config) DownloadDir

func (c Config) DownloadDir() string

func (Config) GameCoreDir added in v0.2.4

func (c Config) GameCoreDir() string

GameCoreDir has the emulators an admin added themselves.

func (Config) GameSaveDir added in v0.2.4

func (c Config) GameSaveDir() string

GameSaveDir has games' saves, a folder per person.

func (Config) GameSystemDir added in v0.2.4

func (c Config) GameSystemDir() string

GameSystemDir has BIOS files the emulators that need one look for.

func (Config) GameWorkDir added in v0.2.4

func (c Config) GameWorkDir() string

GameWorkDir has games unpacked from zips while they're played.

func (Config) ImageDir

func (c Config) ImageDir() string

func (Config) LevelsDir added in v0.1.3

func (c Config) LevelsDir() string

func (Config) LogDir added in v0.2.4

func (c Config) LogDir() string

LogDir keeps each run's log (internal/health), so the log from before a crash or a restart can still be read.

func (Config) LyricsDir added in v0.1.13

func (c Config) LyricsDir() string

LyricsDir keeps what LRCLIB said about songs (internal/lyrics).

func (Config) PluginDir added in v0.1.1

func (c Config) PluginDir() string

PluginDir holds installed plugins and what they keep (internal/plugin).

func (Config) RemoteDir

func (c Config) RemoteDir() string

func (Config) SubtitleDir

func (c Config) SubtitleDir() string

func (Config) ThemeDir

func (c Config) ThemeDir() string

ThemeDir holds an admin's own theme files (docs/themes.md).

func (Config) ThumbnailDir added in v0.1.11

func (c Config) ThumbnailDir() string

ThumbnailDir holds the seek bar's pictures of each video (internal/thumbs).

func (Config) TranscodeDir

func (c Config) TranscodeDir() string

Jump to

Keyboard shortcuts

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