浏览代码

config: move more config option to confgen.sh

laiwei 8 年之前
父节点
当前提交
e69efc47a2
共有 6 个文件被更改,包括 18 次插入17 次删除
  1. 1 1
      Makefile
  2. 1 1
      config/aggregator.json
  3. 7 7
      config/alarm.json
  4. 6 6
      config/api.json
  5. 2 1
      config/confgen.sh
  6. 1 1
      config/gateway.json

+ 1 - 1
Makefile

@@ -29,7 +29,7 @@ pack: checkbin
 	@bash ./config/confgen.sh
 	@cp $(TARGET) ./out/$(TARGET)
 	tar -C out -zcf open-falcon-v$(VERSION).tar.gz .
-	@rm -rf out
+	#@rm -rf out
 
 clean:
 	@rm -rf ./bin

+ 1 - 1
config/aggregator.json

@@ -12,7 +12,7 @@
     },
     "api": {
         "plus_api": "http://127.0.0.1:8080",
-        "plus_api_token": "used-by-alarm-in-server-side-and-disabled-by-set-to-blank",
+        "plus_api_token": "%%PLUS_API_DEFAULT_TOKEN%%",
         "push_api": "http://127.0.0.1:1988/v1/push"
     }
 }

+ 7 - 7
config/alarm.json

@@ -5,17 +5,17 @@
         "listen": "0.0.0.0:9912"
     },
     "redis": {
-        "addr": "127.0.0.1:6379",
+        "addr": "%%REDIS%%",
         "maxIdle": 5,
         "highQueues": [
             "event:p0",
             "event:p1",
-            "event:p2",
-            "event:p3",
-            "event:p4",
-            "event:p5"
+            "event:p2"
         ],
         "lowQueues": [
+            "event:p3",
+            "event:p4",
+            "event:p5",
             "event:p6"
         ],
         "userSmsQueue": "/queue/user/sms",
@@ -26,10 +26,10 @@
         "mail": "http://127.0.0.1:10086/mail",
         "dashboard": "http://127.0.0.1:8081",
         "plus_api":"http://127.0.0.1:8080",
-        "plus_api_token": "used-by-alarm-in-server-side-and-disabled-by-set-to-blank"
+        "plus_api_token": "%%PLUS_API_DEFAULT_TOKEN%%"
     },
     "falcon_portal": {
-        "addr": "root:@tcp(127.0.0.1:3306)/alarms?charset=utf8&loc=Asia%2FChongqing",
+        "addr": "%%MYSQL%%/alarms?charset=utf8&loc=Asia%2FChongqing",
         "idle": 10,
         "max": 100
     },

+ 6 - 6
config/api.json

@@ -1,11 +1,11 @@
 {
 	"log_level": "debug",
 	"db": {
-		"faclon_portal": "root:@tcp(127.0.0.1:3306)/falcon_portal?charset=utf8&parseTime=True&loc=Local",
-		"graph": "root:@tcp(127.0.0.1:3306)/graph?charset=utf8&parseTime=True&loc=Local",
-		"uic": "root:@tcp(127.0.0.1:3306)/uic?charset=utf8&parseTime=True&loc=Local",
-		"dashboard": "root:@tcp(127.0.0.1:3306)/dashboard?charset=utf8&parseTime=True&loc=Local",
-		"alarms": "root:@tcp(127.0.0.1:3306)/alarms?charset=utf8&parseTime=True&loc=Local",
+		"faclon_portal": "%%MYSQL%%/falcon_portal?charset=utf8&parseTime=True&loc=Local",
+		"graph": "%%MYSQL%%/graph?charset=utf8&parseTime=True&loc=Local",
+		"uic": "%%MYSQL%%/uic?charset=utf8&parseTime=True&loc=Local",
+		"dashboard": "%%MYSQL%%/dashboard?charset=utf8&parseTime=True&loc=Local",
+		"alarms": "%%MYSQL%%/alarms?charset=utf8&parseTime=True&loc=Local",
 		"db_bug": true
 	},
 	"graphs": {
@@ -23,7 +23,7 @@
 	"access_control": true,
 	"salt": "pleaseinputwhichyouareusingnow",
 	"skip_auth": false,
-    "default_token": "used-by-alarm-in-server-side-and-disabled-by-set-to-blank",
+	"default_token": "%%PLUS_API_DEFAULT_TOKEN%%",
 	"gen_doc": false,
 	"gen_doc_path": "doc/module.html"
 }

+ 2 - 1
config/confgen.sh

@@ -15,6 +15,7 @@ confs=(
     [%%TRANSFER_RPC%%]=127.0.0.1:8433
     [%%REDIS%%]=127.0.0.1:6379
     [%%MYSQL%%]="root:@tcp(127.0.0.1:3306)"
+    [%%PLUS_API_DEFAULT_TOKEN%%]="default-token-used-in-server-side"
 )
 
 configurer() {
@@ -23,7 +24,7 @@ configurer() {
         search=$i
         replace=${confs[$i]}
         # Note the "" and -e  after -i, needed in OS X
-        find ./out/*/config/*.json -type f -exec sed -i -e "s/${search}/${replace}/g" {} \;
+        find ./out/*/config/*.json -type f -exec sed -i tpl -e "s/${search}/${replace}/g" {} \;
     done
 }
 configurer

+ 1 - 1
config/gateway.json

@@ -22,7 +22,7 @@
         "maxConns": 32,
         "maxIdle": 32,
         "cluster": {
-            "t1": "127.0.0.1:8433"
+            "t1":"%%TRANSFER_RPC%%"
         }
     }
 }