mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 05:47:37 +01:00
* Make config instance-based * Remove config dependency in paths * Refactor config init * Allow startup without database * Get system status at UI initialise * Add setup wizard * Cache and Metadata optional. Database mandatory * Handle metadata not set during full import/export * Add links * Remove config check middleware * Stash not mandatory * Panic on missing mandatory config fields * Redirect setup to main page if setup not required * Add migration UI * Remove unused stuff * Move UI initialisation into App * Don't create metadata paths on RefreshConfig * Add folder selector for generated in setup * Env variable to set and create config file. Make docker images use a fixed config file. * Set config file during setup
39 lines
773 B
Go
39 lines
773 B
Go
package paths
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/stashapp/stash/pkg/utils"
|
|
)
|
|
|
|
type Paths struct {
|
|
Generated *generatedPaths
|
|
|
|
Scene *scenePaths
|
|
SceneMarkers *sceneMarkerPaths
|
|
}
|
|
|
|
func NewPaths(generatedPath string) *Paths {
|
|
p := Paths{}
|
|
p.Generated = newGeneratedPaths(generatedPath)
|
|
|
|
p.Scene = newScenePaths(p)
|
|
p.SceneMarkers = newSceneMarkerPaths(p)
|
|
return &p
|
|
}
|
|
|
|
func GetStashHomeDirectory() string {
|
|
return filepath.Join(utils.GetHomeDirectory(), ".stash")
|
|
}
|
|
|
|
func GetDefaultDatabaseFilePath() string {
|
|
return filepath.Join(GetStashHomeDirectory(), "stash-go.sqlite")
|
|
}
|
|
|
|
func GetSSLKey() string {
|
|
return filepath.Join(GetStashHomeDirectory(), "stash.key")
|
|
}
|
|
|
|
func GetSSLCert() string {
|
|
return filepath.Join(GetStashHomeDirectory(), "stash.crt")
|
|
}
|