X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/4fa4a57c4352f703958c3c5cb8dcd2b56cb35882..8cd28eb8cede1c6888cbbcd319a9617304bfc4c1:/README.md?ds=sidebyside diff --git a/README.md b/README.md index 5f2c7b4..c76ad4f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,17 @@ --> +# Mobius (Friendship Quest Remix) + +A fork of [mobius](https://github.com/jhalter/mobius) with some extra features: + +1. If you have upload permission, you get your own `~` folder. + # Mobius -Mobius is a cross-platform command line [Hotline](https://en.wikipedia.org/wiki/Hotline_Communications) client and server implemented in Golang. +Mobius is a cross-platform command line [Hotline](https://en.wikipedia.org/wiki/Hotline_Communications) server implemented in Golang. -- **Server Goal:** Make it simple to run a Hotline server on macOS, Linux, and Windows, with full compatibility for all popular Hotline clients. -- **Client Goal:** Make it fun and easy to connect to multiple Hotline servers through a [terminal UI](https://github.com/jhalter/mobius/wiki/Mobius-Client-Screenshot-Gallery). +- **Project Goal:** Make it simple to run a Hotline server on macOS, Linux, and Windows, with full compatibility for all popular Hotline clients. ## Installation @@ -53,7 +58,7 @@ sudo docker run \ -p 5500:5500 \ -p 5501:5501 \ -v $HLFILES:/usr/local/var/mobius/config \ - ghcr.io/jhalter/mobius:latest \ + ghcr.io/jhalter/mobius-hotline-server:latest \ -init ``` @@ -171,3 +176,62 @@ Usage of mobius-hotline-server: To run as a systemd service, refer to this sample unit file: [mobius-hotline-server.service](https://github.com/jhalter/mobius/blob/master/cmd/mobius-hotline-server/mobius-hotline-server.service) +## (Optional) HTTP API + +The Mobius server includes an optional HTTP API to perform out-of-band administrative functions. + +To enable it, include the `--api-addr` flag with a string defining the IP and port to listen on in the form of `:`. + +Example: `--api-addr=127.0.0.1:5503` + +⚠️ The API has no authentication, so binding it to localhost is a good idea! + +#### GET /api/v1/stats + +The stats endpoint returns server runtime statistics and counters. + +``` +❯ curl -s localhost:5503/api/v1/stats | jq . +{ + "ConnectionCounter": 0, + "ConnectionPeak": 0, + "CurrentlyConnected": 0, + "DownloadCounter": 0, + "DownloadsInProgress": 0, + "Since": "2024-07-18T15:36:42.426156-07:00", + "UploadCounter": 0, + "UploadsInProgress": 0, + "WaitingDownloads": 0 +} +``` + +#### GET /api/v1/reload + +The reload endpoint reloads the following configuration files from disk: + +* Agreement.txt +* News.txt +* Users/*.yaml +* ThreadedNews.yaml +* banner.jpg + +Example: + +``` +❯ curl -s localhost:5503/api/v1/reload | jq . +{ + "msg": "config reloaded" +} +``` + +#### POST /api/v1/shutdown + +The shutdown endpoint accepts a shutdown message from POST payload, sends it to to all connected Hotline clients, then gracefully shuts down the server. + +Example: + +``` +❯ curl -d 'Server rebooting' localhost:5503/api/v1/shutdown + +{ "msg": "server shutting down" } +```