Skip to content

Commit

Permalink
feat(derper): add DERP_CONFIG
Browse files Browse the repository at this point in the history
add DERP_CONFIG

Signed-off-by: kovacs <[email protected]>
  • Loading branch information
mritd committed Jun 9, 2023
1 parent d4792ce commit 05567be
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions derper/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ build:

ENV DERP_ADDR :8080
ENV DERP_HTTP_PORT 8080
ENV DERP_CONFIG /var/lib/derper/derper.key
ENV DERP_DOMAIN your.domain.com
ENV DERP_CERT_MODE letsencrypt
ENV DERP_CERT_DIR /var/run/tailscale
Expand Down
21 changes: 19 additions & 2 deletions derper/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ if [ "$#" -eq 0 ]; then
if [ -n "${DERP_HTTP_PORT}" ]; then
cmd+=" --http-port=${DERP_HTTP_PORT}"
fi

if [ -n "${DERP_DOMAIN}" ]; then
cmd+=" --hostname=${DERP_DOMAIN}"
fi

if [ -n "${DERP_CONFIG}" ]; then
cmd+=" -c=${DERP_CONFIG}"
fi

if [ -n "${DERP_CERT_MODE}" ]; then
cmd+=" --certmode=${DERP_CERT_MODE}"
fi
Expand All @@ -38,7 +42,20 @@ if [ "$#" -eq 0 ]; then
cmd+=" --verify-clients=${DERP_VERIFY_CLIENTS}"
fi

echo "Run Command: ${cmd}"
cat <<EOF
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░ ░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░
▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒
▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓ ▓▓ ▓ ▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓ ▓▓ ▓▓ ▓▓▓ ▓
▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓ ▓▓ ▓ ▓▓▓ ▓▓ ▓▓▓▓▓ ▓▓▓ ▓▓ ▓ ▓
▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓ ▓▓ ▓ ▓▓▓▓▓ ▓▓ ▓▓▓▓ ▓▓▓ ▓▓ ▓ ▓▓▓▓▓▓▓▓
█████ ███████ █ █ █ █ █████ ███ █ █ ███ ███
█████████████████████████████████████████████████████████████████████████
EOF

echo "[---] Exec Command: ${cmd}"

exec ${cmd}
else
Expand Down

0 comments on commit 05567be

Please sign in to comment.