Skip to content

Commit

Permalink
Fix a series of bugs in MTProto Go
Browse files Browse the repository at this point in the history
  • Loading branch information
MisCusi2023 committed May 4, 2023
1 parent 6177ea9 commit 1907061
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ProxySuper.Core/Services/MTProtoGoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public void Install()
Progress.Percentage = 50;

Progress.Step = "5. 生成密钥";
Settings.SecretText = RunCmd($"docker run nineseconds/mtg generate-secret {Settings.Cleartext}").TrimEnd('\n');
//RunCmd("docker pull nineseconds/mtg:2"); //拉取v2版本命令,但是似乎不用也可以。
//下面的命令是v1版本的命令格式。可以保留。将来如启用v1,可用。
//Settings.SecretText = RunCmd($"docker run nineseconds/mtg:1 generate-secret -c {Settings.Cleartext} tls").TrimEnd('\n');
Settings.SecretText = RunCmd($"docker run nineseconds/mtg:2 generate-secret {Settings.Cleartext}").TrimEnd('\n');
Progress.Percentage = 65;

Progress.Step = "6. 生成配置文件";
Expand All @@ -55,7 +58,7 @@ public void Install()
Progress.Percentage = 80;

Progress.Step = "7. 启动MTProto服务";
RunCmd($"docker run -d -v /etc/mtg.toml:/config.toml --name=mtg --restart=always -p {Settings.Port + ":" + Settings.Port} nineseconds/mtg");
RunCmd($"docker run -d -v /etc/mtg.toml:/config.toml --name=mtg --restart=always -p {Settings.Port + ":" + Settings.Port} nineseconds/mtg:2");
Progress.Desc = "设置自启动MTProto服务";

Progress.Step = "安装完成";
Expand Down Expand Up @@ -116,7 +119,8 @@ public void UpdateSettings()
Progress.Percentage = 50;

Progress.Desc = "生成密钥";
Settings.SecretText = RunCmd($"docker run nineseconds/mtg generate-secret {Settings.Cleartext}").TrimEnd('\n');
//Settings.SecretText = RunCmd($"docker run nineseconds/mtg:1 generate-secret -c {Settings.Cleartext} tls").TrimEnd('\n'); //v1版本
Settings.SecretText = RunCmd($"docker run nineseconds/mtg:2 generate-secret {Settings.Cleartext}").TrimEnd('\n');
Progress.Percentage = 65;

Progress.Desc = "修改配置文件";
Expand Down

0 comments on commit 1907061

Please sign in to comment.