feat: ssr:coolify publish target (SSR image → registry → Coolify deploy webhook) - #37
Merged
Merged
Conversation
Pull sync → generate → patch → Dockerfile → docker build into
buildDockerImage({ buildId, domain, workDir, imageTag }). publishBuildSsr
keeps only the local docker run + state + proxy registration. A remote
pipeline (Coolify) can now build the same image with a registry-prefixed
tag and push it. No behaviour change.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rF3HMB1Z7V3LLsYaUrELs
New host "coolify" for SSR: the publisher owns no Coolify credentials.
Each site is hosted on its owner's Coolify (a different server per
client). The owner creates a "Docker Image" app pulling
${REGISTRY_URL}/ws-<slug> and hands us its deploy webhook URL, passed
per-publish in the /publish body (coolifyWebhookUrl / coolifyWebhookToken?).
publishBuildCoolifySsr: tear down any local serving → buildDockerImage()
tagged ${REGISTRY_URL}/ws-<slug>:latest (+ :<buildId>) → docker login
(token via env, never logged) + push both tags → POST the webhook so
Coolify pulls :latest and redeploys → state.json { mode: "coolify" }.
No Coolify API calls, no Traefik, no polling — a 2xx webhook = queued.
isSafeWebhookUrl rejects non-https / loopback / private hosts (SSRF).
REGISTRY_URL (+ REGISTRY_USER / REGISTRY_TOKEN) gates the target;
/capabilities reports coolify + lists ssr:coolify in targets.
DOCKER_SITE_DOCKERFILE gains ENV IPX_HTTP_ALLOW_ALL_DOMAINS=true + EXPOSE
3000 so a Coolify-hosted app needs no manual config.
webstudio-self-host#23. Fork side (webhook field in the Publish panel) is
a separate PR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rF3HMB1Z7V3LLsYaUrELs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publisher side of webstudio-self-host#23. Two commits.
1.
refactor: extract buildDockerImage()Pull
sync → generate → patch → Dockerfile → docker buildout ofpublishBuildSsrintobuildDockerImage({ buildId, domain, workDir, imageTag }).publishBuildSsrkeeps the localdocker run+ state + proxy registration. No behaviour change.2.
feat: ssr:coolifyThe publisher owns no Coolify credentials. Each site is hosted on its owner's Coolify (potentially a different server per client):
${REGISTRY_URL}/ws-<slug>(port 3000) and copies its deploy webhook URL./publishbody —coolifyWebhookUrl/coolifyWebhookToken.publishBuildCoolifySsr: tear down local serving →buildDockerImage()tagged${REGISTRY_URL}/ws-<slug>:latest(+:<buildId>) →docker login(token via env, never logged) +docker pushboth tags →POSTthe webhook →state.json { mode: "coolify" }.2xxfrom the webhook means "deploy queued".isSafeWebhookUrlrejects non-https / loopback / private hosts (SSRF guard).Config:
REGISTRY_URL(+REGISTRY_USER/REGISTRY_TOKENif private) gates the target — instance-wide, one registry the publisher pushes to and every client's Coolify pulls from (ghcr.io public = simplest, or your ownregistry:2)./capabilities→coolify: !!REGISTRY_URL, listsssr:coolifyintargets.DOCKER_SITE_DOCKERFILEgainsENV IPX_HTTP_ALLOW_ALL_DOMAINS=true+EXPOSE 3000so a Coolify-hosted app needs no manual env.Not here
REGISTRY_*in.env.example(optional) + README section — separate PR.ssg:coolify(feat(ssg): rewrite absolute URLs in .xml so sitemaps get the right origin #24) — thin follow-up (nginx image instead of node).Test
node --check+ resolver smoke tests. No test suite in this repo — e2e (build → push → webhook) on the Coolify bench once the fork + self-host PRs land.🤖 Generated with Claude Code
https://claude.ai/code/session_017rF3HMB1Z7V3LLsYaUrELs