From ecc8306a83c9a328abf72ba69354ce4a203dfe71 Mon Sep 17 00:00:00 2001 From: rafael Date: Fri, 30 Oct 2026 17:49:28 -0300 Subject: [PATCH] [APP-3737] Add remote mode to bskyweb (#12285) Co-authored-by: Claude --- bskyweb/README.md | 22 ++ bskyweb/cmd/bskyweb/main.go | 21 ++ bskyweb/cmd/bskyweb/remotefs.go | 177 +++++++++++++++ bskyweb/cmd/bskyweb/remotefs_test.go | 321 +++++++++++++++++++++++++++ bskyweb/cmd/bskyweb/renderer.go | 14 +- bskyweb/cmd/bskyweb/server.go | 27 ++- bskyweb/go.mod | 2 +- 7 files changed, 573 insertions(+), 11 deletions(-) create mode 100644 bskyweb/cmd/bskyweb/remotefs.go create mode 100644 bskyweb/cmd/bskyweb/remotefs_test.go diff --git a/bskyweb/README.md b/bskyweb/README.md index b028a15c5..621345f43 100644 --- a/bskyweb/README.md +++ b/bskyweb/README.md @@ -43,6 +43,28 @@ go build -o bskyweb ./cmd/bskyweb/ The easiest way to configure the daemon is to copy `example.env` to `.env` and fill in auth values there. +## Web app statics: embedded and remote modes + +`bskyweb` serves the web app's build output (`static/_expo/`, `static/assets/`) +and the template fragments that load it (`templates/scripts.html`, +`templates/fonts.html`) in one of two modes: + +- **Embedded mode** (default, `BSKY_APP_VERSION` unset): serves the build + embedded in the binary at compile time, produced by `pnpm build-web`. Local + development and Render use this mode. +- **Remote mode** (`BSKY_APP_VERSION` set to a social-app commit SHA): serves + that build from S3 (`BSKY_APP_STATICS_BUCKET` and `BSKY_APP_STATICS_REGION`, + which default to production). The `publish-web-statics` GitHub workflow + publishes builds there under `/`. This lets the web app be + deployed without a new `bskyweb` image. + +In remote mode nothing is downloaded at startup. Each file is fetched the first +time it's needed and kept in memory for the life of the process, and concurrent +requests for the same file share one download. Until the fragments can be +loaded, `/` returns a 500, so the pod doesn't become ready. Everything else +(page templates, favicons, `robots.txt`, etc.) always comes from the binary. +Debug mode ignores `BSKY_APP_VERSION`. + ## Feature-gate fallback By default, `bskyweb` fetches the public GrowthBook configuration on startup and diff --git a/bskyweb/cmd/bskyweb/main.go b/bskyweb/cmd/bskyweb/main.go index 09e2c155b..32dcbfb42 100644 --- a/bskyweb/cmd/bskyweb/main.go +++ b/bskyweb/cmd/bskyweb/main.go @@ -125,6 +125,27 @@ func run(args []string) { Value: "", EnvVars: []string{"STATIC_CDN_HOST"}, }, + &cli.StringFlag{ + Name: "bsky-app-version", + Usage: "commit SHA of the web app build to serve from the statics bucket. Empty serves the build embedded in the binary", + Required: false, + Value: "", + EnvVars: []string{"BSKY_APP_VERSION"}, + }, + &cli.StringFlag{ + Name: "bsky-app-statics-bucket", + Usage: "public S3 bucket with the web app builds, used when bsky-app-version is set", + Required: false, + Value: "bsky-app-web-statics-prod", + EnvVars: []string{"BSKY_APP_STATICS_BUCKET"}, + }, + &cli.StringFlag{ + Name: "bsky-app-statics-region", + Usage: "AWS region of the web app statics bucket", + Required: false, + Value: "us-east-2", + EnvVars: []string{"BSKY_APP_STATICS_REGION"}, + }, &cli.BoolFlag{ Name: "bsky-canonical-instance", Usage: "Enable if this is the canonical deployment (bsky.app)", diff --git a/bskyweb/cmd/bskyweb/remotefs.go b/bskyweb/cmd/bskyweb/remotefs.go new file mode 100644 index 000000000..dcdb2a562 --- /dev/null +++ b/bskyweb/cmd/bskyweb/remotefs.go @@ -0,0 +1,177 @@ +package main + +import ( + "bytes" + "errors" + "fmt" + "io" + "io/fs" + "net/http" + "net/url" + "path" + "strings" + "sync" + "time" + + "github.com/bluesky-social/social-app/bskyweb" + "golang.org/x/sync/singleflight" +) + +// remoteAppFS returns the template and static file systems for remote mode. +// The files that change with every web build come from the app version's +// folder at baseURL, and everything else from the binary. +func remoteAppFS(baseURL string) (templates fs.FS, static fs.FS) { + remote := newRemoteFS(baseURL) + templates = &overlayFS{ + base: bskyweb.TemplateFS, + remote: remote, + dir: "templates", + paths: []string{"scripts.html", "fonts.html"}, + } + static = &overlayFS{ + base: bskyweb.StaticFS, + remote: remote, + dir: "static", + paths: []string{"_expo", "assets"}, + } + return templates, static +} + +// overlayFS serves the files and directories in paths, which are relative to +// dir, from remote, and every other name from base. In remote, the names are +// relative to its root: "/" is opened as "". +type overlayFS struct { + base fs.FS + remote fs.FS + dir string + paths []string +} + +func (o *overlayFS) Open(name string) (fs.File, error) { + if rel, ok := strings.CutPrefix(name, o.dir+"/"); ok { + for _, p := range o.paths { + if rel == p || strings.HasPrefix(rel, p+"/") { + return o.remote.Open(rel) + } + } + } + return o.base.Open(name) +} + +// remoteFS is a read-only fs.FS over the files under baseURL. Each file is +// downloaded at most once and then served from memory. Concurrent opens of +// the same file share one download. Failed downloads and missing files aren't +// kept, so the next open tries again. Directories are reported as missing. +type remoteFS struct { + baseURL string + client *http.Client + group singleflight.Group + + mu sync.RWMutex + files map[string][]byte +} + +func newRemoteFS(baseURL string) *remoteFS { + return &remoteFS{ + baseURL: strings.TrimSuffix(baseURL, "/"), + client: &http.Client{Timeout: 30 * time.Second}, + files: make(map[string][]byte), + } +} + +func (r *remoteFS) Open(name string) (fs.File, error) { + if !fs.ValidPath(name) { + return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrInvalid} + } + data, err := r.load(name) + if err != nil { + return nil, &fs.PathError{Op: "open", Path: name, Err: err} + } + return &memFile{ + Reader: bytes.NewReader(data), + info: memFileInfo{name: path.Base(name), size: int64(len(data))}, + }, nil +} + +func (r *remoteFS) cached(name string) ([]byte, bool) { + r.mu.RLock() + defer r.mu.RUnlock() + data, ok := r.files[name] + return data, ok +} + +func (r *remoteFS) load(name string) ([]byte, error) { + if data, ok := r.cached(name); ok { + return data, nil + } + v, err, _ := r.group.Do(name, func() (any, error) { + // Covers a caller that missed the cache right before a download finished. + if data, ok := r.cached(name); ok { + return data, nil + } + data, err := r.download(name) + if err != nil { + if !errors.Is(err, fs.ErrNotExist) { + log.Errorf("loading app file failed: %s", err) + } + return nil, err + } + r.mu.Lock() + r.files[name] = data + r.mu.Unlock() + return data, nil + }) + if err != nil { + return nil, err + } + return v.([]byte), nil +} + +// download returns fs.ErrNotExist for a missing file. Other errors are +// formatted with %v instead of wrapped so they can't match fs.ErrNotExist or +// fs.ErrPermission (e.g. a connect EACCES), which the file server would answer +// with a 404 or 403 instead of a 500. +func (r *remoteFS) download(name string) ([]byte, error) { + u := r.baseURL + "/" + (&url.URL{Path: name}).EscapedPath() + resp, err := r.client.Get(u) + if err != nil { + return nil, fmt.Errorf("downloading %s: %v", u, err) + } + defer resp.Body.Close() + + switch resp.StatusCode { + case http.StatusOK: + data, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("downloading %s: %v", u, err) + } + return data, nil + // The bucket allows anonymous GetObject but not ListBucket, so S3 answers + // a missing key with 403 instead of 404. + case http.StatusForbidden, http.StatusNotFound: + return nil, fs.ErrNotExist + default: + return nil, fmt.Errorf("downloading %s: unexpected status %s", u, resp.Status) + } +} + +// memFile is an open remoteFS file. http.FileServer needs it to support Seek. +type memFile struct { + *bytes.Reader + info memFileInfo +} + +func (f *memFile) Stat() (fs.FileInfo, error) { return f.info, nil } +func (f *memFile) Close() error { return nil } + +type memFileInfo struct { + name string + size int64 +} + +func (i memFileInfo) Name() string { return i.name } +func (i memFileInfo) Size() int64 { return i.size } +func (i memFileInfo) Mode() fs.FileMode { return 0o444 } +func (i memFileInfo) ModTime() time.Time { return time.Time{} } +func (i memFileInfo) IsDir() bool { return false } +func (i memFileInfo) Sys() any { return nil } diff --git a/bskyweb/cmd/bskyweb/remotefs_test.go b/bskyweb/cmd/bskyweb/remotefs_test.go new file mode 100644 index 000000000..a403197de --- /dev/null +++ b/bskyweb/cmd/bskyweb/remotefs_test.go @@ -0,0 +1,321 @@ +package main + +import ( + "errors" + "io" + "io/fs" + "net/http" + "net/http/httptest" + "strings" + "sync" + "testing" + "testing/fstest" + "time" + + "github.com/labstack/echo/v4" +) + +// fakeS3 serves files like the public statics bucket, where a missing key is a 403. +type fakeS3 struct { + mu sync.Mutex + files map[string]string + gets map[string]int + status int + failNext int + release chan struct{} +} + +func newFakeS3(t *testing.T, files map[string]string) (*fakeS3, string) { + t.Helper() + f := &fakeS3{files: files, gets: map[string]int{}} + srv := httptest.NewServer(f) + t.Cleanup(srv.Close) + return f, srv.URL + "/v1" +} + +func (f *fakeS3) ServeHTTP(w http.ResponseWriter, r *http.Request) { + f.mu.Lock() + f.gets[r.URL.Path]++ + body, ok := f.files[r.URL.Path] + status, release := f.status, f.release + if f.failNext > 0 { + f.failNext-- + status = http.StatusInternalServerError + } + f.mu.Unlock() + + if release != nil { + <-release + } + switch { + case status != 0: + w.WriteHeader(status) + case !ok: + w.WriteHeader(http.StatusForbidden) + default: + io.WriteString(w, body) + } +} + +func (f *fakeS3) update(fn func(f *fakeS3)) { + f.mu.Lock() + defer f.mu.Unlock() + fn(f) +} + +func (f *fakeS3) getsOf(path string) int { + f.mu.Lock() + defer f.mu.Unlock() + return f.gets[path] +} + +func TestRemoteFSServesFromMemory(t *testing.T) { + s3, baseURL := newFakeS3(t, map[string]string{"/v1/_expo/app.js": "console.log(1)"}) + remote := newRemoteFS(baseURL) + + for range 2 { + b, err := fs.ReadFile(remote, "_expo/app.js") + if err != nil { + t.Fatal(err) + } + if string(b) != "console.log(1)" { + t.Fatalf("got %q", b) + } + } + if n := s3.getsOf("/v1/_expo/app.js"); n != 1 { + t.Fatalf("got %d upstream GETs, want 1", n) + } +} + +func TestRemoteFSCoalescesConcurrentOpens(t *testing.T) { + s3, baseURL := newFakeS3(t, map[string]string{"/v1/_expo/app.js": "console.log(1)"}) + release := make(chan struct{}) + s3.update(func(f *fakeS3) { f.release = release }) + remote := newRemoteFS(baseURL) + + const n = 10 + errs := make(chan error, n) + var wg sync.WaitGroup + for range n { + wg.Go(func() { + _, err := fs.ReadFile(remote, "_expo/app.js") + errs <- err + }) + } + deadline := time.Now().Add(5 * time.Second) + for s3.getsOf("/v1/_expo/app.js") == 0 { + if time.Now().After(deadline) { + t.Fatal("no upstream GET") + } + time.Sleep(time.Millisecond) + } + // Give the other opens time to join the download in flight. + time.Sleep(50 * time.Millisecond) + close(release) + wg.Wait() + close(errs) + + for err := range errs { + if err != nil { + t.Fatal(err) + } + } + if got := s3.getsOf("/v1/_expo/app.js"); got != 1 { + t.Fatalf("got %d upstream GETs, want 1", got) + } +} + +func TestRemoteFSMissingFile(t *testing.T) { + for _, status := range []int{http.StatusForbidden, http.StatusNotFound} { + s3, baseURL := newFakeS3(t, map[string]string{}) + s3.update(func(f *fakeS3) { f.status = status }) + _, err := newRemoteFS(baseURL).Open("_expo/app.js") + if !errors.Is(err, fs.ErrNotExist) { + t.Errorf("status %d: got %v, want fs.ErrNotExist", status, err) + } + } +} + +func TestRemoteFSRetriesFailures(t *testing.T) { + s3, baseURL := newFakeS3(t, map[string]string{}) + remote := newRemoteFS(baseURL) + + s3.update(func(f *fakeS3) { f.status = http.StatusInternalServerError }) + _, err := remote.Open("_expo/app.js") + if err == nil || errors.Is(err, fs.ErrNotExist) || errors.Is(err, fs.ErrPermission) { + t.Fatalf("got %v, want an upstream error", err) + } + + s3.update(func(f *fakeS3) { f.status = 0 }) + if _, err := remote.Open("_expo/app.js"); !errors.Is(err, fs.ErrNotExist) { + t.Fatalf("got %v, want fs.ErrNotExist", err) + } + + s3.update(func(f *fakeS3) { f.files["/v1/_expo/app.js"] = "console.log(1)" }) + b, err := fs.ReadFile(remote, "_expo/app.js") + if err != nil { + t.Fatal(err) + } + if string(b) != "console.log(1)" { + t.Fatalf("got %q", b) + } + if n := s3.getsOf("/v1/_expo/app.js"); n != 3 { + t.Fatalf("got %d upstream GETs, want 3", n) + } +} + +func TestRemoteFSUnreachable(t *testing.T) { + srv := httptest.NewServer(http.NotFoundHandler()) + srv.Close() + _, err := newRemoteFS(srv.URL).Open("_expo/app.js") + if err == nil || errors.Is(err, fs.ErrNotExist) || errors.Is(err, fs.ErrPermission) { + t.Fatalf("got %v, want an upstream error", err) + } +} + +func TestOverlayFSRouting(t *testing.T) { + base := fstest.MapFS{ + "templates/base.html": {Data: []byte("embedded base")}, + "templates/scripts.html": {Data: []byte("embedded scripts")}, + "static/favicon.png": {Data: []byte("embedded favicon")}, + "static/_expo/old.js": {Data: []byte("embedded old")}, + "static/_exporter.js": {Data: []byte("embedded exporter")}, + } + remote := fstest.MapFS{ + "scripts.html": {Data: []byte("remote scripts")}, + "_expo/app.js": {Data: []byte("remote app")}, + } + templates := &overlayFS{base: base, remote: remote, dir: "templates", paths: []string{"scripts.html", "fonts.html"}} + static, err := fs.Sub(&overlayFS{base: base, remote: remote, dir: "static", paths: []string{"_expo", "assets"}}, "static") + if err != nil { + t.Fatal(err) + } + + for _, tc := range []struct { + fsys fs.FS + name string + want string + }{ + {templates, "templates/base.html", "embedded base"}, + {templates, "templates/scripts.html", "remote scripts"}, + {templates, "templates/fonts.html", ""}, + {static, "favicon.png", "embedded favicon"}, + {static, "_exporter.js", "embedded exporter"}, + {static, "_expo/app.js", "remote app"}, + {static, "_expo/old.js", ""}, + {static, "assets/logo.png", ""}, + } { + b, err := fs.ReadFile(tc.fsys, tc.name) + if tc.want == "" { + if !errors.Is(err, fs.ErrNotExist) { + t.Errorf("%s: got %q, %v, want fs.ErrNotExist", tc.name, b, err) + } + continue + } + if err != nil || string(b) != tc.want { + t.Errorf("%s: got %q, %v, want %q", tc.name, b, err, tc.want) + } + } +} + +func TestRemoteStaticFileServer(t *testing.T) { + s3, baseURL := newFakeS3(t, map[string]string{ + "/v1/_expo/static/js/app.js": "console.log(1)", + "/v1/assets/logo.png": "png", + }) + _, static := remoteAppFS(baseURL) + fsys, err := fs.Sub(static, "static") + if err != nil { + t.Fatal(err) + } + handler := http.FileServer(http.FS(fsys)) + get := func(path string, header ...string) *httptest.ResponseRecorder { + req := httptest.NewRequest(http.MethodGet, path, nil) + for i := 0; i+1 < len(header); i += 2 { + req.Header.Set(header[i], header[i+1]) + } + rec := httptest.NewRecorder() + handler.ServeHTTP(rec, req) + return rec + } + + rec := get("/_expo/static/js/app.js") + if rec.Code != http.StatusOK || rec.Body.String() != "console.log(1)" { + t.Fatalf("remote file: got %d %q", rec.Code, rec.Body.String()) + } + if ct := rec.Header().Get("Content-Type"); !strings.Contains(ct, "javascript") { + t.Errorf("remote file: got Content-Type %q", ct) + } + if rec := get("/_expo/static/js/app.js", "Range", "bytes=0-6"); rec.Code != http.StatusPartialContent || rec.Body.String() != "console" { + t.Errorf("range: got %d %q", rec.Code, rec.Body.String()) + } + if rec := get("/favicon.png"); rec.Code != http.StatusOK { + t.Errorf("embedded file: got %d", rec.Code) + } + if rec := get("/_expo/static/js/missing.js"); rec.Code != http.StatusNotFound { + t.Errorf("missing file: got %d", rec.Code) + } + if rec := get("/_expo/static/js"); rec.Code != http.StatusNotFound { + t.Errorf("directory: got %d", rec.Code) + } + + // A transient failure must be a 500, never a 404 the CDN could cache. + s3.update(func(f *fakeS3) { f.failNext = 1 }) + if rec := get("/assets/logo.png"); rec.Code != http.StatusInternalServerError { + t.Errorf("transient failure: got %d, want 500", rec.Code) + } + if rec := get("/assets/logo.png"); rec.Code != http.StatusOK { + t.Errorf("after transient failure: got %d", rec.Code) + } + s3.update(func(f *fakeS3) { f.status = http.StatusServiceUnavailable }) + if rec := get("/_expo/static/js/other.js"); rec.Code != http.StatusInternalServerError { + t.Errorf("upstream down: got %d, want 500", rec.Code) + } + if rec := get("/_expo/static/js/app.js"); rec.Code != http.StatusOK { + t.Errorf("cached file with upstream down: got %d", rec.Code) + } +} + +func TestRemoteHomeNeedsFragments(t *testing.T) { + s3, baseURL := newFakeS3(t, map[string]string{}) + templates, _ := remoteAppFS(baseURL) + e := echo.New() + e.HideBanner = true + e.Logger.SetOutput(io.Discard) + srv := &Server{echo: e, cfg: &Config{staticCDNHost: "https://cdn.test"}} + e.Renderer = NewRenderer("templates/", templates, false) + e.HTTPErrorHandler = srv.errorHandler + e.GET("/", srv.WebHome) + get := func() *httptest.ResponseRecorder { + rec := httptest.NewRecorder() + e.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/", nil)) + return rec + } + + for _, status := range []int{0, http.StatusInternalServerError} { + s3.update(func(f *fakeS3) { f.status = status }) + if rec := get(); rec.Code != http.StatusInternalServerError { + t.Fatalf("upstream status %d: got %d, want 500", status, rec.Code) + } + } + + // pongo2 must not have cached the failed parse. + s3.update(func(f *fakeS3) { + f.status = 0 + f.files["/v1/scripts.html"] = `` + f.files["/v1/fonts.html"] = `` + }) + rec := get() + if rec.Code != http.StatusOK { + t.Fatalf("got %d, want 200", rec.Code) + } + body := rec.Body.String() + for _, want := range []string{ + ``, + ``, + } { + if !strings.Contains(body, want) { + t.Errorf("body is missing %s", want) + } + } +} diff --git a/bskyweb/cmd/bskyweb/renderer.go b/bskyweb/cmd/bskyweb/renderer.go index 0ff62deaa..464f6eafc 100644 --- a/bskyweb/cmd/bskyweb/renderer.go +++ b/bskyweb/cmd/bskyweb/renderer.go @@ -2,10 +2,10 @@ package main import ( "bytes" - "embed" "errors" "fmt" "io" + "io/fs" "path/filepath" "github.com/flosch/pongo2/v6" @@ -14,13 +14,13 @@ import ( type RendererLoader struct { prefix string - fs *embed.FS + fs fs.FS } -func NewRendererLoader(prefix string, fs *embed.FS) pongo2.TemplateLoader { +func NewRendererLoader(prefix string, fsys fs.FS) pongo2.TemplateLoader { return &RendererLoader{ prefix: prefix, - fs: fs, + fs: fsys, } } func (l *RendererLoader) Abs(_, name string) string { @@ -35,7 +35,7 @@ func (l *RendererLoader) Abs(_, name string) string { } func (l *RendererLoader) Get(path string) (io.Reader, error) { - b, err := l.fs.ReadFile(path) + b, err := fs.ReadFile(l.fs, path) if err != nil { return nil, fmt.Errorf("reading template %q failed: %w", path, err) } @@ -47,9 +47,9 @@ type Renderer struct { Debug bool } -func NewRenderer(prefix string, fs *embed.FS, debug bool) *Renderer { +func NewRenderer(prefix string, fsys fs.FS, debug bool) *Renderer { return &Renderer{ - TemplateSet: pongo2.NewSet(prefix, NewRendererLoader(prefix, fs)), + TemplateSet: pongo2.NewSet(prefix, NewRendererLoader(prefix, fsys)), Debug: debug, } } diff --git a/bskyweb/cmd/bskyweb/server.go b/bskyweb/cmd/bskyweb/server.go index e36e78e33..4b06fc4b8 100644 --- a/bskyweb/cmd/bskyweb/server.go +++ b/bskyweb/cmd/bskyweb/server.go @@ -83,6 +83,21 @@ func serve(cctx *cli.Context) error { staticCDNHost = strings.TrimSuffix(staticCDNHost, "/") canonicalInstance := cctx.Bool("bsky-canonical-instance") robotsDisallowAll := cctx.Bool("robots-disallow-all") + appVersion := cctx.String("bsky-app-version") + appStaticsBucket := cctx.String("bsky-app-statics-bucket") + appStaticsRegion := cctx.String("bsky-app-statics-region") + + templateFS := fs.FS(bskyweb.TemplateFS) + staticFS := fs.FS(bskyweb.StaticFS) + if appVersion != "" { + if debug { + log.Warnf("ignoring app version %s: debug mode serves templates and static files from the local file system", appVersion) + } else { + baseURL := fmt.Sprintf("https://%s.s3.%s.amazonaws.com/%s", appStaticsBucket, appStaticsRegion, url.PathEscape(appVersion)) + log.Infof("serving app version %s from %s", appVersion, baseURL) + templateFS, staticFS = remoteAppFS(baseURL) + } + } // Echo e := echo.New() @@ -173,7 +188,7 @@ func serve(cctx *cli.Context) error { } e.HideBanner = true - e.Renderer = NewRenderer("templates/", &bskyweb.TemplateFS, debug) + e.Renderer = NewRenderer("templates/", templateFS, debug) e.HTTPErrorHandler = server.errorHandler e.IPExtractor = echo.ExtractIPFromXFFHeader() @@ -252,7 +267,7 @@ func serve(cctx *cli.Context) error { log.Debugf("serving static file from the local file system") return http.FS(os.DirFS("static")) } - fsys, err := fs.Sub(bskyweb.StaticFS, "static") + fsys, err := fs.Sub(staticFS, "static") if err != nil { log.Fatal(err) } @@ -510,7 +525,13 @@ func (srv *Server) errorHandler(err error, c echo.Context) { c.Logger().Error(err) data := srv.NewTemplateContext() data["statusCode"] = code - c.Render(code, "error.html", data) + if err := c.Render(code, "error.html", data); err != nil { + // error.html extends base.html, so it fails too when the app's fragments + // can't be loaded. Without a response, net/http would send an empty 200, + // which the probes on / would take as healthy. + c.Logger().Error(err) + c.String(code, http.StatusText(code)) + } } // Handler for redirecting to the download page. diff --git a/bskyweb/go.mod b/bskyweb/go.mod index 65835c81e..0edfcc161 100644 --- a/bskyweb/go.mod +++ b/bskyweb/go.mod @@ -13,6 +13,7 @@ require ( github.com/labstack/echo/v4 v4.13.4 github.com/prometheus/client_golang v1.22.0 github.com/urfave/cli/v2 v2.25.7 + golang.org/x/sync v0.20.0 ) require github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -93,7 +94,6 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.52.0 // indirect golang.org/x/net v0.55.0 // indirect - golang.org/x/sync v0.20.0 // indirect golang.org/x/sys v0.45.0 // indirect golang.org/x/text v0.37.0 // indirect golang.org/x/time v0.12.0 // indirect -- knotmirror 0.0.1