Skip to content

Commit

Permalink
Support TLS no verification option (#13)
Browse files Browse the repository at this point in the history
* ✨ add new option of disable ssl verification

This commit is to add new runner option which disable SL/TLS verification
process. It option is set "1" when use proxy of using self-signed certificate.

* ✨ support tls no verify option
  • Loading branch information
kuju63 authored Mar 20, 2022
1 parent 96fcb21 commit bed3cf3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV http_proxy="" \
repo_name="" \
runner_name="" \
label="" \
group=""
group="" \
tls_no_verify=0

WORKDIR /actions-runner

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ Labeled to Self-Hosted-runner. Details see [here](https://docs.github.com/en/act
### group [Optional]

Add runner to specified self-hosted runner group. Self-hosted runner group is using Organization only.

### tls_no_verify[Optional]

Disable verify process for SSL/TLS. When Proxy server using self-signed certificate, this option is need to set "1".
2 changes: 2 additions & 0 deletions autoconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ else
GROUP="${group}"
fi

echo "TLS verify setting ${GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY}"

expect -c "
set timeout 10
spawn ./config.sh --url https://github.com/${owner}/${repo_name} --token ${TOKEN}
Expand Down
18 changes: 13 additions & 5 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

export TOKEN="${token}"

if [ -z "${token}" ]; then
if [ -z "${token_file}" ]; then
echo "token must be set" 1>&2
Expand All @@ -8,10 +10,16 @@ if [ -z "${token}" ]; then
echo "Token file does not found" 1>&2
exit 1
else
export TOKEN=$(cat $token_file)
secret_token="$(cat "$token_file")"
export TOKEN="$secret_token"
fi
else
export TOKEN="${token}"
fi

if [ -z "${tls_no_verify}" ]; then
export GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY=0
elif [ "$tls_no_verify" = "1" ]; then
echo "Disabled TLS verify check"
export GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY=1
fi

if [ ! -f "./.credentials" ]; then
Expand All @@ -20,12 +28,12 @@ fi

shutdown_handler() {
echo "Start shutdown process"
./config.sh remove --token $TOKEN
./config.sh remove --token "$TOKEN"
}

./run.sh &
pid="$!"
trap "shutdown_handler $pid" SIGTERM
trap '"shutdown_handler $pid"' SIGTERM
while kill -0 $pid > /dev/null 2>&1; do
wait
done

0 comments on commit bed3cf3

Please sign in to comment.