Skip to content

Commit

Permalink
Force timeout during connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb authored and willnorris committed Sep 9, 2024
1 parent 0893401 commit 16d7e0b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ inputs:
description: 'Optional state directory to use (if unset, memory state is used)'
required: false
default: ''
timeout:
description: 'Timeout for `tailscale up`'
required: false
default: '2m'
runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -115,9 +119,10 @@ runs:
- name: Connect to Tailscale
shell: bash
env:
TAILSCALE_AUTHKEY: ${{ inputs.authkey }}
ADDITIONAL_ARGS: ${{ inputs.args }}
HOSTNAME: ${{ inputs.hostname }}
TAILSCALE_AUTHKEY: ${{ inputs.authkey }}
TIMEOUT: ${{ inputs.timeout }}
TS_EXPERIMENT_OAUTH_AUTHKEY: true
run: |
if [ -z "${HOSTNAME}" ]; then
Expand All @@ -127,4 +132,4 @@ runs:
TAILSCALE_AUTHKEY="${{ inputs['oauth-secret'] }}?preauthorized=true&ephemeral=true"
TAGS_ARG="--advertise-tags=${{ inputs.tags }}"
fi
timeout 5m sudo -E tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}
timeout --verbose --kill-after=1s ${TIMEOUT} sudo -E tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}

0 comments on commit 16d7e0b

Please sign in to comment.