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

Mobius API #29

Closed
aptonline opened this issue Jun 8, 2022 · 6 comments
Closed

Mobius API #29

aptonline opened this issue Jun 8, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@aptonline
Copy link
Contributor

aptonline commented Jun 8, 2022

I appreciate this may be way out of the scope of what you are trying to achieve with Mobius but it occurred to me it would be useful for the sever to have its own API that you could use to query activity on the server. For example, to find out how many users are online, the status of the server, any new posts, messages or files that have been uploaded. This could then be used in other , more modern, enviroments such as home assistant or as an alternative to having to trawl the logs for data.

From an iPhone users perspective, having a widget/shortcut combo that shows me stats of the server when away from home would be a great addition. This is only scratching the surface of what an API could do.

@jhalter jhalter added the enhancement New feature or request label Jun 8, 2022
@jhalter
Copy link
Owner

jhalter commented Jun 8, 2022

Thanks for the suggestion. I've intended to do something like this for my own use and plan to work on it after I get through more of the feature parity tasks.

My thought is to add an optional command line argument like --stat-port=5503 that will expose an HTTP endpoint that returns JSON with whatever info seems useful.

jhalter added a commit that referenced this issue Jun 9, 2022
re: #29

TODO: add more stat counters

Usage:
```
./mobius-hotline-server -stats-port 5503
```

```
❯ curl -s localhost:5503 | jq .
{
  "LoginCount": 0,
  "StartTime": "2022-06-08T20:49:10.183921-07:00",
  "DownloadCounter": 0,
  "UploadCounter": 0
}
```
@aptonline
Copy link
Contributor Author

For reference here are the stats that are shown within the official 1.9.1 server:
Screenshot 2022-06-09 at 21 38 36

@jhalter
Copy link
Owner

jhalter commented Jun 9, 2022

I'm hoping to render exactly that window on my Pi server, so I'll definitely collect those stats in addition to others:

IMG_6113

The text is a bit too small on a 1.54" display though, may need to upgrade.

@jhalter
Copy link
Owner

jhalter commented Jul 18, 2024

I've added a couple of new HTTP API endpoint in #143 that provide missing functionality to reload the configuration and send shutdown messages, but I think I'll leave it at that for now.

@aptonline
Copy link
Contributor Author

aptonline commented Aug 5, 2024

Great stuff, would be helpful to be able to see via the API the server version as well if thats easy to implement :)

EDIT: turns out I'm running 0.12.3 and didn't realise it 👎🏼

@aptonline
Copy link
Contributor Author

All up-to-date now :)

@jhalter jhalter closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants