mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 18:53:58 +01:00
Compare commits
2 commits
45c6a14dc0
...
4444fc1315
Author | SHA1 | Date | |
---|---|---|---|
4444fc1315 | |||
a8a5aa9ef4 |
13
README.md
13
README.md
|
@ -328,3 +328,16 @@ It is recommended to use the default ports, because this will make it easier to
|
||||||
## Run Production Server
|
## Run Production Server
|
||||||
|
|
||||||
Make sure you have read all the according sections and have set up everything correctly.
|
Make sure you have read all the according sections and have set up everything correctly.
|
||||||
|
|
||||||
|
## Autorewards
|
||||||
|
|
||||||
|
```bash
|
||||||
|
0 0 * * * cd /home/nova-api && python rewards
|
||||||
|
crontab -e
|
||||||
|
```
|
||||||
|
|
||||||
|
## Donations
|
||||||
|
|
||||||
|
When someone donates, manually update the credits and role to "helper" in the database.
|
||||||
|
For enterprise donations with more lax rate-limits, set the role to "enterprise".
|
||||||
|
Make sure to also include the donation in the `donations` database!
|
||||||
|
|
|
@ -42,7 +42,10 @@ async def check_core_auth(request):
|
||||||
async def new_user_webhook(user: dict) -> None:
|
async def new_user_webhook(user: dict) -> None:
|
||||||
"""Runs when a new user is created."""
|
"""Runs when a new user is created."""
|
||||||
|
|
||||||
|
try:
|
||||||
dhook = Webhook(os.environ['DISCORD_WEBHOOK__USER_CREATED'])
|
dhook = Webhook(os.environ['DISCORD_WEBHOOK__USER_CREATED'])
|
||||||
|
except KeyError:
|
||||||
|
return
|
||||||
|
|
||||||
embed = Embed(
|
embed = Embed(
|
||||||
description='New User',
|
description='New User',
|
||||||
|
|
|
@ -65,6 +65,7 @@ async def respond(
|
||||||
}
|
}
|
||||||
|
|
||||||
skipped_errors = {
|
skipped_errors = {
|
||||||
|
'no_provider_key': 0,
|
||||||
'insufficient_quota': 0,
|
'insufficient_quota': 0,
|
||||||
'billing_not_active': 0,
|
'billing_not_active': 0,
|
||||||
'critical_provider_error': 0,
|
'critical_provider_error': 0,
|
||||||
|
@ -95,12 +96,8 @@ async def respond(
|
||||||
provider_key = provider_auth.split('>')[1]
|
provider_key = provider_auth.split('>')[1]
|
||||||
|
|
||||||
if provider_key == '--NO_KEY--':
|
if provider_key == '--NO_KEY--':
|
||||||
print(f'No key for {provider_name}')
|
skipped_errors['no_provider_key'] += 1
|
||||||
yield await errors.yield_error(500,
|
continue
|
||||||
'Sorry, our API seems to have issues connecting to our provider(s).',
|
|
||||||
'This most likely isn\'t your fault. Please try again later.'
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
target_request['headers'].update(target_request.get('headers', {}))
|
target_request['headers'].update(target_request.get('headers', {}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue