mirror of
https://github.com/shokinn/.files.git
synced 2025-01-18 05:12:26 +00:00
Update proxy env configurations to support tailscale
This commit is contained in:
parent
c73a71f41c
commit
db210597cf
|
@ -369,6 +369,21 @@ setProxyEnv() {
|
||||||
export https_proxy="${PROXY_CFG_HTTPS}"
|
export https_proxy="${PROXY_CFG_HTTPS}"
|
||||||
export GIT_SSH_COMMAND='ssh -o ProxyCommand="/opt/homebrew/bin/corkscrew localhost 9000 %h %p"'
|
export GIT_SSH_COMMAND='ssh -o ProxyCommand="/opt/homebrew/bin/corkscrew localhost 9000 %h %p"'
|
||||||
|
|
||||||
|
[[ -d "{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macsys/Data" ]] && local TAILSCALEPATH="{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macsys/Data/tailscaled-env.txt" || true
|
||||||
|
[[ -d "{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macos.network-extension/Data" ]] && local TAILSCALEPATH="{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macos.network-extension/Data/tailscaled-env.txt" || true
|
||||||
|
[[ -d "/etc/tailscale" ]] && local TAILSCALEPATH="/etc/tailscale/tailscaled-env.txt" || true
|
||||||
|
if [[ -n ${TAILSCALEPATH} ]]; then
|
||||||
|
cat <<EOF > "${TAILSCALEPATH}"
|
||||||
|
NO_PROXY="${NO_PROXY_CFG}"
|
||||||
|
no_proxy="${NO_PROXY_CFG}"
|
||||||
|
HTTP_PROXY="${PROXY_CFG_HTTP}"
|
||||||
|
HTTPS_PROXY="${PROXY_CFG_HTTPS}"
|
||||||
|
http_proxy="${PROXY_CFG_HTTP}"
|
||||||
|
https_proxy="${PROXY_CFG_HTTPS}"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n✈️ exported zscaler proxy: ${HIGHLIGHT}http://${PROXY}${RESET}"
|
echo -e "\n✈️ exported zscaler proxy: ${HIGHLIGHT}http://${PROXY}${RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,6 +396,14 @@ unsetProxyEnv() {
|
||||||
unset https_proxy
|
unset https_proxy
|
||||||
unset GIT_SSH_COMMAND
|
unset GIT_SSH_COMMAND
|
||||||
|
|
||||||
|
[[ -d "{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macsys/Data" ]] && local TAILSCALEPATH="{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macsys/Data/tailscaled-env.txt" || true
|
||||||
|
[[ -d "{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macos.network-extension/Data" ]] && local TAILSCALEPATH="{{@@ env['HOME'] @@}}/Library/Containers/io.tailscale.ipn.macos.network-extension/Data/tailscaled-env.txt" || true
|
||||||
|
[[ -d "/etc/tailscale" ]] && local TAILSCALEPATH="/etc/tailscale/tailscaled-env.txt" || true
|
||||||
|
|
||||||
|
if [[ -n ${TAILSCALEPATH} ]]; then
|
||||||
|
rm "${TAILSCALEPATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n🔄 removed zscaler proxy cofiguration"
|
echo -e "\n🔄 removed zscaler proxy cofiguration"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue