Update ACL to "data"

This commit is contained in:
ChsBuffer
2021-02-20 16:06:00 +08:00
parent aa627cbaf9
commit 212aaf8a8f
4 changed files with 17 additions and 9 deletions

View File

@@ -445,7 +445,7 @@ namespace Netch.Forms
if (useProxy)
req.Proxy = new WebProxy($"http://127.0.0.1:{Global.Settings.HTTPLocalPort}");
await WebUtil.DownloadFileAsync(req, Path.Combine(Global.NetchDir, "bin\\default.acl"));
await WebUtil.DownloadFileAsync(req, Path.Combine(Global.NetchDir, Global.UserACL));
NotifyTip(i18N.Translate("ACL updated successfully"));
}
catch (Exception e)

View File

@@ -1,6 +1,3 @@
using Netch.Controllers;
using Netch.Forms;
using Netch.Models;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -10,6 +7,9 @@ using System.Net.Sockets;
using System.Threading;
using System.Windows.Forms;
using WindowsJobAPI;
using Netch.Controllers;
using Netch.Forms;
using Netch.Models;
namespace Netch
{
@@ -39,6 +39,9 @@ namespace Netch
private static bool? _supportFakeDns;
}
public const string UserACL = "data\\user.acl";
public const string BuiltinACL = "bin\\default.acl";
/// <summary>
/// 出口适配器
/// </summary>

View File

@@ -1,3 +1,4 @@
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Netch.Controllers;
@@ -58,12 +59,14 @@ namespace Netch.Servers.Shadowsocks
$"-l {this.Socks5LocalPort()} " +
$"-m {server.EncryptMethod} " +
$"-k \"{server.Password}\" " +
"-u ");
"-u");
if (!string.IsNullOrWhiteSpace(server.Plugin) && !string.IsNullOrWhiteSpace(server.PluginOption))
argument.Append($"--plugin {server.Plugin} " +
$"--plugin-opts \"{server.PluginOption}\"");
argument.Append($" --plugin {server.Plugin}" +
$" --plugin-opts \"{server.PluginOption}\"");
if (mode.BypassChina)
argument.Append(" --acl default.acl");
{
argument.Append($" --acl {Path.GetFullPath(File.Exists(Global.UserACL) ? Global.UserACL : Global.BuiltinACL)}");
}
#endregion

View File

@@ -1,3 +1,4 @@
using System.IO;
using System.Text;
using Netch.Controllers;
using Netch.Models;
@@ -34,7 +35,8 @@ namespace Netch.Servers.ShadowsocksR
}
argument.Append($" -b {this.LocalAddress()} -l {this.Socks5LocalPort()} -u");
if (mode.BypassChina) argument.Append(" --acl default.acl");
if (mode.BypassChina)
argument.Append($" --acl {Path.GetFullPath(File.Exists(Global.UserACL) ? Global.UserACL : Global.BuiltinACL)}");
#endregion