20 lines
991 B
Bash
20 lines
991 B
Bash
printf '%s\n' __HWLAB_PROXY_SUMMARY_SHELL__ >&2
|
|
cat > /tmp/hwlab-github-proxy-connect.mjs <<'NODE_PROXY'
|
|
// __HWLAB_GIT_MIRROR_PROXY_CONNECT_MJS__
|
|
NODE_PROXY
|
|
chmod 0700 /tmp/hwlab-github-proxy-connect.mjs
|
|
cat > /tmp/hwlab-git-ssh-proxy.sh <<'SH_PROXY'
|
|
#!/bin/sh
|
|
exec ssh -i /root/.ssh/id_rsa -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/root/.ssh/known_hosts -o ConnectTimeout=15 -o ServerAliveInterval=5 -o ServerAliveCountMax=1 -o __HWLAB_PROXY_COMMAND_SHELL__ "$@"
|
|
SH_PROXY
|
|
chmod 0700 /tmp/hwlab-git-ssh-proxy.sh
|
|
export HTTP_PROXY=__HWLAB_PROXY_URL_SHELL__
|
|
export HTTPS_PROXY=__HWLAB_PROXY_URL_SHELL__
|
|
export ALL_PROXY=__HWLAB_PROXY_URL_SHELL__
|
|
export http_proxy=__HWLAB_PROXY_URL_SHELL__
|
|
export https_proxy=__HWLAB_PROXY_URL_SHELL__
|
|
export all_proxy=__HWLAB_PROXY_URL_SHELL__
|
|
export NO_PROXY=__HWLAB_PROXY_NO_PROXY_SHELL__
|
|
export no_proxy=__HWLAB_PROXY_NO_PROXY_SHELL__
|
|
export GIT_SSH=/tmp/hwlab-git-ssh-proxy.sh
|
|
unset GIT_SSH_COMMAND |