stash/pkg/manager/paths/paths.go
Stash Dev 29a40c5bdd Configuration
* Added flags to customize the host and port
* Start up just one server rather than a server for HTTP and HTTPS.  HTTPS server will only start if a cert and key are found
2019-04-11 10:55:58 -07:00

46 lines
935 B
Go

package paths
import (
"github.com/stashapp/stash/pkg/utils"
"path/filepath"
)
type Paths struct {
Generated *generatedPaths
JSON *jsonPaths
Gallery *galleryPaths
Scene *scenePaths
SceneMarkers *sceneMarkerPaths
}
func NewPaths() *Paths {
p := Paths{}
p.Generated = newGeneratedPaths()
p.JSON = newJSONPaths()
p.Gallery = newGalleryPaths()
p.Scene = newScenePaths(p)
p.SceneMarkers = newSceneMarkerPaths(p)
return &p
}
func GetConfigDirectory() string {
return filepath.Join(utils.GetHomeDirectory(), ".stash")
}
func GetDefaultDatabaseFilePath() string {
return filepath.Join(GetConfigDirectory(), "stash-go.sqlite")
}
func GetDefaultConfigFilePath() string {
return filepath.Join(GetConfigDirectory(), "config.yml")
}
func GetSSLKey() string {
return filepath.Join(GetConfigDirectory(), "stash.key")
}
func GetSSLCert() string {
return filepath.Join(GetConfigDirectory(), "stash.crt")
}