Rename VPN -> TUN

This commit is contained in:
arm64v8a
2023-07-14 13:47:52 +09:00
parent 282dd5aacf
commit 3c4556e78c
14 changed files with 64 additions and 64 deletions

View File

@@ -1056,9 +1056,9 @@ namespace NekoGui {
auto source = qjs::ReadHookJS();
if (!source.isEmpty()) {
qjs::QJS js(source);
auto js_result = js.EvalFunction("hook.hook_vpn_config", config);
auto js_result = js.EvalFunction("hook.hook_tun_config", config);
if (config != js_result) {
MW_show_log("hook.js modified your VPN config.");
MW_show_log("hook.js modified your Tun config.");
config = js_result;
}
}
@@ -1087,9 +1087,9 @@ namespace NekoGui {
auto source = qjs::ReadHookJS();
if (!source.isEmpty()) {
qjs::QJS js(source);
auto js_result = js.EvalFunction("hook.hook_vpn_script", script);
auto js_result = js.EvalFunction("hook.hook_tun_script", script);
if (script != js_result) {
MW_show_log("hook.js modified your VPN script.");
MW_show_log("hook.js modified your Tun script.");
script = js_result;
}
}

View File

@@ -22,8 +22,8 @@ interface nekoray_in {
// 目前提供的 hook 点
interface nekoray_hook {
hook_core_config(config: string): string
hook_vpn_config(config: string): string
hook_vpn_script(script: string): string
hook_tun_config(config: string): string
hook_tun_script(script: string): string
hook_import(content: string): string
}
@@ -41,11 +41,11 @@ class my_hook implements nekoray_hook {
return JSON.stringify(json)
}
hook_vpn_config(config: string): string {
hook_tun_config(config: string): string {
return config // 返回输入,表示不修改
}
hook_vpn_script(script: string): string {
hook_tun_script(script: string): string {
console.log("Script") // 输出到 stdout
this.nekoray.log("Script:", script) // 输出到日志
return script
@@ -83,10 +83,10 @@ var my_hook = /** @class */ (function () {
json["dns"]["rules"].push(my_rule);
return JSON.stringify(json);
};
my_hook.prototype.hook_vpn_config = function (config) {
my_hook.prototype.hook_tun_config = function (config) {
return config; // 返回输入,表示不修改
};
my_hook.prototype.hook_vpn_script = function (script) {
my_hook.prototype.hook_tun_script = function (script) {
console.log("Script"); // 输出到 stdout
this.nekoray.log("Script:", script); // 输出到日志
return script;

View File

@@ -64,7 +64,7 @@ func setupCore() {
if getNekorayTunIndex() == 0 {
return resolver_def.LookupIP(context.Background(), "ip", host)
}
// Windows VPN mode use Go resolver
// Windows Tun Mode use Go resolver
return resolver_go.LookupIP(context.Background(), "ip", host)
}
neko_common.GetCurrentInstance = func() interface{} {

View File

@@ -141,7 +141,7 @@ func getBindInterfaceIndex(address string) uint32 {
}
}
// Not in VPN mode
// Not in Tun Mode
if nextInterface == 0 {
return 0
}

View File

@@ -25,7 +25,7 @@ func nekorayLinuxProtect(fd int) bool {
}
}
// check is in VPN mode
// check is in Tun Mode
if is_fwmark_exist(514) {
if cap_net_admin == 1 {
// have permission

View File

@@ -3,7 +3,7 @@ cd qtsdk
if [ "$DL_QT_VER" == "5.15" ]; then
curl -LSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt5.15.7-Windows-x86_64-VS2019-16.11.20-20221103.7z
else
curl -LSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.0-Windows-x86_64-VS2022-17.5.5-20230507.7z
curl -LSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.1-Windows-x86_64-VS2022-17.6.2-20230601.7z
fi
7z x *.7z
rm *.7z

View File

@@ -19,7 +19,7 @@ Depends: libxcb-xinerama0, libqt5core5a, libqt5gui5, libqt5network5, libqt5widge
Description: Qt based cross-platform GUI proxy configuration manager (backend: v2ray / sing-box)
EOF
# Start VPN mode without password
# Start Tun Mode without password
cat >nekoray/opt/nekoray/pkexec <<-EOF
#!/bin/sh

View File

@@ -3,7 +3,7 @@ set -e
set -x
if [ "$EUID" -ne 0 ]; then
echo "[Warning] vpn script not running as root"
echo "[Warning] Tun script not running as root"
fi
if [ "$(uname)" == "Darwin" ]; then

View File

@@ -219,12 +219,12 @@
</message>
<message>
<source>It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option.
For NekoRay, this rewrites the underlying(localhost) DNS in VPN mode.
For NekoBox, this rewrites the underlying(localhost) DNS in VPN mode, normal mode, and also URL Test.</source>
For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode.
For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If you VPN mode is not working, try to change this option.</source>
<source>If you Tun Mode is not working, try to change this option.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -695,7 +695,7 @@ These settings can be changed later.</source>
<context>
<name>DialogVPNSettings</name>
<message>
<source>VPN Settings</source>
<source>Tun Settings</source>
<translation>تنظیمات vpn</translation>
</message>
<message>
@@ -703,7 +703,7 @@ These settings can be changed later.</source>
<translation>مخفی کردن کنسول</translation>
</message>
<message>
<source>VPN Enable IPv6</source>
<source>Tun Enable IPv6</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1084,7 +1084,7 @@ This needs to be run NekoBox with administrator privileges.</source>
<translation>بروزرسانی</translation>
</message>
<message>
<source>VPN Mode</source>
<source>Tun Mode</source>
<translation>حالتvpn</translation>
</message>
<message>
@@ -1284,7 +1284,7 @@ This needs to be run NekoBox with administrator privileges.</source>
<translation>دامنه را حل کنید</translation>
</message>
<message>
<source>VPN Settings</source>
<source>Tun Settings</source>
<translation>تنظیمات vpn</translation>
</message>
<message>
@@ -1308,12 +1308,12 @@ This needs to be run NekoBox with administrator privileges.</source>
<translation>خطا</translation>
</message>
<message>
<source>VPN settings changed</source>
<translation>تنظیمات VPN تغییر کرد</translation>
<source>Tun Settings changed</source>
<translation>تنظیمات Tun تغییر کرد</translation>
</message>
<message>
<source>Restart VPN to take effect.</source>
<translation>VPN را مجدداً راه اندازی کنید تا اعمال شود.</translation>
<source>Restart Tun to take effect.</source>
<translation>Tun را مجدداً راه اندازی کنید تا اعمال شود.</translation>
</message>
<message>
<source>Confirmation</source>
@@ -1336,7 +1336,7 @@ This needs to be run NekoBox with administrator privileges.</source>
<translation>تنظیمات</translation>
</message>
<message>
<source>Current server is incompatible with VPN. Please stop the server first, enable VPN mode, and then restart.</source>
<source>Current server is incompatible with Tun. Please stop the server first, enable Tun Mode, and then restart.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1415,8 +1415,8 @@ End: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to stop VPN process</source>
<translation>فرآیند VPN متوقف نشد</translation>
<source>Failed to stop Tun process</source>
<translation>فرآیند Tun متوقف نشد</translation>
</message>
<message>
<source>Input</source>

View File

@@ -213,15 +213,15 @@
</message>
<message>
<source>It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option.
For NekoRay, this rewrites the underlying(localhost) DNS in VPN mode.
For NekoBox, this rewrites the underlying(localhost) DNS in VPN mode, normal mode, and also URL Test.</source>
For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode.
For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test.</source>
<translation>
NekoRay VPN underlying(localhost) DNS
NekoBox VPN URL underlying(localhost) DNS</translation>
NekoRay Tun underlying(localhost) DNS
NekoBox Tun URL underlying(localhost) DNS</translation>
</message>
<message>
<source>If you VPN mode is not working, try to change this option.</source>
<translation>VPN模式有问</translation>
<source>If you Tun Mode is not working, try to change this option.</source>
<translation> Tun </translation>
</message>
<message>
<source>Default On</source>
@@ -689,16 +689,16 @@ These settings can be changed later.</source>
<context>
<name>DialogVPNSettings</name>
<message>
<source>VPN Settings</source>
<translation>VPN </translation>
<source>Tun Settings</source>
<translation>Tun </translation>
</message>
<message>
<source>Hide Console</source>
<translation></translation>
</message>
<message>
<source>VPN Enable IPv6</source>
<translation> VPN IPv6</translation>
<source>Tun Enable IPv6</source>
<translation> Tun IPv6</translation>
</message>
<message>
<source>Bypass CIDR</source>
@@ -733,7 +733,7 @@ These settings can be changed later.</source>
If still not working, see documentation for more information.
https://matsuridayo.github.io/n-configuration/#vpn-tun</source>
<translation> VPN nekobox_core
<translation> Tun nekobox_core
https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
@@ -1324,12 +1324,12 @@ End: %2</source>
<translation></translation>
</message>
<message>
<source>VPN Mode</source>
<translation>VPN </translation>
<source>Tun Mode</source>
<translation>Tun </translation>
</message>
<message>
<source>Failed to stop VPN process</source>
<translation> VPN </translation>
<source>Failed to stop Tun process</source>
<translation> Tun </translation>
</message>
<message>
<source>Enable System Proxy</source>
@@ -1340,12 +1340,12 @@ End: %2</source>
<translation> VPN</translation>
</message>
<message>
<source>VPN settings changed</source>
<translation>VPN </translation>
<source>Tun Settings changed</source>
<translation>Tun </translation>
</message>
<message>
<source>Restart VPN to take effect.</source>
<translation> VPN </translation>
<source>Restart Tun to take effect.</source>
<translation> Tun </translation>
</message>
<message>
<source>Start</source>
@@ -1396,8 +1396,8 @@ End: %2</source>
<translation></translation>
</message>
<message>
<source>VPN Settings</source>
<translation>VPN </translation>
<source>Tun Settings</source>
<translation>Tun </translation>
</message>
<message>
<source>Restart Program</source>
@@ -1408,8 +1408,8 @@ End: %2</source>
<translation></translation>
</message>
<message>
<source>Current server is incompatible with VPN. Please stop the server first, enable VPN mode, and then restart.</source>
<translation> VPN VPN </translation>
<source>Current server is incompatible with Tun. Please stop the server first, enable Tun Mode, and then restart.</source>
<translation> Tun Tun </translation>
</message>
<message>
<source>Open Config Folder</source>

View File

@@ -411,8 +411,8 @@ void DialogBasicSettings::on_core_settings_clicked() {
auto core_box_underlying_dns_l = new QLabel(tr("Override underlying DNS"));
core_box_underlying_dns_l->setToolTip(tr(
"It is recommended to leave it blank, but it sometimes does not work, at this time you can set this option.\n"
"For NekoRay, this rewrites the underlying(localhost) DNS in VPN mode.\n"
"For NekoBox, this rewrites the underlying(localhost) DNS in VPN mode, normal mode, and also URL Test."));
"For NekoRay, this rewrites the underlying(localhost) DNS in Tun Mode.\n"
"For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mode, and also URL Test."));
core_box_underlying_dns = new MyLineEdit;
core_box_underlying_dns->setText(NekoGui::dataStore->core_box_underlying_dns);
core_box_underlying_dns->setMinimumWidth(300);
@@ -439,7 +439,7 @@ void DialogBasicSettings::on_core_settings_clicked() {
layout->addWidget(core_box_clash_api_secret, line, 1);
} else {
auto core_ray_direct_dns_l = new QLabel("NKR_CORE_RAY_DIRECT_DNS");
core_ray_direct_dns_l->setToolTip(tr("If you VPN mode is not working, try to change this option."));
core_ray_direct_dns_l->setToolTip(tr("If you Tun Mode is not working, try to change this option."));
core_ray_direct_dns = new QCheckBox;
core_ray_direct_dns->setChecked(NekoGui::dataStore->core_ray_direct_dns);
connect(core_ray_direct_dns, &QCheckBox::clicked, this, [&] { CACHE.needRestart = true; });
@@ -454,7 +454,7 @@ void DialogBasicSettings::on_core_settings_clicked() {
layout->addWidget(core_ray_freedom_domainStrategy, line, 1);
#ifdef Q_OS_WIN
auto core_ray_windows_disable_auto_interface_l = new QLabel("NKR_CORE_RAY_WINDOWS_DISABLE_AUTO_INTERFACE");
core_ray_windows_disable_auto_interface_l->setToolTip(tr("If you VPN mode is not working, try to change this option."));
core_ray_windows_disable_auto_interface_l->setToolTip(tr("If you Tun Mode is not working, try to change this option."));
core_ray_windows_disable_auto_interface = new QCheckBox;
core_ray_windows_disable_auto_interface->setChecked(NekoGui::dataStore->core_ray_windows_disable_auto_interface);
connect(core_ray_windows_disable_auto_interface, &QCheckBox::clicked, this, [&] { CACHE.needRestart = true; });

View File

@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>VPN Settings</string>
<string>Tun Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@@ -89,7 +89,7 @@
<item>
<widget class="QCheckBox" name="vpn_ipv6">
<property name="text">
<string>VPN Enable IPv6</string>
<string>Tun Enable IPv6</string>
</property>
</widget>
</item>

View File

@@ -534,7 +534,7 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info)
}
refresh_proxy_list();
if (info.contains("VPNChanged") && NekoGui::dataStore->spmode_vpn) {
MessageBoxWarning(tr("VPN settings changed"), tr("Restart VPN to take effect."));
MessageBoxWarning(tr("Tun Settings changed"), tr("Restart Tun to take effect."));
}
if (suggestRestartProxy && NekoGui::dataStore->started_id >= 0 &&
QMessageBox::question(GetMessageBoxParent(), tr("Confirmation"), tr("Settings changed, restart proxy?")) == QMessageBox::StandardButton::Yes) {
@@ -768,7 +768,7 @@ void MainWindow::neko_set_spmode_vpn(bool enable, bool save) {
}
} else {
if (NekoGui::dataStore->need_keep_vpn_off) {
MessageBoxWarning(software_name, tr("Current server is incompatible with VPN. Please stop the server first, enable VPN mode, and then restart."));
MessageBoxWarning(software_name, tr("Current server is incompatible with Tun. Please stop the server first, enable Tun Mode, and then restart."));
neko_set_spmode_FAILED
}
if (!StartVPNProcess()) {
@@ -1850,7 +1850,7 @@ bool MainWindow::StopVPNProcess(bool unconditional) {
ok = p.exitCode() == 0;
#endif
if (!unconditional) {
ok ? vpn_pid = 0 : MessageBoxWarning(tr("Error"), tr("Failed to stop VPN process"));
ok ? vpn_pid = 0 : MessageBoxWarning(tr("Error"), tr("Failed to stop Tun process"));
}
return ok;
}

View File

@@ -172,7 +172,7 @@
</sizepolicy>
</property>
<property name="text">
<string>VPN Mode</string>
<string>Tun Mode</string>
</property>
</widget>
</item>
@@ -860,7 +860,7 @@
</action>
<action name="menu_vpn_settings">
<property name="text">
<string>VPN Settings</string>
<string>Tun Settings</string>
</property>
</action>
<action name="actionRestart_Program">