Spaces:
Sleeping
Sleeping
Guilherme Silberfarb Costa
Adiciona exclusão autorizada e lixeira privada com recuperação de trabalhos e rascunhos
ad3d3f0 Download scripts/e2e_server.py from gui-sparim/base_conhecimento: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/spaces/gui-sparim/base_conhecimento/resolve/main/scripts/e2e_server.py
- Command line
-
hf download hf://spaces/gui-sparim/base_conhecimento/scripts/e2e_server.py
-
curl -L -o e2e_server.py https://huggingface.co/spaces/gui-sparim/base_conhecimento/resolve/main/scripts/e2e_server.py
1.35 kB
| import os | |
| import sys | |
| from pathlib import Path | |
| root = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(root / "backend")) | |
| path = root / ".runtime/e2e.sqlite3" | |
| path.parent.mkdir(exist_ok=True) | |
| for suffix in ["", "-wal", "-shm"]: | |
| Path(str(path) + suffix).unlink(missing_ok=True) | |
| os.environ["APP_ENV"] = "development" | |
| os.environ["AUTH_PROVIDER"] = "mesa" | |
| os.environ["REVIEWER_USERNAMES"] = "admin" | |
| os.environ["CARLA_MESA_USERS_JSON"] = ( | |
| '{"usuarios":[{"usuario":"admin","nome":"Administrador de teste","matricula":"246810","perfil":"admin"},{"usuario":"leitor_teste","nome":"Leitor de teste","matricula":"135790","perfil":"viewer"},{"usuario":"guilherme","nome":"Guilherme de teste","matricula":"445566","perfil":"viewer"},{"usuario":"colaborador_teste","nome":"Colaborador de teste","matricula":"112233","perfil":"viewer"}]}' | |
| ) | |
| os.environ["DATABASE_URL"] = f"sqlite:///{path}" | |
| os.environ["STORAGE_DIR"] = str(root / ".runtime/e2e-files") | |
| os.environ["BOOTSTRAP_ADMIN_PASSWORD"] = "E2E-Initial-Password-2026" | |
| os.environ["BOOTSTRAP_ADMIN_USER"] = "admin" | |
| os.environ["GATE_PASSWORD"] = "carla" | |
| os.environ["RUN_WORKER"] = "false" | |
| os.environ["SECURE_COOKIES"] = "false" | |
| from app.bootstrap import migrate, seed | |
| migrate() | |
| seed() | |
| import uvicorn | |
| uvicorn.run( | |
| "app.main:app", host="127.0.0.1", port=int(os.getenv("CARLA_E2E_PORT", "8013")) | |
| ) | |