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

feat: Client last seen option #40

Closed
drtech981 opened this issue Dec 6, 2021 · 7 comments
Closed

feat: Client last seen option #40

drtech981 opened this issue Dec 6, 2021 · 7 comments
Labels
enhancement Enhancement of the code, not introducing new features. help-wanted We need some extra helping hands or expertise in order to resolve this! priority-medium This issue may be useful, and needs some attention.

Comments

@drtech981
Copy link

Instead of just showing if the client is online or not, it would be nice to have a last seen time for the client, which helps to diagnose certain issues such as power failure or hardware failure from a remote site (just as it shows in zerotier central manager).

@drtech981 drtech981 added the enhancement Enhancement of the code, not introducing new features. label Dec 6, 2021
@dec0dOS dec0dOS added the priority-medium This issue may be useful, and needs some attention. label Dec 7, 2021
@seanbts
Copy link

seanbts commented Dec 31, 2021

+1 for this feature, can help diagnose offline issues, knowing the time a node went offline.

@dec0dOS
Copy link
Owner

dec0dOS commented Jan 17, 2022

Hello, @drtech981. It is not easy to implement such a feature, as the controller API does not return the last seen member value.
It would require consistent pinging from the server to the backend itself, and saving the "ONLINE" status. Current ZeroUI architecture would require some changes.

I agree that such a feature would be great for the user experience, so any help is welcome.

@dec0dOS dec0dOS added the help-wanted We need some extra helping hands or expertise in order to resolve this! label Jan 17, 2022
@timothyle97
Copy link
Contributor

Yes, the controller API as currently available does not return this value. I have been trying to think about how to do this for a while, but haven't figured out a way yet. I will probably try to see if the ZeroTier implementation with the alternate database tracks online information.

@dec0dOS
Copy link
Owner

dec0dOS commented Jan 24, 2022

I've made some research on this topic.
If the Postgres database is used, the controller does save the last online time. But maintaining and building each version of the controller from source and adding the Postgres to the setup would require much effort.
ZeroUI is trying to be as efficient and as easy to install as possible.
I think that the better way to implement such a feature is the way as I said before.

For reference, see the https://github.com/zerotier/ZeroTierOne/blob/master/controller/LFDB.cpp

@timothyle97
Copy link
Contributor

timothyle97 commented Apr 28, 2022

@dec0dOS I was wondering if (when you have a chance) you could give me a basic overview of how the frontend and backend services interact? I'm new to these programming languages and I was specifically wondering if any of the backend services run in the background, or if everything only runs when the admin web pages are loaded. Just trying to see what the options are with saving the online state of ZT clients.

@dec0dOS
Copy link
Owner

dec0dOS commented Apr 28, 2022

Hey, @timothyle97!
Check the following overview of the ZeroUI architecture:
Express server (backend) serves the frontend HTML/JS/CSS files (React-based application) to the user.
Backend transforms the request from ZeroTier Central API specification to the controller API specification and use the database to store and fetch the external data, that the controller itself does not store.

I see that there is two way to implement this feature: using the postgres controller build that already uses the additional thread on the controller level to store the last online time data. But that approach have several downsides.

So I think that the better way to implement this feature is to use the same technique on the backend level, not the controller level itself. Any nodejs recurring tasks scheduler should be okey for this task. To implement the following feature properly some backlog tasks should be done. Moving to the ES6 modules on the backend level, upgrading current dependencies, improving the developer experience (using the vite build tool).

Any help is welcome! I appreciate your involvement in the ZeroUI project.

Screenshot 2022-04-28 at 13 07 18

@dec0dOS
Copy link
Owner

dec0dOS commented Aug 25, 2022

Added in v1.5.0.

@dec0dOS dec0dOS closed this as completed Aug 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement of the code, not introducing new features. help-wanted We need some extra helping hands or expertise in order to resolve this! priority-medium This issue may be useful, and needs some attention.
Projects
None yet
Development

No branches or pull requests

4 participants