Skip to content

Commit

Permalink
Make exports optional (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelicianoTech authored Sep 24, 2023
1 parent c8a68c7 commit 84f8b4d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/commands/connect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ parameters:
at the following URL: https://tailscale.com/kb/1111/ephemeral-nodes/
type: env_var_name
default: "TS_AUTHKEY"
export-proxies:
description: "Whether or not to export the proxy environment variables."
type: boolean
default: true
proxy-address:
type: string
default: "localhost"
Expand All @@ -34,8 +38,14 @@ steps:
command: |
HOSTNAME="circleci-$(cat /etc/hostname)"
tailscale --socket=/tmp/tailscaled.sock up --authkey ${<< parameters.auth-key >>} --hostname=${HOSTNAME} --accept-routes --timeout=10s
echo "export ALL_PROXY=socks5://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export HTTP_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export HTTPS_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export http_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export https_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
- when:
condition: << parameters.export-proxies >>
steps:
- run:
name: "Export Tailscale Proxy Envars"
command: |
echo "export ALL_PROXY=socks5://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export HTTP_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export HTTPS_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export http_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV
echo "export https_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV

0 comments on commit 84f8b4d

Please sign in to comment.