Cloud development inside your network with Tailscale
How Tailscale can connect an application running in CodeSandbox to your private resources.
At CodeSandbox, we use CodeSandbox Repositories for the majority of our development work (working on the product, inside the product).
This cloud development workflow saves us a lot of time and effort. However, we also have some services that are not available on the public internet — the kind of thing that a CodeSandbox Repository environment might not have access to.
Normally, to develop an application that requires access to internal resources, you have two choices: open up the internal resources to the world, or spend a lot of time mocking the services in your development environment. Neither option is particularly great, so we're excited to announce a partnership with Tailscale to bring CodeSandbox Repositories into your network.
What is Tailscale?
Tailscale lets you easily manage access to private resources, quickly SSH into devices on your network, and work securely from anywhere in the world. It uses a secure Wireguard mesh network to connect devices, virtual machines, and servers — and now CodeSandbox Repository environments — regardless of their location.
We use Tailscale at CodeSandbox to manage network access for private resources, including some of the services that make up the product itself.
Using Tailscale with CodeSandbox
Integrating a CodeSandbox Repository with Tailscale requires an auth key, a secret you embed in the CodeSandbox environment to allow registration on your network. Admins can create them on the auth key page of the Tailscale admin console.
Tailscale currently works in CodeSandbox environments by adding a container to a Dockerized application setup (for example, using docker-compose). The additional container runs the Tailscale client and provides networking for the other containers. Running applications will have access to private resources on your tailnet.
In the screenshot below, you can see an example of a CodeSandbox Repository environment connected to our tailnet.
For more information about the auth key and container setup, check out our documentation.
What this enables
After going through the straightforward setup instructions, you can leverage this integration right away for some useful use cases:
- Providing access to internal resources for applications running inside CodeSandbox.
- Exposing applications to your internal resources from inside of CodeSandbox.
- Seeing running CodeSandbox environments in your Tailscale dashboard.
- Controlling everything using optional tagging and ACLs in Tailscale.
We're excited to open up this new set of possibilities for CodeSandbox development environments. Get started by checking out Tailscale and taking a look at our documentation.