Mention run-mtg script

This commit is contained in:
9seconds
2018-06-19 11:25:58 +03:00
parent 9be13fe093
commit a2d0210780
3 changed files with 7 additions and 3 deletions
+2
View File
@@ -96,3 +96,5 @@ $ docker run --name mtg --restart=unless-stopped -p 444:3128 -p 3129:3129 -d nin
You will have this tool up and running on port 444. Now curl You will have this tool up and running on port 444. Now curl
`localhost:3129` to get `tg://` links or do `docker logs mtg`. Also, `localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
port 3129 will show you some statistics if you are interested in. port 3129 will show you some statistics if you are interested in.
Also, you can use [run-mtg.sh](https://github.com/9seconds/mtg/blob/master/run-mtg.sh) script
+4 -3
View File
@@ -24,14 +24,15 @@ func fetchIP(url string) (net.IP, error) {
} }
defer resp.Body.Close() // nolint: errcheck defer resp.Body.Close() // nolint: errcheck
respData, err := ioutil.ReadAll(resp.Body) respDataBytes, err := ioutil.ReadAll(resp.Body)
if err != nil { if err != nil {
return nil, err return nil, err
} }
respData := strings.TrimSpace(string(respDataBytes))
ip := net.ParseIP(strings.TrimSpace(string(respData))) ip := net.ParseIP(respData)
if ip == nil { if ip == nil {
return nil, errors.Errorf("ifconfig.co returns incorrect IP %s", resp) return nil, errors.Errorf("ifconfig.co returns incorrect IP %s", respData)
} }
return ip, nil return ip, nil
+1
View File
@@ -15,6 +15,7 @@ STAT_PORT=3129
# docker pull "$IMAGE_NAME" # docker pull "$IMAGE_NAME"
docker ps --filter "Name=$CONTAINER_NAME" -aq | xargs -r docker rm -fv docker ps --filter "Name=$CONTAINER_NAME" -aq | xargs -r docker rm -fv
docker run \ docker run \
-d \
--name "$CONTAINER_NAME" \ --name "$CONTAINER_NAME" \
--sysctl 'net.ipv4.ip_local_port_range=10000 65000' \ --sysctl 'net.ipv4.ip_local_port_range=10000 65000' \
--sysctl net.ipv4.tcp_congestion_control=bbr \ --sysctl net.ipv4.tcp_congestion_control=bbr \