Skip to content

Commit

Permalink
ppc support
Browse files Browse the repository at this point in the history
  • Loading branch information
rootTHC committed Mar 26, 2024
1 parent 62a7398 commit 1c6185a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/stealth-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ jobs:
ssl: linux-generic32
- arch: powerpc
cc: powerpc-linux-muslsf # Big Endian, 32bit
ssl: linux-ppc
# ssl: linux-ppc
ssl: linux-generic32
- arch: powerpc64
cc: powerpc64-linux-musl # Big Endian, 64bit
ssl: linux-generic64
Expand Down
22 changes: 15 additions & 7 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@

URL_BASE_CDN="https://cdn.gsocket.io"
URL_BASE_X="https://gsocket.io"

# -----BEGIN deploy_server.sh HOOK-----
# These stubs are filled out by deploy_server.sh:
IS_DEPLOY_SERVER=
URL_BASE=
[[ -n $URL_BASE ]] && [[ -z $GS_URL_BASE ]] && GS_URL_BASE="$URL_BASE"
[[ -n $IS_DEPLOY_SERVER ]] && unset GS_BRANCH
gs_deploy_webhook=
GS_WEBHOOK_404_OK=
[[ -n $gs_deploy_webhook ]] && GS_WEBHOOK="$gs_deploy_webhook"
unset gs_deploy_webhook
# -----END deploy_server.sh HOOK-----

[[ -n $GS_URL_BASE ]] && {
URL_BASE_CDN="${GS_URL_BASE}"
URL_BASE_X="${GS_URL_BASE}"
Expand All @@ -90,12 +103,6 @@ URL_BIN_FULL="${URL_BASE_CDN}/full" # full version (with -h working)
}
[[ -n $GS_URL_DEPLOY ]] && URL_DEPLOY="${GS_URL_DEPLOY}" || URL_DEPLOY="${URL_BASE_X}/x"

# STUBS for deploy_server.sh to fill out:
gs_deploy_webhook=
GS_WEBHOOK_404_OK=
[[ -n $gs_deploy_webhook ]] && GS_WEBHOOK="$gs_deploy_webhook"
unset gs_deploy_webhook

# WEBHOOKS are executed after a successfull install
# shellcheck disable=SC2016 #Expressions don't expand in single quotes, use double quotes for that.
msg='$(hostname) --- $(uname -rom) --- gs-netcat -i -s ${GS_SECRET}'
Expand Down Expand Up @@ -1148,7 +1155,7 @@ WARN_EXECFAIL()
ls -al "${DSTBIN}"
echo -e "${CN}--> ${WARN_EXECFAIL_MSG}
--> GS_OSARCH=${OSARCH}
--> ${CDC}GS_DSTDIR=${DSTBIN%/*}${CN}
--> GS_DSTDIR=${DSTBIN%/*}
--> Try to set ${CDC}export GS_DEBUG=1${CN} and deploy again.
--> Please send that output to ${CM}[email protected]${CN} to get it fixed.
--> Alternatively, try the static binary from
Expand Down Expand Up @@ -1797,6 +1804,7 @@ try_network()
FAIL_OUT
[[ -n "$ERR_LOG" ]] && echo >&2 "$ERR_LOG"
WARN_EXECFAIL
errexit
}

# install <osarch> <srcpackage>
Expand Down
51 changes: 32 additions & 19 deletions deploy/deploy_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,31 @@
# LOG=results.log bash -c "$(curl -fsSL https://gsocket.io/deploy/xs)"

[[ -z $PORT ]] && PORT="32803"
[[ -z $GS_BRANCH ]] && GS_BRANCH="master"
BINDIR="${GS_BRANCH}/bin"
[[ $GS_BRANCH == master ]] && BINDIR="bin"

DEPLOY_SH_NAME="y"

DATA_DIR="gs-www-data"
packages=()
packages+=("x86_64-alpine.tar.gz")
packages+=("aarch64-linux.tar.gz")
packages+=("arm-linux.tar.gz")
packages+=("i386-alpine.tar.gz")
packages+=("i686-cygwin.tar.gz")
packages+=("mips32-alpine.tar.gz")
packages+=("mips64-alpine.tar.gz")
packages+=("mipsel32-alpine.tar.gz")
packages+=("x86_64-osx.tar.gz")
packages+=("x86_64-freebsd.tar.gz")
packages+=("x86_64-openbsd.tar.gz")
packages+=("linux-x86_64")
packages+=("linux-aarch64")
packages+=("linux-mips64")
packages+=("linux-mips32")
packages+=("linux-mipsel")
packages+=("linux-i686")
packages+=("linux-arm")
packages+=("linux-armv6")
packages+=("linux-armv7l")
packages+=("linux-powerpc")
packages+=("linux-powerpc64")
packages+=("linux-powerpcle")
packages+=("linux-powerpc64le")
# packages+=("i686-cygwin.tar.gz")
packages+=("macOS-x86_64")
packages+=("freebsd-x86_64")
packages+=("openbsd-x86_64")

[[ -t 1 ]] && {
CY="\033[1;33m" # yellow
Expand Down Expand Up @@ -124,14 +136,14 @@ command -v python >/dev/null || {

[[ ! -d "${DATA_DIR}/bin" ]] && mkdir -p "${DATA_DIR}/bin"
[[ ! -f "${DATA_DIR}/y" ]] && {
echo -e "Downloading ${CDY}x${CN} (e.g. deploy.sh)"
curl -fsSL 'https://github.com/hackerschoice/gsocket/raw/master/deploy/deploy.sh' --output "${DATA_DIR}/y"
echo -e "Downloading ${CDY}${DEPLOY_SH_NAME}${CN} (e.g. deploy.sh)"
curl -fsSL "https://github.com/hackerschoice/gsocket/raw/${GS_BRANCH}/deploy/deploy.sh" --output "${DATA_DIR}/${DEPLOY_SH_NAME}"
}

for n in "${packages[@]}"; do
[[ -f "${DATA_DIR}/bin/gs-netcat_${n}" ]] && continue
echo -e "Downloading ${CDY}gs-netcat_${n}${CN}..."
curl -fsSL "https://github.com/hackerschoice/binary/raw/main/gsocket/bin/gs-netcat_${n}" --output "${DATA_DIR}/bin/gs-netcat_${n}"
[[ -f "${DATA_DIR}/bin/gs-netcat_mini-${n}" ]] && continue
echo -e "Downloading ${CDY}gs-netcat_mini-${n}${CN}..."
curl -fsSL "https://gsocket.io/${BINDIR}/gs-netcat_mini-${n}" --output "${DATA_DIR}/bin/gs-netcat_mini-${n}"
done

start "Cloudflare" "cloudflare.log" cloudflared tunnel --url "http://127.0.0.1:${PORT}" --no-autoupdate
Expand All @@ -157,9 +169,10 @@ str="${str//[^[:alnum:]].-}" # sanitize
URL_BASE="https://${str}"

# update deploy.sh
sed "s|^URL_BASE=.*|URL_BASE=\"${URL_BASE}\"|" -i "${DATA_DIR}/y"
sed "s|^gs_deploy_webhook=.*|gs_deploy_webhook='${URL_BASE}/results.php?s=\${GS_SECRET}'|" -i "${DATA_DIR}/y"
sed 's|^GS_WEBHOOK_404_OK=.*|GS_WEBHOOK_404_OK=1|' -i "${DATA_DIR}/y"
sed "s|^URL_BASE=.*|URL_BASE=\"${URL_BASE}\"|" -i "${DATA_DIR}/${DEPLOY_SH_NAME}"
sed "s|^IS_DEPLOY_SERVER=.*|IS_DEPLOY_SERVER=1|" -i "${DATA_DIR}/${DEPLOY_SH_NAME}"
sed "s|^gs_deploy_webhook=.*|gs_deploy_webhook='${URL_BASE}/results.php?s=\${GS_SECRET}'|" -i "${DATA_DIR}/${DEPLOY_SH_NAME}"
sed 's|^GS_WEBHOOK_404_OK=.*|GS_WEBHOOK_404_OK=1|' -i "${DATA_DIR}/${DEPLOY_SH_NAME}"

echo -e "\
${CDG}All successfull deployments will be shown below.${CN}
Expand Down

0 comments on commit 1c6185a

Please sign in to comment.