Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Bundle-upload origin should default to the platform upload service — preflight accepts app hosts and fails late with a bare 404

Đang mở
#666 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cli, devops

Hướng nghiên cứu

Start with services/deploy/cdn.ts and trace how resolveCdnDeployInputs chooses storageOrigin; compare that with the cdn.origin mapping described in the issue. Read probeStorageOrigin and the login flow in handlers/keys.ts, then check the relevant deploy tests and docs/self-deploy.md. Done means deploy selects the upload service for the platform runtime and rejects an app-site origin before the build with an actionable message.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Environment

  • CLI: everything-dev 2.0.0-rc.27 (bos deploy, interactive, macOS)
  • Session created by bos login --key --site https://everything.dev
  • Runtime: child (extends: bos://dev.everything.near/everything.dev), publishing gateway preview.nearbuilders.org (first publish)

Symptom

bos deploy builds all 12 workspaces, passes preflight, then fails at the first upload leg:

✗ Deploy failed
  Error: [upload] bundle upload for ui failed: 404 Not Found

The uploads went to the app site, not the upload service. Resolution chain in services/deploy/cdn.ts (resolveCdnDeployInputs):

BOS_STORAGE_ORIGIN env  →  session.siteUrl  →  https://<gateway>

With no env var and a login session pinned to --site https://everything.dev, storageOrigin becomes https://everything.dev. Preflight passes because probeStorageOrigin() only checks GET /health → "OK"/empty and GET /.well-known/mcp.json — an app host running the platform API answers both. But bundle uploads POST /api/storage/bundles, which per ADR 0027 is served only by the standalone upload service (https://upload.everything.dev); the app host returns a bare 404 Not Found (non-retryable, non-JSON body, no hint about the actual problem).

BOS_STORAGE_ORIGIN set on the bos login command does not help — the CLI's login flow (handlers/keys.ts) never reads or persists it; only siteUrl (from --site) is stored, and it silently becomes the deploy's upload origin.

Impact

  • Interactive/self-deployed uploads require a per-command BOS_STORAGE_ORIGIN=https://upload.everything.dev prefix (and bos deploy does not load .env — only dev/start flows do), so it is easy to lose and easy to misunderstand.
  • The failure surfaces late (after the full build) with a body of 404 Not Found and no actionable hint.
  • The same weakness applies to the resolved-fallback https://<gateway> — a gateway origin upload is refused per the docs, but only at this late stage.

Asks

  1. Default the upload origin to the platform upload service. When the runtime extends the base platform / inherits cdn.origin: https://cdn.everything.dev, default storageOrigin to https://upload.everything.dev (the standalone write/control service for that CDN) instead of the session siteUrl. Interactive self-deploys then need no env vars at all.
  2. Persist a storage origin at login (or resolve it at deploy time from the platform release manifest / cdn.origin mapping) rather than reusing the session's siteUrl, which is an app site by design.
  3. Strengthen probeStorageOrigin to verify upload capability before the build (e.g. the storage service exposes an identity/capability route, or probe POST-ability of /api/storage/bundles with an empty payload) and fail fast with an actionable message ("your login is pinned to an app site; set BOS_STORAGE_ORIGIN=https://upload.everything.dev").
  4. Load .env in bos deploy (currently only bos dev/bos start flows do, via env/project-env.ts) so per-project defaults work — or document that the var must be exported per command.
  5. Docs: BOS_STORAGE_AUTH_ORIGIN is an upload-service server-side var (apps/upload/src/auth.ts), but its name invites pasting into client CLI commands, where it is a silent no-op (I did exactly that). A client/server var split in docs/self-deploy.md would help.

Repro

bos login --key --site https://everything.dev   # pins session.siteUrl = app site
bos deploy                                       # → builds fine, then:
# [upload] bundle upload for ui failed: 404 Not Found
# origin used: https://everything.dev/api/storage/bundles (app host)

BOS_STORAGE_ORIGIN=https://upload.everything.dev bos deploy   # works
Ngôn ngữ chính
TypeScript
Star
5
Fork
3
Merge trung bình
9 giờ 37 phút
Pull request đã merge (30 ngày)
157

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NEARBuilders/everything-dev

Tất cả issue của NEARBuilders/everything-dev

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.