This is the proxy server which is used in the docker-worker which allows individual tasks to talk to various taskcluster services (auth, queue, scheduler) without hardcoding credentials into the containers themselves.
Credentials are expected to be passed via the TASKCLUSTER_CLIENT_ID
and TASKCLUSTER_ACCESS_TOKEN
environment variables.
For simplicity the below examples use localhost in general this is nicest when
used with the docker and linking the taskcluster/proxy
image into it.
# Start the server note that 2sz... is the task id
taskcluster-proxy 2szAy1JzSr6pyjVCdiTcoQ -p 60024
curl localhost:60024/v1/task/2szAy1JzSr6pyjVCdiTcoQ
(Note task endpoint is public purely for demonstration)
# Returned url will last one hour
curl localhost:60024/bewit --data 'https://queue.taskcluster.net/v1/task/2szAy1JzSr6pyjVCdiTcoQ'
The proxy server can be deployed directly by building proxy/main.go
but the prefered method is via the ./build.sh
script which will
compile the proxy server for linux/amd64 and deploy the server to a
docker image. Godep is required to run
this script.
./build.sh user/taskcluster-proxy-server
go get github.com/lightsofapollo/taskcluster-proxy
Follow usual go path setup + godeps.
# inside the project root which will look something like:
# $GOPATH/src/github.com/lightsofapollo/taskcluster-proxy
godep go build
To run the full test suites you need a taskcluster auth
token with at least scopes to the auth server "auth:*"
. The
credentials are expected to be in the TASKCLUSTER_CLIENT_ID
and
TASKCLUSTER_ACCESS_TOKEN
environment variables.