Upload 7 files
Browse files- Dockerfile +4 -0
- app.py +14 -0
Dockerfile
CHANGED
|
@@ -20,7 +20,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 20 |
COPY requirements.txt /app/requirements.txt
|
| 21 |
RUN pip install -r /app/requirements.txt
|
| 22 |
|
|
|
|
| 23 |
COPY app.py /app/app.py
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
EXPOSE 7860
|
| 26 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 20 |
COPY requirements.txt /app/requirements.txt
|
| 21 |
RUN pip install -r /app/requirements.txt
|
| 22 |
|
| 23 |
+
# App code and data files
|
| 24 |
COPY app.py /app/app.py
|
| 25 |
+
COPY autocalib_phishy.csv /app/autocalib_phishy.csv
|
| 26 |
+
COPY autocalib_legit.csv /app/autocalib_legit.csv
|
| 27 |
+
COPY known_hosts.csv /app/known_hosts.csv
|
| 28 |
|
| 29 |
EXPOSE 7860
|
| 30 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
|
@@ -380,6 +380,20 @@ def _startup():
|
|
| 380 |
def root():
|
| 381 |
return {"status": "ok", "model": MODEL_ID}
|
| 382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
@app.post("/predict")
|
| 384 |
def predict(payload: PredictPayload):
|
| 385 |
try:
|
|
|
|
| 380 |
def root():
|
| 381 |
return {"status": "ok", "model": MODEL_ID}
|
| 382 |
|
| 383 |
+
@app.get("/debug-config")
|
| 384 |
+
def debug_config():
|
| 385 |
+
return {
|
| 386 |
+
"phishy_count": len(_AUTOCALIB_PHISHY_URLS),
|
| 387 |
+
"legit_count": len(_AUTOCALIB_LEGIT_URLS),
|
| 388 |
+
"known_legit_hosts": _KNOWN_LEGIT_HOSTS[:50],
|
| 389 |
+
"known_phish_hosts": _KNOWN_PHISH_HOSTS[:50],
|
| 390 |
+
"url_repo": URL_REPO,
|
| 391 |
+
"url_repo_type": URL_REPO_TYPE,
|
| 392 |
+
"url_filename": URL_FILENAME,
|
| 393 |
+
"phish_is_positive_env": URL_POSITIVE_CLASS_ENV if URL_POSITIVE_CLASS_ENV else None,
|
| 394 |
+
"resolved_phish_is_positive": _url_phish_is_positive,
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
@app.post("/predict")
|
| 398 |
def predict(payload: PredictPayload):
|
| 399 |
try:
|