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

improve ToS handling #7856

Merged
merged 8 commits into from
Feb 20, 2025
Merged

improve ToS handling #7856

merged 8 commits into from
Feb 20, 2025

Conversation

nilsding
Copy link
Member

@nilsding nilsding commented Feb 14, 2025

still need to do:

  • integrate with the setup wizard
  • add a button for the user to quickly open the website in case they need to accept ToS again
  • automatically re-check for TOS acceptance

@mgallien mgallien force-pushed the feature/improve-tos-handling branch from 70f1ff1 to e4e1452 Compare February 17, 2025 08:19
@Rello Rello added this to the 3.16.0 milestone Feb 17, 2025
@mgallien mgallien force-pushed the feature/improve-tos-handling branch from e4e1452 to 20af49e Compare February 17, 2025 09:51
@nilsding nilsding force-pushed the feature/improve-tos-handling branch from 59c329e to 1093eec Compare February 17, 2025 17:05
@nilsding
Copy link
Member Author

the new page looks pretty much exactly like the existing flow2auth page:

Screenshot_20250217_180807

for now I think that's good enough, ideally we can display the ToS directly in there (something for 3.17.0?)

@nilsding nilsding force-pushed the feature/improve-tos-handling branch 2 times, most recently from 12e8d96 to e2725c1 Compare February 18, 2025 10:54
@nilsding
Copy link
Member Author

new button in the mainwindow:

Screenshot_20250218_113812

and the info text now has a link:

Screenshot_20250218_113840-1

still want/need to implement a check whether the TOS have been accepted if the window is opened again

@nilsding nilsding marked this pull request as ready for review February 18, 2025 12:16
@nilsding nilsding requested review from camilasan, claucambra and mgallien and removed request for camilasan and claucambra February 18, 2025 12:16
Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

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

I had an issue while testing it
see

2025-02-19 10:27:53:065 [ warning nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:223 ]:     QNetworkReply::ContentAccessDenied "Server replied \"403 Forbidden\" to \"PROPFIND https://nextcloud.local/remote.php/dav/files/john/\"" QVariant(int, 403)
2025-02-19 10:27:53:065 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:207 ]:  QNetworkReply::ContentAccessDenied
2025-02-19 10:27:53:065 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:208 ]:  "Error transferring https://nextcloud.local/remote.php/dav/files/john/ - server replied: Forbidden"
2025-02-19 10:27:53:065 [ info nextcloud.sync.networkjob.propfind /desktop/src/libsync/networkjobs.cpp:658 ]:      PROPFIND of QUrl("https://nextcloud.local/remote.php/dav/files/john/") FINISHED WITH STATUS "ContentAccessDenied Server replied \"403 Forbidden\" to \"PROPFIND https://nextcloud.local/remote.php/dav/files/john/\""
2025-02-19 10:27:53:065 [ warning nextcloud.sync.networkjob.propfind /desktop/src/libsync/networkjobs.cpp:677 ]:   *not* successful, http result code is 403 ""
2025-02-19 10:27:53:065 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:207 ]:  QNetworkReply::ContentAccessDenied
2025-02-19 10:27:53:065 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:208 ]:  "Error transferring https://nextcloud.local/remote.php/dav/files/john/ - server replied: Forbidden"
2025-02-19 10:27:53:066 [ debug nextcloud.gui.wizard /desktop/src/gui/wizard/owncloudwizard.cpp:332 ]      [ OCC::OwncloudWizard::slotCurrentPageChanged ]:        Current Wizard page changed to  1
2025-02-19 10:27:56:736 [ debug nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:297 ]        [ OCC::AbstractNetworkJob::slotFinished ]:      Network job OCC::PropfindJob finished for "/"
2025-02-19 10:27:58:929 [ info nextcloud.sync.accessmanager /desktop/src/libsync/accessmanager.cpp:67 ]:   4 "" "https://nextcloud.local/index.php/login/v2" has X-Request-ID "222ad770-ecec-4942-a0ad-9b96c18b608d"
2025-02-19 10:27:58:930 [ info nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:364 ]:        OCC::SimpleNetworkJob created for "https://nextcloud.local" + "" ""
2025-02-19 10:27:58:931 [ debug nextcloud.gui.wizard /desktop/src/gui/wizard/owncloudwizard.cpp:332 ]      [ OCC::OwncloudWizard::slotCurrentPageChanged ]:        Current Wizard page changed to  3
2025-02-19 10:28:00:437 [ info nextcloud.sync.credentials.flow2auth /desktop/src/gui/creds/flow2auth.cpp:150 ]:    setting remote poll timer interval to 30000 msec
2025-02-19 10:28:00:437 [ debug nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:297 ]        [ OCC::AbstractNetworkJob::slotFinished ]:      Network job OCC::SimpleNetworkJob finished for ""
Fontconfig error: Cannot load default config file: No such file: (null)
2025-02-19 10:28:01:680 [ info nextcloud.sync.accessmanager /desktop/src/libsync/accessmanager.cpp:67 ]:   4 "" "https://nextcloud.local/index.php/login/v2" has X-Request-ID "f5b7cf4f-b190-499d-b7b5-90b8f8dc9097"
2025-02-19 10:28:01:680 [ info nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:364 ]:        OCC::SimpleNetworkJob created for "https://nextcloud.local" + "" ""
2025-02-19 10:28:03:273 [ info nextcloud.sync.credentials.flow2auth /desktop/src/gui/creds/flow2auth.cpp:150 ]:    setting remote poll timer interval to 30000 msec
2025-02-19 10:28:03:273 [ debug nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:297 ]        [ OCC::AbstractNetworkJob::slotFinished ]:      Network job OCC::SimpleNetworkJob finished for ""
2025-02-19 10:28:08:575 [ info nextcloud.sync.accessmanager /desktop/src/libsync/accessmanager.cpp:67 ]:   4 "" "https://nextcloud.local/index.php/login/v2/poll" has X-Request-ID "2a163086-da0b-4907-a1c3-8d597fe3bec7"
2025-02-19 10:28:08:576 [ info nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:364 ]:        OCC::SimpleNetworkJob created for "https://nextcloud.local" + "" ""
2025-02-19 10:28:09:878 [ info nextcloud.gui.folder.manager /desktop/src/gui/folderman.cpp:977 ]:  Etag poll timer timeout
2025-02-19 10:28:09:878 [ info nextcloud.gui.folder.manager /desktop/src/gui/folderman.cpp:981 ]:  Folders to sync: 0
2025-02-19 10:28:09:878 [ info nextcloud.gui.folder.manager /desktop/src/gui/folderman.cpp:991 ]:  Number of folders that don't use push notifications: 0
2025-02-19 10:28:10:122 [ warning nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:223 ]:     QNetworkReply::ContentNotFoundError "Server replied \"404 Not Found\" to \"POST https://nextcloud.local/index.php/login/v2/poll\"" QVariant(int, 404)
2025-02-19 10:28:10:122 [ debug nextcloud.sync.credentials.flow2auth /desktop/src/gui/creds/flow2auth.cpp:242 ]    [ OCC::Flow2Auth::slotPollTimerTimeout()::<lambda(QNetworkReply*)> ]:   Error when polling for the appPassword QJsonObject({"error":null}) "There was an error accessing the \"token\" endpoint: <br><em>Error transferring https://nextcloud.local/index.php/login/v2/poll - server replied: Not Found</em>"
2025-02-19 10:28:10:122 [ debug nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:297 ]        [ OCC::AbstractNetworkJob::slotFinished ]:      Network job OCC::SimpleNetworkJob finished for ""
2025-02-19 10:28:22:050 [ info nextcloud.sync.accessmanager /desktop/src/libsync/accessmanager.cpp:67 ]:   4 "" "https://nextcloud.local/index.php/login/v2/poll" has X-Request-ID "a26cc7f1-c328-41d5-b566-a6eec83c5d78"
2025-02-19 10:28:22:050 [ info nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:364 ]:        OCC::SimpleNetworkJob created for "https://nextcloud.local" + "" ""
2025-02-19 10:28:23:467 [ info nextcloud.sync.credentials.flow2auth /desktop/src/gui/creds/flow2auth.cpp:261 ]:    Success getting the appPassword for user:  "john" , server:  "https://nextcloud.local"
2025-02-19 10:28:23:467 [ debug nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:297 ]        [ OCC::AbstractNetworkJob::slotFinished ]:      Network job OCC::SimpleNetworkJob finished for ""
2025-02-19 10:28:23:467 [ info nextcloud.gui.wizard /desktop/src/gui/owncloudsetupwizard.cpp:339 ]:        Connect to url:  "https://nextcloud.local"
2025-02-19 10:28:23:467 [ info nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:117 ]:     Get QNAM
2025-02-19 10:28:23:467 [ info nextcloud.sync.accessmanager /desktop/src/libsync/accessmanager.cpp:67 ]:   2 "" "https://nextcloud.local/ocs/v1.php/cloud/user?format=json" has X-Request-ID "2203a347-eea6-4372-a1fb-1251a5446e4a"
2025-02-19 10:28:23:468 [ info nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:364 ]:        OCC::JsonApiJob created for "https://nextcloud.local" + "/ocs/v1.php/cloud/user" ""
2025-02-19 10:28:25:191 [ info nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:406 ]:     request finished
2025-02-19 10:28:25:191 [ info nextcloud.sync.networkjob.jsonapi /desktop/src/libsync/networkjobs.cpp:969 ]:       JsonApiJob of QUrl("https://nextcloud.local/ocs/v1.php/cloud/user?format=json") FINISHED WITH STATUS "OK"
2025-02-19 10:28:25:191 [ debug nextcloud.gui.wizard /desktop/src/gui/wizard/owncloudwizard.cpp:398 ]      [ OCC::OwncloudWizard::appendToConfigurationLog ]:      Setup-Log:  "Trying to connect to NextcloudDev at https://nextcloud.local …"
2025-02-19 10:28:25:192 [ info nextcloud.sync.accessmanager /desktop/src/libsync/accessmanager.cpp:67 ]:   6 "PROPFIND" "https://nextcloud.local/remote.php/dav/files/john/" has X-Request-ID "3e06731e-ff88-433a-894a-d45a7dbccbb3"
2025-02-19 10:28:25:192 [ info nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:364 ]:        OCC::PropfindJob created for "https://nextcloud.local" + "/" "OCC::OwncloudSetupWizard"
2025-02-19 10:28:25:192 [ debug nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:297 ]        [ OCC::AbstractNetworkJob::slotFinished ]:      Network job OCC::JsonApiJob finished for "/ocs/v1.php/cloud/user"
2025-02-19 10:28:26:146 [ info nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:406 ]:     request finished
2025-02-19 10:28:26:146 [ warning nextcloud.sync.networkjob /desktop/src/libsync/abstractnetworkjob.cpp:223 ]:     QNetworkReply::ContentAccessDenied "Server replied \"403 Forbidden\" to \"PROPFIND https://nextcloud.local/remote.php/dav/files/john/\"" QVariant(int, 403)
2025-02-19 10:28:26:146 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:207 ]:  QNetworkReply::ContentAccessDenied
2025-02-19 10:28:26:146 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:208 ]:  "Error transferring https://nextcloud.local/remote.php/dav/files/john/ - server replied: Forbidden"
2025-02-19 10:28:26:146 [ info nextcloud.sync.networkjob.propfind /desktop/src/libsync/networkjobs.cpp:658 ]:      PROPFIND of QUrl("https://nextcloud.local/remote.php/dav/files/john/") FINISHED WITH STATUS "ContentAccessDenied Server replied \"403 Forbidden\" to \"PROPFIND https://nextcloud.local/remote.php/dav/files/john/\""
2025-02-19 10:28:26:146 [ warning nextcloud.sync.networkjob.propfind /desktop/src/libsync/networkjobs.cpp:677 ]:   *not* successful, http result code is 403 ""
2025-02-19 10:28:26:146 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:207 ]:  QNetworkReply::ContentAccessDenied
2025-02-19 10:28:26:146 [ warning nextcloud.sync.credentials.webflow /desktop/src/gui/creds/webflowcredentials.cpp:208 ]:  "Error transferring https://nextcloud.local/remote.php/dav/files/john/ - server replied: Forbidden"
2025-02-19 10:28:26:148 [ debug nextcloud.gui.wizard /desktop/src/gui/wizard/owncloudwizard.cpp:332 ]      [ OCC::OwncloudWizard::slotCurrentPageChanged ]:        Current Wizard page changed to  1

@nilsding
Copy link
Member Author

nilsding commented Feb 19, 2025

huh interesting, I would expect to see a line of Terms of service not accepted yet! Will prompt the user in the next step in the logs

which version of the TOS app are you using? I used 4.2.0 for testing this (and with version 4.3.0 of the terms of service app the terms are shown at the login page, so the wizard page won't be displayed there)

@mgallien
Copy link
Collaborator

huh interesting, I would expect to see a line of Terms of service not accepted yet! Will prompt the user in the next step in the logs

which version of the TOS app are you using? I used 4.2.0 for testing this (and with version 4.3.0 of the terms of service app the terms are shown at the login page, so the wizard page won't be displayed there)

I am testing with latest release of terms_of_service in part because the behavior is very different and in part because when using 4.3.0, it is impossible to complete the login process

@mgallien
Copy link
Collaborator

huh interesting, I would expect to see a line of Terms of service not accepted yet! Will prompt the user in the next step in the logs
which version of the TOS app are you using? I used 4.2.0 for testing this (and with version 4.3.0 of the terms of service app the terms are shown at the login page, so the wizard page won't be displayed there)

I am testing with latest release of terms_of_service in part because the behavior is very different and in part because when using 4.3.0, it is impossible to complete the login process

same issue for me when testing against 4.2.0

@nilsding
Copy link
Member Author

really strange. both 4.2.0 and 4.3.0 behave like they should on my setup 🤔

I wonder what the response body of the failed request looks like on your end https://github.com/nextcloud/desktop/pull/7856/files#diff-f2f78068f771984fa618719676bee79d13c0fca432dda683e3d99cd6f0a9dad5R233-R237

src/gui/wizard/owncloudadvancedsetuppage.cpp Outdated Show resolved Hide resolved
src/gui/wizard/termsofservicecheckwidget.h Outdated Show resolved Hide resolved
@mgallien mgallien force-pushed the feature/improve-tos-handling branch from 0e08fb2 to 17858fa Compare February 20, 2025 08:51
@mgallien mgallien force-pushed the feature/improve-tos-handling branch from 17858fa to bfa0d1b Compare February 20, 2025 08:57
@mgallien
Copy link
Collaborator

/backport to stable-3.16

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
nilsding and others added 7 commits February 20, 2025 10:53
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
should avoid being blocked by terms_of_service blocking WebDAV access

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
should enable proper polling while the user check and signs the terms of
service via teh web browser

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
this is only shown if the TOS haven't been accepted yet!

for now this only opens the browser, similar to the Flow2Auth page

the `TermsOfServiceCheckWidget` is a combination of the `Flow2Auth` and
the `Flow2AuthWidget` classes -- in the future we ideally display the
required TOS directly in the wizard

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
@nilsding nilsding force-pushed the feature/improve-tos-handling branch from bfa0d1b to 8a83454 Compare February 20, 2025 09:54
Copy link

Artifact containing the AppImage: nextcloud-appimage-pr-7856.zip

SHA256 checksum: 59dcfdb73eab6da03c03ad4025105be798b3a356932549828c6304a93835a59b

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@nilsding nilsding enabled auto-merge February 20, 2025 10:14
@mgallien mgallien disabled auto-merge February 20, 2025 10:35
@mgallien mgallien merged commit 5be4f19 into master Feb 20, 2025
12 of 14 checks passed
@mgallien mgallien deleted the feature/improve-tos-handling branch February 20, 2025 10:35
@backportbot backportbot bot mentioned this pull request Feb 20, 2025
2 tasks
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.5% Coverage on New Code (required ≥ 80%)
87 New Code Smells (required ≤ 0)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done
Development

Successfully merging this pull request may close these issues.

3 participants