mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 13:44:03 +03:00
Mention run-mtg script
This commit is contained in:
@@ -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
|
||||
`localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
|
||||
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
|
||||
|
||||
@@ -24,14 +24,15 @@ func fetchIP(url string) (net.IP, error) {
|
||||
}
|
||||
defer resp.Body.Close() // nolint: errcheck
|
||||
|
||||
respData, err := ioutil.ReadAll(resp.Body)
|
||||
respDataBytes, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
respData := strings.TrimSpace(string(respDataBytes))
|
||||
|
||||
ip := net.ParseIP(strings.TrimSpace(string(respData)))
|
||||
ip := net.ParseIP(respData)
|
||||
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
|
||||
|
||||
@@ -15,6 +15,7 @@ STAT_PORT=3129
|
||||
# docker pull "$IMAGE_NAME"
|
||||
docker ps --filter "Name=$CONTAINER_NAME" -aq | xargs -r docker rm -fv
|
||||
docker run \
|
||||
-d \
|
||||
--name "$CONTAINER_NAME" \
|
||||
--sysctl 'net.ipv4.ip_local_port_range=10000 65000' \
|
||||
--sysctl net.ipv4.tcp_congestion_control=bbr \
|
||||
|
||||
Reference in New Issue
Block a user