-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
ActivityWatch doesn't behave well on multiuser systems #75
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@johan-bjareholt Just FYI: You can set the label !pinned to avoid stalebot marking it as stale. See config here: activitywatch/.github/stale.yml Lines 6 to 9 in 42bf20c
|
Someone mentioned this on the forum: https://forum.activitywatch.net/t/manjaro-linux-kde-multiuser-pc/941/2 A potential solution would be to implement support for something similar to what Syncthing does, by allowing the user to configure a local password. This could then be picked up by watchers from a file in the user's home directory, or manually provided by the user as would have to be the case for aw-watcher-web. Such a solution might overlap partly or entirely with what is implemented in ActivityWatch/aw-server-rust#185 However, real protection from local threats on the local machine is somewhat futile. Unless you have a very well set up system with either full disk encryption (or encryption of the user's home directories) with carefully set user permissions where no other user has sudo/root, there will always be the possibility that another user on the same system snoops. I understand this can be a bit frustrating to some, like those with a shared family computer, but unless someone else takes this on, it's unlikely that we (me and @johan-bjareholt) will work on this anytime soon. |
I would say I have encountered a similar issue. Using ActivityWatch on a multi-user mac, with two users set up for ActivityWatch and in both cases ActivityWatch set to launch upon user login, ActivityWatch crashes whenever the second user logs in - even after the first has logged out.
At this point I use 'Quit ActivityWatch' from the tray icon and launch it again via Spotlight. It runs fine after this. |
@krugerk Indeed, a port can never be bound by two processes simultaneously. However, you might be able to work around this by changing the Note that this will most likely break some things since we assume 5600 to be the port in a lot of places. Because of that, you should probably use 5666 as the alternate port (the "testing port"), which should be handled slightly better. Issues with this workaround:
|
Maybe the port should be based of a hash of username and/or password - that way we automatically get rid of port clashes. As for other users not being able to see the data (using the web panel) the the dashboard could take a security token. |
This makes the app terrible for shared computers. |
@Neurochrom and if the port is a hash of the username, how are watchers such as aw-watcher-web which don't have permissions to know the username be able to know which port to connect to? |
can the raw data/buckets be shifted to user folders like somewhere in. |
@Taza53 They already are, see: https://docs.activitywatch.net/en/latest/configuration.html The issue here is that two users cannot bind the same port, and since there is no local API security, users are able to read each other's data. With those limitations in mind, configuring a separate port (5666 recommended) for a second user works. |
This is a really good idea. |
Because that's not how ports or processes work. A port can only be bound to a single process at a time and a process can only be running as a single user. |
Any update on this? I'm looking for a solution on a multi-user with multi-session system. |
As posted earlier, it seems you could manually configure a port (an available port) for each user. ActivityWatch does not do this for you out of the box. |
I have configured 3 users with 3 different ports (5601, 5602, 5603). ActivityWatch is in the autostart of each user. When all users are logged in simultaneously and I look into the task manager I see all processes (aw-qt, aw-server, aw-watcher...) 3 times, one instance for each user. |
Tried starting two instances of ActivityWatch today on the same computer (different users, Windows).
I was surprised to see the other users data when I opened localhost:5600, then I realized that it's not that strange since they use the same port.
What did surprise me was that I got no error about the server being unable to bind the port. I guess things work differently in the Windows world.
So this has a few issues:
This issue is present with other software as well, such as Syncthing. The basic workaround seems to be to just add the ability to run it on different ports. But this has some privacy issues if we don't also add the ability to password-protect the server.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: