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

Filter certain files from activity log #135

Open
caco3 opened this issue Apr 5, 2017 · 36 comments
Open

Filter certain files from activity log #135

caco3 opened this issue Apr 5, 2017 · 36 comments

Comments

@caco3
Copy link

caco3 commented Apr 5, 2017

Like already requested in #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

@xXSTrikeXx
Copy link

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
Copy link

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
Copy link
Member

Duplicate of #71

@MorrisJobke MorrisJobke marked this as a duplicate of #71 Feb 15, 2019
@nickvergessen
Copy link
Member

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 nickvergessen reopened this Feb 18, 2019
@a-m-s
Copy link

a-m-s commented Jun 27, 2019

👍
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
Copy link

bor8 commented Aug 27, 2019

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
Copy link

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
Copy link

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
Copy link

CombeeMike commented Feb 14, 2020

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

@CWempe
Copy link

CWempe commented Dec 16, 2020

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
Copy link

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
Copy link

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
Copy link
Member

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
Copy link

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

@Azratosh
Copy link

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
Copy link

ivosm commented Jun 1, 2021

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
Copy link

CWempe commented Jun 1, 2021

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
Copy link

netanido commented Jul 7, 2021

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
Copy link

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
Copy link

abe-101 commented Sep 12, 2021

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
Copy link

Same here :)

@barrymichels
Copy link

barrymichels commented Nov 2, 2021

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
Copy link

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

@otto802
Copy link

otto802 commented Nov 4, 2021

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

@tilllt
Copy link

tilllt commented Feb 20, 2022

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

@netanido
Copy link

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

This comment was marked as duplicate.

@freakontrol

This comment was marked as duplicate.

1 similar comment
@kongomongo

This comment was marked as duplicate.

@dlevequeIT
Copy link

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

@dan-elevate
Copy link

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

@etnepresli

This comment was marked as duplicate.

@danepowell
Copy link

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
Copy link

@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
Copy link
Member

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

@devnoname120
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests