mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-05 20:52:22 +01:00
Squash Odysseus development history
This commit is contained in:
@@ -82,4 +82,26 @@ def setup_workspace_routes():
|
||||
resolved = vet_workspace(path)
|
||||
return {"ok": resolved is not None, "path": resolved}
|
||||
|
||||
@router.get("/default")
|
||||
def default_workspace(request: Request):
|
||||
"""Return the explicitly configured backend workspace, if usable.
|
||||
|
||||
WebUI has no local launch directory: it runs against this backend's
|
||||
filesystem. An explicit default gives it the same zero-setup behavior
|
||||
as TUI while keeping workspace access opt-in and server-vetted.
|
||||
"""
|
||||
owner = get_current_user(request)
|
||||
if not owner_is_admin_or_single_user(owner):
|
||||
raise HTTPException(status_code=403, detail="Workspace default is admin-only")
|
||||
|
||||
configured = os.environ.get("ODYSSEUS_WORKSPACE_DEFAULT", "").strip()
|
||||
if not configured:
|
||||
return {"ok": False, "path": None}
|
||||
|
||||
from src.tool_execution import vet_workspace
|
||||
from src.workspace_paths import backend_workspace_path
|
||||
|
||||
resolved = vet_workspace(backend_workspace_path(configured))
|
||||
return {"ok": resolved is not None, "path": resolved}
|
||||
|
||||
return router
|
||||
|
||||
Reference in New Issue
Block a user