mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-07-03 14:07:39 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34ddeb2563 | |||
| 1674a66a3c | |||
| 7a6905f6bf | |||
| 345cf6cf49 | |||
| 5f3dbf0bdd | |||
| 5c167e426d | |||
| 6513ecfa99 | |||
| 0099e642f3 |
+1
-1
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)
|
||||
|
||||
set(PROJECT AmneziaVPN)
|
||||
|
||||
project(${PROJECT} VERSION 3.0.7.4
|
||||
project(${PROJECT} VERSION 3.0.7.2
|
||||
DESCRIPTION "AmneziaVPN"
|
||||
HOMEPAGE_URL "https://amnezia.org/"
|
||||
)
|
||||
|
||||
Vendored
+1
-1
Submodule client/3rd/OpenVPNAdapter updated: 7b4046faf3...0e2db0baa0
@@ -92,6 +92,7 @@ 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)
|
||||
@@ -214,11 +215,7 @@ if(APPLE)
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
add_compile_definitions(MVPN_MACOS)
|
||||
|
||||
set(ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/app.icns)
|
||||
set(MACOSX_BUNDLE_ICON_FILE app.icns)
|
||||
set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
set(SOURCES ${SOURCES} ${ICON_FILE})
|
||||
# ICON = $$PWD/images/app.icns
|
||||
|
||||
find_library(FW_COCOA Cocoa)
|
||||
find_library(FW_APPLICATIONSERVICES ApplicationServices)
|
||||
|
||||
@@ -61,6 +61,9 @@ QVector<amnezia::Proto> ContainerProps::protocolsForContainer(amnezia::DockerCon
|
||||
case DockerContainer::Sftp:
|
||||
return { Proto::Sftp};
|
||||
|
||||
case DockerContainer::Nextcloud:
|
||||
return { Proto::Nextcloud };
|
||||
|
||||
default:
|
||||
return { defaultProtocol(container) };
|
||||
}
|
||||
@@ -90,7 +93,8 @@ 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::Sftp, QObject::tr("Sftp file sharing service")},
|
||||
{DockerContainer::Nextcloud, QObject::tr("Nextcloud")}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -107,7 +111,8 @@ 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::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service")},
|
||||
{DockerContainer::Nextcloud, QObject::tr("Nextcloud private cloud")},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -124,6 +129,7 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -142,6 +148,7 @@ 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,7 +24,9 @@ enum DockerContainer {
|
||||
TorWebSite,
|
||||
Dns,
|
||||
//FileShare,
|
||||
Sftp
|
||||
Sftp,
|
||||
Nextcloud
|
||||
|
||||
};
|
||||
Q_ENUM_NS(DockerContainer)
|
||||
} // namespace ContainerEnumNS
|
||||
|
||||
@@ -17,6 +17,7 @@ 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,6 +491,7 @@ 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;
|
||||
@@ -568,6 +569,11 @@ 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()) {
|
||||
@@ -661,7 +667,7 @@ ErrorCode ServerController::isServerPortBusy(const ServerCredentials &credential
|
||||
}
|
||||
|
||||
ErrorCode errorCode = runScript(credentials,
|
||||
replaceVars(script, genVarsForScript(credentials, container)), cbReadStdOut, cbReadStdErr);
|
||||
replaceVars(script, genVarsForScript(credentials, container, containerConfig)), cbReadStdOut, cbReadStdErr);
|
||||
if (errorCode != ErrorCode::NoError) {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ namespace libssh {
|
||||
int bytesWritten = sftp_write(file, buffer, bufferSize);
|
||||
|
||||
std::string chunk(buffer, bufferSize);
|
||||
qDebug() << "sftp write: " << QString(chunk.c_str());
|
||||
|
||||
if (bytesWritten != bufferSize) {
|
||||
fin.close();
|
||||
@@ -271,6 +272,7 @@ namespace libssh {
|
||||
fin.read(buffer, lastChunkSize);
|
||||
|
||||
std::string chunk(buffer, lastChunkSize);
|
||||
qDebug() << "sftp write: " << QString(chunk.c_str());
|
||||
|
||||
int bytesWritten = sftp_write(file, buffer, lastChunkSize);
|
||||
|
||||
|
||||
@@ -79,7 +79,8 @@ 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::Sftp, QObject::tr("Sftp service")},
|
||||
{Proto::Nextcloud, QObject::tr("Nextcloud")}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -96,10 +97,11 @@ 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;
|
||||
default: return ServiceType::Other;
|
||||
case Proto::Nextcloud : return ServiceType::Other;
|
||||
default: return ServiceType::Other;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +120,7 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -130,6 +133,7 @@ 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;
|
||||
|
||||
@@ -156,6 +160,8 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +180,8 @@ bool ProtocolProps::defaultTransportProtoChangeable(Proto p)
|
||||
case Proto::Dns : return false;
|
||||
case Proto::FileShare : return false;
|
||||
case Proto::Sftp : return false;
|
||||
default: return false;
|
||||
case Proto::Nextcloud : return false;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ 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";
|
||||
|
||||
@@ -125,6 +128,12 @@ 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";
|
||||
|
||||
@@ -154,7 +163,9 @@ enum Proto {
|
||||
TorWebSite,
|
||||
Dns,
|
||||
FileShare,
|
||||
Sftp
|
||||
// Fileshare
|
||||
Sftp,
|
||||
Nextcloud
|
||||
};
|
||||
Q_ENUM_NS(Proto)
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
<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>
|
||||
@@ -95,6 +98,7 @@
|
||||
<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,4 +7,6 @@ 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;\
|
||||
docker --version
|
||||
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
|
||||
@@ -0,0 +1,3 @@
|
||||
FROM nextcloud:latest as amnezia-nextcloud
|
||||
|
||||
LABEL maintainer="AmneziaVPN"
|
||||
@@ -0,0 +1,4 @@
|
||||
# Run container
|
||||
sudo docker run -d \
|
||||
-p $NEXTCLOUD_PORT:80 \
|
||||
--name $CONTAINER_NAME $CONTAINER_NAME
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
friend class ShadowSocksLogic;
|
||||
friend class CloakLogic;
|
||||
friend class UiLogic;
|
||||
friend class NextcloudLogic;
|
||||
|
||||
void onUpdatePage() override;
|
||||
ErrorCode doInstallAction(const std::function<ErrorCode()> &action);
|
||||
|
||||
@@ -100,11 +100,6 @@ void ServerSettingsLogic::onLineEditDescriptionEditingFinished()
|
||||
uiLogic()->onUpdateAllPages();
|
||||
}
|
||||
|
||||
bool ServerSettingsLogic::isCurrentServerHasCredentials()
|
||||
{
|
||||
return m_settings->haveAuthData(uiLogic()->m_selectedServerIndex);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
/* Auth result handler for Android */
|
||||
void authResultReceiver::handleActivityResult(int receiverRequestCode, int resultCode, const QJniObject &data)
|
||||
|
||||
@@ -31,8 +31,6 @@ public:
|
||||
Q_INVOKABLE void onPushButtonClearClientCacheClicked();
|
||||
Q_INVOKABLE void onLineEditDescriptionEditingFinished();
|
||||
|
||||
Q_INVOKABLE bool isCurrentServerHasCredentials();
|
||||
|
||||
public:
|
||||
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~ServerSettingsLogic() = default;
|
||||
|
||||
@@ -23,7 +23,7 @@ class StartPageLogic : public PageLogicBase
|
||||
AUTO_PROPERTY(QString, labelWaitInfoText)
|
||||
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
|
||||
|
||||
AUTO_PROPERTY(QString, privateKeyPassphrase)
|
||||
AUTO_PROPERTY(QString, privateKeyPassphrase);
|
||||
|
||||
READONLY_PROPERTY(QRegularExpression, ipAddressPortRegex)
|
||||
public:
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#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);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
#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
|
||||
@@ -13,18 +13,12 @@ Popup {
|
||||
|
||||
anchors.centerIn: Overlay.overlay
|
||||
modal: true
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
width: parent.width - 20
|
||||
focus: true
|
||||
|
||||
onAboutToHide: {
|
||||
parent.forceActiveFocus(true)
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
@@ -34,9 +28,9 @@ Popup {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
BlueButtonType {
|
||||
id: yesButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: yesText
|
||||
onClicked: {
|
||||
@@ -49,6 +43,7 @@ Popup {
|
||||
}
|
||||
BlueButtonType {
|
||||
id: noButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: noText
|
||||
onClicked: {
|
||||
|
||||
@@ -110,18 +110,13 @@ PageBase {
|
||||
Layout.topMargin: 10
|
||||
text: qsTr("Forget this server")
|
||||
onClicked: {
|
||||
if (ServerSettingsLogic.isCurrentServerHasCredentials()) {
|
||||
popupForgetServer.questionText = "Attention! This action will not remove any data from the server, it will just remove server from the list. Continue?"
|
||||
}
|
||||
else {
|
||||
popupForgetServer.questionText = "Remove server from the list?"
|
||||
}
|
||||
popupForgetServer.open()
|
||||
}
|
||||
}
|
||||
|
||||
PopupWithQuestion {
|
||||
id: popupForgetServer
|
||||
questionText: "Attention! This action will not remove the container on the server, it will only remove the container information from the application. Continue?"
|
||||
yesFunc: function() {
|
||||
ServerSettingsLogic.onPushButtonForgetServer()
|
||||
close()
|
||||
|
||||
@@ -233,8 +233,9 @@ PageBase {
|
||||
anchors.top: label_server_ip.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: StartPageLogic.lineEditIpText
|
||||
onEditingFinished: { StartPageLogic.lineEditIpText = text }
|
||||
onTextEdited: { StartPageLogic.lineEditIpText = text }
|
||||
onEditingFinished: {
|
||||
StartPageLogic.lineEditIpText = text
|
||||
}
|
||||
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: StartPageLogic.ipAddressPortRegex
|
||||
@@ -252,8 +253,9 @@ PageBase {
|
||||
anchors.top: label_login.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: StartPageLogic.lineEditLoginText
|
||||
onEditingFinished: { StartPageLogic.lineEditLoginText = text }
|
||||
onTextEdited: { StartPageLogic.lineEditLoginText = text }
|
||||
onEditingFinished: {
|
||||
StartPageLogic.lineEditLoginText = text
|
||||
}
|
||||
}
|
||||
|
||||
LabelType {
|
||||
@@ -266,29 +268,25 @@ PageBase {
|
||||
id: new_server_password
|
||||
anchors.top: label_new_server_password.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
inputMethodHints: Qt.ImhSensitiveData
|
||||
echoMode: TextInput.Password
|
||||
text: StartPageLogic.lineEditPasswordText
|
||||
onEditingFinished: { StartPageLogic.lineEditPasswordText = text }
|
||||
onTextEdited: { StartPageLogic.lineEditPasswordText = text }
|
||||
onAccepted: { StartPageLogic.onPushButtonConnect() }
|
||||
onEditingFinished: {
|
||||
StartPageLogic.lineEditPasswordText = text
|
||||
}
|
||||
}
|
||||
TextFieldType {
|
||||
id: new_server_ssh_key
|
||||
anchors.top: label_new_server_password.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
visible: false
|
||||
height: 71
|
||||
font.pixelSize: 10
|
||||
verticalAlignment: Text.AlignTop
|
||||
inputMethodHints: Qt.ImhSensitiveData
|
||||
|
||||
text: StartPageLogic.textEditSshKeyText
|
||||
onEditingFinished: { StartPageLogic.textEditSshKeyText = text }
|
||||
onTextEdited: { StartPageLogic.textEditSshKeyText = text }
|
||||
onAccepted: { StartPageLogic.onPushButtonConnect() }
|
||||
onEditingFinished: {
|
||||
StartPageLogic.textEditSshKeyText = text
|
||||
}
|
||||
visible: false
|
||||
}
|
||||
|
||||
LabelType {
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -354,7 +354,7 @@ Window {
|
||||
}
|
||||
textArea.wrapMode: cbLogWrap.checked ? TextEdit.WordWrap: TextEdit.NoWrap
|
||||
|
||||
Keys.onPressed: function(event) {
|
||||
Keys.onPressed: {
|
||||
UiLogic.keyPressEvent(event.key)
|
||||
event.accepted = true
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#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;
|
||||
@@ -100,6 +101,7 @@ 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,6 +52,7 @@ class PageProtocolLogicBase;
|
||||
class OpenVpnLogic;
|
||||
class ShadowSocksLogic;
|
||||
class CloakLogic;
|
||||
class NextcloudLogic;
|
||||
|
||||
class OtherProtocolsLogic;
|
||||
|
||||
@@ -100,6 +101,7 @@ public:
|
||||
friend class OpenVpnLogic;
|
||||
friend class ShadowSocksLogic;
|
||||
friend class CloakLogic;
|
||||
friend class NextcloudLogic;
|
||||
|
||||
friend class OtherProtocolsLogic;
|
||||
|
||||
|
||||
@@ -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/../../../Tools/QtInstallerFramework/$QIF_VERSION/bin
|
||||
# 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
|
||||
fi
|
||||
|
||||
echo "Using Qt in $QT_BIN_DIR"
|
||||
@@ -66,9 +66,11 @@ echo "____________________________________"
|
||||
echo "............Deploy.................."
|
||||
echo "____________________________________"
|
||||
|
||||
# Package
|
||||
# Package
|
||||
echo "Packaging ..."
|
||||
|
||||
#cd $DEPLOY_DIR
|
||||
|
||||
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite -qmldir=$PROJECT_DIR
|
||||
cp -av $BUILD_DIR/service/server/$APP_NAME-service $BUNDLE_DIR/Contents/macOS
|
||||
cp -Rv $PROJECT_DIR/deploy/data/macos/* $BUNDLE_DIR/Contents/macOS
|
||||
@@ -145,7 +147,7 @@ if [ "${MAC_CERT_PW+x}" ]; then
|
||||
fi
|
||||
|
||||
echo "Building DMG installer..."
|
||||
hdiutil create -volname Amnezia -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
|
||||
hdiutil create -volname $APP_NAME -srcfolder $BUILD_DIR/installer/$APP_NAME.app -ov -format UDZO $DMG_FILENAME
|
||||
|
||||
if [ "${MAC_CERT_PW+x}" ]; then
|
||||
echo "Signing DMG installer..."
|
||||
|
||||
@@ -7,6 +7,10 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT IOS AND NOT ANDROID)
|
||||
#include(common.cmake)
|
||||
#if (qtservice-uselib)
|
||||
# add_subdirectory(buildlib)
|
||||
#endif()
|
||||
add_subdirectory(server)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -94,15 +94,10 @@ include_directories(
|
||||
add_executable(${PROJECT} ${SOURCES} ${HEADERS})
|
||||
target_link_libraries(${PROJECT} PRIVATE Qt6::Core Qt6::Network Qt6::RemoteObjects Qt6::Core5Compat ${LIBS})
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(${PROJECT} PROPERTIES
|
||||
INSTALL_RPATH "@executable_path/../Frameworks"
|
||||
BUILD_WITH_INSTALL_RPATH TRUE
|
||||
)
|
||||
endif()
|
||||
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_interface.rep)
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep)
|
||||
if(NOT IOS)
|
||||
qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_interface.rep)
|
||||
endif()
|
||||
|
||||
# deploy artifacts required to run the application to the debug build folder
|
||||
if(WIN32)
|
||||
@@ -117,10 +112,12 @@ elseif(APPLE AND NOT IOS)
|
||||
set(DEPLOY_ARTIFACT_PATH "macos")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
|
||||
${CMAKE_SOURCE_DIR}/deploy/data/${DEPLOY_ARTIFACT_PATH}
|
||||
$<TARGET_FILE_DIR:${PROJECT}>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
if(NOT IOS AND NOT ANDROID)
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<CONFIG:Debug>,copy_directory,true>
|
||||
${CMAKE_SOURCE_DIR}/deploy/data/${DEPLOY_ARTIFACT_PATH}
|
||||
$<TARGET_FILE_DIR:${PROJECT}>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user