From ac6f50c40c71cbb9e53814f5bacc9e538d741e2a Mon Sep 17 00:00:00 2001 From: Henry Dollman Date: Wed, 31 Jul 2024 15:59:10 -0400 Subject: [PATCH] update readme and add same-system docker example --- readme.md | 15 ++++++++++-- .../examples/same-system/docker-compose.yml | 23 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 supplemental/docker/examples/same-system/docker-compose.yml diff --git a/readme.md b/readme.md index d5ece89..90c66bd 100644 --- a/readme.md +++ b/readme.md @@ -237,9 +237,20 @@ Cannot create systems, but can view any system that has been shared with them by ### Agent is not connecting -Assuming the agent is running, the connection is probably being blocked by a firewall. You need to add an inbound rule on the agent system to allow TCP connections to the port. Check any active firewalls, like iptables or ufw, and in your cloud provider account if applicable. +Assuming the agent is running, the connection is probably being blocked by a firewall. You have two options: -Connectivity can be tested by running `telnet ` or `nc -zv ` from a remote machine. +1. Add an inbound rule to the agent system's firewall(s) to allow TCP connections to the port. Check any active firewalls, like iptables, and in your cloud provider account if applicable. +2. Alternatively, software like [Cloudflare Tunnel](https://www.cloudflare.com/products/tunnel/), [WireGuard](https://www.wireguard.com/), or [Tailscale](https://tailscale.com/) can be used to securely bypass your firewall. + +Connectivity can be tested by running `telnet `. + +### Connecting the hub and agent on the same system using Docker + +If using host network mode for the agent but not the hub, you can add your system using the hostname `host.docker.internal`, which resolves to the internal IP address used by the host. See [example docker-compose.yml](/supplemental/docker/examples/same-system/docker-compose.yml). + +If using host network for both, you can use `localhost` as the hostname. + +Otherwise you can use the agent's `container_name` as the hostname if both are in the same docker network. ### Finding the correct filesystem diff --git a/supplemental/docker/examples/same-system/docker-compose.yml b/supplemental/docker/examples/same-system/docker-compose.yml new file mode 100644 index 0000000..a25bf55 --- /dev/null +++ b/supplemental/docker/examples/same-system/docker-compose.yml @@ -0,0 +1,23 @@ +services: + beszel: + image: 'henrygd/beszel' + container_name: 'beszel' + restart: unless-stopped + ports: + - '8090:8090' + volumes: + - ./beszel_data:/beszel_data + extra_hosts: + - 'host.docker.internal:host-gateway' + + beszel-agent: + image: 'henrygd/beszel-agent' + container_name: 'beszel-agent' + restart: unless-stopped + network_mode: host + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + environment: + PORT: 45876 + KEY: '...' + # FILESYSTEM: /dev/sda1 # set to the correct filesystem for disk I/O stats