removed doc

This commit is contained in:
David Brazda
2024-10-08 14:20:45 +02:00
parent badd5b87dd
commit faaaa65081
2 changed files with 18 additions and 1 deletions

View File

@ -11,6 +11,7 @@ _ml_module_loaded = False
#directory for generated images and basic reports
MEDIA_DIRECTORY = Path(__file__).parent.parent.parent / "media"
VBT_DOC_DIRECTORY = Path(__file__).parent.parent.parent / "vbt-doc" #directory for vbt doc
RUNNER_DETAIL_DIRECTORY = Path(__file__).parent.parent.parent / "runner_detail"
#location of strat.log - it is used to fetch by gui

View File

@ -1,7 +1,7 @@
import os,sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.environ["KERAS_BACKEND"] = "jax"
from v2realbot.config import WEB_API_KEY, DATA_DIR, MEDIA_DIRECTORY, LOG_PATH, MODEL_DIR
from v2realbot.config import WEB_API_KEY, DATA_DIR, MEDIA_DIRECTORY, LOG_PATH, MODEL_DIR, VBT_DOC_DIRECTORY
from alpaca.data.timeframe import TimeFrame, TimeFrameUnit
from datetime import datetime
from rich import print
@ -122,6 +122,22 @@ async def static_files(request: Request, path: str, authenticated: bool = Depend
return FileResponse(file_path)
@app.get("/vbt-doc/{file_path:path}")
async def serve_protected_docs(file_path: str, credentials: HTTPBasicCredentials = Depends(authenticate_user)):
file_location = VBT_DOC_DIRECTORY / file_path
if file_location.is_dir(): # If it's a directory, serve index.html
index_file = file_location / "index.html"
if index_file.exists():
return FileResponse(index_file)
else:
raise HTTPException(status_code=404, detail="Index file not found")
elif file_location.exists():
return FileResponse(file_location)
else:
raise HTTPException(status_code=404, detail="File not found")
def get_current_username(
credentials: Annotated[HTTPBasicCredentials, Depends(security)]
):