mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
chore: add logs
This commit is contained in:
@@ -117,6 +117,9 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon
|
|||||||
connData.port = portStr;
|
connData.port = portStr;
|
||||||
|
|
||||||
if (connData.clientPrivKey.isEmpty() || connData.clientPubKey.isEmpty()) {
|
if (connData.clientPrivKey.isEmpty() || connData.clientPubKey.isEmpty()) {
|
||||||
|
qCritical() << "WireguardConfigurator: prepareWireguardConfig: genClientKeys failed"
|
||||||
|
<< "privKey.isEmpty=" << connData.clientPrivKey.isEmpty()
|
||||||
|
<< "pubKey.isEmpty=" << connData.clientPubKey.isEmpty();
|
||||||
errorCode = ErrorCode::InternalError;
|
errorCode = ErrorCode::InternalError;
|
||||||
return connData;
|
return connData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -273,6 +273,8 @@ ErrorCode InstallController::updateClientConfig(const QString &serverId, DockerC
|
|||||||
return ErrorCode::NoError;
|
return ErrorCode::NoError;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
qCritical() << "InstallController: updateClientConfig: unexpected server kind for serverId=" << serverId
|
||||||
|
<< "kind=" << static_cast<int>(m_serversRepository->serverKind(serverId));
|
||||||
return ErrorCode::InternalError;
|
return ErrorCode::InternalError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1235,10 +1237,14 @@ ErrorCode InstallController::installContainer(const QString &serverId, DockerCon
|
|||||||
{
|
{
|
||||||
auto adminConfig = m_serversRepository->selfHostedAdminConfig(serverId);
|
auto adminConfig = m_serversRepository->selfHostedAdminConfig(serverId);
|
||||||
if (!adminConfig.has_value()) {
|
if (!adminConfig.has_value()) {
|
||||||
|
qCritical() << "InstallController: installContainer: selfHostedAdminConfig nullopt, serverId=" << serverId;
|
||||||
return ErrorCode::InternalError;
|
return ErrorCode::InternalError;
|
||||||
}
|
}
|
||||||
ServerCredentials credentials = adminConfig->credentials();
|
ServerCredentials credentials = adminConfig->credentials();
|
||||||
if (!credentials.isValid()) {
|
if (!credentials.isValid()) {
|
||||||
|
qCritical() << "InstallController: installContainer: credentials invalid, serverId=" << serverId
|
||||||
|
<< "host=" << credentials.hostName << "user=" << credentials.userName
|
||||||
|
<< "port=" << credentials.port << "hasSecret=" << !credentials.secretData.isEmpty();
|
||||||
return ErrorCode::InternalError;
|
return ErrorCode::InternalError;
|
||||||
}
|
}
|
||||||
SshSession sshSession(this);
|
SshSession sshSession(this);
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ void InstallUiController::install(DockerContainer container, int port, Transport
|
|||||||
const QString newServerId = m_serversController->getServerId(m_serversController->getServersCount() - 1);
|
const QString newServerId = m_serversController->getServerId(m_serversController->getServersCount() - 1);
|
||||||
const auto admin = m_serversController->selfHostedAdminConfig(newServerId);
|
const auto admin = m_serversController->selfHostedAdminConfig(newServerId);
|
||||||
if (!admin.has_value()) {
|
if (!admin.has_value()) {
|
||||||
|
qCritical() << "InstallUiController: install(new): selfHostedAdminConfig nullopt, newServerId=" << newServerId
|
||||||
|
<< "serversCount=" << m_serversController->getServersCount();
|
||||||
emit installationErrorOccurred(ErrorCode::InternalError);
|
emit installationErrorOccurred(ErrorCode::InternalError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -138,6 +140,7 @@ void InstallUiController::install(DockerContainer container, int port, Transport
|
|||||||
} else {
|
} else {
|
||||||
const auto adminBefore = m_serversController->selfHostedAdminConfig(serverId);
|
const auto adminBefore = m_serversController->selfHostedAdminConfig(serverId);
|
||||||
if (!adminBefore.has_value()) {
|
if (!adminBefore.has_value()) {
|
||||||
|
qCritical() << "InstallUiController: install(existing): selfHostedAdminConfig nullopt before install, serverId=" << serverId;
|
||||||
emit installationErrorOccurred(ErrorCode::InternalError);
|
emit installationErrorOccurred(ErrorCode::InternalError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -154,6 +157,7 @@ void InstallUiController::install(DockerContainer container, int port, Transport
|
|||||||
|
|
||||||
const auto adminAfter = m_serversController->selfHostedAdminConfig(serverId);
|
const auto adminAfter = m_serversController->selfHostedAdminConfig(serverId);
|
||||||
if (!adminAfter.has_value()) {
|
if (!adminAfter.has_value()) {
|
||||||
|
qCritical() << "InstallUiController: install(existing): selfHostedAdminConfig nullopt after install, serverId=" << serverId;
|
||||||
emit installationErrorOccurred(ErrorCode::InternalError);
|
emit installationErrorOccurred(ErrorCode::InternalError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user