Coder Social home page Coder Social logo

tailscale-extension's Introduction

Tailscale Lambda Extension for Containers

Inspired by Corey Quinn's tailscale-layer project. This project aims to do the same thing but usable for those working with any Lambda Container runtime language. Our extension has been modified from Corey's upstream work. I have removed verbose logging and event lifecycle hooks. This has reduced startup overhead, duplicate tailscale up calls, and more configuration options.

Installation

We have pre-build container packages which include the Tailscale Lambda Extension within a basic Docker scratch image containing everything needed to copy to your /opt directory. For example:

FROM public.ecr.aws/lambda/ruby:3.2
RUN yum install -y curl
COPY --from=ghcr.io/rails-lambda/tailscale-extension-amzn:1 /opt /opt

โš ๏ธ Make sure curl is installed since the Tailscale Extension script will need it.

Environment Variables

You will need to generate an ephemeral key within your Tailscale account. Note, this will expire and need updating depending on the time period you select. List of the environment variables include:

  • TS_KEY - Required. Your ephemeral key.
  • TS_HOSTNAME - Optional. The value of --hostname parameter. Default lambda.

OSs & Architectures

We publish multi-platform images for both linux/amd64 and linux/arm64/v8 and we also have Amazon Linux 2 and Debian/Ubuntu variants.

  • ghcr.io/rails-lambda/tailscale-extension-amzn
  • ghcr.io/rails-lambda/tailscale-extension-debian

Example Usage

๐Ÿ“š Using Tailscale on Lambda for a Live Development Proxy

Once your Lambda function starts, you will have a SOCKS5 proxy which can communicate with your Tailscale tailnet at http://localhost:1055. Here is an example of how to leverage that with Ruby's socksify gem.

Net::HTTP.socks_proxy('localhost', 1055).start(...) do |http|
  # your http code here...
end

Again, this extension is not coupled to any runtime language. So how you use the SOCKS5 proxy is up to you. Enjoy!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.