Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix proxy in Qt6 kiosk browser #168

Merged
merged 5 commits into from
Jun 27, 2024

Conversation

knuton
Copy link
Member

@knuton knuton commented Jun 12, 2024

After the switch to Qt6 (#156), proxies were left broken due to a renaming in QNetworkProxy (which is not properly documented in https://doc.qt.io/qtforpython-6/PySide6/QtNetwork/QNetworkProxy.html#PySide6.QtNetwork.QNetworkProxy.ProxyType).

I added proxy functionality to the pre-release test protocol. But I actually would like to lower that burden generally, and would have liked the issue to surface sooner. So I tried to write a VM-based integration test. It almost works, but in the end I am only submitting it as a smoke test.

You can run the kiosk without 02207d1 to see that it crashes if a proxy is configured. The new test would catch that, and in general would fail if the kiosk does not at least claim to have set the proxy on the framework.

I would like to extend the test going forward, but this seems like a good first step. It would have immediately caught what this PR fixes.

Checklist

  • Changelog updated (fixes an unreleased bug, no entry)
  • Code documented
  • User manual updated

The phrasing implies that the proxy has been set, but it is only about
to be set. Inform of the successful action only.
@knuton knuton added the reviewable Ready for initial or iterative review label Jun 12, 2024
@knuton knuton requested a review from guyonvarch June 12, 2024 16:37
@knuton knuton changed the base branch from main to release/2024.5.x June 12, 2024 16:50
Comment on lines 132 to 138
# Ideally here we would check if the request actually arrived at thecloud.
# Unfortunately the proxy is currently not contacted by the kiosk in this
# test setup, even though if we look we see that the proxy is set as
# application proxy. This issue seems to be specific to the test setup, if
# we test in a real installation, the configured proxy is actually used.
# So for now we simply test whether the proxy has been picked up and
# configured.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the test with only theclient, and removing thecloud and theproxy, and it passes. I wonder if we should temporarily comment all that’s not theclient, to prevent givint the idea that it’s currently tested?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guyonvarch guyonvarch added details needed Further information requested to better evaluate changes and removed reviewable Ready for initial or iterative review labels Jun 13, 2024
@guyonvarch
Copy link
Member

guyonvarch commented Jun 14, 2024

Working well using configuring a local proxy, and updating connman conf with the proxy user:*******@localhost:1234, and it says it take the proxy.

    services = {
      tinyproxy = {
        enable = true;
        settings = {
          Port = 1234;
          Listen = "127.0.0.1";
          Timeout = 600;
          BasicAuth = "user *********";
        };
      };
    };

And setting the wrong password in connman conf makes the kiosk to fail loading the page.

knuton added 3 commits June 14, 2024 18:28
This is the humble beginnings of an automated integration test for proxy
use in the kiosk.

At the moment the test is rather limited: It only checks that a proxy
configured with connman is picked up and set as application proxy by the
kiosk.

Unfortunately I have not been able to get the proxy to be actually used
by the Qt framework in this test setup. It rather seems like the proxy
is properly configured from our side. It would be nice to extend the
tests to confirm that requests with the proxy can successfully be made,
but this may require analysis of the Qt framework in the context of the
VM test setup.

I am including two sanity checks that the basic node topology is as
expected (no direct route from client to 'the cloud'), and that the
proxy node basically works (with curl).
After the switch to Qt6 (dividat#156),
proxies were left broken due to a renaming in QNetworkProxy (which is
not properly documented in
https://doc.qt.io/qtforpython-6/PySide6/QtNetwork/QNetworkProxy.html#PySide6.QtNetwork.QNetworkProxy.ProxyType).

Rename to the enum scope to avoid a runtime error when trying to set
proxy.
These sanity checks are good for running an actual test with the kiosk
contacting another host through a proxy, but as I've been unable to get
this test scenario to work, remove them for now.
@knuton
Copy link
Member Author

knuton commented Jun 14, 2024

I thought I was close many, many times, but finally giving up on a proper multi-VLAN test for now.

Removed the remnants of the multi-VLAN setup in d200877

@knuton knuton added reviewable Ready for initial or iterative review and removed details needed Further information requested to better evaluate changes labels Jun 14, 2024
@knuton knuton requested a review from guyonvarch June 14, 2024 16:43
Copy link
Member

@guyonvarch guyonvarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting up tinyproxy, I checked that the application is using the proxy with authentication.

@guyonvarch guyonvarch merged commit 87c5782 into dividat:release/2024.5.x Jun 27, 2024
6 checks passed
@guyonvarch guyonvarch removed the reviewable Ready for initial or iterative review label Jun 27, 2024
@knuton knuton deleted the fix-qt6-proxy branch June 27, 2024 14:19
knuton added a commit to knuton/playos that referenced this pull request Jun 28, 2024
This reverts commit 87c5782, reversing
changes made to 17dc536.
knuton added a commit to knuton/playos that referenced this pull request Jun 28, 2024
This reverts commit 87c5782, reversing
changes made to 17dc536.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants