[misc] Fix production issues
This commit is contained in:
parent
d5ebd481b4
commit
28396eb379
|
@ -57,6 +57,8 @@ class Main:
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
server_config = Config()
|
server_config = Config()
|
||||||
server_config.accesslog = '-'
|
server_config.accesslog = '-'
|
||||||
|
if config['production']:
|
||||||
|
server_config.bind = ['0.0.0.0:8000', '[::]:8000']
|
||||||
app.include_router(router, prefix='/api')
|
app.include_router(router, prefix='/api')
|
||||||
if not config['production'] and config['cors_allow_origin']:
|
if not config['production'] and config['cors_allow_origin']:
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
|
|
|
@ -55,7 +55,7 @@ async def telegram_read_all_public(hood=Depends(get_hood_unauthorized)):
|
||||||
return [
|
return [
|
||||||
BodyTelegramPublic(username=telegrambot.username)
|
BodyTelegramPublic(username=telegrambot.username)
|
||||||
for telegrambot in telegrambots
|
for telegrambot in telegrambots
|
||||||
if telegrambot.enabled == 1
|
if telegrambot.enabled == 1 and telegrambot.username
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue