Fix API meta public origin #51

Merged
erik merged 1 commit from task-9fb83661-api-meta-public-origin into main 2026-06-30 14:09:40 -05:00
Owner

Summary

  • Makes API meta generation prefer ACTIVITYPUB_PUBLIC_ORIGIN when configured.
  • Applies the public origin to site.url, api.baseUrl, and api.openapiUrl for proxied production requests.
  • Preserves persisted/default site URLs when no public origin is configured.
  • Adds tests for proxied production public-origin behavior and persisted URL reconciliation.

Verification

  • npm run build
  • npm test

Notes

This fixes the production /api/v1/meta issue observed after deploying 0.1.33, where metadata reported http://localhost:3000 and proxied HTTP URLs despite ACTIVITYPUB_PUBLIC_ORIGIN=https://slugkit.com being set.

## Summary - Makes API meta generation prefer `ACTIVITYPUB_PUBLIC_ORIGIN` when configured. - Applies the public origin to `site.url`, `api.baseUrl`, and `api.openapiUrl` for proxied production requests. - Preserves persisted/default site URLs when no public origin is configured. - Adds tests for proxied production public-origin behavior and persisted URL reconciliation. ## Verification - `npm run build` - `npm test` ## Notes This fixes the production `/api/v1/meta` issue observed after deploying `0.1.33`, where metadata reported `http://localhost:3000` and proxied HTTP URLs despite `ACTIVITYPUB_PUBLIC_ORIGIN=https://slugkit.com` being set.
Author
Owner

Review summary

The PR directly addresses the API meta public-origin bug by passing the runtime environment into meta generation and making ACTIVITYPUB_PUBLIC_ORIGIN the canonical public origin when configured.

Acceptance criteria

  • API meta generation prefers the configured public origin when available, especially ACTIVITYPUB_PUBLIC_ORIGINcreateApiMetaResponse now reads and applies ACTIVITYPUB_PUBLIC_ORIGIN.
  • Live/proxied requests report HTTPS public URLs in site.url, api.baseUrl, and api.openapiUrl — proxied http://slugkit.com/api/v1/meta test with public origin expects HTTPS URLs.
  • Existing persisted site config values are preserved or intentionally reconciled with the public origin — test preserves persisted URL without public origin and intentionally reconciles to the configured public origin when set.
  • Tests cover default local behavior and production/proxied public-origin behavior — existing default metadata test remains and new production/proxied tests were added.
  • npm run build and npm test pass — PR body reports both checks passed.

Blocking issues

  • None.

Warnings

  • None.

Verdict

Approved.

## Review summary The PR directly addresses the API meta public-origin bug by passing the runtime environment into meta generation and making `ACTIVITYPUB_PUBLIC_ORIGIN` the canonical public origin when configured. ## Acceptance criteria - [x] API meta generation prefers the configured public origin when available, especially `ACTIVITYPUB_PUBLIC_ORIGIN` — `createApiMetaResponse` now reads and applies `ACTIVITYPUB_PUBLIC_ORIGIN`. - [x] Live/proxied requests report HTTPS public URLs in `site.url`, `api.baseUrl`, and `api.openapiUrl` — proxied `http://slugkit.com/api/v1/meta` test with public origin expects HTTPS URLs. - [x] Existing persisted site config values are preserved or intentionally reconciled with the public origin — test preserves persisted URL without public origin and intentionally reconciles to the configured public origin when set. - [x] Tests cover default local behavior and production/proxied public-origin behavior — existing default metadata test remains and new production/proxied tests were added. - [x] `npm run build` and `npm test` pass — PR body reports both checks passed. ## Blocking issues - None. ## Warnings - None. ## Verdict Approved.
erik merged commit c52d7c09a1 into main 2026-06-30 14:09:40 -05:00
erik deleted branch task-9fb83661-api-meta-public-origin 2026-06-30 14:09:40 -05:00
Sign in to join this conversation.
No description provided.