修复 agent-browser socket 目录权限问题
- 自动创建 /tmp/agent-browser-sockets 目录 - 设置 AGENT_BROWSER_SOCKET_DIR 环境变量 - 解决 Permission denied 错误
This commit is contained in:
4
app.py
4
app.py
@@ -44,6 +44,10 @@ CORS(app)
|
|||||||
CAPTURE_DIR = Path(tempfile.gettempdir()) / "web_captures"
|
CAPTURE_DIR = Path(tempfile.gettempdir()) / "web_captures"
|
||||||
CAPTURE_DIR.mkdir(exist_ok=True)
|
CAPTURE_DIR.mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
# agent-browser socket 目录
|
||||||
|
os.environ.setdefault("AGENT_BROWSER_SOCKET_DIR", "/tmp/agent-browser-sockets")
|
||||||
|
Path(os.environ["AGENT_BROWSER_SOCKET_DIR"]).mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
|
|
||||||
class AgentBrowserSession:
|
class AgentBrowserSession:
|
||||||
"""agent-browser 会话管理器"""
|
"""agent-browser 会话管理器"""
|
||||||
|
|||||||
@@ -405,7 +405,7 @@
|
|||||||
submitBtn.disabled = true;
|
submitBtn.disabled = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('http://localhost:16025/api/capture', {
|
const response = await fetch('/api/capture', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
|||||||
Reference in New Issue
Block a user