feat(avatars): host avatars + team logos on Cloud via SDK 2.4.0; remove public-bucket mode (#467)

* feat(avatars): host avatars + team logos on Cloud via SDK 2.4.0; remove public-bucket mode

Host user avatars and org logos on the ZPan Cloud avatar service
(zpan-cloud-sdk ^2.4.0) instead of a public S3/R2 bucket, then remove the
now-dead storages.mode / public-bucket concept entirely (#456 parts 2-3).

- image-upload gateway: upload/delete via SDK uploadAvatar/deleteAvatar against
  a bound Cloud client; validate mime (AVATAR_CONTENT_TYPES) + size
  (MAX_AVATAR_BYTES) before the call; map cloud error codes to 400/403/413/500;
  unbound instance returns 503 cloud_required (delete is a best-effort no-op).
- licensing-cloud: createAvatarUploadClient builds the client with a plain-object
  bearer header so both the image content-type and Authorization survive hono's
  per-request header merge (a Headers instance would be dropped).
- drop storages.mode (migration via drizzle-kit), StorageRepo.select() no longer
  takes a mode, remove StorageMode / Storage.mode / mode schema+audit+UI+i18n and
  the PUBLIC_IMAGES bucket + PUBLIC_IMAGES_URL wiring.

Agent-Profile: https://agent-kanban.dev/agents/f759c704c282d88a

* ci(deploy): drop dead PUBLIC_IMAGES R2 provisioning from CF deploy

The Cloud avatar migration removed the PUBLIC_IMAGES binding from
wrangler.toml, so the deploy workflow's R2 public-images steps are dead and
must go too — otherwise every CF deploy keeps re-provisioning a public-read
zpan-public-images bucket (the footgun #456 eliminates) and sets an unused
PUBLIC_IMAGES_URL secret. Removes the bucket-create, managed-public-URL, and
secret steps (steps.r2 was only consumed by the secret step). Also drops a
stale storage-modes line from the v2.0 roadmap.

Agent-Profile: https://agent-kanban.dev/agents/f759c704c282d88a

---------

Co-authored-by: Alex Chen <alex-chen@mails.agent-kanban.dev>
This commit is contained in:
agent-kanban-local[bot]
2026-06-20 00:16:07 -04:00
committed by GitHub
parent 0138e7779e
commit 00f48cf355
77 changed files with 4600 additions and 798 deletions
+11 -56
View File
@@ -1104,42 +1104,6 @@ func (e SaveEmailConfigJSONBody2Provider) Valid() bool {
}
}
// Defines values for CreateStorageJSONBodyMode.
const (
CreateStorageJSONBodyModePrivate CreateStorageJSONBodyMode = "private"
CreateStorageJSONBodyModePublic CreateStorageJSONBodyMode = "public"
)
// Valid indicates whether the value is a known member of the CreateStorageJSONBodyMode enum.
func (e CreateStorageJSONBodyMode) Valid() bool {
switch e {
case CreateStorageJSONBodyModePrivate:
return true
case CreateStorageJSONBodyModePublic:
return true
default:
return false
}
}
// Defines values for UpdateStorageJSONBodyMode.
const (
UpdateStorageJSONBodyModePrivate UpdateStorageJSONBodyMode = "private"
UpdateStorageJSONBodyModePublic UpdateStorageJSONBodyMode = "public"
)
// Valid indicates whether the value is a known member of the UpdateStorageJSONBodyMode enum.
func (e UpdateStorageJSONBodyMode) Valid() bool {
switch e {
case UpdateStorageJSONBodyModePrivate:
return true
case UpdateStorageJSONBodyModePublic:
return true
default:
return false
}
}
// Defines values for UpdateStorageJSONBodyStatus.
const (
UpdateStorageJSONBodyStatusActive UpdateStorageJSONBodyStatus = "active"
@@ -2095,7 +2059,6 @@ type Storage struct {
Endpoint string `json:"endpoint"`
FilePath string `json:"filePath"`
Id string `json:"id"`
Mode string `json:"mode"`
Region string `json:"region"`
SecretKey string `json:"secretKey"`
Status string `json:"status"`
@@ -3511,23 +3474,19 @@ type SetSystemOptionJSONBody struct {
// CreateStorageJSONBody defines parameters for CreateStorage.
type CreateStorageJSONBody struct {
AccessKey string `json:"accessKey"`
Bucket string `json:"bucket"`
Capacity *int `json:"capacity,omitempty"`
CustomHost *string `json:"customHost,omitempty"`
EgressCreditBillingEnabled *bool `json:"egressCreditBillingEnabled,omitempty"`
EgressCreditPerUnit *int `json:"egressCreditPerUnit,omitempty"`
EgressCreditUnitBytes *int `json:"egressCreditUnitBytes,omitempty"`
Endpoint string `json:"endpoint"`
Mode CreateStorageJSONBodyMode `json:"mode"`
Region *string `json:"region,omitempty"`
SecretKey string `json:"secretKey"`
Title string `json:"title"`
AccessKey string `json:"accessKey"`
Bucket string `json:"bucket"`
Capacity *int `json:"capacity,omitempty"`
CustomHost *string `json:"customHost,omitempty"`
EgressCreditBillingEnabled *bool `json:"egressCreditBillingEnabled,omitempty"`
EgressCreditPerUnit *int `json:"egressCreditPerUnit,omitempty"`
EgressCreditUnitBytes *int `json:"egressCreditUnitBytes,omitempty"`
Endpoint string `json:"endpoint"`
Region *string `json:"region,omitempty"`
SecretKey string `json:"secretKey"`
Title string `json:"title"`
}
// CreateStorageJSONBodyMode defines parameters for CreateStorage.
type CreateStorageJSONBodyMode string
// UpdateStorageJSONBody defines parameters for UpdateStorage.
type UpdateStorageJSONBody struct {
AccessKey *string `json:"accessKey,omitempty"`
@@ -3538,16 +3497,12 @@ type UpdateStorageJSONBody struct {
EgressCreditPerUnit *int `json:"egressCreditPerUnit,omitempty"`
EgressCreditUnitBytes *int `json:"egressCreditUnitBytes,omitempty"`
Endpoint *string `json:"endpoint,omitempty"`
Mode *UpdateStorageJSONBodyMode `json:"mode,omitempty"`
Region *string `json:"region,omitempty"`
SecretKey *string `json:"secretKey,omitempty"`
Status *UpdateStorageJSONBodyStatus `json:"status,omitempty"`
Title *string `json:"title,omitempty"`
}
// UpdateStorageJSONBodyMode defines parameters for UpdateStorage.
type UpdateStorageJSONBodyMode string
// UpdateStorageJSONBodyStatus defines parameters for UpdateStorage.
type UpdateStorageJSONBodyStatus string