瀏覽代碼

hardcode real base path

reid 2 年之前
父節點
當前提交
76cca35feb
共有 2 個文件被更改,包括 2 次插入19 次删除
  1. 1 12
      config/config.go
  2. 1 7
      settings/system.json

+ 1 - 12
config/config.go

@@ -31,25 +31,14 @@ var (
 	WifiNetworks       []string
 	HttpOpen           = false
 	UploadSecret       string
+	BasePath 		   = "/opt/nativeplanet/groundseg"
 	checkInterval      = 5 * time.Minute
-	stagingMode        = os.Getenv("ENVIRONMENT")
 	confMutex          sync.Mutex
 	versMutex          sync.Mutex
 )
 
 // try initializing from system.json on disk
 func init() {
-	// try loading existing config
-	BasePath, err := os.Getwd()
-	if err != nil {
-		errmsg := fmt.Sprintf("Couldn't get cwd: %v", err)
-		logger.Error(errmsg)
-	}
-	for _, arg := range os.Args[1:] {
-		if arg == "dev" {
-			BasePath = "/opt/nativeplanet/groundseg"
-		}
-	}
 	pathMsg := fmt.Sprintf("Loading configs from %s", BasePath)
 	logger.Info(pathMsg)
 	confPath := filepath.Join(BasePath, "settings", "system.json")

+ 1 - 7
settings/system.json

@@ -2,13 +2,7 @@
     "setup": "start",
     "endpointUrl": "api.startram.io",
     "apiVersion": "v1",
-    "piers": [
-      "bilder-nallux-dozryl",
-      "nimsum-hanlyx-nallux-dozryl",
-      "widwet-mornev-nallux-dozryl",
-      "hocfur-wicnym-nallux-dozryl",
-      "nopmul-pollyt"
-    ],
+    "piers": [],
     "netCheck": "1.1.1.1:53",
     "updateMode": "auto",
     "updateUrl": "https://version.groundseg.app",