mtproto_proxy icon indicating copy to clipboard operation
mtproto_proxy copied to clipboard

Proper way to update mtproto_proxy

Open FreedomPrevails opened this issue 6 years ago • 7 comments
trafficstars

First I would like to thank you for this great software, I switched to your proxy as I was having connection and performance issues with mtprotoproxy and your proxy is working great. I would like to know what is the proper way to update mtproto_proxy to the latest version ? I used the installer script.

FreedomPrevails avatar Aug 23 '19 15:08 FreedomPrevails

I'm afraid there is no "proper" way of updating it at the moment. Right now the only way if you have used interactive installer is to run the installer again.

I want to add sub-commands like ./mtp_install.sh update-code or ./mtp_install.sh update-config etc to update script later, but don't have time right now unfortunately.

seriyps avatar Aug 23 '19 15:08 seriyps

Please, don't close this ticket. I will close it when there will be some user-friendly upgrade method available.

seriyps avatar Aug 23 '19 15:08 seriyps

I figured an easy way to update the script to latest version using a script. First you need to use git clone instead of downloading the zip file in the installation script to download the mtproto_proxy, so we can easily use git pull command to update the installation. Then an update.sh script will take care of the updating easily :

#!/bin/bash

gp=$(git pull)

if [ "$gp" == "Already up-to-date." ]; then
  echo "Installation is already up to date"
else
  make
  systemctl stop mtproto-proxy
  rm -rf /opt/mtp_proxy
  make install
  systemctl start mtproto-proxy
fi

FreedomPrevails avatar Aug 23 '19 18:08 FreedomPrevails

我想到了一种使用脚本将脚本更新到最新版本的简单方法。 首先,您需要使用git clone而不是在安装脚本中下载zip文件来下载mtproto_proxy,因此我们可以轻松使用git pull命令来更新安装。 然后update.sh脚本将轻松地处理更新:

#!/bin/bash

gp=$(git pull)

if [ "$gp" == "Already up-to-date." ]; then
  echo "Installation is already up to date"
else
  make
  systemctl stop mtproto-proxy
  rm -rf /opt/mtp_proxy
  make install
  systemctl start mtproto-proxy
fi

I figured an easy way to update the script to latest version using a script. First you need to use git clone instead of downloading the zip file in the installation script to download the mtproto_proxy, so we can easily use git pull command to update the installation. Then an update.sh script will take care of the updating easily :

#!/bin/bash

gp=$(git pull)

if [ "$gp" == "Already up-to-date." ]; then
  echo "Installation is already up to date"
else
  make
  systemctl stop mtproto-proxy
  rm -rf /opt/mtp_proxy
  make install
  systemctl start mtproto-proxy
fi

Your manual update is relatively cumbersome. His one-click script only needs to add 2 more options before installation, 1. New installation 2, update the program code. It’s ok

z991238 avatar Aug 24 '19 02:08 z991238

So, I updated interactive installer script. Now it supports followin commands:

Install proxy:

./mtp_install.sh -p <port> -s <secret> -t <ad tag> -a dd -a tls -d <fake-tls domain>

Upgrade code to the latest version and restart, keeping config unchanged:

./mtp_install.sh upgrade

Interactively generate new config and reload proxy settings without restart:

./mtp_install.sh reconfigure -p <port> -s <secret> -t <ad tag> -a dd -a tls -d <fake-tls domain>

Reload proxy settings without restart after manual changes in config/prod-sys.cnfig:

./mtp_install.sh reload

seriyps avatar Aug 27 '19 17:08 seriyps

Great job. But may I ask why dont you use git to clone the repo and update the code in your installer script ? It is easier and more efficient.

FreedomPrevails avatar Aug 27 '19 17:08 FreedomPrevails

Just to not have git as dependency. But maybe will change it to git later.

seriyps avatar Aug 27 '19 17:08 seriyps