Skip to content

Commit 1db66bd

Browse files
Agent Display Name
1 parent d5bace0 commit 1db66bd

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

DockFlare-Agent/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ def register_with_master():
254254
logging.info(f"Attempting to register with master at {endpoint}")
255255
try:
256256
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
257+
custom_display_name = os.getenv("AGENT_DISPLAY_NAME", "").strip()
258+
default_display_name = f"agent-{AGENT_ID[:8]}" if AGENT_ID else "dockflare-agent"
257259
payload = {
258-
"display_name": f"agent-{AGENT_ID[:8]}" if AGENT_ID else "dockflare-agent",
260+
"display_name": custom_display_name or default_display_name,
259261
"version": "1.0.0",
260262
}
261263
if AGENT_ID:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Next, create a `.env` file in the same directory. This file provides the configu
110110
DOCKFLARE_MASTER_URL=https://dockflare.example.com
111111
DOCKFLARE_API_KEY=agent_api_key_goes_here
112112
DOCKER_HOST=tcp://docker-socket-proxy:2375
113+
AGENT_DISPLAY_NAME=Production Server
113114
# control the docker image used for the managed cloudflared tunnel (accepts repo:tag or repo@sha256:<digest>)
114115
CLOUDFLARED_IMAGE=cloudflare/cloudflared:2025.9.0
115116
LOG_LEVEL=info
@@ -194,6 +195,7 @@ The agent is configured using environment variables, typically through the `.env
194195
| `DOCKFLARE_API_KEY` | ✅ | Agent API key generated in the master UI (`Agents → Generate Key`). |
195196
| `CLOUDFLARED_IMAGE` | ✅ | Preferred Cloudflared release (`cloudflare/cloudflared:2025.9.0`) or digest (`cloudflare/cloudflared@sha256:...`). |
196197
| `DOCKER_HOST` | ✅ | Address of the Docker socket proxy (`tcp://docker-socket-proxy:2375`). |
198+
| `AGENT_DISPLAY_NAME` | ❌ | Human-readable name for the agent (`Production Server`, `NAS Server`). Falls back to `agent-{8chars}` if not set. |
197199
| `CLOUDFLARED_NETWORK_NAME` | ❌ | Docker network used for the managed tunnel (`cloudflare-net` by default). |
198200
| `LOG_LEVEL` | ❌ | Python logging level (`INFO` by default). |
199201
| `REPORT_INTERVAL_SECONDS` | ❌ | Cadence for status reports (defaults to `30`). |

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
DOCKFLARE_MASTER_URL=https://dockflare.example.com
22
DOCKFLARE_API_KEY=agent_api_key_goes_here
33
DOCKER_HOST=tcp://docker-socket-proxy:2375
4+
AGENT_DISPLAY_NAME=Production Server
45
# control the docker image used for the managed cloudflared tunnel (accepts repo:tag or repo@sha256:<digest>)
56
CLOUDFLARED_IMAGE=cloudflare/cloudflared:2025.9.0
67
LOG_LEVEL=info

0 commit comments

Comments
 (0)