Ben 1 年之前
父节点
当前提交
4bf612cf6a
共有 2 个文件被更改,包括 37 次插入13 次删除
  1. 13 13
      internal/server/server.go
  2. 24 0
      scripts/droplets.sh

+ 13 - 13
internal/server/server.go

@@ -216,19 +216,19 @@ func convert2DtoNode(node *model.Node, seq int) *dto.Node {
 		"VN": "http://v.starttransfernow.com/static/VN.png",
 	}
 	countryLabels := map[string]string{
-		"BR": "Brazil",
-		"DE": "Germany",
-		"HK": "Hong Kong",
-		"JP": "Japan",
-		"US": "United States",
-		"UK": "United Kingdom",
-		"GB": "United Kingdom",
-		"AU": "Australia",
-		"CA": "Canada",
-		"KR": " South Korea",
-		"SA": "Saudi Arabia",
-		"SG": "Singapore",
-		"VN": "Vietnam",
+		"BR": "Brazil",         // aws
+		"DE": "Germany",        // aws
+		"HK": "Hong Kong",      // aws
+		"JP": "Japan",          // aws
+		"US": "United States",  // digitalocean
+		"UK": "United Kingdom", // aws
+		"GB": "United Kingdom", // aws
+		"AU": "Australia",      // aws
+		"CA": "Canada",         // digitalocean
+		"KR": "South Korea",    // aws
+		"SA": "Saudi Arabia",   // 无
+		"SG": "Singapore",      //  digitalocean
+		"VN": "Vietnam",        // 无
 	}
 
 	return &dto.Node{

+ 24 - 0
scripts/droplets.sh

@@ -0,0 +1,24 @@
+# fixed
+apt update -y
+ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa <<<y >/dev/null 2>&1
+token=b0929fa414cefbb6266b8760fd0c8107421c33c0
+key=$(cat ~/.ssh/id_rsa.pub)
+echo $key
+now=$(date +%Y-%m-%dT%H:%M:%S.%N)
+echo $now
+
+add-apt-repository ppa:longsleep/golang-backports -y
+apt install golang-1.21 -y
+apt install golang -y
+curl -H "Authorization: token $token" -XPOST http://hubgit.cn/api/v1/user/keys -H 'content-type: application/json' -d"{\"title\":\"slave$now\", \"key\": \"$key\"}"
+ssh-keygen -F hubgit.cn || ssh-keyscan hubgit.cn >~/.ssh/known_hosts
+
+# changed
+git clone root@hubgit.cn:ben/be-vpn.git
+cd be-vpn
+
+chmod +x ./scripts/openvpn-install.sh
+export AUTO_INSTALL=y && ./scripts/openvpn-install.sh
+
+go build ./cmd/slave.go
+nohup ./slave &