mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-01 00:00:36 +03:00
Compare commits
37 Commits
feature/ne
...
android_pt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
330c341922 | ||
|
|
4ddddec978 | ||
|
|
77d46dfeb3 | ||
|
|
74caca67ee | ||
|
|
71ec3336eb | ||
|
|
2f8f759765 | ||
|
|
f7004f62dd | ||
|
|
7ea1677df6 | ||
|
|
d5062674f2 | ||
|
|
33efa56f25 | ||
|
|
930e227a9e | ||
|
|
bdaa56f734 | ||
|
|
c430cca538 | ||
|
|
fc8dfce90d | ||
|
|
beca12ae40 | ||
|
|
109512d83e | ||
|
|
1fb21cfbfc | ||
|
|
ff5fc4cd2a | ||
|
|
3f600c0088 | ||
|
|
adc07a2b6a | ||
|
|
7e3134cdbb | ||
|
|
95b3b0eae3 | ||
|
|
61c27af17c | ||
|
|
2fa82a05d9 | ||
|
|
f8408e863a | ||
|
|
3c0ac8170d | ||
|
|
591e0fea80 | ||
|
|
9a67d2684e | ||
|
|
2d624b3b59 | ||
|
|
cc93898c60 | ||
|
|
3f265b899e | ||
|
|
799c3ec6e6 | ||
|
|
32b355a54e | ||
|
|
82e831f6d8 | ||
|
|
a19e69ae61 | ||
|
|
995a60c503 | ||
|
|
0bb4ad2fbe |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -2,4 +2,3 @@ deploy/data/windows/x64/tap/windows_7/OemVista.inf eol=crlf
|
||||
deploy/data/windows/x64/tap/windows_10/OemVista.inf eol=crlf
|
||||
deploy/data/windows/x32/tap/windows_7/OemVista.inf eol=crlf
|
||||
deploy/data/windows/x32/tap/windows_10/OemVista.inf eol=crlf
|
||||
client/3rd/* linguist-vendored
|
||||
|
||||
47
.gitpod.Dockerfile
vendored
47
.gitpod.Dockerfile
vendored
@@ -1,47 +0,0 @@
|
||||
FROM gitpod/workspace-full-vnc
|
||||
|
||||
USER gitpod
|
||||
|
||||
RUN sudo apt-get -q update \
|
||||
&& sudo apt-get install -yq \
|
||||
build-essential \
|
||||
libgl1-mesa-dev \
|
||||
libgstreamer-gl1.0-0 \
|
||||
libpulse-dev \
|
||||
libsecret-1-dev \
|
||||
libxcb-glx0 \
|
||||
libxcb-icccm4 \
|
||||
libxcb-image0 \
|
||||
libxcb-keysyms1 \
|
||||
libxcb-randr0 \
|
||||
libxcb-render-util0 \
|
||||
libxcb-render0 \
|
||||
libxcb-shape0 \
|
||||
libxcb-shm0 \
|
||||
libxcb-sync1 \
|
||||
libxcb-util1 \
|
||||
libxcb-xfixes0 \
|
||||
libxcb-xinerama0 \
|
||||
libxcb1 \
|
||||
libxkbcommon-dev \
|
||||
libxkbcommon-x11-0 \
|
||||
libxcb-xkb-dev \
|
||||
p7zip-full \
|
||||
&& sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sudo pip3 install aqtinstall
|
||||
|
||||
ARG QT_VERSION=6.4.1
|
||||
ARG QT_ARCH=gcc_64
|
||||
|
||||
ARG QT_DIR=/opt/qt
|
||||
RUN sudo aqt install-qt --outputdir ${QT_DIR} linux desktop ${QT_VERSION} ${QT_ARCH} --modules \
|
||||
qtremoteobjects \
|
||||
qt5compat \
|
||||
qtshadertools
|
||||
ENV QT_BIN_DIR=${QT_DIR}/${QT_VERSION}/${QT_ARCH}/bin
|
||||
|
||||
ARG QIF_VERSION=4.5
|
||||
ARG QIF_DIR=/opt/qif
|
||||
RUN sudo aqt install-tool --outputdir ${QIF_DIR} linux desktop tools_ifw
|
||||
ENV QIF_BIN_DIR=${QIF_DIR}/Tools/QtInstallerFramework/${QIF_VERSION}/bin
|
||||
@@ -1,8 +0,0 @@
|
||||
tasks:
|
||||
- init: >-
|
||||
deploy/build_linux.sh
|
||||
image:
|
||||
file: .gitpod.Dockerfile
|
||||
vscode:
|
||||
extensions:
|
||||
- llvm-vs-code-extensions.vscode-clangd
|
||||
@@ -1,8 +1,7 @@
|
||||
# Amnezia VPN
|
||||
## _The best client for self-hosted VPN_
|
||||
|
||||
[](https://github.com/amnezia-vpn/amnezia-client/actions/workflows/deploy.yml?query=branch:dev)
|
||||
[](https://gitpod.io/#https://github.com/amnezia-vpn/amnezia-client)
|
||||
[]
|
||||
|
||||
Amnezia is a VPN client with the key feature of deploying your own VPN server on you virtual server.
|
||||
|
||||
|
||||
Submodule client/3rd/OpenVPNAdapter updated: 0e2db0baa0...7b4046faf3
@@ -92,7 +92,6 @@ set(HEADERS ${HEADERS}
|
||||
${CMAKE_CURRENT_LIST_DIR}/protocols/vpnprotocol.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/core/sshclient.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/protocols/
|
||||
)
|
||||
|
||||
if(NOT IOS)
|
||||
|
||||
@@ -42,8 +42,11 @@ QString CloakConfigurator::genCloakConfig(const ServerCredentials &credentials,
|
||||
config.insert("NumConn", 1);
|
||||
config.insert("BrowserSig", "chrome");
|
||||
config.insert("StreamTimeout", 300);
|
||||
config.insert("RemoteHost", credentials.hostName);
|
||||
config.insert("RemotePort", "$CLOAK_SERVER_PORT");
|
||||
|
||||
// transfer params to protocol runner
|
||||
config.insert(config_key::transport_proto, "tcp");
|
||||
config.insert(config_key::remote, credentials.hostName);
|
||||
config.insert(config_key::port, "$CLOAK_SERVER_PORT");
|
||||
|
||||
QString textCfg = serverController.replaceVars(QJsonDocument(config).toJson(),
|
||||
serverController.genVarsForScript(credentials, container, containerConfig));
|
||||
|
||||
@@ -61,9 +61,6 @@ QVector<amnezia::Proto> ContainerProps::protocolsForContainer(amnezia::DockerCon
|
||||
case DockerContainer::Sftp:
|
||||
return { Proto::Sftp};
|
||||
|
||||
case DockerContainer::Nextcloud:
|
||||
return { Proto::Nextcloud };
|
||||
|
||||
default:
|
||||
return { defaultProtocol(container) };
|
||||
}
|
||||
@@ -93,8 +90,7 @@ QMap<DockerContainer, QString> ContainerProps::containerHumanNames()
|
||||
{DockerContainer::TorWebSite, QObject::tr("Web site in Tor network")},
|
||||
{DockerContainer::Dns, QObject::tr("DNS Service")},
|
||||
//{DockerContainer::FileShare, QObject::tr("SMB file sharing service")},
|
||||
{DockerContainer::Sftp, QObject::tr("Sftp file sharing service")},
|
||||
{DockerContainer::Nextcloud, QObject::tr("Nextcloud")}
|
||||
{DockerContainer::Sftp, QObject::tr("Sftp file sharing service")}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -111,8 +107,7 @@ QMap<DockerContainer, QString> ContainerProps::containerDescriptions()
|
||||
{DockerContainer::TorWebSite, QObject::tr("Web site in Tor network")},
|
||||
{DockerContainer::Dns, QObject::tr("DNS Service")},
|
||||
//{DockerContainer::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")},
|
||||
{DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service")},
|
||||
{DockerContainer::Nextcloud, QObject::tr("Nextcloud private cloud")},
|
||||
{DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service")}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -129,7 +124,6 @@ amnezia::ServiceType ContainerProps::containerService(DockerContainer c)
|
||||
case DockerContainer::Dns : return ServiceType::Other;
|
||||
//case DockerContainer::FileShare : return ServiceType::Other;
|
||||
case DockerContainer::Sftp : return ServiceType::Other;
|
||||
case DockerContainer::Nextcloud : return ServiceType::Other;
|
||||
default: return ServiceType::Other;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +142,6 @@ Proto ContainerProps::defaultProtocol(DockerContainer c)
|
||||
case DockerContainer::Dns : return Proto::Dns;
|
||||
//case DockerContainer::FileShare : return Protocol::FileShare;
|
||||
case DockerContainer::Sftp : return Proto::Sftp;
|
||||
case DockerContainer::Nextcloud : return Proto::Nextcloud;
|
||||
default: return Proto::Any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@ enum DockerContainer {
|
||||
TorWebSite,
|
||||
Dns,
|
||||
//FileShare,
|
||||
Sftp,
|
||||
Nextcloud
|
||||
|
||||
Sftp
|
||||
};
|
||||
Q_ENUM_NS(DockerContainer)
|
||||
} // namespace ContainerEnumNS
|
||||
|
||||
@@ -17,7 +17,6 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container)
|
||||
case DockerContainer::Dns: return QLatin1String("dns");
|
||||
//case DockerContainer::FileShare: return QLatin1String("file_share");
|
||||
case DockerContainer::Sftp: return QLatin1String("sftp");
|
||||
case DockerContainer::Nextcloud: return QLatin1String("nextcloud");
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +491,6 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential
|
||||
const QJsonObject &ssConfig = config.value(ProtocolProps::protoToString(Proto::ShadowSocks)).toObject();
|
||||
const QJsonObject &wireguarConfig = config.value(ProtocolProps::protoToString(Proto::WireGuard)).toObject();
|
||||
const QJsonObject &sftpConfig = config.value(ProtocolProps::protoToString(Proto::Sftp)).toObject();
|
||||
const QJsonObject &nextcloudConfig = config.value(ProtocolProps::protoToString(Proto::Nextcloud)).toObject();
|
||||
//
|
||||
|
||||
Vars vars;
|
||||
@@ -569,11 +568,6 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential
|
||||
vars.append({{"$SFTP_USER", sftpConfig.value(config_key::userName).toString() }});
|
||||
vars.append({{"$SFTP_PASSWORD", sftpConfig.value(config_key::password).toString() }});
|
||||
|
||||
// Nextcloud vars
|
||||
QString port = nextcloudConfig.value(config_key::port).toString(QString::number(ProtocolProps::defaultPort(Proto::Nextcloud)));
|
||||
vars.append({{"$NEXTCLOUD_PORT", port }});
|
||||
vars.append({{"$NEXTCLOUD_ADMIN_USER", nextcloudConfig.value(config_key::adminUser).toString(protocols::nextcloud::defaultAdminUser) }});
|
||||
vars.append({{"$NEXTCLOUD_ADMIN_PASSWORD", nextcloudConfig.value(config_key::adminPassword).toString(protocols::nextcloud::defaultAdminPassword) }});
|
||||
|
||||
QString serverIp = Utils::getIPAddress(credentials.hostName);
|
||||
if (!serverIp.isEmpty()) {
|
||||
@@ -667,7 +661,7 @@ ErrorCode ServerController::isServerPortBusy(const ServerCredentials &credential
|
||||
}
|
||||
|
||||
ErrorCode errorCode = runScript(credentials,
|
||||
replaceVars(script, genVarsForScript(credentials, container, containerConfig)), cbReadStdOut, cbReadStdErr);
|
||||
replaceVars(script, genVarsForScript(credentials, container)), cbReadStdOut, cbReadStdErr);
|
||||
if (errorCode != ErrorCode::NoError) {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
@@ -80,92 +80,6 @@
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>WireGuard config</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.amnezia.AmneziaVPN.wireguard-config</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>conf</string>
|
||||
<string>cfg</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>OpenVPN config</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.amnezia.AmneziaVPN.openvpn-config</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>ovpn</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>AmneziaVPN backup file</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.amnezia.AmneziaVPN.backup-config</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>backup</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/plain</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Amnezia VPN config</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.amnezia.AmneziaVPN.amnezia-config</string>
|
||||
<string>org.amnezia.AmneziaVPN.wireguard-config</string>
|
||||
<string>org.amnezia.AmneziaVPN.openvpn-config</string>
|
||||
<string>org.amnezia.AmneziaVPN.backup-config</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
</plist>
|
||||
@@ -249,7 +249,7 @@ void AndroidController::cleanupBackendLogs() {
|
||||
}
|
||||
|
||||
void AndroidController::importConfig(const QString& data){
|
||||
m_startPageLogic->importAnyFile(data);
|
||||
m_startPageLogic->selectConfigFormat(data);
|
||||
}
|
||||
|
||||
const QJsonObject &AndroidController::vpnConfig() const
|
||||
|
||||
@@ -73,13 +73,15 @@
|
||||
NSLog(@"Application openURL: %@", url);
|
||||
if (url.fileURL) {
|
||||
QString filePath(url.path.UTF8String);
|
||||
qDebug() << "filePath:" << filePath;
|
||||
if (filePath.isEmpty()) return NO;
|
||||
|
||||
QFile file(filePath);
|
||||
bool isOpenFile = file.open(QIODevice::ReadOnly);
|
||||
qDebug() << "isOpenFile:" << isOpenFile;
|
||||
QByteArray data = file.readAll();
|
||||
|
||||
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importAnyFile(QString(data));
|
||||
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importConnectionFromCode(QString(data));
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
||||
@@ -18,7 +18,10 @@ OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol()
|
||||
{
|
||||
qDebug() << "OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol";
|
||||
OpenVpnOverCloakProtocol::stop();
|
||||
QThread::msleep(200);
|
||||
#ifndef Q_OS_IOS
|
||||
m_ckProcess.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
@@ -27,17 +30,11 @@ ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
setLastError(ErrorCode::CloakExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
|
||||
Utils::killProcessByName(Utils::executable("ck-client", false));
|
||||
}
|
||||
|
||||
// workaround for desktop releases >= 3.0.7
|
||||
if (!m_cloakConfig.contains("RemoteHost") && m_cloakConfig.contains(config_key::remote)) {
|
||||
m_cloakConfig["RemoteHost"] = m_cloakConfig.value(config_key::remote);
|
||||
m_cloakConfig["RemotePort"] = m_cloakConfig.value(config_key::port);
|
||||
}
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
m_cloakCfgFile.setAutoRemove(false);
|
||||
#endif
|
||||
@@ -46,8 +43,15 @@ ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
m_cloakCfgFile.close();
|
||||
|
||||
QStringList args = QStringList() << "-c" << m_cloakCfgFile.fileName()
|
||||
<< "-s" << m_cloakConfig.value(config_key::remote).toString()
|
||||
<< "-p" << m_cloakConfig.value(config_key::port).toString(amnezia::protocols::cloak::defaultPort)
|
||||
<< "-l" << amnezia::protocols::openvpn::defaultPort;
|
||||
|
||||
ProtocolEnumNS::TransportProto tp = ProtocolProps::transportProtoFromString(m_cloakConfig.value(config_key::transport_proto).toString());
|
||||
if (tp == ProtocolEnumNS::TransportProto::Udp) {
|
||||
args << "-u";
|
||||
}
|
||||
|
||||
qDebug().noquote() << "OpenVpnOverCloakProtocol::start()"
|
||||
<< cloakExecPath() << args.join(" ");
|
||||
|
||||
@@ -82,6 +86,7 @@ ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
return OpenVpnProtocol::start();
|
||||
}
|
||||
else return ErrorCode::CloakExecutableMissing;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenVpnOverCloakProtocol::stop()
|
||||
@@ -95,12 +100,9 @@ void OpenVpnOverCloakProtocol::stop()
|
||||
Utils::signalCtrl(m_ckProcess.processId(), CTRL_C_EVENT);
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
m_ckProcess.terminate();
|
||||
|
||||
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
|
||||
QThread::msleep(1000);
|
||||
Utils::killProcessByName(Utils::executable("ck-client", false));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString OpenVpnOverCloakProtocol::cloakExecPath()
|
||||
|
||||
@@ -79,8 +79,7 @@ QMap<amnezia::Proto, QString> ProtocolProps::protocolHumanNames()
|
||||
{Proto::TorWebSite, "Web site in Tor network"},
|
||||
{Proto::Dns, "DNS Service"},
|
||||
{Proto::FileShare, "File Sharing Service"},
|
||||
{Proto::Sftp, QObject::tr("Sftp service")},
|
||||
{Proto::Nextcloud, QObject::tr("Nextcloud")}
|
||||
{Proto::Sftp, QObject::tr("Sftp service")}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -97,11 +96,10 @@ amnezia::ServiceType ProtocolProps::protocolService(Proto p)
|
||||
case Proto::Cloak : return ServiceType::Vpn;
|
||||
case Proto::ShadowSocks : return ServiceType::Vpn;
|
||||
case Proto::WireGuard : return ServiceType::Vpn;
|
||||
case Proto::TorWebSite : return ServiceType::Other;
|
||||
case Proto::TorWebSite : return ServiceType::Other;
|
||||
case Proto::Dns : return ServiceType::Other;
|
||||
case Proto::FileShare : return ServiceType::Other;
|
||||
case Proto::Nextcloud : return ServiceType::Other;
|
||||
default: return ServiceType::Other;
|
||||
default: return ServiceType::Other;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +118,6 @@ int ProtocolProps::defaultPort(Proto p)
|
||||
case Proto::Dns : return 53;
|
||||
case Proto::FileShare : return 139;
|
||||
case Proto::Sftp : return 222;
|
||||
case Proto::Nextcloud : return 8080;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +130,6 @@ bool ProtocolProps::defaultPortChangeable(Proto p)
|
||||
case Proto::Cloak : return true;
|
||||
case Proto::ShadowSocks : return true;
|
||||
case Proto::WireGuard : return true;
|
||||
case Proto::Nextcloud : return true;
|
||||
case Proto::Ikev2 : return false;
|
||||
case Proto::L2tp : return false;
|
||||
|
||||
@@ -160,8 +156,6 @@ TransportProto ProtocolProps::defaultTransportProto(Proto p)
|
||||
case Proto::Dns : return TransportProto::Udp;
|
||||
case Proto::FileShare : return TransportProto::Udp;
|
||||
case Proto::Sftp : return TransportProto::Tcp;
|
||||
case Proto::Nextcloud : return TransportProto::Tcp;
|
||||
default: return defaultTransportProto(Proto::Any);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,8 +174,7 @@ bool ProtocolProps::defaultTransportProtoChangeable(Proto p)
|
||||
case Proto::Dns : return false;
|
||||
case Proto::FileShare : return false;
|
||||
case Proto::Sftp : return false;
|
||||
case Proto::Nextcloud : return false;
|
||||
default: return false;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@ namespace config_key {
|
||||
constexpr char hostName[] = "hostName";
|
||||
constexpr char userName[] = "userName";
|
||||
constexpr char password[] = "password";
|
||||
constexpr char adminUser[] = "adminUser";
|
||||
constexpr char adminPassword[] = "adminPassword";
|
||||
|
||||
constexpr char port[] = "port";
|
||||
constexpr char local_port[] = "local_port";
|
||||
|
||||
@@ -128,12 +125,6 @@ constexpr char serverPskKeyPath[] = "/opt/amnezia/wireguard/wireguard_psk.key";
|
||||
|
||||
}
|
||||
|
||||
namespace nextcloud {
|
||||
constexpr char defaultAdminUser[] = "admin";
|
||||
constexpr char defaultAdminPassword[] = "admin";
|
||||
}
|
||||
|
||||
|
||||
namespace sftp {
|
||||
constexpr char defaultUserName[] = "sftp_user";
|
||||
|
||||
@@ -163,9 +154,7 @@ enum Proto {
|
||||
TorWebSite,
|
||||
Dns,
|
||||
FileShare,
|
||||
// Fileshare
|
||||
Sftp,
|
||||
Nextcloud
|
||||
Sftp
|
||||
};
|
||||
Q_ENUM_NS(Proto)
|
||||
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
<file>server_scripts/openvpn_cloak/configure_container.sh</file>
|
||||
<file>server_scripts/openvpn_cloak/start.sh</file>
|
||||
<file>server_scripts/openvpn_cloak/template.ovpn</file>
|
||||
<file>server_scripts/nextcloud/Dockerfile</file>
|
||||
<file>server_scripts/nextcloud/configure_container.sh</file>
|
||||
<file>server_scripts/nextcloud/run_container.sh</file>
|
||||
<file>server_scripts/install_docker.sh</file>
|
||||
<file>server_scripts/build_container.sh</file>
|
||||
<file>server_scripts/prepare_host.sh</file>
|
||||
@@ -98,7 +95,6 @@
|
||||
<file>ui/qml/Pages/Protocols/PageProtoTorWebSite.qml</file>
|
||||
<file>ui/qml/Pages/Protocols/PageProtocolBase.qml</file>
|
||||
<file>ui/qml/Pages/Protocols/PageProtoWireGuard.qml</file>
|
||||
<file>ui/qml/Pages/Protocols/PageProtoNextcloud.qml</file>
|
||||
<file>ui/qml/Pages/InstallSettings/InstallSettingsBase.qml</file>
|
||||
<file>ui/qml/Pages/InstallSettings/SelectContainer.qml</file>
|
||||
<file>ui/qml/Pages/Share/PageShareProtoCloak.qml</file>
|
||||
|
||||
@@ -7,6 +7,4 @@ if [[ -z "$docker_service" ]]; then sudo $pm update -y -q; sudo $pm install -y -
|
||||
docker_service=$(systemctl list-units --full -all | grep docker.service | grep -v inactive | grep -v dead | grep -v failed);\
|
||||
if [[ -z "$docker_service" ]]; then sleep 5 && sudo systemctl start docker && sleep 5; fi;\
|
||||
if [[ -f "$pm_yum" ]]; then sudo systemctl enable docker && sudo systemctl start docker; fi;\
|
||||
if [[ ! -f "/usr/bin/docker-compose" ]]; then sudo $pm update -y -q; sudo $pm install -y -q docker-compose; fi;\
|
||||
docker --version \
|
||||
docker-compose --version
|
||||
docker --version
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
FROM nextcloud:latest as amnezia-nextcloud
|
||||
|
||||
LABEL maintainer="AmneziaVPN"
|
||||
@@ -1,4 +0,0 @@
|
||||
# Run container
|
||||
sudo docker run -d \
|
||||
-p $NEXTCLOUD_PORT:80 \
|
||||
--name $CONTAINER_NAME $CONTAINER_NAME
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
friend class ShadowSocksLogic;
|
||||
friend class CloakLogic;
|
||||
friend class UiLogic;
|
||||
friend class NextcloudLogic;
|
||||
|
||||
void onUpdatePage() override;
|
||||
ErrorCode doInstallAction(const std::function<ErrorCode()> &action);
|
||||
|
||||
@@ -192,7 +192,7 @@ void StartPageLogic::onPushButtonImportOpenFile()
|
||||
file.open(QIODevice::ReadOnly);
|
||||
QByteArray data = file.readAll();
|
||||
|
||||
importAnyFile(QString(data));
|
||||
selectConfigFormat(QString(data));
|
||||
}
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
@@ -202,7 +202,7 @@ void StartPageLogic::startQrDecoder()
|
||||
}
|
||||
#endif
|
||||
|
||||
void StartPageLogic::importAnyFile(const QString &configData)
|
||||
void StartPageLogic::selectConfigFormat(QString configData)
|
||||
{
|
||||
auto configFormat = checkConfigFormat(configData);
|
||||
if (configFormat == ConfigTypes::OpenVpn) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
Q_INVOKABLE void startQrDecoder();
|
||||
#endif
|
||||
|
||||
void importAnyFile(const QString &configData);
|
||||
void selectConfigFormat(QString configData);
|
||||
|
||||
bool importConnection(const QJsonObject &profile);
|
||||
bool importConnectionFromCode(QString code);
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#include "NextcloudLogic.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "core/servercontroller.h"
|
||||
#include "ui/pages_logic/ServerConfiguringProgressLogic.h"
|
||||
#include "ui/uilogic.h"
|
||||
|
||||
using namespace amnezia;
|
||||
using namespace PageEnumNS;
|
||||
|
||||
NextcloudLogic::NextcloudLogic(UiLogic *logic, QObject *parent):
|
||||
PageProtocolLogicBase(logic, parent),
|
||||
m_lineNextcloudPortText{},
|
||||
m_lineAdminUserText{},
|
||||
m_lineAdminPasswordText{},
|
||||
m_pushButtonSaveVisible{false},
|
||||
m_progressBarResetVisible{false},
|
||||
m_labelInfoVisible{true},
|
||||
m_labelInfoText{},
|
||||
m_progressBarResetValue{0},
|
||||
m_progressBarResetMaximium{100}
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NextcloudLogic::updateProtocolPage(const QJsonObject &nextcloudConfig, DockerContainer container, bool haveAuthData)
|
||||
{
|
||||
set_pageEnabled(haveAuthData);
|
||||
set_pushButtonSaveVisible(haveAuthData);
|
||||
set_progressBarResetVisible(haveAuthData);
|
||||
|
||||
set_lineAdminUserText(nextcloudConfig.value(config_key::adminUser).toString(protocols::nextcloud::defaultAdminUser));
|
||||
set_lineAdminPasswordText(nextcloudConfig.value(config_key::adminPassword).toString(protocols::nextcloud::defaultAdminPassword));
|
||||
}
|
||||
|
||||
QJsonObject NextcloudLogic::getProtocolConfigFromPage(QJsonObject oldConfig)
|
||||
{
|
||||
oldConfig.insert(config_key::adminUser, lineAdminUserText());
|
||||
oldConfig.insert(config_key::adminPassword, lineAdminPasswordText());
|
||||
return oldConfig;
|
||||
}
|
||||
|
||||
void NextcloudLogic::onPushButtonSaveClicked()
|
||||
{
|
||||
QJsonObject protocolConfig = m_settings->protocolConfig(uiLogic()->m_selectedServerIndex, uiLogic()->m_selectedDockerContainer, Proto::Nextcloud);
|
||||
protocolConfig = getProtocolConfigFromPage(protocolConfig);
|
||||
|
||||
QJsonObject containerConfig = m_settings->containerConfig(uiLogic()->m_selectedServerIndex, uiLogic()->m_selectedDockerContainer);
|
||||
QJsonObject newContainerConfig = containerConfig;
|
||||
newContainerConfig.insert(ProtocolProps::protoToString(Proto::Nextcloud), protocolConfig);
|
||||
}
|
||||
|
||||
void NextcloudLogic::onPushButtonCancelClicked()
|
||||
{
|
||||
emit uiLogic()->pageLogic<ServerConfiguringProgressLogic>()->cancelDoInstallAction(true);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
#ifndef NEXTCLOUDLOGIC_H
|
||||
#define NEXTCLOUDLOGIC_H
|
||||
|
||||
#include "PageProtocolLogicBase.h"
|
||||
|
||||
class UiLogic;
|
||||
|
||||
class NextcloudLogic : public PageProtocolLogicBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
AUTO_PROPERTY(QString, lineNextcloudPortText)
|
||||
AUTO_PROPERTY(QString, lineAdminUserText)
|
||||
AUTO_PROPERTY(QString, lineAdminPasswordText)
|
||||
|
||||
AUTO_PROPERTY(bool, labelInfoVisible)
|
||||
AUTO_PROPERTY(QString, labelInfoText)
|
||||
|
||||
AUTO_PROPERTY(int, progressBarResetValue)
|
||||
AUTO_PROPERTY(int, progressBarResetMaximium)
|
||||
AUTO_PROPERTY(bool, progressBarResetVisible)
|
||||
AUTO_PROPERTY(bool, progressBarTextVisible)
|
||||
AUTO_PROPERTY(QString, progressBarText)
|
||||
|
||||
AUTO_PROPERTY(bool, labelServerBusyVisible)
|
||||
AUTO_PROPERTY(QString, labelServerBusyText)
|
||||
|
||||
AUTO_PROPERTY(bool, pushButtonSaveVisible)
|
||||
AUTO_PROPERTY(bool, pushButtonCancelVisible)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void onPushButtonSaveClicked();
|
||||
Q_INVOKABLE void onPushButtonCancelClicked();
|
||||
|
||||
public:
|
||||
explicit NextcloudLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~NextcloudLogic() = default;
|
||||
|
||||
void updateProtocolPage(const QJsonObject &nextcloudConfig, DockerContainer container, bool haveAuthData) override;
|
||||
QJsonObject getProtocolConfigFromPage(QJsonObject oldConfig) override;
|
||||
|
||||
private:
|
||||
UiLogic *m_uiLogic;
|
||||
|
||||
};
|
||||
|
||||
#endif // NEXTCLOUDLOGIC_H
|
||||
@@ -1,80 +0,0 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import ProtocolEnum 1.0
|
||||
import "../"
|
||||
import "../../Controls"
|
||||
import "../../Config"
|
||||
|
||||
PageProtocolBase {
|
||||
id: root
|
||||
protocol: ProtocolEnum.Nextcloud
|
||||
logic: UiLogic.protocolLogic(protocol)
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("Nextcloud settings")
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: frame_settings
|
||||
width: parent.width
|
||||
anchors.top: caption.bottom
|
||||
anchors.topMargin: 10
|
||||
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
Grid {
|
||||
id: grid
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
horizontalItemAlignment: Grid.AlignHCenter
|
||||
verticalItemAlignment: Grid.AlignVCenter
|
||||
topPadding: 5
|
||||
leftPadding: 30
|
||||
rightPadding: 30
|
||||
spacing: 5
|
||||
|
||||
LabelType {
|
||||
width: 130
|
||||
text: qsTr("Port")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tf_port_num
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
text: logic.lineNextcloudPortText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
LabelType {
|
||||
width: 130
|
||||
text: qsTr("Admin user")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tf_admin_user
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
text: logic.lineAdminUserText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
LabelType {
|
||||
width: 130
|
||||
text: qsTr("Admin password")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tf_admin_password
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
text: logic.lineAdminPasswordText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -74,7 +74,6 @@
|
||||
#include "pages_logic/protocols/ShadowSocksLogic.h"
|
||||
#include "pages_logic/protocols/OtherProtocolsLogic.h"
|
||||
#include "pages_logic/protocols/WireGuardLogic.h"
|
||||
#include "pages_logic/protocols/NextcloudLogic.h"
|
||||
|
||||
using namespace amnezia;
|
||||
using namespace PageEnumNS;
|
||||
@@ -101,7 +100,6 @@ UiLogic::UiLogic(std::shared_ptr<Settings> settings, std::shared_ptr<VpnConfigur
|
||||
m_protocolLogicMap.insert(Proto::Dns, new OtherProtocolsLogic(this));
|
||||
m_protocolLogicMap.insert(Proto::Sftp, new OtherProtocolsLogic(this));
|
||||
m_protocolLogicMap.insert(Proto::TorWebSite, new OtherProtocolsLogic(this));
|
||||
m_protocolLogicMap.insert(Proto::Nextcloud, new NextcloudLogic(this));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ class PageProtocolLogicBase;
|
||||
class OpenVpnLogic;
|
||||
class ShadowSocksLogic;
|
||||
class CloakLogic;
|
||||
class NextcloudLogic;
|
||||
|
||||
class OtherProtocolsLogic;
|
||||
|
||||
@@ -101,7 +100,6 @@ public:
|
||||
friend class OpenVpnLogic;
|
||||
friend class ShadowSocksLogic;
|
||||
friend class CloakLogic;
|
||||
friend class NextcloudLogic;
|
||||
|
||||
friend class OtherProtocolsLogic;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ bool Utils::processIsRunning(const QString& fileName)
|
||||
QProcess process;
|
||||
process.setReadChannel(QProcess::StandardOutput);
|
||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||
process.start("wmic.exe", QStringList() << "/OUTPUT:STDOUT" << "PROCESS" << "get" << "Caption");
|
||||
process.start(QString("wmic.exe /OUTPUT:STDOUT PROCESS get %1").arg("Caption"));
|
||||
process.waitForStarted();
|
||||
process.waitForFinished();
|
||||
QString processData(process.readAll());
|
||||
@@ -165,8 +165,9 @@ bool Utils::checkIpSubnetFormat(const QString &ip)
|
||||
void Utils::killProcessByName(const QString &name)
|
||||
{
|
||||
qDebug().noquote() << "Kill process" << name;
|
||||
qDebug() << "Hello";
|
||||
#ifdef Q_OS_WIN
|
||||
QProcess::execute("taskkill", QStringList() << "/IM" << name << "/F");
|
||||
QProcess::execute(QString("taskkill /im %1 /f").arg(name));
|
||||
#elif defined Q_OS_IOS
|
||||
return;
|
||||
#else
|
||||
|
||||
@@ -40,8 +40,8 @@ DMG_FILENAME=$PROJECT_DIR/${APP_NAME}.dmg
|
||||
if [ -z "${QT_VERSION+x}" ]; then
|
||||
QT_VERSION=6.4.1;
|
||||
QIF_VERSION=4.1
|
||||
# QT_BIN_DIR=$HOME/Qt/$QT_VERSION/macos/bin
|
||||
QIF_BIN_DIR=${QT_BIN_DIR:-$HOME/Qt/$QT_VERSION/macos/bin}/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
|
||||
QT_BIN_DIR=$HOME/Qt/$QT_VERSION/macos/bin
|
||||
QIF_BIN_DIR=$QT_BIN_DIR/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
|
||||
fi
|
||||
|
||||
echo "Using Qt in $QT_BIN_DIR"
|
||||
|
||||
Reference in New Issue
Block a user