setup

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MullvadAutoSetup

func MullvadAutoSetup(state *SetupState)

MullvadAutoSetup runs the automated Mullvad VPN setup flow. Exported so cmd/vpn.go can reuse it for `admirarr vpn setup`.

func Run

func Run(dryRun bool)

Run executes the full interactive setup wizard.

func RunAuto

func RunAuto(dryRun bool)

RunAuto executes the full setup wizard in non-interactive mode.

Types

type ServiceState

type ServiceState struct {
	Detected  bool
	Reachable bool
	IsDocker  bool
	Host      string
	Port      int
	APIKey    string
}

ServiceState tracks the detected state of a single service.

type SetupState

type SetupState struct {
	DataPath         string
	ComposeDir       string
	ConfigDir        string
	Timezone         string
	VPNProvider      string
	VPNType          string
	RemoteHost       string // Remote host IP for non-Docker services (auto-detected on WSL)
	SelectedServices []string
	Services         map[string]*ServiceState
	Keys             map[string]string
	// ManualKeys tracks keys the user entered manually (need persisting).
	ManualKeys map[string]string
	// VPNCreds holds provider-specific VPN credentials for Gluetun.
	VPNCreds map[string]string
	// Indexers holds the desired indexer set (populated during Phase 7).
	Indexers map[string]config.IndexerConfig
	// JellyfinUser and JellyfinPassword store credentials set during Jellyfin init.
	JellyfinUser     string
	JellyfinPassword string
	// SeerrInitialized is set to true when initSeerr() completes successfully.
	SeerrInitialized bool
	// AutoMode skips interactive prompts, using detected/configured defaults.
	AutoMode bool
	// DryRun previews changes without applying mutations.
	DryRun bool
}

SetupState accumulates validated configuration across all phases.

func (*SetupState) InternalURL

func (s *SetupState) InternalURL(service string) string

InternalURL returns the inter-service URL for a service. Docker services use container names; remote services use the remote host IP; native services use localhost.

type StepResult

type StepResult struct {
	Name    string
	Passed  int
	Fixed   int
	Skipped int
	Errors  []string
}

StepResult tracks what happened in each phase.

func CheckConnectivity

func CheckConnectivity(state *SetupState) StepResult

CheckConnectivity runs Phase 3: service reachability and restart offers.

func ConfigureDownloadClients

func ConfigureDownloadClients(state *SetupState) StepResult

ConfigureDownloadClients runs Phase 5: download client + qBittorrent configuration.

func DeployStack

func DeployStack(state *SetupState) StepResult

DeployStack runs Phase 2: deploy missing services via Docker Compose.

func Detect

func Detect(state *SetupState) StepResult

Detect runs Phase 1: environment detection.

func SelectServices

func SelectServices(state *SetupState) StepResult

SelectServices runs Phase 0: service tier selection.

func SyncIndexers

func SyncIndexers() StepResult

SyncIndexers is the standalone version called by `indexers sync`.

func SyncQualityProfiles

func SyncQualityProfiles(state *SetupState) StepResult

SyncQualityProfiles runs Phase 10: deploy Recyclarr if needed, generate config, sync TRaSH Guides, then ensure all items use the configured quality profile.

func ValidateAPIKeys

func ValidateAPIKeys(state *SetupState) StepResult

ValidateAPIKeys runs Phase 4: API key discovery and validation. Two-pass approach: silent auto-discovery first, manual prompt only if needed.

func ValidateRootFolders

func ValidateRootFolders(state *SetupState) StepResult

ValidateRootFolders runs Phase 6: root folder and media path validation.

func VerifyIndexers

func VerifyIndexers(state *SetupState) StepResult

VerifyIndexers runs Phase 7: declarative indexer sync + Prowlarr wiring. Reads config.Indexers and converges Prowlarr to match.

func WireBazarr

func WireBazarr(state *SetupState) StepResult

WireBazarr runs Phase 9: connect Bazarr to Radarr/Sonarr.

func WireSeerr

func WireSeerr(state *SetupState) StepResult

WireSeerr runs Phase 8: connect Seerr to Radarr/Sonarr/media server.

func WriteConfig

func WriteConfig(state *SetupState) StepResult

WriteConfig runs Phase 11: write validated config to disk.

Jump to

Keyboard shortcuts

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