Better README.MD + clean up entrypoint.sh
This commit is contained in:
1
.env
1
.env
@@ -1,4 +1,3 @@
|
|||||||
# Socat Proxy Configuration
|
|
||||||
TARGET_HOST= # Target hostname/IP to proxy to
|
TARGET_HOST= # Target hostname/IP to proxy to
|
||||||
TARGET_PORT= # Target port to proxy to
|
TARGET_PORT= # Target port to proxy to
|
||||||
UNIX_SOCKET_NAME= # Name of the socket file
|
UNIX_SOCKET_NAME= # Name of the socket file
|
||||||
|
31
README.MD
31
README.MD
@@ -46,13 +46,12 @@ A lightweight Docker container that creates a UNIX socket proxy to TCP connectio
|
|||||||
|
|
||||||
1. Create a `.env` file with your configuration:
|
1. Create a `.env` file with your configuration:
|
||||||
```bash
|
```bash
|
||||||
# .env
|
TARGET_HOST= #your target host
|
||||||
TARGET_HOST=socket-proxy-beszel
|
TARGET_PORT= #your target host port
|
||||||
TARGET_PORT=2375
|
UNIX_SOCKET_NAME= #your socket file name
|
||||||
UNIX_SOCKET_NAME=docker.sock
|
UNIX_SOCKET_PATH= #your socket folder path inside socat-proxy
|
||||||
UNIX_SOCKET_PATH=/socket
|
HOST_SOCKET_PATH= #your socket folder path inside your host
|
||||||
HOST_SOCKET_PATH=/docker/beszel-agent/sock
|
DEBUG_LEVEL=1
|
||||||
DEBUG_LEVEL=0
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Create a `compose.yml` file:
|
2. Create a `compose.yml` file:
|
||||||
@@ -82,13 +81,13 @@ docker compose up -d
|
|||||||
```bash
|
```bash
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name socat-proxy \
|
--name socat-proxy \
|
||||||
-e TARGET_HOST=socket-proxy-beszel \
|
-e TARGET_HOST= #your target host \
|
||||||
-e TARGET_PORT=2375 \
|
-e TARGET_PORT= #your target host port \
|
||||||
-e UNIX_SOCKET_NAME=docker.sock \
|
-e UNIX_SOCKET_NAME= #your socket file name \
|
||||||
-e UNIX_SOCKET_PATH=/socket \
|
-e UNIX_SOCKET_PATH= #your socket folder path inside socat-proxy \
|
||||||
-e HOST_SOCKET_PATH=/docker/beszel-agent/sock \
|
-e HOST_SOCKET_PATH= #your socket folder path inside your host\
|
||||||
-e DEBUG_LEVEL=1 \
|
-e DEBUG_LEVEL=1 \
|
||||||
-v /docker/beszel-agent/sock:/socket \
|
-v ${HOST_SOCKET_PATH}:${UNIX_SOCKET_PATH}$ \
|
||||||
git.djeex.fr/djeex/socat-proxy:latest
|
git.djeex.fr/djeex/socat-proxy:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -119,10 +118,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${HOST_SOCKET_PATH}:${UNIX_SOCKET_PATH}
|
- ${HOST_SOCKET_PATH}:${UNIX_SOCKET_PATH}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- ${TARGET_HOST}
|
||||||
|
|
||||||
socket-proxy:
|
socket-proxy:
|
||||||
image: lscr.io/linuxserver/socket-proxy:latest
|
image: lscr.io/linuxserver/socket-proxy:latest
|
||||||
container_name: socket-proxy-beszel
|
container_name: ${TARGET_HOST}
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
environment:
|
environment:
|
||||||
@@ -143,7 +144,7 @@ services:
|
|||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
volumes:
|
volumes:
|
||||||
- ${HOST_SOCKET_PATH}/docker.sock:/var/run/docker.sock:ro
|
- ${HOST_SOCKET_PATH}/${UNIX_SOCKET_NAME}:/var/run/docker.sock:ro
|
||||||
environment:
|
environment:
|
||||||
- #... your Beszel environment var
|
- #... your Beszel environment var
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@@ -4,14 +4,7 @@ set -e
|
|||||||
CYAN="\033[1;36m"
|
CYAN="\033[1;36m"
|
||||||
NC="\033[0m"
|
NC="\033[0m"
|
||||||
|
|
||||||
TARGET_HOST=${TARGET_HOST}
|
DEBUG_LEVEL=${DEBUG_LEVEL:-1}
|
||||||
TARGET_PORT=${TARGET_PORT}
|
|
||||||
UNIX_SOCKET_NAME=${UNIX_SOCKET_NAME}
|
|
||||||
UNIX_SOCKET_PATH=${UNIX_SOCKET_PATH}
|
|
||||||
HOST_SOCKET_PATH=${HOST_SOCKET_PATH}
|
|
||||||
DEBUG_LEVEL=${DEBUG_LEVEL:-1} # Default to basic logging
|
|
||||||
|
|
||||||
# Remove trailing slashes to avoid double slashes
|
|
||||||
UNIX_SOCKET_PATH=${UNIX_SOCKET_PATH%/}
|
UNIX_SOCKET_PATH=${UNIX_SOCKET_PATH%/}
|
||||||
HOST_SOCKET_PATH=${HOST_SOCKET_PATH%/}
|
HOST_SOCKET_PATH=${HOST_SOCKET_PATH%/}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user