From 685657d3112dc186a8d0b33c7a3c3adf8166009d Mon Sep 17 00:00:00 2001 From: kev Date: Fri, 15 Oct 2021 18:12:48 +0800 Subject: [PATCH] update fteproxy --- fteproxy/Dockerfile | 26 +++++++-------- fteproxy/Dockerfile.debian | 36 ++++++++++---------- fteproxy/README.md | 59 +++++++++++++++++++-------------- fteproxy/arm/Dockerfile | 24 +++++++------- fteproxy/arm/docker-compose.yml | 26 ++++++++------- fteproxy/docker-compose.yml | 56 ++++++++++++++++--------------- 6 files changed, 122 insertions(+), 105 deletions(-) diff --git a/fteproxy/Dockerfile b/fteproxy/Dockerfile index 6f79bed..8cf30cf 100644 --- a/fteproxy/Dockerfile +++ b/fteproxy/Dockerfile @@ -2,8 +2,8 @@ # Dockerfile for fteproxy # -FROM alpine -MAINTAINER kev +FROM alpine:3 +MAINTAINER EasyPi Software Foundation RUN set -xe \ && apk add -U build-base \ @@ -19,17 +19,17 @@ RUN set -xe \ python-dev \ && rm -rf /root/.cache /var/cache/apk/* -ENV MODE server -ENV UPSTREAM_FORMAT manual-http-request -ENV DOWNSTREAM_FORMAT manual-http-response -ENV CLIENT_IP 127.0.0.1 -ENV CLIENT_PORT 8079 -ENV SERVER_IP 127.0.0.1 -ENV SERVER_PORT 8080 -ENV PROXY_IP 127.0.0.1 -ENV PROXY_PORT 8081 -ENV RELEASE 20131224 -ENV KEY FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 +ENV MODE=server +ENV UPSTREAM_FORMAT=manual-http-request +ENV DOWNSTREAM_FORMAT=manual-http-response +ENV CLIENT_IP=127.0.0.1 +ENV CLIENT_PORT=8079 +ENV SERVER_IP=127.0.0.1 +ENV SERVER_PORT=8080 +ENV PROXY_IP=127.0.0.1 +ENV PROXY_PORT=8081 +ENV RELEASE=20131224 +ENV KEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 CMD fteproxy --mode $MODE \ --upstream-format $UPSTREAM_FORMAT \ diff --git a/fteproxy/Dockerfile.debian b/fteproxy/Dockerfile.debian index 1d9e3a4..ca0a30a 100644 --- a/fteproxy/Dockerfile.debian +++ b/fteproxy/Dockerfile.debian @@ -3,14 +3,14 @@ # FROM debian:jessie -MAINTAINER kev +MAINTAINER EasyPi Software Foundation -ENV FTE_VER 0.2.18 -ENV FTE_SYS linux -ENV FTE_ARCH x86_64 -ENV FTE_URL https://fteproxy.org/dist/${FTE_VER}/fteproxy-${FTE_VER}-${FTE_SYS}-${FTE_ARCH}.tar.gz -ENV FTE_FILE fteproxy.tar.gz -ENV FTE_MD5 81e1f941df9fa202c08dd73d5def0d33 +ENV FTE_VER=0.2.18 +ENV FTE_SYS=linux +ENV FTE_ARCH=x86_64 +ENV FTE_URL=https://fteproxy.org/dist/${FTE_VER}/fteproxy-${FTE_VER}-${FTE_SYS}-${FTE_ARCH}.tar.gz +ENV FTE_FILE=fteproxy.tar.gz +ENV FTE_MD5=81e1f941df9fa202c08dd73d5def0d33 RUN apt-get update \ && apt-get install -y curl \ @@ -20,17 +20,17 @@ RUN apt-get update \ && tar xzf ${FTE_FILE} --strip 1 -C /fteproxy \ && rm -rf ${FTE_FILE} /var/lib/apt/lists/* -ENV MODE server -ENV UPSTREAM_FORMAT manual-http-request -ENV DOWNSTREAM_FORMAT manual-http-response -ENV CLIENT_IP 127.0.0.1 -ENV CLIENT_PORT 8079 -ENV SERVER_IP 127.0.0.1 -ENV SERVER_PORT 8080 -ENV PROXY_IP 127.0.0.1 -ENV PROXY_PORT 8081 -ENV RELEASE 20131224 -ENV KEY FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 +ENV MODE=server +ENV UPSTREAM_FORMAT=manual-http-request +ENV DOWNSTREAM_FORMAT=manual-http-response +ENV CLIENT_IP=127.0.0.1 +ENV CLIENT_PORT=8079 +ENV SERVER_IP=127.0.0.1 +ENV SERVER_PORT=8080 +ENV PROXY_IP=127.0.0.1 +ENV PROXY_PORT=8081 +ENV RELEASE=20131224 +ENV KEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 CMD /fteproxy/fteproxy.bin --mode $MODE \ --upstream-format $UPSTREAM_FORMAT \ diff --git a/fteproxy/README.md b/fteproxy/README.md index e9df06f..2800afb 100644 --- a/fteproxy/README.md +++ b/fteproxy/README.md @@ -25,33 +25,44 @@ In the following example, I will setup a server/client pair to connect www.googl ## Create a docker-compose.yml ```yaml -server: - image: vimagick/fteproxy - ports: - - "80" - environment: - - MODE=server - - SERVER_IP=0.0.0.0 - - SERVER_PORT=80 - - PROXY_IP=www.google.com - - PROXY_PORT=80 - - KEY=CB2FBA2BC70490526E749E01BB050F6B555964290DFF58CF24785B4A093F7B18 +version: "3.8" -client: - image: vimagick/fteproxy - ports: - - "9009:80" - links: - - server - environment: - - MODE=client - - SERVER_IP=server - - SERVER_PORT=80 - - CLIENT_IP=0.0.0.0 - - CLIENT_PORT=80 - - KEY=CB2FBA2BC70490526E749E01BB050F6B555964290DFF58CF24785B4A093F7B18 +services: + + server: + image: vimagick/fteproxy + ports: + - "4911:4911" + environment: + - MODE=server + - SERVER_IP=0.0.0.0 + - SERVER_PORT=4911 + - PROXY_IP=openvpn + - PROXY_PORT=1194 + - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 + extra_hosts: + - openvpn:1.2.3.4 + restart: unless-stopped + + client: + image: vimagick/fteproxy + ports: + - "1194:1194" + environment: + - MODE=client + - SERVER_IP=openvpn.easypi.pro + - SERVER_PORT=4911 + - CLIENT_IP=0.0.0.0 + - CLIENT_PORT=1194 + - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 + restart: unless-stopped ``` +You need to split the docker-compose.yml into two parts: + +- server: to mask a tcp service +- client: to unmask the service + > To generate random key: > `xxd -u -p -c32 /dev/urandom | head -n1` diff --git a/fteproxy/arm/Dockerfile b/fteproxy/arm/Dockerfile index f1ad8c0..ab48e67 100644 --- a/fteproxy/arm/Dockerfile +++ b/fteproxy/arm/Dockerfile @@ -2,7 +2,7 @@ # Dockerfile for fteproxy-arm # -FROM easypi/alpine-arm +FROM alpine:3 MAINTAINER EasyPi Software Foundation RUN set -xe \ @@ -19,17 +19,17 @@ RUN set -xe \ python-dev \ && rm -rf /root/.cache /var/cache/apk/* -ENV MODE server -ENV UPSTREAM_FORMAT manual-http-request -ENV DOWNSTREAM_FORMAT manual-http-response -ENV CLIENT_IP 127.0.0.1 -ENV CLIENT_PORT 8079 -ENV SERVER_IP 127.0.0.1 -ENV SERVER_PORT 8080 -ENV PROXY_IP 127.0.0.1 -ENV PROXY_PORT 8081 -ENV RELEASE 20131224 -ENV KEY FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 +ENV MODE=server +ENV UPSTREAM_FORMAT=manual-http-request +ENV DOWNSTREAM_FORMAT=manual-http-response +ENV CLIENT_IP=127.0.0.1 +ENV CLIENT_PORT=8079 +ENV SERVER_IP=127.0.0.1 +ENV SERVER_PORT=8080 +ENV PROXY_IP=127.0.0.1 +ENV PROXY_PORT=8081 +ENV RELEASE=20131224 +ENV KEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 CMD fteproxy --mode $MODE \ --upstream-format $UPSTREAM_FORMAT \ diff --git a/fteproxy/arm/docker-compose.yml b/fteproxy/arm/docker-compose.yml index 0856b07..c46307f 100644 --- a/fteproxy/arm/docker-compose.yml +++ b/fteproxy/arm/docker-compose.yml @@ -1,12 +1,14 @@ -fteproxy: - image: easypi/fteproxy-arm - ports: - - "1194:1194" - environment: - - MODE=client - - SERVER_IP=vpn.easypi.info - - SERVER_PORT=4911 - - CLIENT_IP=0.0.0.0 - - CLIENT_PORT=1194 - - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 - restart: always +version: "3.8" +services: + fteproxy: + image: easypi/fteproxy-arm + ports: + - "1194:1194" + environment: + - MODE=client + - SERVER_IP=vpn.easypi.info + - SERVER_PORT=4911 + - CLIENT_IP=0.0.0.0 + - CLIENT_PORT=1194 + - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 + restart: unless-stopped diff --git a/fteproxy/docker-compose.yml b/fteproxy/docker-compose.yml index ab28ec5..46343f6 100644 --- a/fteproxy/docker-compose.yml +++ b/fteproxy/docker-compose.yml @@ -1,27 +1,31 @@ -master: - image: vimagick/fteproxy - ports: - - "4911:4911" - external_links: - - openvpn_server_1:openvpn - environment: - - MODE=server - - SERVER_IP=0.0.0.0 - - SERVER_PORT=4911 - - PROXY_IP=openvpn - - PROXY_PORT=1194 - - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 - restart: always +version: "3.8" -bridge: - image: vimagick/fteproxy - ports: - - "1194:1194" - environment: - - MODE=client - - SERVER_IP=openvpn.easypi.pro - - SERVER_PORT=4911 - - CLIENT_IP=0.0.0.0 - - CLIENT_PORT=1194 - - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 - restart: always +services: + + server: + image: vimagick/fteproxy + ports: + - "4911:4911" + environment: + - MODE=server + - SERVER_IP=0.0.0.0 + - SERVER_PORT=4911 + - PROXY_IP=openvpn + - PROXY_PORT=1194 + - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 + extra_hosts: + - openvpn:1.2.3.4 + restart: unless-stopped + + client: + image: vimagick/fteproxy + ports: + - "1194:1194" + environment: + - MODE=client + - SERVER_IP=openvpn.easypi.pro + - SERVER_PORT=4911 + - CLIENT_IP=0.0.0.0 + - CLIENT_PORT=1194 + - KEY=66754b8113ea7a218b7613f73f7e13b1e91790216f659b5f78b903b34c654741 + restart: unless-stopped