nextcloud / bookmarks

🔖 Bookmark app for Nextcloud
https://apps.nextcloud.com/apps/bookmarks
GNU Affero General Public License v3.0
1.01k stars 173 forks source link

Shared Notes will be massivly checked by Bookmarks --> Tons of Activites #1840

Closed GAS85 closed 2 years ago

GAS85 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Install Notes and Bookmarks.
  2. User A use Bookmarks. User B do not use Bookmarks at all.
  3. User A: Create Category "TEST" in Notes. This will drive to Folder creation in /Notes/TEST
  4. Share Folder /Notes/TEST with User B.
  5. User B move shared folder from /TEST to /Notes/TEST, in this case shared notes will appears to the Notes App.
  6. Create one - multiple Notes in TEST Category.
  7. User A Check Activity page and see that it is full of Requests From User B: "Shared file %File List from the Notes Folder% was downloaded by User B via the browser" - each 10 min
  8. Check Web Server Logs, there is 0 access requests from any Address.
  9. Check audit.log and see massive access requests to all Notes under User B/Notes/*.* (there a different Notes, names replaced)
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/Test.txt\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/NoteXX.txt\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/Versicherungsscheinnummer.txt\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Auslandsreisekrankenversicherung.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Example.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Note2.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Note3.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Note4.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Note5.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/Note26.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.txt\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.md\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.txt\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX.txt\"","userAgent":"--","version":"22.2.9.1"}
    {"reqId":"h72xorOR0S0L8inJZehR","level":1,"time":"2022-07-07T09:25:03+00:00","remoteAddr":"","user":"User B","app":"admin_audit","method":"","url":"--","message":"File accessed: \"/Notes/TEST/NoteXX(3).md\"","userAgent":"--","version":"22.2.9.1"}
  10. Disable Bookmarks App --> See 0 Requests.

Expected behavior Enabling of App should not drive to massive checks.

Screenshots grafik

Server (please complete the following information):

Additional context Add any other context about the problem here.

Web server error log

Nothing related

Nextcloud log (nextcloud/data/nextcloud.log)

Nothing related

Browser log

Nothing related
GAS85 commented 2 years ago

Additional information is also here https://help.nextcloud.com/t/periodical-not-clear-files-access/137592

marcelklehr commented 2 years ago

Thanks for reporting! This will be fixed in the next release!

GAS85 commented 2 years ago

It is somehow it is working, but I still have some questions...

After update to 11.0.1 User B do not produce any activity:

Bit User A now producing tons of file access logs entries in a audit.log. E.g. all requests with reqID: 9G9jJ3InOOgNvKAPKeBF are files access in Notes folder.

grep '"reqId":"9G9jJ3InOOgNvKAPKeBF"' /var/nextcloud/data/audit.log | wc -l
101

I suppose this app access Notes folder to fetch URLs and add them to bookmarks... Can you please add some info about this feature to the README.md? Also what kind of format should it be, e.g. simple line with URL or something else like all URLs from the text will be add to bookmarks. I see that it is specified here: https://github.com/nextcloud/bookmarks/blob/master/lib/Service/NotesService.php#L22 seems as simple URL in the text.

Also my suggestion is to check only recent modified files since last check, or e.g. all changed files in last hour or even day. This will reduce access dramatically and could be done via bash CLI or Nextcloud DB check.

marcelklehr commented 2 years ago

Also my suggestion is to check only recent modified files since last check, or e.g. all changed files in last hour or even day. This will reduce access dramatically and could be done via bash CLI or Nextcloud DB check.

Good idea!