Documentation
¶
Overview ¶
Package config loads server settings from flags and environment variables.
Index ¶
- Variables
- func ParseSize(s string) (int64, error)
- type Config
- func (c Config) BackupDir() string
- func (c Config) Database() string
- func (c Config) DownloadDir() string
- func (c Config) GameCoreDir() string
- func (c Config) GameSaveDir() string
- func (c Config) GameSystemDir() string
- func (c Config) GameWorkDir() string
- func (c Config) ImageDir() string
- func (c Config) LevelsDir() string
- func (c Config) LogDir() string
- func (c Config) LyricsDir() string
- func (c Config) PluginDir() string
- func (c Config) RemoteDir() string
- func (c Config) SubtitleDir() string
- func (c Config) ThemeDir() string
- func (c Config) ThumbnailDir() string
- func (c Config) TranscodeDir() string
Constants ¶
This section is empty.
Variables ¶
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 ¶
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)
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 (Config) BackupDir ¶ added in v0.2.0
BackupDir holds copies of a SQLite database (internal/backup).
func (Config) DownloadDir ¶
func (Config) GameCoreDir ¶ added in v0.2.4
GameCoreDir has the emulators an admin added themselves.
func (Config) GameSaveDir ¶ added in v0.2.4
GameSaveDir has games' saves, a folder per person.
func (Config) GameSystemDir ¶ added in v0.2.4
GameSystemDir has BIOS files the emulators that need one look for.
func (Config) GameWorkDir ¶ added in v0.2.4
GameWorkDir has games unpacked from zips while they're played.
func (Config) LogDir ¶ added in v0.2.4
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
LyricsDir keeps what LRCLIB said about songs (internal/lyrics).
func (Config) PluginDir ¶ added in v0.1.1
PluginDir holds installed plugins and what they keep (internal/plugin).
func (Config) SubtitleDir ¶
func (Config) ThumbnailDir ¶ added in v0.1.11
ThumbnailDir holds the seek bar's pictures of each video (internal/thumbs).