nextcloud / activity

:zap: Activity app for Nextcloud
117 stars 66 forks source link

Filter certain files from activity log #135

Open caco3 opened 7 years ago

caco3 commented 7 years ago

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:

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

-

xXSTrikeXx commented 6 years ago

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 👍

Aesculapius commented 6 years ago

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...

MorrisJobke commented 5 years ago

Duplicate of #71

nickvergessen commented 5 years ago

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.

a-m-s commented 5 years ago

:+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.

bor8 commented 5 years ago

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.

Andreas-Kainz commented 4 years ago

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.

CombeeMike commented 4 years ago

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 commented 4 years ago

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

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

@ 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"...

CWempe commented 3 years ago

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/

lucker999 commented 3 years ago

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!

Andreas-Kainz commented 3 years ago

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.

nickvergessen commented 3 years ago

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.

dmoltisanti commented 3 years ago

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

Azratosh commented 3 years ago

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.

ivosm commented 3 years ago

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. :-)

CWempe commented 3 years ago

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". 😉

netanido commented 3 years ago

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. 😉

vrillusions commented 3 years ago

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.

abe-101 commented 3 years ago

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.

dmoltisanti commented 3 years ago

Same here :)

barrymichels commented 3 years ago

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';

Frichetten commented 3 years ago

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

otto802 commented 3 years ago

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

tilllt commented 2 years ago

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

netanido commented 2 years ago

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.

JojoBr0 commented 2 years ago

+1 for this feature...

freakontrol commented 2 years ago

+1

kongomongo commented 2 years ago

+1

dlevequeIT commented 2 years ago

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

dan-elevate commented 2 years ago

I would also love this feature! Is it so complicated to implement? many users would appreciate it!

etnepresli commented 2 years ago

+1

danepowell commented 2 years ago

Please do not comment on this issue unless you have something novel to contribute. To show support, click the thumbs up icon on the OP rather than leaving a comment. (Ironic that I have to explain this on an issue about spammy notifications! 😄 )

devnoname120 commented 1 year ago

@nickvergessen Would you consider adding such a feature? Adding an option to exclude specific directories from activity seems rather straightforward. Alternatively, would you be open to a pull request?

nickvergessen commented 1 year ago

I guess a PR is the best chance, but I'm not in charge of the app anymore.

devnoname120 commented 1 year ago

After thinking a bit it would make sense if dot files were only displayed if dot files are set to shown in the file manager.