Documentation ¶
Index ¶
- Constants
- func FileEnvSet() bool
- func IsOfficialBuild() bool
- type Instance
- func (i *Instance) ActivatePublicAccessTripwire(requestIP string) error
- func (i *Instance) FinalizeSetup()
- func (i *Instance) GetAPIKey() string
- func (i *Instance) GetAutostartVideo() bool
- func (i *Instance) GetAutostartVideoOnPlaySelected() bool
- func (i *Instance) GetCPUProfilePath() string
- func (i *Instance) GetCSS() string
- func (i *Instance) GetCSSEnabled() bool
- func (i *Instance) GetCSSPath() string
- func (i *Instance) GetCachePath() string
- func (i *Instance) GetConfigFile() string
- func (i *Instance) GetConfigPath() string
- func (i *Instance) GetContinuePlaylistDefault() bool
- func (i *Instance) GetCreateGalleriesFromFolders() bool
- func (i *Instance) GetCredentials() (string, string)
- func (i *Instance) GetCustomPerformerImageLocation() string
- func (i *Instance) GetCustomServedFolders() URLMap
- func (i *Instance) GetCustomUILocation() string
- func (i *Instance) GetDLNADefaultEnabled() bool
- func (i *Instance) GetDLNADefaultIPWhitelist() []string
- func (i *Instance) GetDLNAInterfaces() []string
- func (i *Instance) GetDLNAServerName() string
- func (i *Instance) GetDangerousAllowPublicWithoutAuth() bool
- func (i *Instance) GetDatabasePath() string
- func (i *Instance) GetDefaultAutoTagSettings() *models.AutoTagMetadataOptions
- func (i *Instance) GetDefaultDatabaseFilePath() string
- func (i *Instance) GetDefaultGenerateSettings() *models.GenerateMetadataOptions
- func (i *Instance) GetDefaultIdentifySettings() *models.IdentifyMetadataTaskOptions
- func (i *Instance) GetDefaultPluginsPath() string
- func (i *Instance) GetDefaultScanSettings() *models.ScanMetadataOptions
- func (i *Instance) GetDefaultScrapersPath() string
- func (i *Instance) GetDeleteFileDefault() bool
- func (i *Instance) GetDeleteGeneratedDefault() bool
- func (i *Instance) GetDisableDropdownCreate() *models.ConfigDisableDropdownCreate
- func (i *Instance) GetExcludes() []string
- func (i *Instance) GetExternalHost() string
- func (i *Instance) GetFunscriptOffset() int
- func (i *Instance) GetGalleryExtensions() []string
- func (i *Instance) GetGeneratedPath() string
- func (i *Instance) GetHandyKey() string
- func (i *Instance) GetHost() string
- func (i *Instance) GetImageExcludes() []string
- func (i *Instance) GetImageExtensions() []string
- func (i *Instance) GetJWTSignKey() []byte
- func (i *Instance) GetLanguage() string
- func (i *Instance) GetLogAccess() bool
- func (i *Instance) GetLogFile() string
- func (i *Instance) GetLogLevel() string
- func (i *Instance) GetLogOut() bool
- func (i *Instance) GetMaxSessionAge() int
- func (i *Instance) GetMaxStreamingTranscodeSize() models.StreamingResolutionEnum
- func (i *Instance) GetMaxTranscodeSize() models.StreamingResolutionEnum
- func (i *Instance) GetMaxUploadSize() int64
- func (i *Instance) GetMaximumLoopDuration() int
- func (i *Instance) GetMenuItems() []string
- func (i *Instance) GetMetadataPath() string
- func (i *Instance) GetNoBrowser() bool
- func (i *Instance) GetNotificationsEnabled() bool
- func (i *Instance) GetParallelTasks() int
- func (i *Instance) GetParallelTasksWithAutoDetection() int
- func (i *Instance) GetPasswordHash() string
- func (i *Instance) GetPluginsPath() string
- func (i *Instance) GetPort() int
- func (i *Instance) GetPreviewAudio() bool
- func (i *Instance) GetPreviewExcludeEnd() string
- func (i *Instance) GetPreviewExcludeStart() string
- func (i *Instance) GetPreviewPreset() models.PreviewPreset
- func (i *Instance) GetPreviewSegmentDuration() float64
- func (i *Instance) GetPreviewSegments() int
- func (i *Instance) GetScraperCDPPath() string
- func (i *Instance) GetScraperCertCheck() bool
- func (i *Instance) GetScraperExcludeTagPatterns() []string
- func (i *Instance) GetScraperUserAgent() string
- func (i *Instance) GetScrapersPath() string
- func (i *Instance) GetSecurityTripwireAccessedFromPublicInternet() string
- func (i *Instance) GetSessionStoreKey() []byte
- func (i *Instance) GetShowOneTimeMovedNotification() bool
- func (i *Instance) GetShowScrubber() bool
- func (i *Instance) GetShowStudioAsText() bool
- func (i *Instance) GetSlideshowDelay() int
- func (i *Instance) GetSoundOnPreview() bool
- func (i *Instance) GetStashBoxes() models.StashBoxes
- func (i *Instance) GetStashPaths() []*models.StashConfig
- func (i *Instance) GetTLSFiles() (certFile, keyFile string)
- func (i *Instance) GetUsername() string
- func (i *Instance) GetVideoExtensions() []string
- func (i *Instance) GetVideoFileNamingAlgorithm() models.HashAlgorithm
- func (i *Instance) GetWallPlayback() string
- func (i *Instance) GetWallShowTitle() bool
- func (i *Instance) HasCredentials() bool
- func (i *Instance) HasOverride(key string) bool
- func (i *Instance) HasTLSConfig() bool
- func (i *Instance) InitTLS()
- func (i *Instance) IsCalculateMD5() bool
- func (i *Instance) IsNewSystem() bool
- func (i *Instance) IsWriteImageThumbnails() bool
- func (i *Instance) Set(key string, value interface{})
- func (i *Instance) SetCSS(css string)
- func (i *Instance) SetChecksumDefaultValues(defaultAlgorithm models.HashAlgorithm, usingMD5 bool)
- func (i *Instance) SetConfigFile(fn string)
- func (i *Instance) SetInitialConfig() error
- func (i *Instance) SetInitialMemoryConfig() error
- func (i *Instance) SetPassword(value string)
- func (i *Instance) Validate() error
- func (i *Instance) ValidateCredentials(username string, password string) bool
- func (i *Instance) ValidateStashBoxes(boxes []*models.StashBoxInput) error
- func (i *Instance) Write() error
- type MissingConfigError
- type StashBoxError
- type URLMap
Constants ¶
const ( Stash = "stash" Cache = "cache" Generated = "generated" Metadata = "metadata" Downloads = "downloads" ApiKey = "api_key" Username = "username" Password = "password" MaxSessionAge = "max_session_age" 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" ParallelTasks = "parallel_tasks" PreviewPreset = "preview_preset" PreviewAudio = "preview_audio" PreviewSegmentDuration = "preview_segment_duration" PreviewSegments = "preview_segments" PreviewExcludeStart = "preview_exclude_start" PreviewExcludeEnd = "preview_exclude_end" WriteImageThumbnails = "write_image_thumbnails" Host = "host" Port = "port" ExternalHost = "external_host" // 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" // plugin options PluginsPath = "plugins_path" // 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. CustomUILocation = "custom_ui_location" // 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" ShowScrubber = "show_scrubber" WallPlayback = "wall_playback" SlideshowDelay = "slideshow_delay" DisableDropdownCreatePerformer = "disable_dropdown_create.performer" DisableDropdownCreateStudio = "disable_dropdown_create.studio" DisableDropdownCreateTag = "disable_dropdown_create.tag" HandyKey = "handy_key" FunscriptOffset = "funscript_offset" SecurityTripwireAccessedFromPublicInternet = "security_tripwire_accessed_from_public_internet" // DLNA options DLNAServerName = "dlna.server_name" DLNADefaultEnabled = "dlna.default_enabled" DLNADefaultIPWhitelist = "dlna.default_whitelist" DLNAInterfaces = "dlna.interfaces" // 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" )
Variables ¶
This section is empty.
Functions ¶
func FileEnvSet ¶ added in v0.11.0
func FileEnvSet() bool
FileEnvSet returns true if the configuration file environment parameter is set.
func IsOfficialBuild ¶ added in v0.13.0
func IsOfficialBuild() bool
Types ¶
type Instance ¶ added in v0.7.0
func GetInstance ¶ added in v0.7.0
func GetInstance() *Instance
func Initialize ¶ added in v0.7.0
func (*Instance) ActivatePublicAccessTripwire ¶ added in v0.10.0
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 (*Instance) FinalizeSetup ¶ added in v0.7.0
func (i *Instance) FinalizeSetup()
func (*Instance) GetAutostartVideo ¶ added in v0.7.0
func (*Instance) GetAutostartVideoOnPlaySelected ¶ added in v0.11.0
func (*Instance) GetCPUProfilePath ¶ added in v0.8.0
GetCPUProfilePath returns the path to the CPU profile file to output profiling info to. This is set only via a commandline flag. Returns an empty string if not set.
func (*Instance) GetCSSEnabled ¶ added in v0.7.0
func (*Instance) GetCSSPath ¶ added in v0.7.0
func (*Instance) GetCachePath ¶ added in v0.7.0
func (*Instance) GetConfigFile ¶ added in v0.7.0
GetConfigFile returns the full path to the used configuration file.
func (*Instance) GetConfigPath ¶ added in v0.7.0
GetConfigPath returns the path of the directory containing the used configuration file.
func (*Instance) GetContinuePlaylistDefault ¶ added in v0.11.0
func (*Instance) GetCreateGalleriesFromFolders ¶ added in v0.7.0
func (*Instance) GetCredentials ¶ added in v0.7.0
func (*Instance) GetCustomPerformerImageLocation ¶ added in v0.9.0
func (*Instance) GetCustomServedFolders ¶ added in v0.7.0
GetCustomServedFolders gets the map of custom paths to their applicable filesystem locations
func (*Instance) GetCustomUILocation ¶ added in v0.7.0
func (*Instance) GetDLNADefaultEnabled ¶ added in v0.8.0
GetDLNADefaultEnabled returns true if the DLNA is enabled by default.
func (*Instance) GetDLNADefaultIPWhitelist ¶ added in v0.8.0
GetDLNADefaultIPWhitelist returns a list of IP addresses/wildcards that are allowed to use the DLNA service.
func (*Instance) GetDLNAInterfaces ¶ added in v0.8.0
GetDLNAInterfaces returns a list of interface names to expose DLNA on. If empty, runs on all interfaces.
func (*Instance) GetDLNAServerName ¶ added in v0.8.0
GetDLNAServerName returns the visible name of the DLNA server. If empty, "stash" will be used.
func (*Instance) GetDangerousAllowPublicWithoutAuth ¶ added in v0.10.0
GetDangerousAllowPublicWithoutAuth determines if the security feature is enabled. See https://github.com/stashapp/stash/wiki/Authentication-Required-When-Accessing-Stash-From-the-Internet
func (*Instance) GetDatabasePath ¶ added in v0.7.0
func (*Instance) GetDefaultAutoTagSettings ¶ added in v0.12.0
func (i *Instance) GetDefaultAutoTagSettings() *models.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 (*Instance) GetDefaultDatabaseFilePath ¶ added in v0.7.0
GetDefaultDatabaseFilePath returns the default database filename, which is located in the same directory as the config file.
func (*Instance) GetDefaultGenerateSettings ¶ added in v0.12.0
func (i *Instance) 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 (*Instance) GetDefaultIdentifySettings ¶ added in v0.11.0
func (i *Instance) GetDefaultIdentifySettings() *models.IdentifyMetadataTaskOptions
GetDefaultIdentifySettings returns the default Identify task settings. Returns nil if the settings could not be unmarshalled, or if it has not been set.
func (*Instance) GetDefaultPluginsPath ¶ added in v0.7.0
func (*Instance) GetDefaultScanSettings ¶ added in v0.12.0
func (i *Instance) GetDefaultScanSettings() *models.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 (*Instance) GetDefaultScrapersPath ¶ added in v0.7.0
func (*Instance) GetDeleteFileDefault ¶ added in v0.11.0
func (*Instance) GetDeleteGeneratedDefault ¶ added in v0.11.0
func (*Instance) GetDisableDropdownCreate ¶ added in v0.11.0
func (i *Instance) GetDisableDropdownCreate() *models.ConfigDisableDropdownCreate
func (*Instance) GetExcludes ¶ added in v0.7.0
func (*Instance) GetExternalHost ¶ added in v0.7.0
func (*Instance) GetFunscriptOffset ¶ added in v0.9.0
func (*Instance) GetGalleryExtensions ¶ added in v0.7.0
func (*Instance) GetGeneratedPath ¶ added in v0.7.0
func (*Instance) GetHandyKey ¶ added in v0.8.0
func (*Instance) GetImageExcludes ¶ added in v0.7.0
func (*Instance) GetImageExtensions ¶ added in v0.7.0
func (*Instance) GetJWTSignKey ¶ added in v0.7.0
func (*Instance) GetLanguage ¶ added in v0.7.0
func (*Instance) GetLogAccess ¶ added in v0.7.0
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 (*Instance) GetLogFile ¶ added in v0.7.0
GetLogFile returns the filename of the file to output logs to. An empty string means that file logging will be disabled.
func (*Instance) GetLogLevel ¶ added in v0.7.0
GetLogLevel returns the lowest log level to write to the log. Should be one of "Debug", "Info", "Warning", "Error"
func (*Instance) GetLogOut ¶ added in v0.7.0
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 (*Instance) GetMaxSessionAge ¶ added in v0.7.0
GetMaxSessionAge gets the maximum age for session cookies, in seconds. Session cookie expiry times are refreshed every request.
func (*Instance) GetMaxStreamingTranscodeSize ¶ added in v0.7.0
func (i *Instance) GetMaxStreamingTranscodeSize() models.StreamingResolutionEnum
func (*Instance) GetMaxTranscodeSize ¶ added in v0.7.0
func (i *Instance) GetMaxTranscodeSize() models.StreamingResolutionEnum
func (*Instance) GetMaxUploadSize ¶ added in v0.7.0
Max allowed graphql upload size in megabytes
func (*Instance) GetMaximumLoopDuration ¶ added in v0.7.0
func (*Instance) GetMenuItems ¶ added in v0.7.0
Interface options
func (*Instance) GetMetadataPath ¶ added in v0.7.0
func (*Instance) GetNoBrowser ¶ added in v0.11.0
func (*Instance) GetNotificationsEnabled ¶ added in v0.13.0
func (*Instance) GetParallelTasks ¶ added in v0.7.0
GetParallelTasks returns the number of parallel tasks that should be started by scan or generate task.
func (*Instance) GetParallelTasksWithAutoDetection ¶ added in v0.7.0
func (*Instance) GetPasswordHash ¶ added in v0.7.0
func (*Instance) GetPluginsPath ¶ added in v0.7.0
func (*Instance) GetPreviewAudio ¶ added in v0.8.0
func (*Instance) GetPreviewExcludeEnd ¶ added in v0.7.0
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 (*Instance) GetPreviewExcludeStart ¶ added in v0.7.0
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 (*Instance) GetPreviewPreset ¶ added in v0.7.0
func (i *Instance) GetPreviewPreset() models.PreviewPreset
GetPreviewPreset returns the preset when generating previews. Defaults to Slow.
func (*Instance) GetPreviewSegmentDuration ¶ added in v0.7.0
GetPreviewSegmentDuration returns the duration of a single segment in a scene preview file, in seconds.
func (*Instance) GetPreviewSegments ¶ added in v0.7.0
GetPreviewSegments returns the amount of segments in a scene preview file.
func (*Instance) GetScraperCDPPath ¶ added in v0.7.0
GetScraperCDPPath gets the path to the Chrome executable or remote address to an instance of Chrome.
func (*Instance) GetScraperCertCheck ¶ added in v0.7.0
GetScraperCertCheck returns true if the scraper should check for insecure certificates when fetching an image or a page.
func (*Instance) GetScraperExcludeTagPatterns ¶ added in v0.9.0
func (*Instance) GetScraperUserAgent ¶ added in v0.7.0
func (*Instance) GetScrapersPath ¶ added in v0.7.0
func (*Instance) GetSecurityTripwireAccessedFromPublicInternet ¶ added in v0.10.0
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 (*Instance) GetSessionStoreKey ¶ added in v0.7.0
func (*Instance) GetShowOneTimeMovedNotification ¶ added in v0.13.0
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 (*Instance) GetShowScrubber ¶ added in v0.13.0
func (*Instance) GetShowStudioAsText ¶ added in v0.7.0
func (*Instance) GetSlideshowDelay ¶ added in v0.7.0
func (*Instance) GetSoundOnPreview ¶ added in v0.7.0
func (*Instance) GetStashBoxes ¶ added in v0.7.0
func (i *Instance) GetStashBoxes() models.StashBoxes
func (*Instance) GetStashPaths ¶ added in v0.7.0
func (i *Instance) GetStashPaths() []*models.StashConfig
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 (*Instance) GetTLSFiles ¶ added in v0.9.0
func (*Instance) GetUsername ¶ added in v0.7.0
func (*Instance) GetVideoExtensions ¶ added in v0.7.0
func (*Instance) GetVideoFileNamingAlgorithm ¶ added in v0.7.0
func (i *Instance) GetVideoFileNamingAlgorithm() models.HashAlgorithm
GetVideoFileNamingAlgorithm returns what hash algorithm should be used for naming generated scene video files.
func (*Instance) GetWallPlayback ¶ added in v0.7.0
func (*Instance) GetWallShowTitle ¶ added in v0.7.0
func (*Instance) HasCredentials ¶ added in v0.7.0
func (*Instance) HasOverride ¶ added in v0.11.0
func (*Instance) HasTLSConfig ¶ added in v0.9.0
func (*Instance) IsCalculateMD5 ¶ added in v0.7.0
IsCalculateMD5 returns true if MD5 checksums should be generated for scene video files.
func (*Instance) IsNewSystem ¶ added in v0.7.0
func (*Instance) IsWriteImageThumbnails ¶ added in v0.10.0
IsWriteImageThumbnails returns true if image thumbnails should be written to disk after generating on the fly.
func (*Instance) SetChecksumDefaultValues ¶ added in v0.9.0
func (i *Instance) SetChecksumDefaultValues(defaultAlgorithm models.HashAlgorithm, usingMD5 bool)
func (*Instance) SetConfigFile ¶ added in v0.7.0
func (*Instance) SetInitialConfig ¶ added in v0.7.0
SetInitialConfig fills in missing required config fields
func (*Instance) SetInitialMemoryConfig ¶ added in v0.10.0
SetInitialMemoryConfig fills in missing required config fields without writing the configuration
func (*Instance) SetPassword ¶ added in v0.7.0
func (*Instance) ValidateCredentials ¶ added in v0.7.0
func (*Instance) ValidateStashBoxes ¶ added in v0.7.0
func (i *Instance) ValidateStashBoxes(boxes []*models.StashBoxInput) error
type MissingConfigError ¶ added in v0.7.0
type MissingConfigError struct {
// contains filtered or unexported fields
}
func (MissingConfigError) Error ¶ added in v0.7.0
func (e MissingConfigError) Error() string
type StashBoxError ¶ added in v0.11.0
type StashBoxError struct {
// contains filtered or unexported fields
}
StashBoxError represents configuration errors of Stash-Box
func (*StashBoxError) Error ¶ added in v0.11.0
func (s *StashBoxError) Error() string