Compare commits
9 Commits
acbcde6295
...
39f7c75bcf
Author | SHA1 | Date |
---|---|---|
|
39f7c75bcf | |
|
2b54161c2d | |
|
a155438e94 | |
|
536c859bca | |
|
7b00ab1f2c | |
|
f78071e2bd | |
|
5314241b9f | |
|
41806aaa9d | |
|
a285f1181a |
|
@ -37,7 +37,6 @@ http {
|
||||||
set_real_ip_from ::/0;
|
set_real_ip_from ::/0;
|
||||||
real_ip_recursive on;
|
real_ip_recursive on;
|
||||||
proxy_set_header Host $proxy_host;
|
proxy_set_header Host $proxy_host;
|
||||||
proxy_set_header X-Forwarded-For $realip_remote_addr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,4 @@
|
||||||
nginx || exit $?
|
nginx || exit $?
|
||||||
exec /usr/local/hudctrl/bin/gunicorn \
|
exec /usr/local/hudctrl/bin/gunicorn \
|
||||||
-k uvicorn.workers.UvicornWorker \
|
-k uvicorn.workers.UvicornWorker \
|
||||||
--forwarded-allow-ips 127.0.0.1/32,${FORWARDED_ALLOW_IPS} \
|
|
||||||
hudctrl.api:app
|
hudctrl.api:app
|
||||||
|
|
|
@ -9,7 +9,7 @@ python = "^3.10"
|
||||||
fastapi = "^0.75.1"
|
fastapi = "^0.75.1"
|
||||||
uvicorn = "^0.17.6"
|
uvicorn = "^0.17.6"
|
||||||
python-multipart = "^0.0.5"
|
python-multipart = "^0.0.5"
|
||||||
aiomarionette = "^0.0.2"
|
aiomarionette = "^0.0.3"
|
||||||
Pillow = "^9.1.0"
|
Pillow = "^9.1.0"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
|
@ -61,3 +61,7 @@ warn_return_any = true
|
||||||
module = 'hudctrl.api'
|
module = 'hudctrl.api'
|
||||||
disallow_untyped_defs = false
|
disallow_untyped_defs = false
|
||||||
disallow_incomplete_defs = false
|
disallow_incomplete_defs = false
|
||||||
|
|
||||||
|
[tool.pyright]
|
||||||
|
venvPath = '.'
|
||||||
|
venv = '.venv'
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import fastapi
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
import fastapi
|
||||||
|
|
||||||
from .hud import HUDService, NoMonitorConfig
|
from .hud import HUDService, NoMonitorConfig
|
||||||
from .xrandr import MonitorConfig
|
from .xrandr import MonitorConfig
|
||||||
|
@ -15,11 +17,16 @@ log = logging.getLogger(__name__)
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
HUDCTRL_URLS_FILE = os.environ.get('HUDCTRL_URLS_FILE')
|
||||||
|
|
||||||
|
|
||||||
app = fastapi.FastAPI(
|
app = fastapi.FastAPI(
|
||||||
docs_url='/api-doc/',
|
docs_url='/api-doc/',
|
||||||
)
|
)
|
||||||
|
|
||||||
svc = HUDService()
|
svc = HUDService()
|
||||||
|
if HUDCTRL_URLS_FILE:
|
||||||
|
svc.urls_file = Path(HUDCTRL_URLS_FILE)
|
||||||
|
|
||||||
|
|
||||||
class PNGImageResponse(fastapi.Response):
|
class PNGImageResponse(fastapi.Response):
|
||||||
|
|
Loading…
Reference in New Issue