mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Improved/fixed macOS support (#4153)
* Fix macOS notifications * Change CFBundleIdentifier to match domain * Distribute Stash.app * Also build universal phasher binary * Fix binary name in check_version.go * Expose GOOS, working dir and home dir in systemStatus endpoint * Disable setup in working directory when running Stash.app * More Makefile improvements, remove unused scripts * Improve READMEs and documentation
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -46,6 +47,9 @@ type SystemStatus struct {
|
||||
ConfigPath *string `json:"configPath"`
|
||||
AppSchema int `json:"appSchema"`
|
||||
Status SystemStatusEnum `json:"status"`
|
||||
Os string `json:"os"`
|
||||
WorkingDir string `json:"working_dir"`
|
||||
HomeDir string `json:"home_dir"`
|
||||
}
|
||||
|
||||
type SystemStatusEnum string
|
||||
@@ -740,20 +744,27 @@ func (s *Manager) Migrate(ctx context.Context, input MigrateInput) error {
|
||||
}
|
||||
|
||||
func (s *Manager) GetSystemStatus() *SystemStatus {
|
||||
workingDir := fsutil.GetWorkingDirectory()
|
||||
homeDir := fsutil.GetHomeDirectory()
|
||||
|
||||
database := s.Database
|
||||
status := SystemStatusEnumOk
|
||||
dbSchema := int(database.Version())
|
||||
dbPath := database.DatabasePath()
|
||||
appSchema := int(database.AppSchemaVersion())
|
||||
configFile := s.Config.GetConfigFile()
|
||||
|
||||
status := SystemStatusEnumOk
|
||||
if s.Config.IsNewSystem() {
|
||||
status = SystemStatusEnumSetup
|
||||
} else if dbSchema < appSchema {
|
||||
status = SystemStatusEnumNeedsMigration
|
||||
}
|
||||
|
||||
configFile := s.Config.GetConfigFile()
|
||||
|
||||
return &SystemStatus{
|
||||
Os: runtime.GOOS,
|
||||
WorkingDir: workingDir,
|
||||
HomeDir: homeDir,
|
||||
DatabaseSchema: &dbSchema,
|
||||
DatabasePath: &dbPath,
|
||||
AppSchema: appSchema,
|
||||
|
||||
Reference in New Issue
Block a user