This commit is contained in:
arm64v8a
2023-07-25 13:03:02 +09:00
parent ad00b8db74
commit e8147589f7
5 changed files with 144 additions and 117 deletions

View File

@@ -863,6 +863,13 @@ namespace NekoGui {
{"detour", "direct"}, {"detour", "direct"},
}; };
// block
if (!status->forTest)
dnsServers += QJsonObject{
{"tag", "dns-block"},
{"address", "rcode://success"},
};
// Fakedns // Fakedns
if (dataStore->fake_dns && IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) { if (dataStore->fake_dns && IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) {
dnsServers += QJsonObject{ dnsServers += QJsonObject{
@@ -893,6 +900,18 @@ namespace NekoGui {
add_rule_dns(status->domainListDNSRemote, "dns-remote"); add_rule_dns(status->domainListDNSRemote, "dns-remote");
add_rule_dns(status->domainListDNSDirect, "dns-direct"); add_rule_dns(status->domainListDNSDirect, "dns-direct");
// built-in rules
if (!status->forTest) {
dnsRules += QJsonObject{
{"query_type", QJsonArray{32, 33}},
{"server", "dns-block"},
};
dnsRules += QJsonObject{
{"domain_suffix", ".lan"},
{"server", "dns-block"},
};
}
// fakedns rule // fakedns rule
if (dataStore->fake_dns && IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) { if (dataStore->fake_dns && IS_NEKO_BOX_INTERNAL_TUN && dataStore->spmode_vpn && !status->forTest) {
dnsRules += QJsonObject{ dnsRules += QJsonObject{
@@ -1071,7 +1090,6 @@ namespace NekoGui {
.replace("%STRICT_ROUTE%", dataStore->vpn_strict_route ? "true" : "false") .replace("%STRICT_ROUTE%", dataStore->vpn_strict_route ? "true" : "false")
.replace("%FINAL_OUT%", no_match_out) .replace("%FINAL_OUT%", no_match_out)
.replace("%DNS_ADDRESS%", BOX_UNDERLYING_DNS) .replace("%DNS_ADDRESS%", BOX_UNDERLYING_DNS)
.replace("%FAKE_DNS_ENABLE%", dataStore->fake_dns ? "true" : "false")
.replace("%FAKE_DNS_INBOUND%", dataStore->fake_dns ? "tun-in" : "empty") .replace("%FAKE_DNS_INBOUND%", dataStore->fake_dns ? "tun-in" : "empty")
.replace("%PORT%", Int2String(dataStore->inbound_socks_port)); .replace("%PORT%", Int2String(dataStore->inbound_socks_port));
// hook.js // hook.js

View File

@@ -4,7 +4,7 @@
}, },
"dns": { "dns": {
"fakeip": { "fakeip": {
"enabled": %FAKE_DNS_ENABLE%, "enabled": true,
"inet4_range": "198.18.0.0/15", "inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18" "inet6_range": "fc00::/18"
}, },
@@ -29,6 +29,13 @@
} }
], ],
"rules": [ "rules": [
{
"query_type": [
32,
33
],
"server": "dns-block"
},
{ {
"domain_suffix": [ "domain_suffix": [
".lan" ".lan"
@@ -132,9 +139,10 @@
"nekobox_core.exe" "nekobox_core.exe"
], ],
"outbound": "direct" "outbound": "direct"
}, }
//%PROCESS_NAME_RULE% //%PROCESS_NAME_RULE%
//%CIDR_RULE% //%CIDR_RULE%
,
{ {
"port": 53, "port": 53,
"outbound": "dns-out" "outbound": "dns-out"

View File

@@ -13,30 +13,34 @@
<property name="windowTitle"> <property name="windowTitle">
<string notr="true">EditHysteria</string> <string notr="true">EditHysteria</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Hop Port</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="MyLineEdit" name="hopPort"/> <widget class="MyLineEdit" name="hopPort"/>
</item> </item>
<item row="8" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_11">
<property name="text"> <property name="text">
<string>Auth Type</string> <string>Hop Interval (s)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="1" column="1">
<widget class="QLabel" name="label_3"> <widget class="MyLineEdit" name="hopInterval"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Protocol</string> <string>Upload (Mbps)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1">
<widget class="MyLineEdit" name="obfsPassword"/>
</item>
<item row="10" column="1">
<widget class="MyLineEdit" name="sni"/>
</item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="MyLineEdit" name="uploadMbps"/> <widget class="MyLineEdit" name="uploadMbps"/>
</item> </item>
@@ -47,7 +51,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="3" column="1">
<widget class="MyLineEdit" name="downloadMbps"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Protocol</string>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QComboBox" name="protocol"> <widget class="QComboBox" name="protocol">
@@ -83,24 +97,24 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Hop Interval (s)</string> <string>Obfs Password</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="5" column="1">
<widget class="MyLineEdit" name="hopInterval"/> <widget class="MyLineEdit" name="obfsPassword"/>
</item> </item>
<item row="13" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
<string>Certificate</string> <string>Auth Type</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="6" column="1">
<widget class="QComboBox" name="authPayloadType"> <widget class="QComboBox" name="authPayloadType">
<item> <item>
<property name="text"> <property name="text">
@@ -119,7 +133,37 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="12" column="1"> <item row="7" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Auth Payload</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="MyLineEdit" name="authPayload"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>SNI</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="MyLineEdit" name="sni"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string notr="true">Only 1 value</string>
</property>
<property name="text">
<string notr="true">ALPN</string>
</property>
</widget>
</item>
<item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="MyLineEdit" name="alpn"/> <widget class="MyLineEdit" name="alpn"/>
@@ -133,84 +177,40 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="0"> <item row="10" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>Hop Port</string> <string>Certificate</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="1"> <item row="10" column="1">
<widget class="QPushButton" name="certificate"> <widget class="QPushButton" name="certificate">
<property name="text"> <property name="text">
<string notr="true">PushButton</string> <string notr="true">PushButton</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="11" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Upload (Mbps)</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Obfs Password</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>SNI</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="MyLineEdit" name="downloadMbps"/>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_5">
<property name="toolTip">
<string notr="true">Only 1 value</string>
</property>
<property name="text">
<string notr="true">ALPN</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="MyLineEdit" name="streamReceiveWindow"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Auth Payload</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="MyLineEdit" name="authPayload"/>
</item>
<item row="15" column="1">
<widget class="MyLineEdit" name="connectionReceiveWindow"/>
</item>
<item row="14" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string notr="true">recv_window</string> <string notr="true">recv_window</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="15" column="0"> <item row="11" column="1">
<widget class="MyLineEdit" name="streamReceiveWindow"/>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
<string notr="true">recv_window_conn</string> <string notr="true">recv_window_conn</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="1">
<widget class="MyLineEdit" name="connectionReceiveWindow"/>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
@@ -221,10 +221,21 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>hopPort</tabstop>
<tabstop>hopInterval</tabstop>
<tabstop>uploadMbps</tabstop> <tabstop>uploadMbps</tabstop>
<tabstop>downloadMbps</tabstop> <tabstop>downloadMbps</tabstop>
<tabstop>protocol</tabstop>
<tabstop>disableMtuDiscovery</tabstop>
<tabstop>obfsPassword</tabstop>
<tabstop>authPayloadType</tabstop>
<tabstop>authPayload</tabstop>
<tabstop>sni</tabstop> <tabstop>sni</tabstop>
<tabstop>alpn</tabstop>
<tabstop>allowInsecure</tabstop>
<tabstop>certificate</tabstop> <tabstop>certificate</tabstop>
<tabstop>streamReceiveWindow</tabstop>
<tabstop>connectionReceiveWindow</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections/> <connections/>

View File

@@ -13,14 +13,17 @@
<property name="windowTitle"> <property name="windowTitle">
<string notr="true">EditNaive</string> <string notr="true">EditNaive</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout">
<item row="2" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Protocol</string> <string>Username</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="MyLineEdit" name="username"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
@@ -31,6 +34,13 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="MyLineEdit" name="password"/> <widget class="MyLineEdit" name="password"/>
</item> </item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Protocol</string>
</property>
</widget>
</item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QComboBox" name="protocol"> <widget class="QComboBox" name="protocol">
<item> <item>
@@ -52,13 +62,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>SNI</string>
</property>
</widget>
</item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QPushButton" name="extra_headers"> <widget class="QPushButton" name="extra_headers">
<property name="text"> <property name="text">
@@ -66,16 +69,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Username</string> <string>SNI</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="MyLineEdit" name="username"/>
</item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="MyLineEdit" name="sni"/> <widget class="MyLineEdit" name="sni"/>
</item> </item>
@@ -86,6 +86,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1">
<widget class="QPushButton" name="certificate">
<property name="text">
<string notr="true">PushButton</string>
</property>
</widget>
</item>
<item row="6" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="text"> <property name="text">
@@ -96,13 +103,6 @@
<item row="6" column="1"> <item row="6" column="1">
<widget class="MyLineEdit" name="insecure_concurrency"/> <widget class="MyLineEdit" name="insecure_concurrency"/>
</item> </item>
<item row="5" column="1">
<widget class="QPushButton" name="certificate">
<property name="text">
<string notr="true">PushButton</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
@@ -112,15 +112,6 @@
<header>ui/widget/MyLineEdit.h</header> <header>ui/widget/MyLineEdit.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops>
<tabstop>username</tabstop>
<tabstop>password</tabstop>
<tabstop>protocol</tabstop>
<tabstop>extra_headers</tabstop>
<tabstop>sni</tabstop>
<tabstop>certificate</tabstop>
<tabstop>insecure_concurrency</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -335,7 +335,6 @@ void MainWindow::neko_start(int _id) {
if (!mu_stopping.tryLock()) { if (!mu_stopping.tryLock()) {
MessageBoxWarning(software_name, "Another profile is stopping..."); MessageBoxWarning(software_name, "Another profile is stopping...");
mu_starting.unlock(); mu_starting.unlock();
mu_stopping.unlock();
return; return;
} }
mu_stopping.unlock(); mu_stopping.unlock();