-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stcp, xtcp, sudp: support allow_users and specified server user (#3472)
- Loading branch information
Showing
17 changed files
with
355 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ packages/ | |
release/ | ||
test/bin/ | ||
vendor/ | ||
lastversion/ | ||
dist/ | ||
.idea/ | ||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
|
||
OS="$(go env GOOS)" | ||
ARCH="$(go env GOARCH)" | ||
|
||
if [ "${TARGET_OS}" ]; then | ||
OS="${TARGET_OS}" | ||
fi | ||
if [ "${TARGET_ARCH}" ]; then | ||
ARCH="${TARGET_ARCH}" | ||
fi | ||
|
||
# Determine the latest version by version number ignoring alpha, beta, and rc versions. | ||
if [ "${FRP_VERSION}" = "" ] ; then | ||
FRP_VERSION="$(curl -sL https://github.com/fatedier/frp/releases | \ | ||
grep -o 'releases/tag/v[0-9]*.[0-9]*.[0-9]*"' | sort -V | \ | ||
tail -1 | awk -F'/' '{ print $3}')" | ||
FRP_VERSION="${FRP_VERSION%?}" | ||
FRP_VERSION="${FRP_VERSION#?}" | ||
fi | ||
|
||
if [ "${FRP_VERSION}" = "" ] ; then | ||
printf "Unable to get latest frp version. Set FRP_VERSION env var and re-run. For example: export FRP_VERSION=1.0.0" | ||
exit 1; | ||
fi | ||
|
||
SUFFIX=".tar.gz" | ||
if [ "${OS}" = "windows" ] ; then | ||
SUFFIX=".zip" | ||
fi | ||
NAME="frp_${FRP_VERSION}_${OS}_${ARCH}${SUFFIX}" | ||
DIR_NAME="frp_${FRP_VERSION}_${OS}_${ARCH}" | ||
URL="https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/${NAME}" | ||
|
||
download_and_extract() { | ||
printf "Downloading %s from %s ...\n" "$NAME" "${URL}" | ||
if ! curl -o /dev/null -sIf "${URL}"; then | ||
printf "\n%s is not found, please specify a valid FRP_VERSION\n" "${URL}" | ||
exit 1 | ||
fi | ||
curl -fsLO "${URL}" | ||
filename=$NAME | ||
|
||
if [ "${OS}" = "windows" ]; then | ||
unzip "${filename}" | ||
else | ||
tar -xzf "${filename}" | ||
fi | ||
rm "${filename}" | ||
|
||
if [ "${TARGET_DIRNAME}" ]; then | ||
mv "${DIR_NAME}" "${TARGET_DIRNAME}" | ||
DIR_NAME="${TARGET_DIRNAME}" | ||
fi | ||
} | ||
|
||
download_and_extract | ||
|
||
printf "" | ||
printf "\nfrp %s Download Complete!\n" "$FRP_VERSION" | ||
printf "\n" | ||
printf "frp has been successfully downloaded into the %s folder on your system.\n" "$DIR_NAME" | ||
printf "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
#!/usr/bin/env bash | ||
#!/bin/sh | ||
|
||
ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd) | ||
SCRIPT=$(readlink -f "$0") | ||
ROOT=$(unset CDPATH && cd "$(dirname "$SCRIPT")/.." && pwd) | ||
|
||
which ginkgo &> /dev/null | ||
if [ $? -ne 0 ]; then | ||
ginkgo_command=$(which ginkgo 2>/dev/null) | ||
if [ -z "$ginkgo_command" ]; then | ||
echo "ginkgo not found, try to install..." | ||
go install github.com/onsi/ginkgo/v2/[email protected] | ||
fi | ||
|
||
debug=false | ||
if [ x${DEBUG} == x"true" ]; then | ||
if [ "x${DEBUG}" = "xtrue" ]; then | ||
debug=true | ||
fi | ||
logLevel=debug | ||
if [ x${LOG_LEVEL} != x"" ]; then | ||
logLevel=${LOG_LEVEL} | ||
if [ "${LOG_LEVEL}" ]; then | ||
logLevel="${LOG_LEVEL}" | ||
fi | ||
|
||
ginkgo -nodes=8 --poll-progress-after=30s ${ROOT}/test/e2e -- -frpc-path=${ROOT}/bin/frpc -frps-path=${ROOT}/bin/frps -log-level=${logLevel} -debug=${debug} | ||
frpcPath=${ROOT}/bin/frpc | ||
if [ "${FRPC_PATH}" ]; then | ||
frpcPath="${FRPC_PATH}" | ||
fi | ||
frpsPath=${ROOT}/bin/frps | ||
if [ "${FRPS_PATH}" ]; then | ||
frpsPath="${FRPS_PATH}" | ||
fi | ||
|
||
ginkgo -nodes=8 --poll-progress-after=60s ${ROOT}/test/e2e -- -frpc-path=${frpcPath} -frps-path=${frpsPath} -log-level=${logLevel} -debug=${debug} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.