ActivityWatch / ActivityWatch/aw-server-rust

Suggestion: Regex-based inbound data filters

オープン
#482 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
315
フォーク
96
平均マージ
2日 21時間
マージ済み PR(30日)
14

説明

Being able to filter the inbound data [has been the most popular feature request for a very long time](https://forum.activitywatch.net/t/add-an-exclude-list/345) and comes up again and again in the issues of different repositories. In the status quo, some watchers (e.g. [the window watcher](https://github.com/ActivityWatch/aw-watcher-window/pull/37)) have their own filtering, but they have various problems:

1. **Discoverability:** The configuration is so hidden that [even the developers forget that it exist](https://github.com/ActivityWatch/aw-server/issues/59#issuecomment-538738568) (no offense). Even when it's exposed as a config, it still requires the user to find it somewhere in the docs, then edit the configuration file to set it up correctly. This is not very discoverable.
2. **Consistency:** The user needs to look into the docs for each watcher to see whether it supports data filtering and to find out how it's configured.
3. **Limited expressiveness:** For the window watcher, it's only possible to remove all window titles. Many people say they only want to exclude some sensitive information (e.g. mail subjects). In my case, I'm frequently using an app that shows a timer in the window title, creating a new entry every second, which makes the timeline barely readable and very unresponsive.

## Suggestion

We could add regex-based filtering on the heartbeat level: whenever a heartbeat comes in, it's checked against a set of user-configurable regexes. If one matches on any field of the entry, the entry is discarded. We could also extend this feature to allow regex-replacing entries or matching only some fields of the JSON entry.

Similar inbound data filters can be found in e.g. [Sentry](https://docs.sentry.io/product/relay/).

I could probably implement this by myself, at least in Python and the Vue frontend, but probably in Rust as well, but I'd like to know if the approach is welcome in the first place. Tbh, if it isn't, I'd consider writing a simple proxy server that does exactly this -- applying some replacements to the `heartbeat` endpoint and passing everything else through.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。