安装代理
代理运行在您一侧,位于文件服务器旁。它通过 HTTPS 连回您的工作区,并完成 SFTP、FTP、FTPS、SMB 和 NFS 的工作。
创建代理
- 打开代理并创建一个代理。部署指南会打开,并显示代理 ID 和密钥。
- 请立即复制密钥。它只显示一次;之后重新打开的指南会显示
<agent-secret>。 - 确定 xEvolve 可以访问代理的公共 HTTPS 地址。将其填为
XEVOLVE_AGENT_URL。
设置
| 变量 | 值 |
|---|---|
AGENT_SECRET | 指南中显示的代理密钥。 |
XEVOLVE_API_URL | 您的工作区地址,例如 https://<workspace>.xevolve.io。不要使用 api.xevolve.io:它没有工作区,会返回 workspace_not_ready。 |
XEVOLVE_API_TOKEN | 再次填写代理密钥。 |
XEVOLVE_AGENT_ID | 指南中显示的代理 ID。 |
XEVOLVE_AGENT_URL | xEvolve 访问代理的公共 URL。 |
PORT | 3100 |
Docker
docker run -d --name xevolve-agent \
-p 3100:3100 \
-e AGENT_SECRET=<agent-secret> \
-e XEVOLVE_API_URL=https://<workspace>.xevolve.io \
-e XEVOLVE_API_TOKEN=<agent-secret> \
-e XEVOLVE_AGENT_ID=<agent-id> \
-e XEVOLVE_AGENT_URL=https://your-agent-url.example.com \
--restart unless-stopped \
ghcr.io/spot-techno/xevolve-agent:latestAzure Web App for Containers
az group create -n xevolve-agent-rg -l westeurope
az appservice plan create -n xevolve-agent-plan -g xevolve-agent-rg \
--is-linux --sku B1
az webapp create -n xevolve-agent -g xevolve-agent-rg \
-p xevolve-agent-plan \
-i ghcr.io/spot-techno/xevolve-agent:latest
az webapp config appsettings set -n xevolve-agent -g xevolve-agent-rg \
--settings \
AGENT_SECRET=<agent-secret> \
XEVOLVE_API_URL=https://<workspace>.xevolve.io \
XEVOLVE_API_TOKEN=<agent-secret> \
XEVOLVE_AGENT_ID=<agent-id> \
XEVOLVE_AGENT_URL=https://xevolve-agent.azurewebsites.net \
WEBSITES_PORT=3100AWS ECS (Fargate)
这假设已存在 VPC、子网和名为 xevolve 的 ECS 集群。
aws ecs register-task-definition --cli-input-json file://task-def.json
aws ecs create-service \
--cluster xevolve \
--service-name xevolve-agent \
--task-definition xevolve-agent \
--desired-count 1 \
--launch-type FARGATE \
--network-configuration "awsvpcConfiguration={subnets=[<subnet-id>],securityGroups=[<security-group-id>],assignPublicIp=ENABLED}"task-def.json 文件:
{
"family": "xevolve-agent",
"containerDefinitions": [{
"name": "agent",
"image": "ghcr.io/spot-techno/xevolve-agent:latest",
"portMappings": [{"containerPort": 3100}],
"environment": [
{"name": "AGENT_SECRET", "value": "<agent-secret>"},
{"name": "XEVOLVE_API_URL", "value": "https://<workspace>.xevolve.io"},
{"name": "XEVOLVE_API_TOKEN", "value": "<agent-secret>"},
{"name": "XEVOLVE_AGENT_ID", "value": "<agent-id>"},
{"name": "XEVOLVE_AGENT_URL", "value": "https://your-agent-url.example.com"}
]
}],
"cpu": "256", "memory": "512",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"]
}确认其正常工作
- 打开代理,在代理卡片上选择测试代理。这会检查 xEvolve 能否访问代理地址。
- 等待一分钟。代理每 60 秒发送一次心跳,卡片会显示最后一次看到它的时间。
- 添加或编辑 SFTP、FTP、FTPS、SMB 或 NFS 连接,选择此代理,并测试连接。
测试代理不会验证代理密钥。密钥错误的表现是没有心跳。