mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 10:41:19 -08:00
Adds tsweb/compserve: content negotiation for precompressed static variants, with a transcode-to-identity fallback for clients that do not accept an encoding (including when the raw file is absent), and CompressWriter, which live-compresses dynamic responses with zstd in its fastest mode, streamed incrementally with no buffering. Negotiation is q-value and wildcard aware (gzip;q=0 previously matched gzip). client/web serves its prebuilt embedded assets through compserve, replacing brotli with zstd; the embedded FS is wrapped in tsweb/vcstime for conditional-request mod times. tsweb/compserve/gzip.go keeps transitional serving of gzip variants from pre-zstd file systems (such as the currently published web-client-prebuilt module): passthrough to gzip-accepting clients, transcoded to identity otherwise; it becomes inert once a zstd-only module is published. util/zstdframe gains pooled GetDecoder and GetStreamingEncoder (concurrency=1). util/precompress is now a build-time tool, generating zstd variants only. cmd/tsconnect and cmd/build-webclient consume the new precompress/compserve split. tsweb.AcceptsEncoding and tsweb/tswebutil are removed; negotiation lives in compserve and the deprecated shim had no callers. go.mod bumps web-client-prebuilt. Also fixes a transcoding bug where http.ServeContent's size probe via the promoted zstd.Decoder.WriteTo could report a zero length, serving empty bodies. Updates tailscale/corp#20099 Signed-off-by: James Tucker <[email protected]>
20 lines
788 B
Nix
20 lines
788 B
Nix
# This is a shell.nix file used to describe the environment that
|
|
# tailscale needs for development.
|
|
#
|
|
# For more information about this and why this file is useful, see here:
|
|
# https://nixos.org/guides/nix-pills/developing-with-nix-shell.html
|
|
#
|
|
# Also look into direnv: https://direnv.net/, this can make it so that you can
|
|
# automatically get your environment set up when you change folders into the
|
|
# project.
|
|
(import (
|
|
let
|
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
|
in fetchTarball {
|
|
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
|
sha256 = lock.nodes.flake-compat.locked.narHash; }
|
|
) {
|
|
src = ./.;
|
|
}).shellNix
|
|
# nix-direnv cache busting line: sha256-O4Q7kad5olQbg86+asGF4/kVXqWECsMYjQsGq75BY9M=
|