Krillsson / sys-API

Home server monitoring API and backend for Monitee
https://monitee.app
Apache License 2.0
90 stars 2 forks source link
homeserver monitoring self-hosted

header Docker hub

System API (sys-API) provide a GraphQL API to your computers hardware.

It publishes and monitors values from OSHI with the help of Spring. On Windows the information is supplemented with OpenHardwareMonitor with a bit of help from OhmJni4Net.

This is the server backend for the Android app Monitee.

Get it on Play Store

What can it do?

Query for:

Monitoring

Currently, you can monitor

GraphQL

GraphQL is available through the /graphql endpoint. Checkout the schema. There's also a set of sample queries in the sample-queries directory

A web-UI for trying out the GraphQL-API is also available at <IP>:8080/graphiql. If you don't want to expose this functionality. It can be disabled via the configuration.

graphQLPlayGround:
  enabled: false

If the server is protected by Basic Auth, you need to configure GraphQL Playground to send the authorization header. Here's an example with the default credentials:

{
  "authorization": "Basic dXNlcjpwYXNzd29yZA=="
}

Running

Download the latest release.

Running using docker

Make sure you have docker compose installed.

Configuration

The application expects a user config file (configuration.yml) and a spring configuration file (application.properties) in the /config directory. See the sample files in the /config repository directory.

Self-signed certificates

By default, sys-API will generate a self-signed certificate to enable HTTPS. This is to lower the barrier for encrypted traffic between the client and the server. Please note that using properly signed certificates is better. Let's Encrypt is a free and good alternative. Refer wiki page on how to set it up.

For convenience, the certificates are persisted using a java keystore. If you wish to re-generate the certificates, delete the keystorewww.jks file. But note that this will require re-adding the server in Monitee.

Development

Setup

git clone [this repo] sys-api
./gradlew run

Package for distribution in a .zip:

./gradlew shadowDistZip

And the resulting files should be located in /server/target/

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.