mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-11 07:32:57 +03:00
🚀 Feature: API for external dashboards? #467
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Node815 on GitHub.
Feature description
I use the Homepage dashboard from Benphelps and wondered if there are any plans to add API stats endpoints we can use for data aggregation such as Prometheus?
Pitch
I think for my use, it would be for my homepage which can shows items such as a Succesfull login count, failed login count, number of users etc.. So, at a glance, you can keep on the site to be react for anomalies which can happen, also it's fun to see this data for us data nerds. :)
@stonith404 commented on GitHub:
I think this feature is a bit too use case specific. I want to keep Pocket ID as simple as possible.
But you can actually implement this by your own very easily. Inside the the data folder is the Sqlite database of Pocket ID. You can create a simple API with your favourite programming language that queries the Sqlite database. ChatGPT could help you to create this in a few minutes :)
For example for the login count you can just filter the "Audit_Logs" table and for the user count you can just count the rows of the "Users" table. Failed login attempts don't get logged as you can't brute force or try to guess a passkey.
@stonith404 commented on GitHub:
Here is a working example with Node.js :)
@simono41 commented on GitHub:
@stonith404 @Node815
I once rewritten your codes from the template and from AI the code to GO to use the data from Pocket-ID in my Grafana Prometheus environment.
https://code.brothertec.eu/simono41/pocket-id-exporter
@Node815 commented on GitHub:
Fair Enough, the idea came to me as I was removing one app from Homepage and replaced yours with it. (Authentik) I will see what I can do through GPT. But not sure how well it will work. Feel free to close this.