public-release phases 1-3: read-only public mode, gunicorn container, demo bootstrap, CI, README
- before_request guard: visitors browse + explore; writes need PHYSCOM_ADMIN_TOKEN login - SameSite=Lax/HttpOnly cookies, persisted secret key, debug off unless FLASK_DEBUG=1 - non-root gunicorn container with healthcheck; physcom demo --if-empty on first start - landing page Top Concepts, write controls hidden from visitors - CI workflow, pyproject metadata, compose Ollama parity, README rewrite - tests/test_web_access.py: access control + GET smoke test of every page Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
from flask import Blueprint, flash, redirect, render_template, request, url_for
|
||||
|
||||
@@ -138,8 +136,8 @@ def pipeline_run():
|
||||
run_id = repo.create_pipeline_run(domain.id, config)
|
||||
|
||||
# Resolve DB path for the background thread
|
||||
from physcom_web.app import DEFAULT_DB
|
||||
db_path = str(Path(os.environ.get("PHYSCOM_DB", str(DEFAULT_DB))))
|
||||
from physcom_web.app import db_path as _db_path
|
||||
db_path = str(_db_path())
|
||||
|
||||
# Start background thread
|
||||
t = threading.Thread(
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import math
|
||||
|
||||
from flask import Blueprint, flash, redirect, render_template, request, url_for
|
||||
|
||||
from physcom.engine.constraint_resolver import ConstraintResolver
|
||||
@@ -104,9 +106,10 @@ def explore(domain_name: str, combo_id: int):
|
||||
if raw is None:
|
||||
return None
|
||||
try:
|
||||
return float(raw)
|
||||
value = float(raw)
|
||||
except ValueError:
|
||||
return None
|
||||
return value if math.isfinite(value) else None
|
||||
|
||||
explore_result = _run_evaluate(
|
||||
repo, domain, combo,
|
||||
|
||||
Reference in New Issue
Block a user