This repository provides an example of how to access Twingate protected resources in the Coder workspace.
Coder is an open-source platform for creating and managing developer workspaces on your preferred clouds and servers.
This repository provides an example of how to configure a Twingate client running with either a service account or as a regular user in Coder. Users will then be able to access resources such as internal databases or APIs that are Twingate protected directly from their Coder workspace.
In this example, we will demonstrate how to set up Twingate client in Coder by modifying the Coder Docker default templates.
- Twingate account
- Coder server installed
- Create a new Coder Docker starter template, for more details see here
- Replace the content of the default
main.tf
with docker_interactive.tf, for more details see here - Go to the Setting page of the template and set your Twingate Tenant Name in Variable, e.g. for
acme.twingate.com
, insertacme
- Create workspace and open the workspace terminal. run
twingate status
- If status is
authenticating
you should follow the URL displayed to authenticate - If status is
not running
, executetwingate start
followed by/usr/bin/twingate-notifier console
and follow the URL displayed to authenticate
- If status is
- Generate a Twingate Service Account Key, for more details see here
- Create a new Docker starter template, for more details see here
- Replace the content of the default
main.tf
with docker_serviceaccount.tf, for more details see here - Go to the Setting page of the template and set your Twingate Service Key Variable
- Create workspace and open the workspace terminal. run
twingate status
- it should returnonline
To see how we modified the default Docker template and how this would work for other types of templates, e.g. Kubernetes, see Other Template
- Twingate client requires
privileged
docker container