config

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stash               = "stash"
	Cache               = "cache"
	BackupDirectoryPath = "backup_directory_path"
	Generated           = "generated"
	Metadata            = "metadata"
	BlobsPath           = "blobs_path"
	Downloads           = "downloads"
	ApiKey              = "api_key"
	Username            = "username"
	Password            = "password"
	MaxSessionAge       = "max_session_age"

	FFMpegPath  = "ffmpeg_path"
	FFProbePath = "ffprobe_path"

	BlobsStorage = "blobs_storage"

	DefaultMaxSessionAge = 60 * 60 * 1 // 1 hours

	Database = "database"

	Exclude      = "exclude"
	ImageExclude = "image_exclude"

	VideoExtensions            = "video_extensions"
	ImageExtensions            = "image_extensions"
	GalleryExtensions          = "gallery_extensions"
	CreateGalleriesFromFolders = "create_galleries_from_folders"

	// CalculateMD5 is the config key used to determine if MD5 should be calculated
	// for video files.
	CalculateMD5 = "calculate_md5"

	// VideoFileNamingAlgorithm is the config key used to determine what hash
	// should be used when generating and using generated files for scenes.
	VideoFileNamingAlgorithm = "video_file_naming_algorithm"

	MaxTranscodeSize          = "max_transcode_size"
	MaxStreamingTranscodeSize = "max_streaming_transcode_size"

	// ffmpeg extra args options
	TranscodeInputArgs      = "ffmpeg.transcode.input_args"
	TranscodeOutputArgs     = "ffmpeg.transcode.output_args"
	LiveTranscodeInputArgs  = "ffmpeg.live_transcode.input_args"
	LiveTranscodeOutputArgs = "ffmpeg.live_transcode.output_args"

	ParallelTasks = "parallel_tasks"

	PreviewPreset                 = "preview_preset"
	TranscodeHardwareAcceleration = "ffmpeg.hardware_acceleration"

	SequentialScanning        = "sequential_scanning"
	SequentialScanningDefault = false

	PreviewAudio = "preview_audio"

	PreviewSegmentDuration = "preview_segment_duration"

	PreviewSegments = "preview_segments"

	PreviewExcludeStart = "preview_exclude_start"

	PreviewExcludeEnd = "preview_exclude_end"

	WriteImageThumbnails = "write_image_thumbnails"

	CreateImageClipsFromVideos = "create_image_clip_from_videos"

	Host = "host"

	Port = "port"

	ExternalHost = "external_host"

	// http proxy url if required
	Proxy = "proxy"

	// urls or IPs that should not use the proxy
	NoProxy = "no_proxy"

	// key used to sign JWT tokens
	JWTSignKey = "jwt_secret_key"

	// key used for session store
	SessionStoreKey = "session_store_key"

	// scraping options
	ScrapersPath              = "scrapers_path"
	ScraperUserAgent          = "scraper_user_agent"
	ScraperCertCheck          = "scraper_cert_check"
	ScraperCDPPath            = "scraper_cdp_path"
	ScraperExcludeTagPatterns = "scraper_exclude_tag_patterns"

	// stash-box options
	StashBoxes = "stash_boxes"

	PythonPath = "python_path"

	// plugin options
	PluginsPath          = "plugins_path"
	PluginsSetting       = "plugins.settings"
	PluginsSettingPrefix = PluginsSetting + "."
	DisabledPlugins      = "plugins.disabled"

	PluginPackageSources = "plugins.package_sources"

	ScraperPackageSources = "scrapers.package_sources"

	// i18n
	Language = "language"

	// served directories
	// this should be manually configured only
	CustomServedFolders = "custom_served_folders"

	// UI directory. Overrides to serve the UI from a specific location
	// rather than use the embedded UI.
	UILocation = "ui_location"

	// backwards compatible name
	LegacyCustomUILocation = "custom_ui_location"

	// Gallery Cover Regex
	GalleryCoverRegex = "gallery_cover_regex"

	// Interface options
	MenuItems = "menu_items"

	SoundOnPreview = "sound_on_preview"

	WallShowTitle = "wall_show_title"

	CustomPerformerImageLocation = "custom_performer_image_location"
	MaximumLoopDuration          = "maximum_loop_duration"
	AutostartVideo               = "autostart_video"
	AutostartVideoOnPlaySelected = "autostart_video_on_play_selected"

	ContinuePlaylistDefault = "continue_playlist_default"
	ShowStudioAsText        = "show_studio_as_text"
	CSSEnabled              = "cssenabled"
	JavascriptEnabled       = "javascriptenabled"
	CustomLocalesEnabled    = "customlocalesenabled"

	ShowScrubber = "show_scrubber"

	WallPlayback = "wall_playback"

	ImageLightboxSlideshowDelay             = "image_lightbox.slideshow_delay"
	ImageLightboxDisplayModeKey             = "image_lightbox.display_mode"
	ImageLightboxScaleUp                    = "image_lightbox.scale_up"
	ImageLightboxResetZoomOnNav             = "image_lightbox.reset_zoom_on_nav"
	ImageLightboxScrollModeKey              = "image_lightbox.scroll_mode"
	ImageLightboxScrollAttemptsBeforeChange = "image_lightbox.scroll_attempts_before_change"

	UI = "ui"

	DisableDropdownCreatePerformer = "disable_dropdown_create.performer"
	DisableDropdownCreateStudio    = "disable_dropdown_create.studio"
	DisableDropdownCreateTag       = "disable_dropdown_create.tag"
	DisableDropdownCreateMovie     = "disable_dropdown_create.movie"

	HandyKey                = "handy_key"
	FunscriptOffset         = "funscript_offset"
	UseStashHostedFunscript = "use_stash_hosted_funscript"

	DrawFunscriptHeatmapRange = "draw_funscript_heatmap_range"

	ThemeColor        = "theme_color"
	DefaultThemeColor = "#202b33"

	SecurityTripwireAccessedFromPublicInternet = "security_tripwire_accessed_from_public_internet"

	// DLNA options
	DLNAServerName         = "dlna.server_name"
	DLNADefaultEnabled     = "dlna.default_enabled"
	DLNADefaultIPWhitelist = "dlna.default_whitelist"
	DLNAInterfaces         = "dlna.interfaces"

	DLNAVideoSortOrder = "dlna.video_sort_order"

	DLNAPort        = "dlna.port"
	DLNAPortDefault = 1338

	// Logging options
	LogFile = "logfile"
	LogOut  = "logout"

	LogLevel = "loglevel"

	LogAccess = "logaccess"

	// Default settings
	DefaultScanSettings     = "defaults.scan_task"
	DefaultIdentifySettings = "defaults.identify_task"
	DefaultAutoTagSettings  = "defaults.auto_tag_task"
	DefaultGenerateSettings = "defaults.generate_task"

	DeleteFileDefault      = "defaults.delete_file"
	DeleteGeneratedDefault = "defaults.delete_generated"

	// Desktop Integration Options
	NoBrowser                           = "nobrowser"
	NoBrowserDefault                    = false
	NotificationsEnabled                = "notifications_enabled"
	NotificationsEnabledDefault         = true
	ShowOneTimeMovedNotification        = "show_one_time_moved_notification"
	ShowOneTimeMovedNotificationDefault = false

	// File upload options
	MaxUploadSize = "max_upload_size"

	// Developer options
	ExtraBlobsPaths = "developer_options.extra_blob_paths"
)

Variables

Functions

func FileEnvSet

func FileEnvSet() bool

FileEnvSet returns true if the configuration file environment parameter is set.

Types

type AutoTagMetadataOptions added in v0.17.0

type AutoTagMetadataOptions struct {
	// IDs of performers to tag files with, or "*" for all
	Performers []string `json:"performers"`
	// IDs of studios to tag files with, or "*" for all
	Studios []string `json:"studios"`
	// IDs of tags to tag files with, or "*" for all
	Tags []string `json:"tags"`
}

type BlobsStorageType added in v0.20.0

type BlobsStorageType string
const (
	// Database
	BlobStorageTypeDatabase BlobsStorageType = "DATABASE"
	// Filesystem
	BlobStorageTypeFilesystem BlobsStorageType = "FILESYSTEM"
)

func (BlobsStorageType) IsValid added in v0.20.0

func (e BlobsStorageType) IsValid() bool

func (BlobsStorageType) MarshalGQL added in v0.20.0

func (e BlobsStorageType) MarshalGQL(w io.Writer)

func (BlobsStorageType) String added in v0.20.0

func (e BlobsStorageType) String() string

func (*BlobsStorageType) UnmarshalGQL added in v0.20.0

func (e *BlobsStorageType) UnmarshalGQL(v interface{}) error

type Config added in v0.24.0

type Config struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *Config

func Initialize

func Initialize() (*Config, error)

Called at startup

func InitializeEmpty added in v0.24.0

func InitializeEmpty() *Config

Called by tests to initialize an empty config

func (*Config) ActivatePublicAccessTripwire added in v0.24.0

func (i *Config) ActivatePublicAccessTripwire(requestIP string) error

ActivatePublicAccessTripwire sets the security_tripwire_accessed_from_public_internet config field to the provided IP address to indicate that stash has been accessed from this public IP without authentication.

func (*Config) FinalizeSetup added in v0.24.0

func (i *Config) FinalizeSetup()

func (*Config) GetAPIKey added in v0.24.0

func (i *Config) GetAPIKey() string

func (*Config) GetAllPluginConfiguration added in v0.24.0

func (i *Config) GetAllPluginConfiguration() map[string]map[string]interface{}

func (*Config) GetAutostartVideo added in v0.24.0

func (i *Config) GetAutostartVideo() bool

func (*Config) GetAutostartVideoOnPlaySelected added in v0.24.0

func (i *Config) GetAutostartVideoOnPlaySelected() bool

func (*Config) GetBackupDirectoryPath added in v0.24.0

func (i *Config) GetBackupDirectoryPath() string

func (*Config) GetBackupDirectoryPathOrDefault added in v0.24.0

func (i *Config) GetBackupDirectoryPathOrDefault() string

func (*Config) GetBlobsPath added in v0.24.0

func (i *Config) GetBlobsPath() string

func (*Config) GetBlobsStorage added in v0.24.0

func (i *Config) GetBlobsStorage() BlobsStorageType

func (*Config) GetCSS added in v0.24.0

func (i *Config) GetCSS() string

func (*Config) GetCSSEnabled added in v0.24.0

func (i *Config) GetCSSEnabled() bool

func (*Config) GetCSSPath added in v0.24.0

func (i *Config) GetCSSPath() string

func (*Config) GetCachePath added in v0.24.0

func (i *Config) GetCachePath() string

func (*Config) GetConfigFile added in v0.24.0

func (i *Config) GetConfigFile() string

GetConfigFile returns the full path to the used configuration file.

func (*Config) GetConfigPath added in v0.24.0

func (i *Config) GetConfigPath() string

GetConfigPath returns the path of the directory containing the used configuration file.

func (*Config) GetConfigPathAbs added in v0.26.0

func (i *Config) GetConfigPathAbs() string

GetConfigPathAbs returns the path of the directory containing the used configuration file, resolved to an absolute path. Returns the return value of GetConfigPath if the path cannot be made into an absolute path.

func (*Config) GetContinuePlaylistDefault added in v0.24.0

func (i *Config) GetContinuePlaylistDefault() bool

func (*Config) GetCreateGalleriesFromFolders added in v0.24.0

func (i *Config) GetCreateGalleriesFromFolders() bool

func (*Config) GetCredentials added in v0.24.0

func (i *Config) GetCredentials() (string, string)

func (*Config) GetCustomLocales added in v0.24.0

func (i *Config) GetCustomLocales() string

func (*Config) GetCustomLocalesEnabled added in v0.24.0

func (i *Config) GetCustomLocalesEnabled() bool

func (*Config) GetCustomLocalesPath added in v0.24.0

func (i *Config) GetCustomLocalesPath() string

func (*Config) GetCustomPerformerImageLocation added in v0.24.0

func (i *Config) GetCustomPerformerImageLocation() string

func (*Config) GetCustomServedFolders added in v0.24.0

func (i *Config) GetCustomServedFolders() utils.URLMap

GetCustomServedFolders gets the map of custom paths to their applicable filesystem locations

func (*Config) GetDLNADefaultEnabled added in v0.24.0

func (i *Config) GetDLNADefaultEnabled() bool

GetDLNADefaultEnabled returns true if the DLNA is enabled by default.

func (*Config) GetDLNADefaultIPWhitelist added in v0.24.0

func (i *Config) GetDLNADefaultIPWhitelist() []string

GetDLNADefaultIPWhitelist returns a list of IP addresses/wildcards that are allowed to use the DLNA service.

func (*Config) GetDLNAInterfaces added in v0.24.0

func (i *Config) GetDLNAInterfaces() []string

GetDLNAInterfaces returns a list of interface names to expose DLNA on. If empty, runs on all interfaces.

func (*Config) GetDLNAPort added in v0.26.0

func (i *Config) GetDLNAPort() int

GetDLNAPort returns the port to run the DLNA server on. If empty, 1338 will be used.

func (*Config) GetDLNAPortAsString added in v0.26.0

func (i *Config) GetDLNAPortAsString() string

GetDLNAPortAsString returns the port to run the DLNA server on as a string.

func (*Config) GetDLNAServerName added in v0.24.0

func (i *Config) GetDLNAServerName() string

GetDLNAServerName returns the visible name of the DLNA server. If empty, "stash" will be used.

func (*Config) GetDangerousAllowPublicWithoutAuth added in v0.24.0

func (i *Config) GetDangerousAllowPublicWithoutAuth() bool

GetDangerousAllowPublicWithoutAuth determines if the security feature is enabled. See https://docs.stashapp.cc/networking/authentication-required-when-accessing-stash-from-the-internet

func (*Config) GetDatabasePath added in v0.24.0

func (i *Config) GetDatabasePath() string

func (*Config) GetDefaultAutoTagSettings added in v0.24.0

func (i *Config) GetDefaultAutoTagSettings() *AutoTagMetadataOptions

GetDefaultAutoTagSettings returns the default Scan task settings. Returns nil if the settings could not be unmarshalled, or if it has not been set.

func (*Config) GetDefaultDatabaseFilePath added in v0.24.0

func (i *Config) GetDefaultDatabaseFilePath() string

GetDefaultDatabaseFilePath returns the default database filename, which is located in the same directory as the config file.

func (*Config) GetDefaultGenerateSettings added in v0.24.0

func (i *Config) GetDefaultGenerateSettings() *models.GenerateMetadataOptions

GetDefaultGenerateSettings returns the default Scan task settings. Returns nil if the settings could not be unmarshalled, or if it has not been set.

func (*Config) GetDefaultIdentifySettings added in v0.24.0

func (i *Config) GetDefaultIdentifySettings() *identify.Options

GetDefaultIdentifySettings returns the default Identify task settings. Returns nil if the settings could not be unmarshalled, or if it has not been set.

func (*Config) GetDefaultPluginsPath added in v0.24.0

func (i *Config) GetDefaultPluginsPath() string

func (*Config) GetDefaultScanSettings added in v0.24.0

func (i *Config) GetDefaultScanSettings() *ScanMetadataOptions

GetDefaultScanSettings returns the default Scan task settings. Returns nil if the settings could not be unmarshalled, or if it has not been set.

func (*Config) GetDefaultScrapersPath added in v0.24.0

func (i *Config) GetDefaultScrapersPath() string

func (*Config) GetDeleteFileDefault added in v0.24.0

func (i *Config) GetDeleteFileDefault() bool

func (*Config) GetDeleteGeneratedDefault added in v0.24.0

func (i *Config) GetDeleteGeneratedDefault() bool

func (*Config) GetDisableDropdownCreate added in v0.24.0

func (i *Config) GetDisableDropdownCreate() *ConfigDisableDropdownCreate

func (*Config) GetDisabledPlugins added in v0.24.0

func (i *Config) GetDisabledPlugins() []string

func (*Config) GetDrawFunscriptHeatmapRange added in v0.24.0

func (i *Config) GetDrawFunscriptHeatmapRange() bool

func (*Config) GetExcludes added in v0.24.0

func (i *Config) GetExcludes() []string

func (*Config) GetExternalHost added in v0.24.0

func (i *Config) GetExternalHost() string

func (*Config) GetExtraBlobsPaths added in v0.25.0

func (i *Config) GetExtraBlobsPaths() []string

GetExtraBlobsPaths returns extra blobs paths. For developer/advanced use only.

func (*Config) GetFFMpegPath added in v0.26.0

func (i *Config) GetFFMpegPath() string

GetFFMpegPath returns the path to the FFMpeg executable. If empty, stash will attempt to resolve it from the path.

func (*Config) GetFFProbePath added in v0.26.0

func (i *Config) GetFFProbePath() string

GetFFProbePath returns the path to the FFProbe executable. If empty, stash will attempt to resolve it from the path.

func (*Config) GetFunscriptOffset added in v0.24.0

func (i *Config) GetFunscriptOffset() int

func (*Config) GetGalleryCoverRegex added in v0.24.0

func (i *Config) GetGalleryCoverRegex() string

func (*Config) GetGalleryExtensions added in v0.24.0

func (i *Config) GetGalleryExtensions() []string

func (*Config) GetGeneratedPath added in v0.24.0

func (i *Config) GetGeneratedPath() string

func (*Config) GetHandyKey added in v0.24.0

func (i *Config) GetHandyKey() string

func (*Config) GetHost added in v0.24.0

func (i *Config) GetHost() string

func (*Config) GetImageExcludes added in v0.24.0

func (i *Config) GetImageExcludes() []string

func (*Config) GetImageExtensions added in v0.24.0

func (i *Config) GetImageExtensions() []string

func (*Config) GetImageLightboxOptions added in v0.24.0

func (i *Config) GetImageLightboxOptions() ConfigImageLightboxResult

func (*Config) GetJWTSignKey added in v0.24.0

func (i *Config) GetJWTSignKey() []byte

func (*Config) GetJavascript added in v0.24.0

func (i *Config) GetJavascript() string

func (*Config) GetJavascriptEnabled added in v0.24.0

func (i *Config) GetJavascriptEnabled() bool

func (*Config) GetJavascriptPath added in v0.24.0

func (i *Config) GetJavascriptPath() string

func (*Config) GetLanguage added in v0.24.0

func (i *Config) GetLanguage() string

func (*Config) GetLiveTranscodeInputArgs added in v0.24.0

func (i *Config) GetLiveTranscodeInputArgs() []string

func (*Config) GetLiveTranscodeOutputArgs added in v0.24.0

func (i *Config) GetLiveTranscodeOutputArgs() []string

func (*Config) GetLogAccess added in v0.24.0

func (i *Config) GetLogAccess() bool

GetLogAccess returns true if http requests should be logged to the terminal. HTTP requests are not logged to the log file. Defaults to true.

func (*Config) GetLogFile added in v0.24.0

func (i *Config) GetLogFile() string

GetLogFile returns the filename of the file to output logs to. An empty string means that file logging will be disabled.

func (*Config) GetLogLevel added in v0.24.0

func (i *Config) GetLogLevel() string

GetLogLevel returns the lowest log level to write to the log. Should be one of "Debug", "Info", "Warning", "Error"

func (*Config) GetLogOut added in v0.24.0

func (i *Config) GetLogOut() bool

GetLogOut returns true if logging should be output to the terminal in addition to writing to a log file. Logging will be output to the terminal if file logging is disabled. Defaults to true.

func (*Config) GetMaxSessionAge added in v0.24.0

func (i *Config) GetMaxSessionAge() int

GetMaxSessionAge gets the maximum age for session cookies, in seconds. Session cookie expiry times are refreshed every request.

func (*Config) GetMaxStreamingTranscodeSize added in v0.24.0

func (i *Config) GetMaxStreamingTranscodeSize() models.StreamingResolutionEnum

func (*Config) GetMaxTranscodeSize added in v0.24.0

func (i *Config) GetMaxTranscodeSize() models.StreamingResolutionEnum

func (*Config) GetMaxUploadSize added in v0.24.0

func (i *Config) GetMaxUploadSize() int64

Max allowed graphql upload size in megabytes

func (*Config) GetMaximumLoopDuration added in v0.24.0

func (i *Config) GetMaximumLoopDuration() int

func (*Config) GetMenuItems added in v0.24.0

func (i *Config) GetMenuItems() []string

Interface options

func (*Config) GetMetadataPath added in v0.24.0

func (i *Config) GetMetadataPath() string

func (*Config) GetNoBrowser added in v0.24.0

func (i *Config) GetNoBrowser() bool

func (*Config) GetNoProxy added in v0.24.0

func (i *Config) GetNoProxy() string

GetProxy returns the url of a http proxy to be used for all outgoing http calls.

func (*Config) GetNotificationsEnabled added in v0.24.0

func (i *Config) GetNotificationsEnabled() bool

func (*Config) GetParallelTasks added in v0.24.0

func (i *Config) GetParallelTasks() int

GetParallelTasks returns the number of parallel tasks that should be started by scan or generate task.

func (*Config) GetParallelTasksWithAutoDetection added in v0.24.0

func (i *Config) GetParallelTasksWithAutoDetection() int

func (*Config) GetPasswordHash added in v0.24.0

func (i *Config) GetPasswordHash() string

func (*Config) GetPluginConfiguration added in v0.24.0

func (i *Config) GetPluginConfiguration(pluginID string) map[string]interface{}

func (*Config) GetPluginPackagePathGetter added in v0.24.0

func (i *Config) GetPluginPackagePathGetter() packagePathGetter

func (*Config) GetPluginPackageSources added in v0.24.0

func (i *Config) GetPluginPackageSources() []*models.PackageSource

func (*Config) GetPluginsPath added in v0.24.0

func (i *Config) GetPluginsPath() string

func (*Config) GetPort added in v0.24.0

func (i *Config) GetPort() int

func (*Config) GetPreviewAudio added in v0.24.0

func (i *Config) GetPreviewAudio() bool

func (*Config) GetPreviewExcludeEnd added in v0.24.0

func (i *Config) GetPreviewExcludeEnd() string

GetPreviewExcludeEnd returns the configuration setting string for excluding the end of scene videos for preview generation. A float value is interpreted as the amount of seconds to exclude from the end of the video when generating previews. If the value is suffixed with a '%' character, then it is interpreted as a proportion of the total video duration.

func (*Config) GetPreviewExcludeStart added in v0.24.0

func (i *Config) GetPreviewExcludeStart() string

GetPreviewExcludeStart returns the configuration setting string for excluding the start of scene videos for preview generation. This can be in two possible formats. A float value is interpreted as the amount of seconds to exclude from the start of the video before it is included in the preview. If the value is suffixed with a '%' character (for example '2%'), then it is interpreted as a proportion of the total video duration.

func (*Config) GetPreviewPreset added in v0.24.0

func (i *Config) GetPreviewPreset() models.PreviewPreset

GetPreviewPreset returns the preset when generating previews. Defaults to Slow.

func (*Config) GetPreviewSegmentDuration added in v0.24.0

func (i *Config) GetPreviewSegmentDuration() float64

GetPreviewSegmentDuration returns the duration of a single segment in a scene preview file, in seconds.

func (*Config) GetPreviewSegments added in v0.24.0

func (i *Config) GetPreviewSegments() int

GetPreviewSegments returns the amount of segments in a scene preview file.

func (*Config) GetProxy added in v0.24.0

func (i *Config) GetProxy() string

GetProxy returns the url of a http proxy to be used for all outgoing http calls.

func (*Config) GetPythonPath added in v0.24.0

func (i *Config) GetPythonPath() string

func (*Config) GetScraperCDPPath added in v0.24.0

func (i *Config) GetScraperCDPPath() string

GetScraperCDPPath gets the path to the Chrome executable or remote address to an instance of Chrome.

func (*Config) GetScraperCertCheck added in v0.24.0

func (i *Config) GetScraperCertCheck() bool

GetScraperCertCheck returns true if the scraper should check for insecure certificates when fetching an image or a page.

func (*Config) GetScraperExcludeTagPatterns added in v0.24.0

func (i *Config) GetScraperExcludeTagPatterns() []string

func (*Config) GetScraperPackagePathGetter added in v0.24.0

func (i *Config) GetScraperPackagePathGetter() packagePathGetter

func (*Config) GetScraperPackageSources added in v0.24.0

func (i *Config) GetScraperPackageSources() []*models.PackageSource

func (*Config) GetScraperUserAgent added in v0.24.0

func (i *Config) GetScraperUserAgent() string

func (*Config) GetScrapersPath added in v0.24.0

func (i *Config) GetScrapersPath() string

func (*Config) GetSecurityTripwireAccessedFromPublicInternet added in v0.24.0

func (i *Config) GetSecurityTripwireAccessedFromPublicInternet() string

GetSecurityTripwireAccessedFromPublicInternet returns a public IP address if stash has been accessed from the public internet, with no auth enabled, and DangerousAllowPublicWithoutAuth disabled. Returns an empty string otherwise.

func (*Config) GetSequentialScanning added in v0.24.0

func (i *Config) GetSequentialScanning() bool

func (*Config) GetSessionStoreKey added in v0.24.0

func (i *Config) GetSessionStoreKey() []byte

func (*Config) GetShowOneTimeMovedNotification added in v0.24.0

func (i *Config) GetShowOneTimeMovedNotification() bool

GetShowOneTimeMovedNotification shows whether a small notification to inform the user that Stash will no longer show a terminal window, and instead will be available in the tray, should be shown. It is true when an existing system is started after upgrading, and set to false forever after it is shown.

func (*Config) GetShowScrubber added in v0.24.0

func (i *Config) GetShowScrubber() bool

func (*Config) GetShowStudioAsText added in v0.24.0

func (i *Config) GetShowStudioAsText() bool

func (*Config) GetSoundOnPreview added in v0.24.0

func (i *Config) GetSoundOnPreview() bool

func (*Config) GetStashBoxes added in v0.24.0

func (i *Config) GetStashBoxes() []*models.StashBox

func (*Config) GetStashPaths added in v0.24.0

func (i *Config) GetStashPaths() StashConfigs

GetStathPaths returns the configured stash library paths. Works opposite to the usual case - it will return the override value only if the main value is not set.

func (*Config) GetTLSFiles added in v0.24.0

func (i *Config) GetTLSFiles() (certFile, keyFile string)

func (*Config) GetThemeColor added in v0.24.0

func (i *Config) GetThemeColor() string

func (*Config) GetTranscodeHardwareAcceleration added in v0.24.0

func (i *Config) GetTranscodeHardwareAcceleration() bool

func (*Config) GetTranscodeInputArgs added in v0.24.0

func (i *Config) GetTranscodeInputArgs() []string

func (*Config) GetTranscodeOutputArgs added in v0.24.0

func (i *Config) GetTranscodeOutputArgs() []string

func (*Config) GetUIConfiguration added in v0.24.0

func (i *Config) GetUIConfiguration() map[string]interface{}

func (*Config) GetUILocation added in v0.26.0

func (i *Config) GetUILocation() string

func (*Config) GetUseStashHostedFunscript added in v0.24.0

func (i *Config) GetUseStashHostedFunscript() bool

func (*Config) GetUsername added in v0.24.0

func (i *Config) GetUsername() string

func (*Config) GetVideoExtensions added in v0.24.0

func (i *Config) GetVideoExtensions() []string

func (*Config) GetVideoFileNamingAlgorithm added in v0.24.0

func (i *Config) GetVideoFileNamingAlgorithm() models.HashAlgorithm

GetVideoFileNamingAlgorithm returns what hash algorithm should be used for naming generated scene video files.

func (*Config) GetVideoSortOrder added in v0.24.0

func (i *Config) GetVideoSortOrder() string

GetVideoSortOrder returns the sort order to display videos. If empty, videos will be sorted by titles.

func (*Config) GetWallPlayback added in v0.24.0

func (i *Config) GetWallPlayback() string

func (*Config) GetWallShowTitle added in v0.24.0

func (i *Config) GetWallShowTitle() bool

func (*Config) HasCredentials added in v0.24.0

func (i *Config) HasCredentials() bool

func (*Config) HasOverride added in v0.24.0

func (i *Config) HasOverride(key string) bool

func (*Config) HasTLSConfig added in v0.24.0

func (i *Config) HasTLSConfig() bool

func (*Config) InitTLS added in v0.24.0

func (i *Config) InitTLS()

func (*Config) IsCalculateMD5 added in v0.24.0

func (i *Config) IsCalculateMD5() bool

IsCalculateMD5 returns true if MD5 checksums should be generated for scene video files.

func (*Config) IsCreateImageClipsFromVideos added in v0.24.0

func (i *Config) IsCreateImageClipsFromVideos() bool

func (*Config) IsNewSystem added in v0.24.0

func (i *Config) IsNewSystem() bool

func (*Config) IsWriteImageThumbnails added in v0.24.0

func (i *Config) IsWriteImageThumbnails() bool

IsWriteImageThumbnails returns true if image thumbnails should be written to disk after generating on the fly.

func (*Config) Marshal added in v0.26.0

func (i *Config) Marshal() ([]byte, error)

func (*Config) SetBool added in v0.26.0

func (i *Config) SetBool(key string, value bool)

these methods are intended to ensure type safety (ie no primitive pointers)

func (*Config) SetCSS added in v0.24.0

func (i *Config) SetCSS(css string)

func (*Config) SetConfigFile added in v0.24.0

func (i *Config) SetConfigFile(fn string)

func (*Config) SetCustomLocales added in v0.24.0

func (i *Config) SetCustomLocales(customLocales string)

func (*Config) SetDefault added in v0.24.0

func (i *Config) SetDefault(key string, value interface{})

func (*Config) SetFloat added in v0.26.0

func (i *Config) SetFloat(key string, value float64)

func (*Config) SetInitialConfig added in v0.24.0

func (i *Config) SetInitialConfig() error

SetInitialConfig fills in missing required config fields. The config file will not be written.

func (*Config) SetInt added in v0.26.0

func (i *Config) SetInt(key string, value int)

func (*Config) SetInterface added in v0.26.0

func (i *Config) SetInterface(key string, value interface{})

func (*Config) SetJavascript added in v0.24.0

func (i *Config) SetJavascript(javascript string)

func (*Config) SetPassword added in v0.24.0

func (i *Config) SetPassword(value string)

func (*Config) SetPluginConfiguration added in v0.24.0

func (i *Config) SetPluginConfiguration(pluginID string, v map[string]interface{})

SetPluginConfiguration sets the configuration for a plugin. It will overwrite any existing configuration.

func (*Config) SetString added in v0.26.0

func (i *Config) SetString(key string, value string)

func (*Config) SetUIConfiguration added in v0.24.0

func (i *Config) SetUIConfiguration(v map[string]interface{})

func (*Config) Validate added in v0.24.0

func (i *Config) Validate() error

func (*Config) ValidateCredentials added in v0.24.0

func (i *Config) ValidateCredentials(username string, password string) bool

func (*Config) ValidateStashBoxes added in v0.24.0

func (i *Config) ValidateStashBoxes(boxes []*StashBoxInput) error

func (*Config) Write added in v0.24.0

func (i *Config) Write() error

type ConfigDisableDropdownCreate added in v0.17.0

type ConfigDisableDropdownCreate struct {
	Performer bool `json:"performer"`
	Tag       bool `json:"tag"`
	Studio    bool `json:"studio"`
	Movie     bool `json:"movie"`
}

type ConfigImageLightboxResult added in v0.17.0

type ConfigImageLightboxResult struct {
	SlideshowDelay             *int                      `json:"slideshowDelay"`
	DisplayMode                *ImageLightboxDisplayMode `json:"displayMode"`
	ScaleUp                    *bool                     `json:"scaleUp"`
	ResetZoomOnNav             *bool                     `json:"resetZoomOnNav"`
	ScrollMode                 *ImageLightboxScrollMode  `json:"scrollMode"`
	ScrollAttemptsBeforeChange int                       `json:"scrollAttemptsBeforeChange"`
}

type ImageLightboxDisplayMode

type ImageLightboxDisplayMode string
const (
	ImageLightboxDisplayModeOriginal ImageLightboxDisplayMode = "ORIGINAL"
	ImageLightboxDisplayModeFitXy    ImageLightboxDisplayMode = "FIT_XY"
	ImageLightboxDisplayModeFitX     ImageLightboxDisplayMode = "FIT_X"
)

func (ImageLightboxDisplayMode) IsValid added in v0.17.0

func (e ImageLightboxDisplayMode) IsValid() bool

func (ImageLightboxDisplayMode) MarshalGQL added in v0.17.0

func (e ImageLightboxDisplayMode) MarshalGQL(w io.Writer)

func (ImageLightboxDisplayMode) String added in v0.17.0

func (e ImageLightboxDisplayMode) String() string

func (*ImageLightboxDisplayMode) UnmarshalGQL added in v0.17.0

func (e *ImageLightboxDisplayMode) UnmarshalGQL(v interface{}) error

type ImageLightboxScrollMode

type ImageLightboxScrollMode string
const (
	ImageLightboxScrollModeZoom ImageLightboxScrollMode = "ZOOM"
	ImageLightboxScrollModePanY ImageLightboxScrollMode = "PAN_Y"
)

func (ImageLightboxScrollMode) IsValid added in v0.17.0

func (e ImageLightboxScrollMode) IsValid() bool

func (ImageLightboxScrollMode) MarshalGQL added in v0.17.0

func (e ImageLightboxScrollMode) MarshalGQL(w io.Writer)

func (ImageLightboxScrollMode) String added in v0.17.0

func (e ImageLightboxScrollMode) String() string

func (*ImageLightboxScrollMode) UnmarshalGQL added in v0.17.0

func (e *ImageLightboxScrollMode) UnmarshalGQL(v interface{}) error

type MissingConfigError

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

func (MissingConfigError) Error

func (e MissingConfigError) Error() string

type ScanMetadataOptions added in v0.17.0

type ScanMetadataOptions struct {
	// Forces a rescan on files even if they have not changed
	Rescan bool `json:"rescan"`
	// Generate scene covers during scan
	ScanGenerateCovers bool `json:"scanGenerateCovers"`
	// Generate previews during scan
	ScanGeneratePreviews bool `json:"scanGeneratePreviews"`
	// Generate image previews during scan
	ScanGenerateImagePreviews bool `json:"scanGenerateImagePreviews"`
	// Generate sprites during scan
	ScanGenerateSprites bool `json:"scanGenerateSprites"`
	// Generate phashes during scan
	ScanGeneratePhashes bool `json:"scanGeneratePhashes"`
	// Generate image thumbnails during scan
	ScanGenerateThumbnails bool `json:"scanGenerateThumbnails"`
	// Generate image thumbnails during scan
	ScanGenerateClipPreviews bool `json:"scanGenerateClipPreviews"`
}

type StashBoxError

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

StashBoxError represents configuration errors of Stash-Box

func (*StashBoxError) Error

func (s *StashBoxError) Error() string

type StashBoxInput added in v0.17.0

type StashBoxInput struct {
	Endpoint string `json:"endpoint"`
	APIKey   string `json:"api_key"`
	Name     string `json:"name"`
}

type StashConfig added in v0.17.0

type StashConfig struct {
	Path         string `json:"path"`
	ExcludeVideo bool   `json:"excludeVideo"`
	ExcludeImage bool   `json:"excludeImage"`
}

type StashConfigInput added in v0.17.0

type StashConfigInput struct {
	Path         string `json:"path"`
	ExcludeVideo bool   `json:"excludeVideo"`
	ExcludeImage bool   `json:"excludeImage"`
}

Stash configuration details

type StashConfigs added in v0.20.0

type StashConfigs []*StashConfig

func (StashConfigs) GetStashFromDirPath added in v0.20.0

func (s StashConfigs) GetStashFromDirPath(dirPath string) *StashConfig

func (StashConfigs) GetStashFromPath added in v0.20.0

func (s StashConfigs) GetStashFromPath(path string) *StashConfig

Jump to

Keyboard shortcuts

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