Skip to content

Commit

Permalink
socat pgyvpn
Browse files Browse the repository at this point in the history
  • Loading branch information
aozhuochao committed Apr 22, 2024
1 parent e9c8782 commit 2bae3d7
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 27 deletions.
85 changes: 61 additions & 24 deletions .github/workflows/pgyvpn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,51 @@ jobs:

# ########## 构建 ###########################

- name: 构建镜像 adockero/pgyvpn:tinyproxy-2.2.2

# ubuntu-------------------------------------------
- name: 构建镜像 adockero/pgyvpn:ubuntu
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:tinyproxy-2.2.2
tags: adockero/pgyvpn:ubuntu
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./pgyvpn/pgyvpn-2.2.2
file: "./pgyvpn/pgyvpn-2.2.2/Dockerfile"
context: ./
file: "./pgyvpn/ubuntu/Dockerfile"
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
# build-args: NODE_VERSION=14
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true
labels: true

- name: 构建镜像 adockero/pgyvpn:tinyproxy
- name: 构建镜像 adockero/pgyvpn:ubuntu-socat
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:tinyproxy
tags: adockero/pgyvpn:ubuntu-socat
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./
file: "./pgyvpn/Dockerfile"
file: "./pgyvpn/ubuntu/Dockerfile.socat"
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
# build-args: NODE_VERSION=14
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true
labels: true


- name: 构建镜像 adockero/pgyvpn:tinyproxy-sshd
- name: 构建镜像 adockero/pgyvpn:ubuntu-socat-sshd
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:tinyproxy-sshd
tags: adockero/pgyvpn:ubuntu-socat-sshd
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./
file: "./pgyvpn/tinyproxy-sshd/Dockerfile"
file: "./pgyvpn/sshd/Dockerfile.ubuntu.socat"
# Always attempt to pull a newer version of the image
pull: true
push: true
Expand All @@ -83,15 +85,14 @@ jobs:
# Adds labels with git repository information to the built image
labels: true

# ubuntu-------------------------------------------
- name: 构建镜像 adockero/pgyvpn:ubuntu
- name: 构建镜像 adockero/pgyvpn:ubuntu-tinyproxy
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:ubuntu
tags: adockero/pgyvpn:ubuntu-tinyproxy
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./
file: "./pgyvpn/ubuntu/Dockerfile"
file: "./pgyvpn/ubuntu/Dockerfile.tinyproxy"
# Always attempt to pull a newer version of the image
pull: true
push: true
Expand All @@ -101,14 +102,14 @@ jobs:
# Adds labels with git repository information to the built image
labels: true

- name: 构建镜像 adockero/pgyvpn:ubuntu-tinyproxy
- name: 构建镜像 adockero/pgyvpn:ubuntu-tinyproxy-sshd
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:ubuntu-tinyproxy
tags: adockero/pgyvpn:ubuntu-tinyproxy-sshd
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./
file: "./pgyvpn/ubuntu/Dockerfile.tinyproxy"
file: "./pgyvpn/sshd/Dockerfile.ubuntu"
# Always attempt to pull a newer version of the image
pull: true
push: true
Expand All @@ -118,24 +119,60 @@ jobs:
# Adds labels with git repository information to the built image
labels: true

- name: 构建镜像 adockero/pgyvpn:ubuntu-tinyproxy-sshd
# ubuntu-------------------------------------------


- name: 构建镜像 adockero/pgyvpn:tinyproxy-2.2.2
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:ubuntu-tinyproxy-sshd
tags: adockero/pgyvpn:tinyproxy-2.2.2
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./pgyvpn/pgyvpn-2.2.2
file: "./pgyvpn/pgyvpn-2.2.2/Dockerfile"
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
# build-args: NODE_VERSION=14
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true

- name: 构建镜像 adockero/pgyvpn:tinyproxy
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:tinyproxy
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./
file: "./pgyvpn/tinyproxy-sshd/Dockerfile.ubuntu"
file: "./pgyvpn/Dockerfile"
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
# build-args: NODE_VERSION=14
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true
labels: true

# ubuntu-------------------------------------------

- name: 构建镜像 adockero/pgyvpn:tinyproxy-sshd
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/pgyvpn:tinyproxy-sshd
# Path to the Dockerfile (Default is '{path}/Dockerfile')
context: ./
file: "./pgyvpn/sshd/Dockerfile"
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
# build-args: NODE_VERSION=14
# APK_ARG=rsync
# Adds labels with git repository information to the built image
labels: true


# - name: 构建镜像 adockero/node-service:node-11-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ ENV SSHD_PASSWORD=''
COPY ./common/open-sshd-passwd.sh /open-sshd-passwd.sh


COPY ./pgyvpn/tinyproxy-sshd/docker-entrypoint.sh /docker-entrypoint-sshd.sh
COPY ./pgyvpn/sshd/docker-entrypoint.sh /docker-entrypoint-sshd.sh
ENTRYPOINT [ "/docker-entrypoint-sshd.sh" ]

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ ENV SSHD_PASSWORD=''
COPY ./common/open-sshd-passwd.sh /open-sshd-passwd.sh


COPY ./pgyvpn/tinyproxy-sshd/docker-entrypoint.sh /docker-entrypoint-sshd.sh
COPY ./pgyvpn/sshd/docker-entrypoint.sh /docker-entrypoint-sshd.sh
ENTRYPOINT [ "/docker-entrypoint-sshd.sh" ]

16 changes: 16 additions & 0 deletions pgyvpn/sshd/Dockerfile.ubuntu.socat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM adockero/pgyvpn:ubuntu-socat


RUN apt update \
&& apt install -y openssh-server \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get clean

ENV SSHD_PORT 22
ENV SSHD_PASSWORD=''
COPY ./common/open-sshd-passwd.sh /open-sshd-passwd.sh


COPY ./pgyvpn/sshd/docker-entrypoint.sh /docker-entrypoint-sshd.sh
ENTRYPOINT [ "/docker-entrypoint-sshd.sh" ]

File renamed without changes.
29 changes: 29 additions & 0 deletions pgyvpn/ubuntu/Dockerfile.socat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

FROM adockero/pgyvpn:ubuntu


RUN apt update \
&& apt install -y socat \
&& mv /docker-entrypoint.sh /usr/share/pgyvpn/script/pgystart \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get clean


# COPY --chmod 0755 docker-entrypoint.sh /docker-entrypoint.sh
ENV PROXY_IP ""
ENV PROXY_PORT ""
COPY ./pgyvpn/ubuntu/docker-entrypoint.socat.sh /docker-entrypoint.sh


EXPOSE 8888

# 一次脚本
COPY ./common/one-exec.sh /one-exec.sh
ENV ONE_EXEC ""

ENTRYPOINT [ "/docker-entrypoint.sh" ]





2 changes: 1 addition & 1 deletion pgyvpn/ubuntu/Dockerfile.tinyproxy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM adockero/pgyvpn:ubuntu


RUN apt update \
&& apt install -y tinyproxy \
&& apt install -y tinyproxy psmisc \
&& ln -s $(which tinyproxy) /usr/sbin/ \
&& mkdir -p /usr/share/pgyvpn/script/ \
&& mv /docker-entrypoint.sh /usr/share/pgyvpn/script/pgystart \
Expand Down
15 changes: 15 additions & 0 deletions pgyvpn/ubuntu/docker-entrypoint.socat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash


mkdir -p /var/log/oray/
touch /var/log/oray/pgyvpn/pgyvistor.log

(sleep 2 && tail -f /var/log/oray/pgyvpn/pgyvistor.log) &

/one-exec.sh

(sleep 1 && /usr/share/pgyvpn/script/pgystart) &

exec socat -v TCP-LISTEN:8888,fork,reuseaddr TCP:$PROXY_IP:$PROXY_PORT "$@"


0 comments on commit 2bae3d7

Please sign in to comment.