Files
windmill/backend/windmill-api
Tristan TR 48618cff8c feat: Add image when publishing a project (#10310)
* refactor(hub): remove per-item Publish to Hub entry points

Publishing to the Hub now happens exclusively through the folder-level
deploy-to-hub flow (/folders). Remove the standalone entry points:

- script detail page menu item (and the SCRIPT_VIEW_SHOW_PUBLISH_TO_HUB
  const that gated it)
- script list row dropdown item
- raw app editor menu item, its zip-download drawer and publishToHub()
- long-dead commented block in AppEditorHeader

Also drop the now-orphaned URL helpers (scriptToHubUrl, flowToHubUrl,
appToHubUrl, rawAppToHubUrl) from lib/hub.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(hub): upload a custom project logo from the deploy-to-hub drawer

Add a Logo field to the bundle metadata form: a drag-and-drop dropzone
(png/svg, 512KB client-side cap mirrored server-side by the Hub) that
turns into a live replica of the Hub project card once an image is
picked, so the logo can be judged in context before publishing. The
logo is pushed after the draft's items/migrations via the new
POST /projects/{slug}/logo proxy in hub_publish.rs (slug validated by
construction, `logo: null` forwarded to clear). Leaving the field empty
never touches the Hub's existing logo, so re-publishing a bundle keeps it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(hub): logo removal, safer mime inference, explicit clear semantics

Review follow-ups on the project logo upload:

- Removing a published logo is now possible: hubLogo is three-state
  (undefined = leave the Hub's logo alone, null = clear on publish,
  object = upload). Rehydration reads has_logo so the drawer shows a
  "Remove on publish" affordance when the Hub already has one, with an
  undo banner before publishing.
- hub_publish.rs uses a double-Option for the logo field: a missing
  `logo` key is now a 400 instead of being serialized as `logo: null`,
  which the Hub interprets as an explicit clear — POSTing `{}` can no
  longer silently delete a project's logo.
- Client mime inference prefers the browser-reported file.type over the
  filename extension, so a PNG misnamed *.svg no longer produces a
  broken preview and a guaranteed server-side sniff rejection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Update frontend/src/lib/components/workspaceSettings/deployToHubSession.svelte.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update frontend/src/lib/components/workspaceSettings/DeployToHub.svelte

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix(hub): validate logo size/mime/base64 in the proxy, document the endpoint

- Enforce the logo constraints in windmill-api itself instead of relying
  on the browser and remote Hub: a route-level DefaultBodyLimit sized
  for a max logo in base64 (+JSON envelope) overrides the global request
  limit, and the handler validates the mime allowlist, base64 alphabet
  and decoded length (512KB cap) before anything is forwarded.
- Add /w/{workspace}/hub/projects/{slug}/logo to openapi.yaml (with the
  ProjectLogoBody schema) and regenerate the frontend client.
- Drop a narrating comment on the hidden file input.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-07-24 18:19:25 +02:00
..
2024-04-08 01:42:43 +02:00

Windmill API

The API server, exposing functionality to other components and the frontend

This crate exposes both a library as well as a binary target.