From 05072cb766a6200e859a402258ccf1fde1b1adec Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 9 Mar 2025 17:31:21 +0800 Subject: feat(service): mv config to docker imagei, better pri/pub git. --- services/docker/v2ray/v2ray-wrapper.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 services/docker/v2ray/v2ray-wrapper.sh (limited to 'services/docker/v2ray/v2ray-wrapper.sh') diff --git a/services/docker/v2ray/v2ray-wrapper.sh b/services/docker/v2ray/v2ray-wrapper.sh new file mode 100755 index 0000000..3887a0e --- /dev/null +++ b/services/docker/v2ray/v2ray-wrapper.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +die() { + echo "$@" >&2 + exit 1 +} + +[ -n "$CRUPEST_V2RAY_TOKEN" ] || die "CRUPEST_V2RAY_TOKEN is not set. It is used as password of v2ray tunnel." +[ -n "$CRUPEST_V2RAY_PATH" ] || die "CRUPEST_V2RAY_PATH is not set. It is used as the http endpoint." + +sed -e "s|@@CRUPEST_V2RAY_TOKEN@@|$CRUPEST_V2RAY_TOKEN|" \ + -e "s|@@CRUPEST_V2RAY_PATH@@|$CRUPEST_V2RAY_PATH|" \ + "/app/config.json.template" > /app/config.json + +exec /usr/bin/v2ray run -c /app/config.json -- cgit v1.2.3