Compare commits

...

5 Commits

Author SHA1 Message Date
lunardunno
fd6a47f9d9 Extended names for variables
Extended names for variables:
from major to majorVersion;
from minor to minorVersion;
2025-04-05 11:02:57 +04:00
lunardunno
39ab6dca1e Linux version 4.14
The functionality of the updated amnezia-awg container in Debian 9 with Linux kernel version 4.14 and newer has been tested.
2025-04-04 14:29:31 +04:00
lunardunno
52216043bb polishing 2025-04-01 06:54:19 +04:00
lunardunno
ded3995169 Added Linux version check
Added Linux version check and introduced corresponding ServerLinuxKernelTooOld error.
2025-04-01 04:32:32 +04:00
lunardunno
8156ac7757 Linux version to stdOut
print the Linux version to stdOut for subsequent checking by the server controller.
2025-04-01 03:15:25 +04:00
4 changed files with 16 additions and 1 deletions

View File

@@ -407,6 +407,18 @@ ErrorCode ServerController::installDockerWorker(const ServerCredentials &credent
cbReadStdOut, cbReadStdErr);
qDebug().noquote() << "ServerController::installDockerWorker" << stdOut;
if (container == DockerContainer::Awg) {
QRegularExpression regex(R"(Linux\s+(\d+)\.(\d+)[^\d]*)");
QRegularExpressionMatch match = regex.match(stdOut);
if (match.hasMatch()) {
int majorVersion = match.captured(1).toInt();
int minorVersion = match.captured(2).toInt();
if (majorVersion < 4 || (majorVersion == 4 && minorVersion < 14)) {
return ErrorCode::ServerLinuxKernelTooOld;
}
}
}
if (stdOut.contains("lock"))
return ErrorCode::ServerPacketManagerError;
if (stdOut.contains("command not found"))

View File

@@ -58,6 +58,7 @@ namespace amnezia
ServerUserDirectoryNotAccessible = 208,
ServerUserNotAllowedInSudoers = 209,
ServerUserPasswordRequired = 210,
ServerLinuxKernelTooOld = 211,
// Ssh connection errors
SshRequestDeniedError = 300,

View File

@@ -26,6 +26,7 @@ QString errorString(ErrorCode code) {
case(ErrorCode::ServerUserDirectoryNotAccessible): errorMessage = QObject::tr("The server user's home directory is not accessible"); break;
case(ErrorCode::ServerUserNotAllowedInSudoers): errorMessage = QObject::tr("Action not allowed in sudoers"); break;
case(ErrorCode::ServerUserPasswordRequired): errorMessage = QObject::tr("The user's password is required"); break;
case(ErrorCode::ServerLinuxKernelTooOld): errorMessage = QObject::tr("Server error: Linux kernel is too old"); break;
// Libssh errors
case(ErrorCode::SshRequestDeniedError): errorMessage = QObject::tr("SSH request was denied"); break;

View File

@@ -20,4 +20,5 @@ if [ "$(systemctl is-active docker)" != "active" ]; then \
sleep 5; sudo systemctl start docker; sleep 5;\
fi;\
if ! command -v sudo > /dev/null 2>&1; then echo "Failed to install sudo, command not found"; exit 1; fi;\
docker --version
docker --version;\
uname -sr