activity icon indicating copy to clipboard operation
activity copied to clipboard

Filter certain files from activity log

Open caco3 opened this issue 7 years ago • 36 comments

Like already requested in https://github.com/nextcloud/activity/issues/44, I am also in a need to exclude a certain file from the activity log. Reason: I have a tool which periodically uploads an ics file which I then import into Nextcloud. Those uplaods all are shown in the activity log.

Steps to reproduce

  1. Use a tool to periodically upload a file via WebDAV.
  2. Check the Activity Log.

Expected behaviour

A way to exclude certain files from Activity Log.

Actual behaviour

Activity Log is bloated with unneeded log entries.

Server configuration

Web server: Appache

Database: MYSQL

PHP version: 7.x

Nextcloud version: (see Nextcloud admin page) 11.0.2

Where did you install Nextcloud from: Web

Signing status:

No errors have been found.

List of activated apps: Enabled:

  • activity: 2.4.1
  • activitylog: 0.0.1
  • admin_audit: 1.1.0
  • comments: 1.1.0
  • contacts: 1.5.3
  • dav: 1.1.1
  • deck: 0.1.2
  • direct_menu: 0.10.1
  • external: 1.2
  • federatedfilesharing: 1.1.1
  • federation: 1.1.1
  • files: 1.6.1
  • files_accesscontrol: 1.1.2
  • files_downloadactivity: 1.0.1
  • files_external: 1.1.2
  • files_markdown: 1.0.1
  • files_pdfviewer: 1.0.1
  • files_retention: 1.0.1
  • files_sharing: 1.1.1
  • files_texteditor: 2.2
  • files_trashbin: 1.1.0
  • files_versions: 1.4.0
  • files_videoplayer: 1.0.0
  • firstrunwizard: 2.0
  • gallery: 16.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.0
  • notes: 2.2.0
  • notifications: 1.0.1
  • password_policy: 1.1.0
  • provisioning_api: 1.1.0
  • qownnotesapi: 17.3.0
  • serverinfo: 1.1.1
  • sharebymail: 1.0.1
  • survey_client: 0.1.5
  • systemtags: 1.1.3
  • templateeditor: 0.2
  • theming: 1.1.1
  • twofactor_backupcodes: 1.0.0
  • updatenotification: 1.1.1
  • workflowengine: 1.1.1 Disabled:
  • calendar.2
  • encryption
  • files_automatedtagging
  • user_external
  • user_ldap
  • user_saml

Nextcloud configuration: { "system": { "datadirectory": "/home//owncloud_", "dbtype": "mysql", "version": "11.0.2.7", "installedat": "1334086349.5631", "lastupdatedat": "1334087083.9888", "dbname": "_owncloud", "dbhost": ".mysql.db.internal", "dbtableprefix": "oc_", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "instanceid": "5083050d6af67", "maxZipInputSize": 419430400, "allowZipDownload": true, "theme": "", "maintenance": false, "loglevel": 3, "trusted_domains": [ "owncloud..ch", "www..ch", ".ch" ], "mail_from_address": "owncloud", "mail_smtpmode": "php", "mail_domain": ".ch", "secret": "REMOVED SENSITIVE VALUE", "trashbin_retention_obligation": "auto, auto", "appstore.experimental.enabled": true, "memcache.local": "\OC\Memcache\APCu", "updater.release.channel": "stable" } }

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No

Client configuration

Recent FF/Chrome

Operating system: Linux, what else!

Logs

Nextcloud log (data/nextcloud.log)

Browser log

caco3 avatar Apr 05 '17 21:04 caco3

The easiest way can be firstly to hide only hidden files. Make it much easier atm to implement. What do you think about it @nickvergessen? There can be also an option under RSS-Feed. To show or hide also hidden files 👍

xXSTrikeXx avatar Mar 08 '18 17:03 xXSTrikeXx

Same request here. Would like to see how public shared links are used, but some of them get requested multiple times every day (eg. my avatar on a forum). To be able to exclude certain files or search for specific files in the activity log would make it way more usable...

Aesculapius avatar Mar 22 '18 08:03 Aesculapius

Duplicate of #71

MorrisJobke avatar Feb 15 '19 13:02 MorrisJobke

No this is a different issue. #71 is to find stuff, This here basically is to prevent being spamed by a single file in all your feeds.

nickvergessen avatar Feb 18 '19 10:02 nickvergessen

:+1: I'd like to exclude a whole folder. I have a machine that regularly syncs hundreds of backup files to my nextcloud, and the activity stream just gets swamped. The only way to see what happened to other files is to set them all as favourites, which is not ideal.

a-m-s avatar Jun 27 '19 11:06 a-m-s

Very worth supporting, where should I send money? ;)

In my case it would be very helpful if I could block certain users from the activity log because I have created my own user for WebDAV. Or block shares. Or block folders. Or block files. Depending on what is easier to implement.

bor8 avatar Aug 27 '19 15:08 bor8

I think this could be done with NC 18 workflow engine. In the workflow app I would setup the user specific activity task and in the activity app an section in the sidebar with flow (or how the workflow engine in called) where you see than in subsections user defined activity filters.

Andreas-Kainz avatar Jan 07 '20 22:01 Andreas-Kainz

Here's my use case:

I'm syncing my VS Code settings via Nextcloud. Obviously multiple files get synced every time I just open VS Code. Those changes clutter my activity log stream & mail notification to an extent which makes them pretty much useless to me.

Therefore I'd love to see some way of excluding single files and complete folders as well. Only filtering logs by app as suggested somewhere else wouldn't help me at all.

CombeeMike avatar Jan 26 '20 07:01 CombeeMike

I just hard coded my own filter into the system by applying some changes to the source files which I'll explain here for anyone who might be interested in this as well.

Exclaimer

  • Only apply such changes if you "know" what you're doing and understand the implications.
  • I'm not responsible for anyone breaking his system with changes described by me ;)
  • Those changes are probably lost on every update and/or can cause troubles on/after updates.
  • Those changes only remove entries from the "activity digest mails" but not from the activities view in the web app or anywhere else.

Changes

Manually add a where clause inside nextcloud/apps/activity/lib/MailQueueHandler.php:getItemsForUser which filters files that you don't want to see in the mail.

E.g. I've applied the following filter to exclude all files within the folder /sync/VSCode/ where /sync/ is a "top level" folder inside my Nextcloud:

# The "amq_subjectparams" column starts with something like "[{"763636":"\/sync\/VSCode\/User\/..."
# for "file activities".
# Therefore we're filtering everything that includes the following pattern:
# ":"\/sync\/VSCode\/
# 
# The "\\\\" are an escape sequence for only one "\"
->andWhere($query->expr()->notLike('amq_subjectparams', $query->createNamedParameter('%\":\"\\\\/sync\\\\/VSCode\\\\/%')))

Here's my adjusted query which is now "live" inside getItemsForUser. I only added the second andWhere clause. Everything else is original code:

$query->select('*')
			->from('activity_mq')
			->where($query->expr()->lte('amq_timestamp', $query->createNamedParameter($maxTime)))
			->andWhere($query->expr()->eq('amq_affecteduser', $query->createNamedParameter($affectedUser)))
			->andWhere($query->expr()->notLike('amq_subjectparams', $query->createNamedParameter('%\":\"\\\\/sync\\\\/VSCode\\\\/%')))
			->orderBy('amq_timestamp', 'ASC')
			->setMaxResults($maxNumItems);

HowTo test changes

  • Comment out the content of nextcloud/apps/activity/lib/MailQueueHandler.php:deleteSentItems to not "clear" the sent items after a test and allow sending of a testmail with the same content multiple times
  • Force sending of "activity digest mail" from cmd line:
    sudo -u www-data php /path/to/nextcloud/occ activity:send-mails
  • Watch out for PHP errors in system logs (Settings -> Logging in the web app)
  • "Re-activate" deleteSentItems after done with testing...

@ nextcloud devs

Please let me know if I've done something really terrible here and don't see it myself ;) E.g. I have no idea if I'm using the $query->createNamedParameter method correctly but just figured out that "it works"...

CombeeMike avatar Feb 14 '20 08:02 CombeeMike

I fully support the idea of excluding certain directories.

I recently setup Joplin to sync my notes via Nextcloud.

But now my activity feed is full with events of temporary files. Avery few minutes there is a new entry.

image

Or am I the only one with this issue?

I would guess there are more users using this kind of setup. https://nextcloud.com/blog/mobile-note-taking-with-your-private-cloud-announcing-joplinnextcloud-integration/

CWempe avatar Dec 16 '20 21:12 CWempe

I couldn't agree more!

Without excluding folders and files (somewhere in settings or even config) this is ridiculously useless app. I doesn't do much, but load the server and spam the feeds. ANd it couldn't be turned off in regards of email. It also utilized in dashboard files, which for the same reason rendered absolutely useless - displays only some background syncing activities most of the time (about 95% in my case).

So, why do not let users filter what they would like to see?! It is four years since this issue came up and it just ignored!

lucker999 avatar Mar 12 '21 16:03 lucker999

On an ms exchange server it's very simple to get email notifications for changes. On nextcloud I didn't get the functionality with flow.

Andreas-Kainz avatar Mar 12 '21 16:03 Andreas-Kainz

So, why do not let users filter what they would like to see?! It is four years since this issue came up and it just ignored!

Because this issue just got as little as 6 upvotes in 4 years. We have issues with 30+ upvotes within one year, so there is a lot more demand for other things.

nickvergessen avatar Mar 24 '21 09:03 nickvergessen

Chiming in here, would love to see this implemented too :)

dmoltisanti avatar Mar 24 '21 09:03 dmoltisanti

I agree as well, would love to see something like this implemented.

Personally, I would love to just be able to exclude hidden directories (starting with a .). I use Nextcloud (selfhosted) to back up some of my PyCharm projects, which all have their .git and .idea dirs inside their project root directories. The random changes inside there are not of any relevance to me, so having a setting to just exclude hidden dirs from my feed would be very convenient.

Azratosh avatar Mar 24 '21 15:03 Azratosh

So, why do not let users filter what they would like to see?! It is four years since this issue came up and it just ignored!

Because this issue just got as little as 6 upvotes in 4 years. We have issues with 30+ upvotes within one year, so there is a lot more demand for other things.

I understand you, but in my case, I've got here accidentally when seeing activity full of .git files from qownnotes and taking it as a bug but first searching docs and couldn't believe, it's not there, then ... and then found somebody mentioned this issue. I really think, this is the type of functionality, many people will just hate NC and spread a bad words about it or refuse to use it. For me it's all the time very sad to see a superb app, where just a tiny bug or missing feature make people hate it. And I am pretty sure, that, there isn't anybody who likes to see fles from .git folder in Activity. I would really not expect it's necessary to upvote for it as well as e.g. for upload multiple files. BTW dot folders and dot files should be excluded by default even without any additional functionality. Just because there are not intended for std users to even see them. :-)

ivosm avatar Jun 01 '21 13:06 ivosm

BTW dot folders and dot files should be excluded by default even without any additional functionality. Just because there are not intended for std users to even see them. :-)

I totally agree. This might already solve 80% of this issue.

But lets be honest. The next feature request would be: "Add option to include (specific) dot files/folders in activity log". 😉

CWempe avatar Jun 01 '21 15:06 CWempe

So, why do not let users filter what they would like to see?! It is four years since this issue came up and it just ignored!

Because this issue just got as little as 6 upvotes in 4 years. We have issues with 30+ upvotes within one year, so there is a lot more demand for other things.

This is correct, but I think it will be very easy to implement. Each file and each folder has an Activities-Tab in its details. The only thing what we need is one checkbox to disable logging activities for this folder/file. If you want, you can expand this to the users/groups sections. And then you have only to add one query to this field in the event in which the activities will be handled. In that way you can prevent the database from filling senseless records into the activities-table.

I can add this by myself, But the Problem is, that it will be overwritten each time, I will do an update.

In my case there are two files which will be called periodically (every 10 minutes) from 6 servers. And this leads to 120 activities per hour (1440 activities per day). This is a little much. 😉

netanido avatar Jul 07 '21 09:07 netanido

I can add this by myself, But the Problem is, that it will be overwritten each time, I will do an update.

Could this be implemented via an app? Haven't really looked into apps and if it's possible to add hooks so essentially when it is about to add a new line to activity feed another app can intercept it and then say don't add this to activity feed.

vrillusions avatar Aug 25 '21 13:08 vrillusions

I fully support the idea of excluding certain directories.

I recently setup Joplin to sync my notes via Nextcloud.

But now my activity feed is full with events of temporary files. Avery few minutes there is a new entry.

image

Or am I the only one with this issue?

I would guess there are more users using this kind of setup. https://nextcloud.com/blog/mobile-note-taking-with-your-private-cloud-announcing-joplinnextcloud-integration/

You are not the only one! I use Joplin and it stuffs my activity with useless info. I would to see a feature that allowed to exluce entire folders from the activity log.

abe-101 avatar Sep 12 '21 15:09 abe-101

Same here :)

dmoltisanti avatar Sep 13 '21 02:09 dmoltisanti

Came here for the exact same reason: installed Joplin on all my devices and setup sync. My activity tab is now useless.

I ended up writing a cron script that deletes entries with the folders I want to ignore using this mysql query:

delete from oc_activity where subjectparams like '%JoplinSync%' and user='bmichels' and affecteduser='bmichels';

barrymichels avatar Nov 02 '21 11:11 barrymichels

Adding another voice to the list, although not because of Joplin.

Frichetten avatar Nov 04 '21 03:11 Frichetten

in my usecase its the omnifocus (webdav) app which pollutes the activity stream :-(

otto802 avatar Nov 04 '21 22:11 otto802

Same here, using Duplicati via WebDAV and the Activity Stream is basically filles by this backup activity, everything else gets lost in that.

tilllt avatar Feb 20 '22 21:02 tilllt

For me the biggest problem is, that there is the possibility, that I don't get important messages. This makes the whole messaging-system senseless. Now I was forced to deaktivate all messages from downloaded files, although it could be a certain security risk not to know what will be downloaded from the cloud.

netanido avatar Mar 15 '22 11:03 netanido

+1 for this feature...

JojoBr0 avatar May 04 '22 16:05 JojoBr0

+1

freakontrol avatar Jun 01 '22 13:06 freakontrol

+1

kongomongo avatar Jun 19 '22 13:06 kongomongo

Same problem with Joplin. My activity panel is spammed by all these notifications

dlevequeIT avatar Jun 29 '22 17:06 dlevequeIT