mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix setting pointers corrupting config in memory (#4868)
This commit is contained in:
@@ -27,101 +27,101 @@ func TestConcurrentConfigAccess(t *testing.T) {
|
||||
i.GetConfigFile()
|
||||
i.GetConfigPath()
|
||||
i.GetDefaultDatabaseFilePath()
|
||||
i.Set(BackupDirectoryPath, i.GetBackupDirectoryPath())
|
||||
i.SetInterface(BackupDirectoryPath, i.GetBackupDirectoryPath())
|
||||
i.GetStashPaths()
|
||||
_ = i.ValidateStashBoxes(nil)
|
||||
_ = i.Validate()
|
||||
_ = i.ActivatePublicAccessTripwire("")
|
||||
i.Set(Cache, i.GetCachePath())
|
||||
i.Set(Generated, i.GetGeneratedPath())
|
||||
i.Set(Metadata, i.GetMetadataPath())
|
||||
i.Set(Database, i.GetDatabasePath())
|
||||
i.SetInterface(Cache, i.GetCachePath())
|
||||
i.SetInterface(Generated, i.GetGeneratedPath())
|
||||
i.SetInterface(Metadata, i.GetMetadataPath())
|
||||
i.SetInterface(Database, i.GetDatabasePath())
|
||||
|
||||
// these must be set as strings since the original values are also strings
|
||||
// setting them as []byte will cause the returned string to be corrupted
|
||||
i.Set(JWTSignKey, string(i.GetJWTSignKey()))
|
||||
i.Set(SessionStoreKey, string(i.GetSessionStoreKey()))
|
||||
i.SetInterface(JWTSignKey, string(i.GetJWTSignKey()))
|
||||
i.SetInterface(SessionStoreKey, string(i.GetSessionStoreKey()))
|
||||
|
||||
i.GetDefaultScrapersPath()
|
||||
i.Set(Exclude, i.GetExcludes())
|
||||
i.Set(ImageExclude, i.GetImageExcludes())
|
||||
i.Set(VideoExtensions, i.GetVideoExtensions())
|
||||
i.Set(ImageExtensions, i.GetImageExtensions())
|
||||
i.Set(GalleryExtensions, i.GetGalleryExtensions())
|
||||
i.Set(CreateGalleriesFromFolders, i.GetCreateGalleriesFromFolders())
|
||||
i.Set(Language, i.GetLanguage())
|
||||
i.Set(VideoFileNamingAlgorithm, i.GetVideoFileNamingAlgorithm())
|
||||
i.Set(ScrapersPath, i.GetScrapersPath())
|
||||
i.Set(ScraperUserAgent, i.GetScraperUserAgent())
|
||||
i.Set(ScraperCDPPath, i.GetScraperCDPPath())
|
||||
i.Set(ScraperCertCheck, i.GetScraperCertCheck())
|
||||
i.Set(ScraperExcludeTagPatterns, i.GetScraperExcludeTagPatterns())
|
||||
i.Set(StashBoxes, i.GetStashBoxes())
|
||||
i.SetInterface(Exclude, i.GetExcludes())
|
||||
i.SetInterface(ImageExclude, i.GetImageExcludes())
|
||||
i.SetInterface(VideoExtensions, i.GetVideoExtensions())
|
||||
i.SetInterface(ImageExtensions, i.GetImageExtensions())
|
||||
i.SetInterface(GalleryExtensions, i.GetGalleryExtensions())
|
||||
i.SetInterface(CreateGalleriesFromFolders, i.GetCreateGalleriesFromFolders())
|
||||
i.SetInterface(Language, i.GetLanguage())
|
||||
i.SetInterface(VideoFileNamingAlgorithm, i.GetVideoFileNamingAlgorithm())
|
||||
i.SetInterface(ScrapersPath, i.GetScrapersPath())
|
||||
i.SetInterface(ScraperUserAgent, i.GetScraperUserAgent())
|
||||
i.SetInterface(ScraperCDPPath, i.GetScraperCDPPath())
|
||||
i.SetInterface(ScraperCertCheck, i.GetScraperCertCheck())
|
||||
i.SetInterface(ScraperExcludeTagPatterns, i.GetScraperExcludeTagPatterns())
|
||||
i.SetInterface(StashBoxes, i.GetStashBoxes())
|
||||
i.GetDefaultPluginsPath()
|
||||
i.Set(PluginsPath, i.GetPluginsPath())
|
||||
i.Set(Host, i.GetHost())
|
||||
i.Set(Port, i.GetPort())
|
||||
i.Set(ExternalHost, i.GetExternalHost())
|
||||
i.Set(PreviewSegmentDuration, i.GetPreviewSegmentDuration())
|
||||
i.Set(ParallelTasks, i.GetParallelTasks())
|
||||
i.Set(ParallelTasks, i.GetParallelTasksWithAutoDetection())
|
||||
i.Set(PreviewAudio, i.GetPreviewAudio())
|
||||
i.Set(PreviewSegments, i.GetPreviewSegments())
|
||||
i.Set(PreviewExcludeStart, i.GetPreviewExcludeStart())
|
||||
i.Set(PreviewExcludeEnd, i.GetPreviewExcludeEnd())
|
||||
i.Set(PreviewPreset, i.GetPreviewPreset())
|
||||
i.Set(MaxTranscodeSize, i.GetMaxTranscodeSize())
|
||||
i.Set(MaxStreamingTranscodeSize, i.GetMaxStreamingTranscodeSize())
|
||||
i.Set(ApiKey, i.GetAPIKey())
|
||||
i.Set(Username, i.GetUsername())
|
||||
i.Set(Password, i.GetPasswordHash())
|
||||
i.SetInterface(PluginsPath, i.GetPluginsPath())
|
||||
i.SetInterface(Host, i.GetHost())
|
||||
i.SetInterface(Port, i.GetPort())
|
||||
i.SetInterface(ExternalHost, i.GetExternalHost())
|
||||
i.SetInterface(PreviewSegmentDuration, i.GetPreviewSegmentDuration())
|
||||
i.SetInterface(ParallelTasks, i.GetParallelTasks())
|
||||
i.SetInterface(ParallelTasks, i.GetParallelTasksWithAutoDetection())
|
||||
i.SetInterface(PreviewAudio, i.GetPreviewAudio())
|
||||
i.SetInterface(PreviewSegments, i.GetPreviewSegments())
|
||||
i.SetInterface(PreviewExcludeStart, i.GetPreviewExcludeStart())
|
||||
i.SetInterface(PreviewExcludeEnd, i.GetPreviewExcludeEnd())
|
||||
i.SetInterface(PreviewPreset, i.GetPreviewPreset())
|
||||
i.SetInterface(MaxTranscodeSize, i.GetMaxTranscodeSize())
|
||||
i.SetInterface(MaxStreamingTranscodeSize, i.GetMaxStreamingTranscodeSize())
|
||||
i.SetInterface(ApiKey, i.GetAPIKey())
|
||||
i.SetInterface(Username, i.GetUsername())
|
||||
i.SetInterface(Password, i.GetPasswordHash())
|
||||
i.GetCredentials()
|
||||
i.Set(MaxSessionAge, i.GetMaxSessionAge())
|
||||
i.Set(CustomServedFolders, i.GetCustomServedFolders())
|
||||
i.Set(LegacyCustomUILocation, i.GetUILocation())
|
||||
i.Set(MenuItems, i.GetMenuItems())
|
||||
i.Set(SoundOnPreview, i.GetSoundOnPreview())
|
||||
i.Set(WallShowTitle, i.GetWallShowTitle())
|
||||
i.Set(CustomPerformerImageLocation, i.GetCustomPerformerImageLocation())
|
||||
i.Set(WallPlayback, i.GetWallPlayback())
|
||||
i.Set(MaximumLoopDuration, i.GetMaximumLoopDuration())
|
||||
i.Set(AutostartVideo, i.GetAutostartVideo())
|
||||
i.Set(ShowStudioAsText, i.GetShowStudioAsText())
|
||||
i.Set(legacyImageLightboxSlideshowDelay, *i.GetImageLightboxOptions().SlideshowDelay)
|
||||
i.Set(ImageLightboxSlideshowDelay, *i.GetImageLightboxOptions().SlideshowDelay)
|
||||
i.SetInterface(MaxSessionAge, i.GetMaxSessionAge())
|
||||
i.SetInterface(CustomServedFolders, i.GetCustomServedFolders())
|
||||
i.SetInterface(LegacyCustomUILocation, i.GetUILocation())
|
||||
i.SetInterface(MenuItems, i.GetMenuItems())
|
||||
i.SetInterface(SoundOnPreview, i.GetSoundOnPreview())
|
||||
i.SetInterface(WallShowTitle, i.GetWallShowTitle())
|
||||
i.SetInterface(CustomPerformerImageLocation, i.GetCustomPerformerImageLocation())
|
||||
i.SetInterface(WallPlayback, i.GetWallPlayback())
|
||||
i.SetInterface(MaximumLoopDuration, i.GetMaximumLoopDuration())
|
||||
i.SetInterface(AutostartVideo, i.GetAutostartVideo())
|
||||
i.SetInterface(ShowStudioAsText, i.GetShowStudioAsText())
|
||||
i.SetInterface(legacyImageLightboxSlideshowDelay, *i.GetImageLightboxOptions().SlideshowDelay)
|
||||
i.SetInterface(ImageLightboxSlideshowDelay, *i.GetImageLightboxOptions().SlideshowDelay)
|
||||
i.GetCSSPath()
|
||||
i.GetCSS()
|
||||
i.GetJavascriptPath()
|
||||
i.GetJavascript()
|
||||
i.GetCustomLocalesPath()
|
||||
i.GetCustomLocales()
|
||||
i.Set(CSSEnabled, i.GetCSSEnabled())
|
||||
i.Set(CSSEnabled, i.GetCustomLocalesEnabled())
|
||||
i.Set(HandyKey, i.GetHandyKey())
|
||||
i.Set(UseStashHostedFunscript, i.GetUseStashHostedFunscript())
|
||||
i.Set(DLNAServerName, i.GetDLNAServerName())
|
||||
i.Set(DLNADefaultEnabled, i.GetDLNADefaultEnabled())
|
||||
i.Set(DLNADefaultIPWhitelist, i.GetDLNADefaultIPWhitelist())
|
||||
i.Set(DLNAInterfaces, i.GetDLNAInterfaces())
|
||||
i.Set(DLNAPort, i.GetDLNAPort())
|
||||
i.Set(LogFile, i.GetLogFile())
|
||||
i.Set(LogOut, i.GetLogOut())
|
||||
i.Set(LogLevel, i.GetLogLevel())
|
||||
i.Set(LogAccess, i.GetLogAccess())
|
||||
i.Set(MaxUploadSize, i.GetMaxUploadSize())
|
||||
i.Set(FunscriptOffset, i.GetFunscriptOffset())
|
||||
i.Set(DefaultIdentifySettings, i.GetDefaultIdentifySettings())
|
||||
i.Set(DeleteGeneratedDefault, i.GetDeleteGeneratedDefault())
|
||||
i.Set(DeleteFileDefault, i.GetDeleteFileDefault())
|
||||
i.Set(dangerousAllowPublicWithoutAuth, i.GetDangerousAllowPublicWithoutAuth())
|
||||
i.Set(SecurityTripwireAccessedFromPublicInternet, i.GetSecurityTripwireAccessedFromPublicInternet())
|
||||
i.Set(DisableDropdownCreatePerformer, i.GetDisableDropdownCreate().Performer)
|
||||
i.Set(DisableDropdownCreateStudio, i.GetDisableDropdownCreate().Studio)
|
||||
i.Set(DisableDropdownCreateTag, i.GetDisableDropdownCreate().Tag)
|
||||
i.Set(DisableDropdownCreateMovie, i.GetDisableDropdownCreate().Movie)
|
||||
i.Set(AutostartVideoOnPlaySelected, i.GetAutostartVideoOnPlaySelected())
|
||||
i.Set(ContinuePlaylistDefault, i.GetContinuePlaylistDefault())
|
||||
i.Set(PythonPath, i.GetPythonPath())
|
||||
i.SetInterface(CSSEnabled, i.GetCSSEnabled())
|
||||
i.SetInterface(CSSEnabled, i.GetCustomLocalesEnabled())
|
||||
i.SetInterface(HandyKey, i.GetHandyKey())
|
||||
i.SetInterface(UseStashHostedFunscript, i.GetUseStashHostedFunscript())
|
||||
i.SetInterface(DLNAServerName, i.GetDLNAServerName())
|
||||
i.SetInterface(DLNADefaultEnabled, i.GetDLNADefaultEnabled())
|
||||
i.SetInterface(DLNADefaultIPWhitelist, i.GetDLNADefaultIPWhitelist())
|
||||
i.SetInterface(DLNAInterfaces, i.GetDLNAInterfaces())
|
||||
i.SetInterface(DLNAPort, i.GetDLNAPort())
|
||||
i.SetInterface(LogFile, i.GetLogFile())
|
||||
i.SetInterface(LogOut, i.GetLogOut())
|
||||
i.SetInterface(LogLevel, i.GetLogLevel())
|
||||
i.SetInterface(LogAccess, i.GetLogAccess())
|
||||
i.SetInterface(MaxUploadSize, i.GetMaxUploadSize())
|
||||
i.SetInterface(FunscriptOffset, i.GetFunscriptOffset())
|
||||
i.SetInterface(DefaultIdentifySettings, i.GetDefaultIdentifySettings())
|
||||
i.SetInterface(DeleteGeneratedDefault, i.GetDeleteGeneratedDefault())
|
||||
i.SetInterface(DeleteFileDefault, i.GetDeleteFileDefault())
|
||||
i.SetInterface(dangerousAllowPublicWithoutAuth, i.GetDangerousAllowPublicWithoutAuth())
|
||||
i.SetInterface(SecurityTripwireAccessedFromPublicInternet, i.GetSecurityTripwireAccessedFromPublicInternet())
|
||||
i.SetInterface(DisableDropdownCreatePerformer, i.GetDisableDropdownCreate().Performer)
|
||||
i.SetInterface(DisableDropdownCreateStudio, i.GetDisableDropdownCreate().Studio)
|
||||
i.SetInterface(DisableDropdownCreateTag, i.GetDisableDropdownCreate().Tag)
|
||||
i.SetInterface(DisableDropdownCreateMovie, i.GetDisableDropdownCreate().Movie)
|
||||
i.SetInterface(AutostartVideoOnPlaySelected, i.GetAutostartVideoOnPlaySelected())
|
||||
i.SetInterface(ContinuePlaylistDefault, i.GetContinuePlaylistDefault())
|
||||
i.SetInterface(PythonPath, i.GetPythonPath())
|
||||
t.Logf("Worker %v iteration %v took %v", wk, l, time.Since(start))
|
||||
}
|
||||
wg.Done()
|
||||
|
||||
Reference in New Issue
Block a user