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

feature request - inactivity timeout #63

Open
jpuskar opened this issue Jan 22, 2022 · 2 comments
Open

feature request - inactivity timeout #63

jpuskar opened this issue Jan 22, 2022 · 2 comments

Comments

@jpuskar
Copy link

jpuskar commented Jan 22, 2022

Do you think there is a good way to disconnect sessions after an inactivity period?

Right now I have simulated this by:

  • Applying a blank screensaver after 5 minutes using xfce4-screensaver. The blank screensaver causes low enough traffic that nginx will disconnect the websocket, dropping the session.
  • Setting the tokenDuration to 5mins (I'm using LDAP because I could not get this working with Azure AD OIDC).
  • Blocking /api/token_refresh via the nginx ingress

So the end result being that nginx disconnects me after 10 minutes (screensaver + proxy-read-timeout). And the user can't just refresh the page, because /api/refresh_token is blocked, so it causes a brand new login.

But this is somewhat fragile because it relies on the screensaver to stop websocket traffic. This seems like it does not work 100% of the time.

So I wonder, is it possible to modify the UI code to somehow recognize that the user does not have the tab open and disconnect the websocket client-side?

@tinyzimmer
Copy link
Collaborator

tinyzimmer commented Jan 22, 2022

There is a server-side mechanism for this here. But nothing on the client side. Would be open to PRs with ideas though.

EDIT: Not really a timeout tho, more a safeguard against people leaving sessions open in general

@jpuskar
Copy link
Author

jpuskar commented Jan 22, 2022

I saw that!

I think fundamentally the only thing truly aware of 'inactivity' is the desktop container itself.

In my case, I'm running in nonroot mode, so I can trust the container a little bit. E.g., I can mostly rely on a trigger like running a screensaver.

So I wonder if there is a way to trigger a disconnect from inside the container (for example, have the screensaver kill a process), but without causing the container to get deleted. But I think anything I try to do would prevent a reconnection.

Because although the container is aware that there is inactivity and has launched a process, what I really need to end up doing is closing the websocket. And the container doesn't maintain the websocket -- the VNC to HTTPS bridge does that which I think runs in a sidecar.

Pretty interesting problem.

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

No branches or pull requests

2 participants