Ver Fonte

config cleanup

nallux há 2 anos atrás
pai
commit
a950ee1548

+ 0 - 17
broadcast/broadcast.go

@@ -122,23 +122,6 @@ func constructPierInfo(piers []string) (map[string]structs.Urbit, error) {
 	// convert the running status into bools
 	for pier, status := range pierStatus {
 		dockerConfig := docker.Conf(pier)
-		fmt.Println(dockerConfig)
-		// pull docker info from json
-		/*
-			var dockerConfig structs.UrbitDocker
-			confPath := filepath.Join(config.BasePath, "settings", "pier", pier+".json")
-			file, err := ioutil.ReadFile(confPath)
-			if err != nil {
-				errmsg := fmt.Sprintf("Unable to load %s config: %v", pier, err)
-				logger.Error(errmsg)
-				continue
-			}
-			if err := json.Unmarshal(file, &dockerConfig); err != nil {
-				errmsg := fmt.Sprintf("Error decoding %s JSON: %v", pier, err)
-				logger.Error(errmsg)
-				continue
-			}
-		*/
 		urbit := structs.Urbit{}
 		if existingUrbit, exists := currentState.Urbits[pier]; exists {
 			// If the ship already exists in broadcastState, use its current state

+ 2 - 2
docker/urbit.go

@@ -39,6 +39,8 @@ func Conf(pier string) structs.UrbitDocker {
 }
 
 func loadConfig(pier string) error {
+	urbitMutex.Lock()
+	defer urbitMutex.Unlock()
 	// pull docker info from json
 	confPath := filepath.Join(config.BasePath, "settings", "pier", pier+".json")
 	file, err := ioutil.ReadFile(confPath)
@@ -53,8 +55,6 @@ func loadConfig(pier string) error {
 		return fmt.Errorf(errmsg)
 	}
 	// Store in var
-	urbitMutex.Lock()
-	defer urbitMutex.Unlock()
 	urbitsConfig[pier] = targetStruct
 	return nil
 }

+ 2 - 2
settings/pier/nopmul-pollyt.json

@@ -14,7 +14,7 @@
     "minio_password": "",
     "network": "none",
     "wg_url": "nopmul-pollyt.nativeplanet.live",
-    "wg_http_port": "null",
+    "wg_http_port": 0,
     "wg_ames_port": "null",
     "wg_s3_port": "null",
     "wg_console_port": "null",
@@ -29,4 +29,4 @@
     "show_urbit_web": "default",
     "dev_mode": false,
     "click": false
-}
+}

+ 0 - 32
settings/pier/~hocfur-wicnym-nallux-dozryl.json

@@ -1,32 +0,0 @@
-{
-    "pier_name": "~hocfur-wicnym-nallux-dozryl",
-    "http_port": 8082,
-    "ames_port": 34345,
-    "loom_size": 31,
-    "urbit_version": "v2.1",
-    "minio_version": "latest",
-    "urbit_repo": "registry.hub.docker.com/nativeplanet/urbit",
-    "minio_repo": "registry.hub.docker.com/minio/minio",
-    "urbit_amd64_sha256": "f08cd1717c6191a277f7cee46807eee8d772d8001c61c0610a53455bd56c5a77",
-    "urbit_arm64_sha256": "ed13a935b30e9a7666686c153464748ff2b768f1803df39c56ead2cf9e9c29df",
-    "minio_amd64_sha256": "f6a3001a765dc59a8e365149ade0ea628494230e984891877ead016eb24ba9a9",
-    "minio_arm64_sha256": "567779c9f29aca670f84d066051290faeaae6c3ad3a3b7062de4936aaab2a29d",
-    "minio_password": "",
-    "network": "none",
-    "wg_url": "nan",
-    "wg_http_port": null,
-    "wg_ames_port": null,
-    "wg_s3_port": null,
-    "wg_console_port": null,
-    "meld_schedule": false,
-    "meld_frequency": 7,
-    "meld_time": "0000",
-    "meld_last": "0",
-    "meld_next": "0",
-    "boot_status": "boot",
-    "custom_urbit_web": "",
-    "custom_s3_web": "",
-    "show_urbit_web": "default",
-    "dev_mode": false,
-    "click": false
-}

+ 6 - 8
settings/system.json

@@ -3,13 +3,11 @@
     "endpointUrl": "dev-api.nativeplanet.live",
     "apiVersion": "v1",
     "piers": [
-        "widwet-mornev-nallux-dozryl",
-        "hocfur-wicnym-nallux-dozryl",
-        "pinlyd-mattyd-nallux-dozryl",
-        "solnys-dibmyn-nallux-dozryl",
-        "wormun-fadwyl-nallux-dozryl",
-        "nopmul-pollyt",
-        "nalruc-nallux-dozryl"
+      "bilder-nallux-dozryl",
+      "nimsum-hanlyx-nallux-dozryl",
+      "widwet-mornev-nallux-dozryl",
+      "hocfur-wicnym-nallux-dozryl",
+      "nopmul-pollyt"
     ],
     "netCheck": "1.1.1.1:53",
     "updateMode": "auto",
@@ -46,4 +44,4 @@
     "pubkey": "a1c5VlArTGNXY25vM24zeCtoYUlJOGVUVW5EYjdESEU5VVRoZzN2VHp4Zz0K",
     "privkey": "cuwW3f4mM1JDxFVq/S8bcRFewY77kY6a6bhi3dQV8NY=",
     "salt": "privateprivate"
-}
+}