Compare commits

..

4 Commits

Author SHA1 Message Date
lunardunno f1152ccad3 Merge branch 'sudo_permission_check' into wheel_group_suppor 2024-11-16 09:18:05 +04:00
lunardunno 3d95b14fc1 checking that the username is root
Changing the mechanism for checking that the username is root
2024-11-16 09:04:11 +04:00
Nethius 8547de82ea bump xcode-version for macos build (#1249) 2024-11-14 10:58:04 +07:00
lunardunno 6d176dcc2f wheel group check
Checking if the user is included in the wheel group
2024-10-24 22:06:07 +04:00
5 changed files with 68 additions and 71 deletions
+1 -1
View File
@@ -256,7 +256,7 @@ jobs:
- name: 'Setup xcode'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3.1'
xcode-version: '15.4.0'
- name: 'Install Qt'
uses: jurplel/install-qt-action@v3
+2 -6
View File
@@ -751,10 +751,6 @@ ErrorCode ServerController::isServerPortBusy(const ServerCredentials &credential
ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, DockerContainer container)
{
if (credentials.userName == "root") {
return ErrorCode::NoError;
}
QString stdOut;
auto cbReadStdOut = [&](const QString &data, libssh::Client &) {
stdOut += data + "\n";
@@ -768,7 +764,7 @@ ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, D
const QString scriptData = amnezia::scriptData(SharedScriptType::check_user_in_sudo);
ErrorCode error = runScript(credentials, replaceVars(scriptData, genVarsForScript(credentials)), cbReadStdOut, cbReadStdErr);
if (!stdOut.contains("sudo"))
if (!stdOut.contains("root :") && !stdOut.contains(" sudo") && !stdOut.contains(" wheel"))
return ErrorCode::ServerUserNotInSudo;
return error;
@@ -832,4 +828,4 @@ ErrorCode ServerController::getDecryptedPrivateKey(const ServerCredentials &cred
{
auto error = m_sshClient.getDecryptedPrivateKey(credentials, decryptedPrivateKey, callback);
return error;
}
}
@@ -145,7 +145,6 @@ Button {
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
enabled: root.enabled
onEntered: {
backgroundRect.color = root.hoveredColor
@@ -16,82 +16,83 @@ PageType {
defaultActiveFocusItem: focusItem
ColumnLayout {
id: header
FlickableType {
id: fl
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 0
Item {
id: focusItem
KeyNavigation.tab: backButton
}
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton
}
HeaderType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
headerText: qsTr("VPN by Amnezia")
descriptionText: qsTr("Choose a VPN service that suits your needs.")
}
}
ListView {
id: servicesListView
anchors.top: header.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.topMargin: 16
spacing: 0
contentHeight: content.height
currentIndex: 1
clip: true
model: ApiServicesModel
ColumnLayout {
id: content
ScrollBar.vertical: ScrollBar {}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
delegate: Item {
implicitWidth: servicesListView.width
implicitHeight: delegateContent.implicitHeight
spacing: 0
ColumnLayout {
id: delegateContent
Item {
id: focusItem
KeyNavigation.tab: backButton
}
anchors.fill: parent
BackButtonType {
id: backButton
Layout.topMargin: 20
// KeyNavigation.tab: fileButton.rightButton
}
CardWithIconsType {
id: card
HeaderType {
Layout.fillWidth: true
Layout.topMargin: 8
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 32
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 16
headerText: qsTr("VPN by Amnezia")
descriptionText: qsTr("Choose a VPN service that suits your needs.")
}
headerText: name
bodyText: cardDescription
footerText: price
ListView {
id: containers
width: parent.width
height: containers.contentItem.height
spacing: 16
rightImageSource: "qrc:/images/controls/chevron-right.svg"
currentIndex: 1
interactive: false
model: ApiServicesModel
enabled: isServiceAvailable
delegate: Item {
implicitWidth: containers.width
implicitHeight: delegateContent.implicitHeight
onClicked: {
if (isServiceAvailable) {
ApiServicesModel.setServiceIndex(index)
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
ColumnLayout {
id: delegateContent
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
CardWithIconsType {
id: card
Layout.fillWidth: true
Layout.rightMargin: 16
Layout.leftMargin: 16
headerText: name
bodyText: cardDescription
footerText: price
rightImageSource: "qrc:/images/controls/chevron-right.svg"
onClicked: {
if (isServiceAvailable) {
ApiServicesModel.setServiceIndex(index)
PageController.goToPage(PageEnum.PageSetupWizardApiServiceInfo)
}
}
}
}
}
@@ -47,6 +47,7 @@ PageType {
KeyNavigation.tab: textKey.textField
}
HeaderType {
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()