mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-19 18:30:34 +08:00
update structure
This commit is contained in:
parent
2ef530d17b
commit
e5e600e754
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,5 @@
|
||||
SourceTrail/
|
||||
|
||||
libs/gen/
|
||||
libs/gRPC-win32/
|
||||
|
||||
build/
|
||||
|
@ -1 +1 @@
|
||||
3018
|
||||
3038
|
||||
|
@ -84,7 +84,9 @@ INCLUDEPATH += \
|
||||
libs/gen/
|
||||
|
||||
HEADERS += \
|
||||
libs/libqvb.h \
|
||||
src/Qv2rayBase.hpp \
|
||||
src/Qv2rayFeatures.hpp \
|
||||
src/QvCoreConfigObjects.hpp \
|
||||
src/QvCoreConfigOperations.hpp \
|
||||
src/QvUtils.hpp \
|
||||
@ -280,3 +282,5 @@ with_metainfo {
|
||||
message(" ")
|
||||
message("Done configuring Qv2ray project. Build output will be at:" $$OUT_PWD)
|
||||
message("Type `make` or `mingw32-make` to start building Qv2ray")
|
||||
|
||||
unix|win32: LIBS += -L$$PWD/libs/ -lqvb
|
||||
|
1
libs/gRPC-win32
Submodule
1
libs/gRPC-win32
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a2c741f03d0ceac6bc3ff1ae4097610400afa172
|
4
src/Qv2rayFeatures.hpp
Normal file
4
src/Qv2rayFeatures.hpp
Normal file
@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
// Qv2ray build features.
|
||||
//#ifdef __Q_Build_Without_Chart
|
@ -5,6 +5,8 @@
|
||||
#include "QvCoreConfigOperations.hpp"
|
||||
#include "QvCore/QvCommandLineArgs.hpp"
|
||||
|
||||
#include "libs/libqvb.h"
|
||||
|
||||
using namespace v2ray::core::app::stats::command;
|
||||
using grpc::Channel;
|
||||
using grpc::ClientContext;
|
||||
@ -177,9 +179,12 @@ namespace Qv2ray
|
||||
// Config API
|
||||
apiFailedCounter = 0;
|
||||
this->apiPort = conf.apiConfig.statsPort;
|
||||
Channel = grpc::CreateChannel("127.0.0.1:" + to_string(apiPort), grpc::InsecureChannelCredentials());
|
||||
StatsService service;
|
||||
Stub = service.NewStub(Channel);
|
||||
auto addr = "127.0.0.1:" + QString::number(apiPort);
|
||||
auto str = Dial(const_cast<char *>(addr.toStdString().c_str()), 10000);
|
||||
LOG(MODULE_VCORE, str)
|
||||
//Channel = grpc::CreateChannel("127.0.0.1:" + to_string(apiPort), grpc::InsecureChannelCredentials());
|
||||
//StatsService service;
|
||||
//Stub = service.NewStub(Channel);
|
||||
apiTimerId = startTimer(1000);
|
||||
DEBUG(MODULE_VCORE, "API Worker started.")
|
||||
}
|
||||
@ -249,19 +254,21 @@ namespace Qv2ray
|
||||
return 0;
|
||||
}
|
||||
|
||||
GetStatsRequest request;
|
||||
request.set_name(name.toStdString());
|
||||
request.set_reset(false);
|
||||
GetStatsResponse response;
|
||||
ClientContext context;
|
||||
Status status = Stub->GetStats(&context, request, &response);
|
||||
|
||||
if (!status.ok()) {
|
||||
LOG(MODULE_VCORE, "API call returns: " + QSTRN(status.error_code()) + " (" + QString::fromStdString(status.error_message()) + ")")
|
||||
apiFailedCounter++;
|
||||
}
|
||||
|
||||
return response.stat().value();
|
||||
//GetStatsRequest request;
|
||||
//request.set_name(name.toStdString());
|
||||
//request.set_reset(false);
|
||||
//GetStatsResponse response;
|
||||
//ClientContext context;
|
||||
//Status status = Stub->GetStats(&context, request, &response);
|
||||
//
|
||||
//if (!status.ok()) {
|
||||
// LOG(MODULE_VCORE, "API call returns: " + QSTRN(status.error_code()) + " (" + QString::fromStdString(status.error_message()) + ")")
|
||||
// apiFailedCounter++;
|
||||
//}
|
||||
//return response.stat().value();
|
||||
auto data = GetStats(const_cast<char *>(name.toStdString().c_str()), 1000);
|
||||
//LOG(MODULE_VCORE, "API RETURN: " + QString::number(data))
|
||||
return data;
|
||||
}
|
||||
// ------------------------------------------------------------- API FUNCTIONS --------------------------
|
||||
long V2rayKernelInstance::getTagSpeedUp(const QString &tag)
|
||||
|
@ -100,6 +100,7 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QDialog(parent),
|
||||
//
|
||||
vCorePathTxt->setText(CurrentConfig.v2CorePath);
|
||||
vCoreAssetsPathTxt->setText(CurrentConfig.v2AssetsPath);
|
||||
enableAPI->setChecked(CurrentConfig.apiConfig.enableAPI);
|
||||
statsPortBox->setValue(CurrentConfig.apiConfig.statsPort);
|
||||
//
|
||||
//
|
||||
|
@ -1,90 +0,0 @@
|
||||
7-Zip
|
||||
~~~~~
|
||||
License for use and distribution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
7-Zip Copyright (C) 1999-2019 Igor Pavlov.
|
||||
|
||||
The licenses for files are:
|
||||
|
||||
1) 7z.dll:
|
||||
- The "GNU LGPL" as main license for most of the code
|
||||
- The "GNU LGPL" with "unRAR license restriction" for some code
|
||||
- The "BSD 3-clause License" for some code
|
||||
2) All other files: the "GNU LGPL".
|
||||
|
||||
Redistributions in binary form must reproduce related license information from this file.
|
||||
|
||||
Note:
|
||||
You can use 7-Zip on any computer, including a computer in a commercial
|
||||
organization. You don't need to register or pay for 7-Zip.
|
||||
|
||||
|
||||
GNU LGPL information
|
||||
--------------------
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You can receive a copy of the GNU Lesser General Public License from
|
||||
http://www.gnu.org/
|
||||
|
||||
|
||||
|
||||
|
||||
BSD 3-clause License
|
||||
--------------------
|
||||
|
||||
The "BSD 3-clause License" is used for the code in 7z.dll that implements LZFSE data decompression.
|
||||
That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
|
||||
that also uses the "BSD 3-clause License":
|
||||
|
||||
----
|
||||
Copyright (c) 2015-2016, Apple Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
----
|
||||
|
||||
|
||||
|
||||
|
||||
unRAR license restriction
|
||||
-------------------------
|
||||
|
||||
The decompression engine for RAR archives was developed using source
|
||||
code of unRAR program.
|
||||
All copyrights to original unRAR code are owned by Alexander Roshal.
|
||||
|
||||
The license for original unRAR code has the following restriction:
|
||||
|
||||
The unRAR sources cannot be used to re-create the RAR compression algorithm,
|
||||
which is proprietary. Distribution of modified unRAR sources in separate form
|
||||
or as a part of other software is permitted, provided that it is clearly
|
||||
stated in the documentation and source comments that the code may
|
||||
not be used to develop a RAR (WinRAR) compatible archiver.
|
||||
|
||||
|
||||
--
|
||||
Igor Pavlov
|
BIN
tools/7z.dll
BIN
tools/7z.dll
Binary file not shown.
BIN
tools/7z.exe
BIN
tools/7z.exe
Binary file not shown.
Binary file not shown.
@ -1,11 +1,5 @@
|
||||
@echo off
|
||||
cd tools
|
||||
echo Extracting files.
|
||||
%~dp0\7z.exe -y e %~dp0gRPC-win32.tar.gz -o%~dp0 && %~dp0\7z.exe -y x %~dp0gRPC-win32.tar -o%~dp0\..\libs\gRPC-win32
|
||||
if errorlevel 1 goto errored
|
||||
|
||||
del %~dp0gRPC-win32.tar
|
||||
|
||||
mkdir %~dp0..\libs\gen
|
||||
|
||||
echo.
|
||||
|
@ -1,68 +0,0 @@
|
||||
// THIS FILE WILL NOT BE TOGETHER WITH BUILD PROCESSES
|
||||
#ifdef QV2RAY
|
||||
static_assert(false, "NO NOT INCLUDE ME"); // DO NOT TRY TO INCLUDE ME
|
||||
|
||||
|
||||
|
||||
struct ReverseObject {
|
||||
list<REVERSEObjects::BridgeObject> bridges;
|
||||
list<REVERSEObjects::PortalObject> portals;
|
||||
ReverseObject() : bridges(), portals() {}
|
||||
XTOSTRUCT(O(bridges, portals))
|
||||
};
|
||||
namespace REVERSEObjects
|
||||
{
|
||||
struct BridgeObject {
|
||||
string tag;
|
||||
string domain;
|
||||
BridgeObject() : tag(), domain() {}
|
||||
XTOSTRUCT(O(tag, domain))
|
||||
};
|
||||
|
||||
struct PortalObject {
|
||||
string tag;
|
||||
string domain;
|
||||
PortalObject() : tag(), domain() {}
|
||||
XTOSTRUCT(O(tag, domain))
|
||||
};
|
||||
|
||||
}
|
||||
// IN: OUTBOUNDObjects namespace;
|
||||
struct ProxySettingsObject {
|
||||
string tag;
|
||||
ProxySettingsObject(): tag() {}
|
||||
XTOSTRUCT(O(tag))
|
||||
};
|
||||
|
||||
// IN: INBOUNDObjects namespace;
|
||||
struct AllocateObject {
|
||||
string strategy;
|
||||
int refresh;
|
||||
int concurrency;
|
||||
AllocateObject(): strategy(), refresh(), concurrency() {}
|
||||
XTOSTRUCT(O(strategy, refresh, concurrency))
|
||||
};
|
||||
|
||||
// IN: ROUTINGObjects
|
||||
struct BalancerObject {
|
||||
string tag ;
|
||||
list<string> selector;
|
||||
BalancerObject() : tag(), selector() {}
|
||||
XTOSTRUCT(O(tag, selector))
|
||||
};
|
||||
|
||||
|
||||
struct VMessIn { // INBound;
|
||||
struct ClientObject {
|
||||
string id;
|
||||
int level;
|
||||
int alterId;
|
||||
string email;
|
||||
XTOSTRUCT(O(id, level, alterId, email))
|
||||
};
|
||||
list<ClientObject> clients;
|
||||
// detour and default will not be implemented as it's complicated...
|
||||
bool disableInsecureEncryption;
|
||||
XTOSTRUCT(O(clients, disableInsecureEncryption))
|
||||
};
|
||||
#endif
|
@ -1,41 +0,0 @@
|
||||
# Automatically generate .qm files out of .ts files in TRANSLATIONS and
|
||||
# EXTRA_TRANSLATIONS.
|
||||
#
|
||||
# If embed_translations is enabled, the generated .qm files are made available
|
||||
# in the resource system under :/i18n/.
|
||||
#
|
||||
# Otherwise, the .qm files are available in the build directory in LRELEASE_DIR.
|
||||
# They can also be automatically installed by setting QM_FILES_INSTALL_PATH.
|
||||
|
||||
qtPrepareTool(QMAKE_LRELEASE, lrelease)
|
||||
|
||||
isEmpty(LRELEASE_DIR): LRELEASE_DIR = .qm
|
||||
isEmpty(QM_FILES_RESOURCE_PREFIX): QM_FILES_RESOURCE_PREFIX = i18n
|
||||
|
||||
lrelease.name = lrelease
|
||||
lrelease.input = TRANSLATIONS EXTRA_TRANSLATIONS
|
||||
lrelease.output = $$LRELEASE_DIR/${QMAKE_FILE_IN_BASE}.qm
|
||||
lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} $$QMAKE_LRELEASE_FLAGS -qm ${QMAKE_FILE_OUT}
|
||||
silent: lrelease.commands = @echo lrelease ${QMAKE_FILE_IN} && $$lrelease.commands
|
||||
lrelease.CONFIG = no_link
|
||||
QMAKE_EXTRA_COMPILERS += lrelease
|
||||
|
||||
all_translations = $$TRANSLATIONS $$EXTRA_TRANSLATIONS
|
||||
for (translation, all_translations) {
|
||||
# mirrors $$LRELEASE_DIR/${QMAKE_FILE_IN_BASE}.qm above
|
||||
translation = $$basename(translation)
|
||||
QM_FILES += $$OUT_PWD/$$LRELEASE_DIR/$$replace(translation, \\..*$, .qm)
|
||||
}
|
||||
embed_translations {
|
||||
qmake_qm_files.files = $$QM_FILES
|
||||
qmake_qm_files.base = $$OUT_PWD/$$LRELEASE_DIR
|
||||
qmake_qm_files.prefix = $$QM_FILES_RESOURCE_PREFIX
|
||||
RESOURCES += qmake_qm_files
|
||||
} else {
|
||||
!isEmpty(QM_FILES_INSTALL_PATH) {
|
||||
qm_files.files = $$QM_FILES
|
||||
qm_files.path = $$QM_FILES_INSTALL_PATH
|
||||
INSTALLS += qm_files
|
||||
}
|
||||
lrelease.CONFIG += target_predeps no_clean
|
||||
}
|
Loading…
Reference in New Issue
Block a user