mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-01-12 04:23:04 +02:00
add stunnel-arm
This commit is contained in:
parent
c3f14433de
commit
afc34a5fc2
@ -172,6 +172,7 @@ A collection of delicious docker recipes.
|
||||
- [x] shadowsocks-libev-arm :+1:
|
||||
- [x] squid
|
||||
- [x] stunnel
|
||||
- [x] stunnel-arm
|
||||
- [x] tor
|
||||
|
||||
## VPN
|
||||
|
15
stunnel/arm/Dockerfile
Normal file
15
stunnel/arm/Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# Dockerfile for stunnel-arm
|
||||
#
|
||||
|
||||
FROM easypi/alpine-arm
|
||||
|
||||
MAINTAINER kev <noreply@easypi.info>
|
||||
|
||||
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing stunnel
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME /etc/stunnel
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
12
stunnel/arm/docker-compose.yml
Normal file
12
stunnel/arm/docker-compose.yml
Normal file
@ -0,0 +1,12 @@
|
||||
bridge:
|
||||
image: easypi/stunnel-arm
|
||||
ports:
|
||||
- "1194:1194"
|
||||
environment:
|
||||
- CLIENT=yes
|
||||
- SERVICE=openvpn
|
||||
- ACCEPT=0.0.0.0:1194
|
||||
- CONNECT=server:4911
|
||||
extra_hosts:
|
||||
- server:1.2.3.4
|
||||
restart: always
|
26
stunnel/arm/docker-entrypoint.sh
Executable file
26
stunnel/arm/docker-entrypoint.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /etc/stunnel
|
||||
|
||||
cat > stunnel.conf <<_EOF_
|
||||
foreground = yes
|
||||
setuid = stunnel
|
||||
setgid = stunnel
|
||||
socket = l:TCP_NODELAY=1
|
||||
socket = r:TCP_NODELAY=1
|
||||
cert = /etc/stunnel/stunnel.pem
|
||||
client = ${CLIENT:-no}
|
||||
|
||||
[${SERVICE}]
|
||||
accept = ${ACCEPT}
|
||||
connect = ${CONNECT}
|
||||
_EOF_
|
||||
|
||||
if ! [ -f stunnel.pem ]
|
||||
then
|
||||
openssl req -x509 -nodes -newkey rsa:2048 -days 3650 -subj '/CN=stunnel' \
|
||||
-keyout stunnel.pem -out stunnel.pem
|
||||
chmod 600 stunnel.pem
|
||||
fi
|
||||
|
||||
exec stunnel "$@"
|
Loading…
Reference in New Issue
Block a user