Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04e0332

Browse files
committed
bump to alpine 3.16
1 parent 50ecf85 commit 04e0332

4 files changed

Lines changed: 27 additions & 21 deletions

File tree

.github/workflows/buildPush.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
with:
6868
builder: ${{ steps.buildx.outputs.name }}
6969
context: .
70+
build-args: VER=3.16
7071
file: ./Dockerfile
7172
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
7273
push: ${{env.DOCKER_PUSH }}

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM alpine:3.15
1+
ARG VER=3.15.2
2+
FROM alpine:${VER}
23
LABEL maintainer=edgd1er
34

45
ENV OVPN_CONFIG_DIR="/app/openvpn/config" \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ services:
9999
- OPENVPN_PARAMETERS= #optional, empty by default, overrides openvpn config file with parameters
100100
- OPENVPN_LOGLEVEL= #Optional, define openvpn verbose level 0-9
101101
- EXIT_WHEN_IP_NOTASEXPECTED=0 # when detected ip is not belonging to remote vpn network
102-
- LOCAL_NETWORK=192.168.53.0/24
102+
- LOCAL_NETWORK=192.168.0.0/24 # allow network access for socks and tinyproxy.
103103
- TINYPORT=8888 #define tinyport inside the container, optional, 8888 by default,
104104
- TINY_LOGLEVEL=Error #Critical (least verbose), Error, Warning, Notice, Connect (to log connections without Info's noise), Info
105105
- DANTE_LOGLEVEL="error" #Optional, error by default, available values: connect disconnect error data

tests.sh

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,32 @@ SOCK_PORT=1081
77
FAILED=0
88
INTERVAL=4
99

10-
#Main
11-
echo "Building and starting image"
12-
docker compose -f docker-compose.yml up -d --build
13-
echo "Waiting for the container to be up.(every ${INTERVAL} sec)"
14-
logs=""
15-
while [ 0 -eq $(echo $logs| grep -c "Initialization Sequence Completed") ]
16-
do
17-
logs="$(docker compose logs)"
18-
sleep ${INTERVAL}
19-
((n++))
20-
echo "loop: ${n}"
21-
[[ ${n} -eq 15 ]] && break ||true
22-
done
23-
24-
25-
docker compose logs
10+
#Functions
11+
12+
buildAndWait() {
13+
echo "Stopping and removing running containers"
14+
docker compose down -v
15+
echo "Building and starting image"
16+
docker compose -f docker-compose.yml up -d --build
17+
echo "Waiting for the container to be up.(every ${INTERVAL} sec)"
18+
logs=""
19+
while [ 0 -eq $(echo $logs | grep -c "Initialization Sequence Completed") ]; do
20+
logs="$(docker compose logs)"
21+
sleep ${INTERVAL}
22+
((n++))
23+
echo "loop: ${n}"
24+
[[ ${n} -eq 15 ]] && break || true
25+
done
26+
docker compose logs
27+
}
2628

29+
#Main
30+
[[ "localhost" == ${PROXY_HOST} ]] && buildAndWait
2731
for PORT in ${HTTP_PORT} ${SOCK_PORT}; do
2832
msg="Test connection to port ${PORT}: "
2933
if [ 0 -eq $(echo "" | nc -v -q 2 ${PROXY_HOST} ${PORT} 2>&1 | grep -c "] succeeded") ]; then
3034
msg+=" Failed"
31-
((FAILED+=1))
35+
((FAILED += 1))
3236
else
3337
msg+=" OK"
3438
fi
@@ -40,15 +44,15 @@ if [[ $? -eq 0 ]]; then
4044
echo "IP is ${IP}"
4145
else
4246
echo "curl through http proxy to https://ifconfig.me/ip failed"
43-
((FAILED+=1))
47+
((FAILED += 1))
4448
fi
4549

4650
IP=$(curl -sqx socks5://${PROXY_HOST}:${SOCK_PORT} "https://ifconfig.me/ip")
4751
if [[ $? -eq 0 ]]; then
4852
echo "IP is ${IP}"
4953
else
5054
echo "curl through socks proxy to https://ifconfig.me/ip failed"
51-
((FAILED+=1))
55+
((FAILED += 1))
5256
fi
5357

5458
docker compose down

0 commit comments

Comments
 (0)