mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 16:09:39 +00:00
* 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>
68 lines
1.7 KiB
TypeScript
68 lines
1.7 KiB
TypeScript
import { AppService, FlowService } from './gen'
|
|
import hubPathsData from './hubPaths.json'
|
|
import {
|
|
replacePlaceholderForSignatureScriptTemplate,
|
|
SIGNATURE_TEMPLATE_FLOW_HUB_ID,
|
|
SIGNATURE_TEMPLATE_SCRIPT_HUB_PATH
|
|
} from './components/triggers/http/utils'
|
|
|
|
export const DEFAULT_HUB_BASE_URL = 'https://hub.windmill.dev'
|
|
export const PRIVATE_HUB_MIN_VERSION = 10_000_000
|
|
|
|
export const HubScript = {
|
|
SIGNATURE_TEMPLATE: SIGNATURE_TEMPLATE_SCRIPT_HUB_PATH
|
|
} as const
|
|
|
|
export const HubFlow = {
|
|
SIGNATURE_TEMPLATE: SIGNATURE_TEMPLATE_FLOW_HUB_ID
|
|
} as const
|
|
|
|
export function replaceScriptPlaceholderWithItsValues(id: string, content: string) {
|
|
switch (id) {
|
|
case HubScript.SIGNATURE_TEMPLATE:
|
|
case HubFlow.SIGNATURE_TEMPLATE:
|
|
return replacePlaceholderForSignatureScriptTemplate(content)
|
|
default:
|
|
return content
|
|
}
|
|
}
|
|
|
|
export async function loadHubFlows() {
|
|
try {
|
|
const flows = (await FlowService.listHubFlows()).flows ?? []
|
|
const processed = flows.sort((a, b) => b.votes - a.votes)
|
|
return processed
|
|
} catch {
|
|
console.error('Hub is not available')
|
|
}
|
|
}
|
|
|
|
export async function loadHubApps() {
|
|
try {
|
|
const apps = (await AppService.listHubApps()).apps ?? []
|
|
const processed = apps.sort((a, b) => b.votes - a.votes)
|
|
return processed
|
|
} catch {
|
|
console.error('Hub is not available')
|
|
}
|
|
}
|
|
|
|
type HubPaths = {
|
|
gitSyncTest: string
|
|
gitInitRepo: string
|
|
slackErrorHandler: string
|
|
slackRecoveryHandler: string
|
|
slackSuccessHandler: string
|
|
slackReport: string
|
|
discordReport: string
|
|
smtpReport: string
|
|
teamsErrorHandler: string
|
|
teamsRecoveryHandler: string
|
|
teamsSuccessHandler: string
|
|
emailErrorHandler: string
|
|
cloneRepoToS3forGitRepoViewer: string
|
|
appReport: string
|
|
}
|
|
|
|
export const hubPaths = hubPathsData as HubPaths
|