tailscale/gokrazy
Brad Fitzpatrick 4082512293 tempfork/{acme,ssh}: add new package for x/crypto package forks, move
We were maintaining temporary dev forks of golang.org/x/crypto/{acme,ssh}
in https://github.com/tailscale/golang-x-crypto instead of using
this repo's tempfork directory as we do with other packages. The reason we were
doing that was because x/crypto/ssh depended on x/crypto/ssh/internal/poly1305
and I hadn't noticed there are forwarding wrappers already available
in x/crypto/poly1305. It also depended internal/bcrypt_pbkdf but we don't use that
so it's easy to just delete that calling code in our tempfork/ssh.

This means we don't need another repo, for better or worse. (better:
one repo, worse: slightly more annoying to rebase to upstream, but not
terrible)

The acme package is moved unmodified.

This copies the code from tailscale/golang-x-crypto at git rev
3fde5e568a

Updates #8593
Updates #10238

Change-Id: I8af4378c04c1f82e63d31bf4d16dba9f510f9199
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-09-18 12:17:36 -07:00
..
natlabapp tempfork/{acme,ssh}: add new package for x/crypto package forks, move 2024-09-18 12:17:36 -07:00
natlabapp.arm64 tempfork/{acme,ssh}: add new package for x/crypto package forks, move 2024-09-18 12:17:36 -07:00
tsapp tempfork/{acme,ssh}: add new package for x/crypto package forks, move 2024-09-18 12:17:36 -07:00
.gitignore gokrazy,tstest/integration/nat: add Gokrazy appliance just for natlab 2024-08-13 15:26:12 -07:00
build.go gokrazy{,/natlabapp.arm64}: start adding arm64 appliance support 2024-09-03 09:24:15 -07:00
go.mod gokrazy, various: use point versions of Go and update Nix deps 2024-09-16 16:06:43 -04:00
go.sum gokrazy: bump 2024-08-09 09:06:54 -07:00
gok gokrazy: update breakglass with now-upstreamed ec2 change 2024-06-04 15:21:57 -07:00
Makefile gokrazy,tstest/integration/nat: add Gokrazy appliance just for natlab 2024-08-13 15:26:12 -07:00
README.md gokrazy: add prototype Tailscale appliance, build tooling, docs 2024-06-03 15:01:19 -07:00
tidy-deps.go gokrazy: add prototype Tailscale appliance, build tooling, docs 2024-06-03 15:01:19 -07:00
UTM.md gokrazy: add prototype Tailscale appliance, build tooling, docs 2024-06-03 15:01:19 -07:00

Tailscale Appliance Gokrazy Image

This is (as of 2024-06-02) a WORK IN PROGRESS (pre-alpha) experiment to package Tailscale as a Gokrazy appliance image for use on both VMs (AWS, GCP, Azure, Proxmox, ...) and Rasperry Pis.

See https://github.com/tailscale/tailscale/issues/1866

Overview

It makes a ~70MB image (about the same size as tailscale-setup-full-1.66.4.exe and smaller than the combined Tailscale Android APK) that combines the Linux kernel and Tailscale and that's it. Nothing written in C. (except optional busybox for debugging) So no operating system to maintain. Gokrazy has three partitions: two read-only ones (one active at a time, the other for updates for the next boot) and one optional stateful, writable partition that survives upgrades (/perm/)

Initial bootstrap configuration of this appliance will be over either serial or configuration files (auth keys, subnet routes, etc) baked into the image (for Raspberry Pis) or in cloud-init/user-data (for AWS, etc). As of 2024-06-02, AWS user-data config files work.

Quick start

Install dependencies:

$ brew install qemu e2fsprogs

Build + launch:

$ make qemu

That puts serial on stdio. To exit the serial console and escape to the qemu monitor, type Ctrl-a c. Then type quit in the monitor to quit.

Building

make image to build just the image (tsapp.img), without uploading it.

UTM

You can also use UTM, but the qemu path above is easier. For UTM, see the UTM instructions.

AWS

Build an AMI

go run build.go --bucket=your-S3-temp-bucket to build an AMI. Make sure your "aws" command is in your path and has access.

Creating an instance

When creating an instance, you need a Nitro machine type to get a virtual serial console. Notably, that means the t2.* instance types that AWS pushes as a free option are not new enough. Use t3.* at least.

As of 2024-06-02 this builder tool only supports x86_64 (arm64 should be trivial and will come soon), so don't use a Graviton machine type.

To connect to the serial console, you can either use the web console, or use the CLI like:

$ aws ec2-instance-connect send-serial-console-ssh-public-key --instance-id i-0b4a0eabc43629f13 --serial-port 0 --ssh-public-key file:///your/home/.ssh/id_ed25519.pub --region us-west-2
{
    "RequestId": "a93b0ea3-9ff9-45d5-b8ed-b1e70ccc0410",
    "Success": true
}
$ ssh i-0b4a0eabc43629f13.port0@serial-console.ec2-instance-connect.us-west-2.aws