Sites images#186
Merged
Merged
Conversation
Renames the `siteImages` table to `siteAssets` so a site can carry sub-pages, stylesheets, scripts, and fonts alongside images. Public URL stays at `/_assets/<filename>` on each site host. Allowed content types now include text/html, text/css, application/javascript, application/json, text/plain, application/wasm, woff/woff2 — plus the existing image types. - schema: `siteImages` → `siteAssets`, drops unused `kind` field - convex: siteImages.ts → siteAssets.ts; functions renamed accordingly - http route: /api/sites/resolve-image → /resolve-asset - server.ts: resolveSiteImageUrl → resolveSiteAssetUrl; path unchanged - UI: SiteImages → SiteAssets with type-aware icons; copy says "Files" - inspectSiteImages dev helper dropped along with the table Greenfield rename — no data migration needed since the only existing rows were test uploads on this branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # convex/_generated/api.d.ts # convex/dev.ts # convex/http.ts # convex/schema.ts # convex/sitesHttp.ts # server.ts # src/pages/SiteDetail.tsx
Browser uploads via presigned PUT need CORS on the Railway Bucket (allowed any origin, PUT/GET/HEAD). Adds a one-shot script to apply the CORSConfiguration and corrects the .env.example endpoint hint to match Railway's actual hostname pattern (t3.storageapi.dev). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Server-side capture for the bucket-served traffic on Railway. Two events: - site_view — fired on every successful HTML serve at / - site_asset_view — fired on every successful /_assets/<filename> resolve Properties include site_id, site_hostname, site_did, site_scid, content_type, referrer, IP and user-agent. Distinct id is hash(ip + ua + utc-day) so the same visitor is stable across one day with no cross-day linkage. Convex's resolveSiteAsset now returns siteId alongside the presigned URL so the server can include it in the event. No app-side tracking changes — the existing posthog-js stays in charge of user-attributed events. Reads POSTHOG_KEY / POSTHOG_HOST with VITE_POSTHOG_* fallback. No-ops when unconfigured. Errors are swallowed; events never block the response. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.