Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6b21531
replace virtual modules with generated files, formalize public helper…
BoDonkey Jun 3, 2026
9048c2e
Add changeset
BoDonkey Jun 3, 2026
f1333cf
Helpers cleanup
BoDonkey Jun 4, 2026
a33b84a
Path correction
BoDonkey Jun 4, 2026
a70b170
Add .d.ts and tsconfig files
BoDonkey Jun 4, 2026
83272f4
Remove first design doc
BoDonkey Jun 4, 2026
e9d94cd
Remove final design doc
BoDonkey Jun 4, 2026
99644c0
Better static cache root dir behavior and docs fix
BoDonkey Jun 4, 2026
ffaecff
Bump dependancy
BoDonkey Jun 5, 2026
ea8f042
Refactor for non-bc
BoDonkey Jun 5, 2026
df33277
Migration and version number
BoDonkey Jun 5, 2026
2ab77f9
Response to comments.
BoDonkey Jun 6, 2026
93157d9
Deprecate old files
BoDonkey Jun 6, 2026
564aabb
Fixes upgrade header handling
BoDonkey Jun 17, 2026
32f7a9a
Add tests
BoDonkey Jun 18, 2026
ffdffdc
Fix raw-text sanitization bypass vulnerability and add regression tes…
Dipanshusinghh Jun 4, 2026
c21d5fb
changeset for singh contribution (#5442)
boutell Jun 4, 2026
62d710d
Fix relationship select scrolling issue (#5445)
myovchev Jun 5, 2026
f1dd138
jsx changeset (#5446)
boutell Jun 5, 2026
3bc03d8
Ensure install of the project root for astro projects (#5449)
myovchev Jun 8, 2026
8899103
test node 26 (#5450)
boutell Jun 8, 2026
4e1be7a
Add link for telemetry policy (#5455)
BoDonkey Jun 9, 2026
ff6cbb6
remove absent options (#5456)
boutell Jun 9, 2026
043c215
Remove consumed 4.30.0 changesets from main (#5454)
BoDonkey Jun 10, 2026
6fba442
cli links that are correct, or will be post publish (#5458)
boutell Jun 10, 2026
a6daca5
release db connect to solve chicken and egg problem in cypress-tools …
boutell Jun 10, 2026
227b638
Corrects documentation links (#5457)
BoDonkey Jun 10, 2026
6e6b98c
Merge commit from fork
boutell Jun 10, 2026
6d48f1f
Merge commit from fork
boutell Jun 10, 2026
20a29ea
Merge commit from fork
boutell Jun 10, 2026
736d6c4
Merge commit from fork
boutell Jun 10, 2026
5fda79e
Mergeback latest (#5468)
boutell Jun 10, 2026
5094022
Hotfix cli links (#5469)
BoDonkey Jun 10, 2026
7a29be1
Fix asset URLs when a site prefix is configured (#5448)
Manohar2503 Jun 11, 2026
56a844a
Mergeup latest to main (#5473)
boutell Jun 11, 2026
1937537
fix: treat col as a self-closing tag (#5447)
vansh1011 Jun 16, 2026
57a01ab
Add explicit test for inline configuration collapsing (#5475)
myovchev Jun 17, 2026
334dc61
Pro 9442 insensitive redirects (#5479)
BoDonkey Jun 17, 2026
91ecf47
Bump undici, fix a leak (#5480)
myovchev Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/a11y-admin-nav.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/a11y-context-title.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/a11y-locale-switcher.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/a11y-recently-edited-icon.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/a11y-sr-only.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/a11y-tray-aria.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/boozy-manual-severaltoms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sanitize-html": patch
---

Security: added a number of new attributes to be protected against unsafe URLs, e.g. `javascript:` and similar. None of these are used in the default configuration of `sanitize-html` or `apostrophe` or likely to be used there, and some attributes, like an `action` for a `form`, are inherently unsafe to allow if XSS protection is your goal. Nevertheless it makes sense to block certain URL types where they are not appropriate. Some attributes are not supported at all by modern browsers but are included for completeness. Thanks to [crattack](https://github.com/crattack) for reporting the vulnerability.
5 changes: 0 additions & 5 deletions .changeset/busy-spies-enter.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/clean-actors-laugh.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cozy-wombats-burn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fiery-lights-fetch.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/fifty-hornets-follow.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/file-pretty-url-host-header-ssrf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"apostrophe": patch
---

Security: when `@apostrophecms/file` pretty URLs are enabled (`prettyUrls: true`), the upstream request used to serve the file is no longer built from the incoming `Host` header. The self-request is now resolved against the site's configured `baseUrl` (via `req.baseUrl`), falling back to the request host only when no `baseUrl` is configured. This closes a server-side request forgery (SSRF) vector in which the `Host` header could steer the proxied fetch at another host. The real-world risk was low: the path is constrained to an existing attachment's `/uploads/attachments/<cuid>-<slug>.<ext>`, and cuids are unique and immutable, so any reachable content was already public via the front door. Thanks to [EchoSkorJjj](https://github.com/EchoSkorJjj) for reporting the issue.
5 changes: 0 additions & 5 deletions .changeset/full-symbols-obey.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/jolly-zoos-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apostrophecms/redirect": minor
---

New `caseInsensitive` option. When enabled, "Old URL" values are stored in lowercase and incoming request URLs are matched case-insensitively. A migration lowercases existing redirects when the option is enabled. See the README for details, including a note on the non-reversible nature of this change.
5 changes: 5 additions & 0 deletions .changeset/mighty-wasps-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-apostrophe": patch
---

Fixes broken link
5 changes: 5 additions & 0 deletions .changeset/new-doors-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sanitize-html": patch
---

Address a potential vulnerability when nonTextTags is configured in a nonstandard way. While it is never a good idea to remove known non-text tags from the standard list e.g. script, styles, etc., this change ensures that doing so does not result in nested tags being passed through without sanitization when they are not expressly allowed. (ApostropheCMS would never trigger this situation.) Thanks to [Dipanshu singh](https://github.com/Dipanshusinghh) for pointing out the issue and contributing the fix.
5 changes: 5 additions & 0 deletions .changeset/old-seals-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apostrophecms/apostrophe-astro": minor
---

Upgraded the `undici` HTTP client from v6 to v8, which requires Node.js 22.19 or newer, and fixed a connection leak in the Astro proxy where responses that are not streamed on to the browser — redirects (301/302/307/308) and bodyless responses (204/304) — now release their backend response body immediately instead of leaving it for garbage collection, which under load could hold connections open and exhaust the connection pool.
7 changes: 0 additions & 7 deletions .changeset/open-garlics-smile.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/pink-buckets-write.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/proud-moons-guard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"apostrophe": patch
---

Security fix: server-side prototype pollution (CWE-1321) via dot-notation paths. `apos.util.set()` and `apos.util.get()` now refuse to traverse `__proto__`, `constructor` and `prototype` path segments. Previously an authenticated editor could send a PATCH REST API request whose patch operators (for example `$pullAll` with a key of `__proto__.publicApiProjection`) wrote to `Object.prototype`. A polluted `publicApiProjection` defeated the `publicApiCheck()` authorization gate on piece-type REST endpoints for subsequent unauthenticated requests, for the lifetime of the Node.js process. All users should update. Thanks to [tonghuaroot](https://github.com/tonghuaroot), [H3xV0rT3x](https://github.com/H3xV0rT3x), and [5h1kh4r](https://github.com/5h1kh4r) for reporting the vulnerability.
5 changes: 0 additions & 5 deletions .changeset/quick-guests-join.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/seo-analytics-xss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apostrophecms/seo": patch
---

Security: the Google Analytics tracking ID (`seoGoogleTrackingId`) and Google Tag Manager ID (`seoGoogleTagManager`) global SEO fields were interpolated directly into the bodies of inline `<script>` tags without escaping. Any user permitted to edit the global document, including editors and contributors (if their submission were approved), could set these fields to a value that broke out of the surrounding script and executed arbitrary JavaScript for every visitor on every page (stored XSS). These values are now emitted as escaped `json` nodes, matching the JSON-LD handling, so they can no longer terminate the `<script>` element or escape the string literal they sit in. All projects using `@apostrophecms/seo` with untrusted editors should upgrade promptly to close this vulnerability. Thanks to [H3xV0rT3x](https://github.com/H3xV0rT3x) and [hibrian827](https://github.com/hibrian827) for reporting the issue.
6 changes: 0 additions & 6 deletions .changeset/seven-emus-vanish.md

This file was deleted.

16 changes: 16 additions & 0 deletions .changeset/six-socks-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@apostrophecms/apostrophe-astro": minor
---

- Replace vite-plugin-apostrophe-config and vite-plugin-apostrophe-doctype with
vite/vite-plugin-apostrophe-generated-config.js, which writes real files to
node_modules/.apostrophe-astro-config/ (config.js, doctypes.js)
- Register Vite aliases for apostrophe-astro-config/config and /doctypes
- Update all internal virtual: imports to alias specifiers
- Rename static build cache dir to node_modules/.apostrophe-astro-static/
- Add helpers/server/ (aposFetch, getAposHost, isStaticBuild)
- Add helpers/universal/ (URL, slug, styles, attachment helpers)
- Keep lib/aposPageFetch.js as the internal implementation (starter kit entrypoint only)
- Reduce lib/util.js, lib/aposSetQueryParameter.js, lib/static.js to deprecated shims
- Add MIGRATION.md
- Bump undici to ^7.x for Node.js 24+ compatibility
5 changes: 5 additions & 0 deletions .changeset/sixty-hats-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"apostrophe": patch
---

Fix invalid HTML output for <col> elements in sanitize-html (treat void elements correctly)
5 changes: 5 additions & 0 deletions .changeset/smart-kids-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"apostrophe": patch
---

Selecting an item in a relationship "browse" dialog no longer scrolls the title and Cancel/Select buttons out of view when the item is far down the list.
10 changes: 0 additions & 10 deletions .changeset/solid-boats-send.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/stale-shirts-read.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/upset-ties-cough.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/violet-windows-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"apostrophe": minor
---

JSX support for templates within ApostropheCMS. JSX is now co-equal with Nunjucks, with a gradual migration strategy. Anyone who is familiar with React will be very comfortable writing JSX templates, which also offer a superior debugging experience, and templates can be migrated gradually. JSX is a great option for those who don't wish to create parallel Astro and ApostropheCMS projects, but still prefer a modern syntax. For more information, see the new [JSX templates guide](https://apostrophecms.com/docs/guide/jsx-templates.html).
15 changes: 0 additions & 15 deletions .changeset/wild-forks-fetch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wild-lies-film.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions:

env:
# Define supported runtime versions for matrix expansion once for the workflow.
NODE_VERSIONS_JSON: "[20,22,24]"
NODE_VERSIONS_JSON: "[22,24,26]"
MONGODB_VERSIONS_JSON: '["7","8"]'
REDIS_VERSION: "7"
POSTGRES_VERSION: "16"
Expand Down
4 changes: 4 additions & 0 deletions packages/apostrophe-astro/.mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
loader: esmock
file: test/setup.js
spec: test/**/*.test.js
timeout: 5000
9 changes: 9 additions & 0 deletions packages/apostrophe-astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.13.0 (2026-06-10)

### Fixes

- Adding or removing an area field from a schema no longer breaks documents on an external front such as Astro.
- `AposArea` now renders only schema-backed areas. A missing area no longer throws, and an area orphaned by removing its field from the schema (while its content remains in the document) renders nothing instead of breaking sibling areas in edit mode. Logged-in editors get a diagnostic message in place of an orphaned area; anonymous visitors see nothing.
- Editable documents sent to an external front now materialize empty area objects for schema area fields added after the document was created, so they can be edited in context.
- `apos.util.getManagerOf` accepts a `{ log }` option to suppress its error log when probing objects that may not have a manager.

## 1.12.0

### Adds
Expand Down
62 changes: 62 additions & 0 deletions packages/apostrophe-astro/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Migrating to @apostrophecms/apostrophe-astro v1.13

## Astro v6 support

v1.13 adds support for Astro v6 (Vite 7). Astro v5 continues to work.

---

## Astro v6: remove `security.allowedDomains` from static builds

If your project uses `security.allowedDomains` in `astro.config.mjs` **and** runs static builds, guard it to SSR-only. In a static build Astro v6 reads `request.headers` to validate forwarded headers even during prerendering, producing a spurious warning for every page:

```
[WARN] `Astro.request.headers` was used when rendering the route `src/pages/[...slug].astro`
```

`allowedDomains` has no effect during prerendering (there are no real HTTP headers at build time), so the fix is straightforward:

```js
// astro.config.mjs
const isStatic = process.env.APOS_BUILD === 'static'; // or however you detect it

export default defineConfig({
output: isStatic ? 'static' : 'server',
// Only configure allowedDomains for SSR — it is meaningless during
// static prerendering and triggers a spurious headers warning in Astro v6.
...(!isStatic && {
security: { allowedDomains }
}),
// ...
});
```

---

## Deprecated: direct `lib/` imports for public helpers

Some `lib/` paths are deprecated in favour of the stable helper entry points. Note that `lib/aposPageFetch.js` is **not** deprecated — it is an internal function used by the starter kit's `[...slug].astro` entrypoint and is not part of the public API.

| Old import | New import |
|---|---|
| `@apostrophecms/apostrophe-astro/lib/static.js` | `@apostrophecms/apostrophe-astro/helpers/server` (`getAllStaticPaths`, `getAllUrlMetadata`, `getLocales`) |
| `@apostrophecms/apostrophe-astro/lib/aposSetQueryParameter.js` | `@apostrophecms/apostrophe-astro/helpers/universal` (`aposSetQueryParameter`) |
| `@apostrophecms/apostrophe-astro/lib/util.js` | `@apostrophecms/apostrophe-astro/helpers/universal` (`slugify`, etc.) |
| `@apostrophecms/apostrophe-astro/lib/aposStyles.js` | `@apostrophecms/apostrophe-astro/helpers/universal` (`stylesAttributes`, `stylesElements`) |
| `@apostrophecms/apostrophe-astro/lib/attachment.js` | `@apostrophecms/apostrophe-astro/helpers/universal` (`getAttachmentUrl`, `getAttachmentSrcset`, etc.) |

Example:

```js
// Before
import { getAllStaticPaths } from '@apostrophecms/apostrophe-astro/lib/static.js';

// After
import { getAllStaticPaths } from '@apostrophecms/apostrophe-astro/helpers/server';
```

---

## Removed: Vite virtual modules

`virtual:apostrophe-config` and `virtual:apostrophe-doctypes` were private implementation details and are no longer available. If you were importing either of these directly, remove those imports — there is no public replacement, as they were never part of the supported API.
4 changes: 2 additions & 2 deletions packages/apostrophe-astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Your `[...slug].astro` component should look like this:

```js
---
import aposPageFetch from '@apostrophecms/apostrophe-astro/lib/aposPageFetch.js';
import { aposPageFetch } from '@apostrophecms/apostrophe-astro/helpers/server';
import AposLayout from '@apostrophecms/apostrophe-astro/components/layouts/AposLayout.astro';
import AposTemplate from '@apostrophecms/apostrophe-astro/components/AposTemplate.astro';

Expand Down Expand Up @@ -651,7 +651,7 @@ links to each page of blog posts:

```js
---
import setParameter from '@apostrophecms/apostrophe-astro/lib/aposSetQueryParameter.js';
import { aposSetQueryParameter as setParameter } from '@apostrophecms/apostrophe-astro/helpers/universal';

const {
pieces,
Expand Down
2 changes: 1 addition & 1 deletion packages/apostrophe-astro/components/AposTemplate.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { templates } from 'virtual:apostrophe-doctypes';
import { templates } from 'apostrophe-astro-config/doctypes';

const { aposData } = Astro.props;

Expand Down
2 changes: 1 addition & 1 deletion packages/apostrophe-astro/components/AposWidget.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { widgets } from "virtual:apostrophe-doctypes";
import { widgets } from 'apostrophe-astro-config/doctypes';

const { widget, options, ...props } = Astro.props;
const isEdit = widget._edit && Astro.url.searchParams.get("aposEdit");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import config from "virtual:apostrophe-config";
import config from 'apostrophe-astro-config/config';

const { title, bodyClass, aposData } = Astro.props;
const { viewTransitionWorkaround } = config;
Expand Down
7 changes: 5 additions & 2 deletions packages/apostrophe-astro/components/layouts/AposLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import AposRunLayout from "./AposRunLayout.astro";
import AposEditLayout from "./AposEditLayout.astro";
import AposRefreshLayout from "./AposRefreshLayout.astro";
import config from 'virtual:apostrophe-config';
import config from 'apostrophe-astro-config/config';

const { aposData } = Astro.props;

Expand All @@ -13,7 +13,10 @@ if (!headersToInclude && config.forwardHeaders) {
headersToInclude = config.forwardHeaders;
}

if (headersToInclude && Array.isArray(headersToInclude)) {
// Response headers are only meaningful in SSR — prerendered static pages
// have no per-request HTTP response, and accessing Astro.response.headers
// in that context triggers a warning in Astro v6.
if (!config.staticBuild && headersToInclude && Array.isArray(headersToInclude)) {
const headers = aposData.aposResponseHeaders;
if (headers) {
for (const header of headersToInclude) {
Expand Down
Loading