Explorar el Código

Mention run-mtg script

tags/0.9
9seconds hace 7 años
padre
commit
a2d0210780
Se han modificado 3 ficheros con 7 adiciones y 3 borrados
  1. 2
    0
      README.md
  2. 4
    3
      config/global_ips.go
  3. 1
    0
      run-mtg.sh

+ 2
- 0
README.md Ver fichero

@@ -96,3 +96,5 @@ $ docker run --name mtg --restart=unless-stopped -p 444:3128 -p 3129:3129 -d nin
96 96
 You will have this tool up and running on port 444. Now curl
97 97
 `localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
98 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 Ver fichero

@@ -24,14 +24,15 @@ func fetchIP(url string) (net.IP, error) {
24 24
 	}
25 25
 	defer resp.Body.Close() // nolint: errcheck
26 26
 
27
-	respData, err := ioutil.ReadAll(resp.Body)
27
+	respDataBytes, err := ioutil.ReadAll(resp.Body)
28 28
 	if err != nil {
29 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 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 38
 	return ip, nil

+ 1
- 0
run-mtg.sh Ver fichero

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

Loading…
Cancelar
Guardar