update agent docs

This commit is contained in:
yusing 2025-03-01 17:06:30 +08:00
parent 0a348278ca
commit 21616f4d42

View file

@ -8,6 +8,7 @@ Main benefits:
- No more exposing docker socket: drops the need of `docker-socket-proxy` - No more exposing docker socket: drops the need of `docker-socket-proxy`
- No more exposing app ports: fewer attack surface - No more exposing app ports: fewer attack surface
```yaml ```yaml
services: services:
app: app:
@ -15,6 +16,7 @@ Main benefits:
# ports: # this part is not needed on agent server # ports: # this part is not needed on agent server
# - 6789 # - 6789
``` ```
- Secure: no one can connect to it except GoDoxy main server because of mTLS, plus connection is encrypted - Secure: no one can connect to it except GoDoxy main server because of mTLS, plus connection is encrypted
- Fetch info from agent server, e.g. CPU usage, Memory usage, container list, container logs, etc... (to be ready for beszel and dockge like features in WebUI) - Fetch info from agent server, e.g. CPU usage, Memory usage, container list, container logs, etc... (to be ready for beszel and dockge like features in WebUI)
@ -25,43 +27,11 @@ Prerequisites:
- GoDoxy main server must be running - GoDoxy main server must be running
1. Create a directory for agent server, cd into it 1. Create a directory for agent server, cd into it
2. Copy `agent.compose.yml` into the directory 2. Navigate to **Metrics tab** in WebUI, click **Add agent**, fill in required infomation then click **Copy docker compose**
3. Modify `agent.compose.yml` to set `REGISTRATION_ALLOWED_HOSTS` 3. Paste the docker compose into the agent server then start it with `docker compose up -d`
4. Run `docker-compose up -d` to start agent
5. Follow instructions on screen to run command on GoDoxy main server
6. Add config output to GoDoxy main server in `config.yml` under `providers.agents`
```yaml
providers:
agents:
- 12.34.5.6:8889
```
### How does it work ### How does it work
Setup flow:
```mermaid
flowchart TD
subgraph Agent Server
A[Create a directory] -->
B[Setup agent.compose.yml] -->
C[Set REGISTRATION_ALLOWED_HOSTS] -->
D[Run agent] -->
E[Wait for main server to register]
F[Respond to main server]
G[Agent now run in agent mode]
end
subgraph Main Server
E -->
H[Run register command] -->
I[Send registration request] --> F -->
J[Store client certs] -->
K[Send done request] --> G -->
L[Add agent to config.yml]
end
```
Run flow: Run flow:
```mermaid ```mermaid