Просмотр исходного кода

Mention run-mtg script

tags/0.9
9seconds 8 лет назад
Родитель
Сommit
a2d0210780
3 измененных файлов: 7 добавлений и 3 удалений
  1. 2
    0
      README.md
  2. 4
    3
      config/global_ips.go
  3. 1
    0
      run-mtg.sh

+ 2
- 0
README.md Просмотреть файл

96
 You will have this tool up and running on port 444. Now curl
96
 You will have this tool up and running on port 444. Now curl
97
 `localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
97
 `localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
98
 port 3129 will show you some statistics if you are interested in.
98
 port 3129 will show you some statistics if you are interested in.
99
+
100
+Also, you can use [run-mtg.sh](https://github.com/9seconds/mtg/blob/master/run-mtg.sh) script

+ 4
- 3
config/global_ips.go Просмотреть файл

24
 	}
24
 	}
25
 	defer resp.Body.Close() // nolint: errcheck
25
 	defer resp.Body.Close() // nolint: errcheck
26
 
26
 
27
-	respData, err := ioutil.ReadAll(resp.Body)
27
+	respDataBytes, err := ioutil.ReadAll(resp.Body)
28
 	if err != nil {
28
 	if err != nil {
29
 		return nil, err
29
 		return nil, err
30
 	}
30
 	}
31
+	respData := strings.TrimSpace(string(respDataBytes))
31
 
32
 
32
-	ip := net.ParseIP(strings.TrimSpace(string(respData)))
33
+	ip := net.ParseIP(respData)
33
 	if ip == nil {
34
 	if ip == nil {
34
-		return nil, errors.Errorf("ifconfig.co returns incorrect IP %s", resp)
35
+		return nil, errors.Errorf("ifconfig.co returns incorrect IP %s", respData)
35
 	}
36
 	}
36
 
37
 
37
 	return ip, nil
38
 	return ip, nil

+ 1
- 0
run-mtg.sh Просмотреть файл

15
 # docker pull "$IMAGE_NAME"
15
 # docker pull "$IMAGE_NAME"
16
 docker ps --filter "Name=$CONTAINER_NAME" -aq | xargs -r docker rm -fv
16
 docker ps --filter "Name=$CONTAINER_NAME" -aq | xargs -r docker rm -fv
17
 docker run \
17
 docker run \
18
+    -d \
18
     --name "$CONTAINER_NAME" \
19
     --name "$CONTAINER_NAME" \
19
     --sysctl 'net.ipv4.ip_local_port_range=10000 65000' \
20
     --sysctl 'net.ipv4.ip_local_port_range=10000 65000' \
20
     --sysctl net.ipv4.tcp_congestion_control=bbr \
21
     --sysctl net.ipv4.tcp_congestion_control=bbr \

Загрузка…
Отмена
Сохранить