Database microservice for database access for SkeetBot.
All requests require a header key for authorization.
The data stored for a user is
- username
- CPU core count
- GPU
- user agent
- username banned flag
- IP banned flag
- IP address
- ISO timestamp of the last time the object was updated
No duplicate usernames are allowed; core counts received that are not numbers are stored as 0
.
Method | route | Description |
---|---|---|
GET | /users |
Returns a list of all users |
POST | /users |
Creates a new user |
GET | /users/:username |
Gets a user by username |
PUT | /users/:username |
Updates a user |
DELETE | /users/:username |
Deletes a user |
GET | /bannedusers |
Gets all users banned by username |
GET | /bannedips |
Gets all users banned by ip |
A file called settings.json
is required to store sensitive data related to database access. It has the following structure.
{
"pg": {
"user": "postgresusername",
"host": "postgreshost",
"database": "database",
"password": "password",
"port": 0000
},
"api": {
"key": "secret"
}
}