An open API service indexing awesome lists of open source software.

https://github.com/tinyauthapp/analytics

A simple server to transparently collect version information from Tinyauth instances.
https://github.com/tinyauthapp/analytics

analytics tinyauth

Last synced: 10 days ago
JSON representation

A simple server to transparently collect version information from Tinyauth instances.

Awesome Lists containing this project

README

          

# Tinyauth analytics

A simple server to transparently collect version information from Tinyauth instances.

## How it works

Every Tinyauth instance runs a goroutine (unless you choose to opt-out) that does a "heartbeat" every 12 hours indicating the instance is still "alive". The heartbeat contains the UUID generated by Tinyauth on startup and the version information. The server stores them in the SQLite database alongside with the last seen date. When you request all the instances, the server responds with an array containing the versions, UUIDs and last seen dates.

## Running

The central information server is hosted at `https://api.tinyauth.app` and all instance information can be requested from the `/v1/instances/all` endpoint or be seen visually on the `/dashboard` page. If you like, you can run your own server for your own projects. This can be done by cloning the repository and running:

```sh
docker compose up -d
```

## Configuration

The server is configured using environment variables, the following options are supported:

| Name | Type | Description | Default |
| ---------------------- | ------------ | --------------------------------------------- | -------------------- |
| `DATABASE_PATH` | string | Path to the SQLite database file. | `/data/analytics.db` |
| `PORT` | number | The port to run the server on. | `8080` |
| `ADDRESS` | string | The address to bind the server to. | `0.0.0.0` |
| `RATE_LIMIT_COUNT` | number | Maximum number of requests per minute per IP. | `3` |
| `CORS_ALLOWED_ORIGINS` | string/array | Comma-separated list of allowed CORS origins. | `*` |
| `TRUSTED_PROXIES` | string/array | Comma-separated list of trusted proxy IPs. | `` |
| `DASHBOARD_ENABLED` | boolean | Whether to enable the dashboard. | `true` |
| `BADGE_ENABLED` | boolean | Whether to enable the badge endpoint. | `true` |

## Contributing

If you like you can contribute to this project by picking up an [issue](https://github.com/tinyauthapp/analytics/issues) or creating a [pull request](https://github.com/tinyauthapp/analytics/pulls). Contributing is appreciated a lot!

## License

Tinyauth analytics is licensed under the MIT License. TL;DR — You can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software. Just make sure to include the original license in any substantial portions of the code. There’s no warranty — use at your own risk. See the [LICENSE](LICENSE) file for full details.