mnt is good
parent
8986182548
commit
c314016a0b
15
build.sh
15
build.sh
|
|
@ -6,11 +6,16 @@ docker build -t caddsies .
|
|||
|
||||
docker run --rm -it \
|
||||
-p 2018:2018 \
|
||||
-v $(pwd)/caddyfile:/etc/caddy/Caddyfile \
|
||||
-v $(pwd)/stunfile:/etc/stunfile.conf \
|
||||
-v $(pwd)/stunserver.crt:/etc/stunserver.crt \
|
||||
-v $(pwd)/stunserver.key:/etc/stunserver.key \
|
||||
-v $(pwd)/stunclient.crt:/etc/stunclient.crt \
|
||||
-v $(pwd)/caddyfile:/mnt/Caddyfile \
|
||||
-v $(pwd)/stunfile:/mnt/stunfile.conf \
|
||||
-v $(pwd)/stunserver.crt:/mnt/stunserver.crt \
|
||||
-v $(pwd)/stunserver.key:/mnt/stunserver.key \
|
||||
-v $(pwd)/stunclient.crt:/mnt/stunclient.crt \
|
||||
-e CADDYFILE=/mnt/Caddyfile \
|
||||
-e STUNFILE=/mnt/stunfile.conf \
|
||||
-e STUNSERVERCRT=/mnt/stunserver.crt \
|
||||
-e STUNSERVERKEY=/mnt/stunserver.key \
|
||||
-e STUNCLIENTCRT=/mnt/stunclient.crt \
|
||||
caddsies:latest
|
||||
|
||||
#-p 2015:2015 \
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CADDYFILE="${CADDYFILE:-/etc/caddy/Caddyfile}"
|
||||
STUNFILE="${STUNFILE:-/etc/stunfile.conf}"
|
||||
|
||||
STUNSERVERCRT="${STUNSERVERCRT:-/etc/stunserver.crt}"
|
||||
STUNSERVERKEY="${STUNSERVERKEY:-/etc/stunserver.key}"
|
||||
STUNCLIENTKEY="${STUNCLIENTCRT:-/etc/stunclient.crt}"
|
||||
STUNCLIENTCRT="${STUNCLIENTCRT:-/etc/stunclient.crt}"
|
||||
|
||||
ROOTDIR="${ROOTDIR:-/srv/index}"
|
||||
SITE_ADDRESS="${SITE_ADDRESS:-localhost}"
|
||||
|
|
@ -37,9 +39,9 @@ fi
|
|||
|
||||
cp "$STUNFILE" "${STUNFILE}_overload"
|
||||
STUNFILE="${STUNFILE}_overload"
|
||||
sed -i -e 's/.etc.stunserver.crt/'"${STUNSERVERCRT}"'/g' "${STUNFILE}"
|
||||
sed -i -e 's/.etc.stunserver.key/'"${STUNSERVERKEY}"'/g' "${STUNFILE}"
|
||||
sed -i -e 's/.etc.stunclient.crt/'"${STUNCLIENTCRT}"'/g' "${STUNFILE}"
|
||||
sed -i -e 's/.etc.stunserver.crt/'"${STUNSERVERCRT//\//\\\/}"'/g' "${STUNFILE}"
|
||||
sed -i -e 's/.etc.stunserver.key/'"${STUNSERVERKEY//\//\\\/}"'/g' "${STUNFILE}"
|
||||
sed -i -e 's/.etc.stunclient.crt/'"${STUNCLIENTCRT//\//\\\/}"'/g' "${STUNFILE}"
|
||||
|
||||
stunnel "${STUNFILE}" > /stun-access.log 2>&1 &
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
; client = no
|
||||
|
||||
foreground=yes
|
||||
output=/stun-access.log
|
||||
verifyPeer=yes
|
||||
requireCert=yes
|
||||
|
||||
cert=replace
|
||||
key=/etc/stunserver.key
|
||||
CAfile=/etc/stunclient.crt
|
||||
|
||||
[default]
|
||||
accept=2018
|
||||
connect=2015
|
||||
Loading…
Reference in New Issue