Apostrophe 4.31.0: Developer Activation #5474
BoDonkey
announced in
Release Notes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Apostrophe Community!
Apostrophe 4.31.0 is our first quarterly feature release, and its theme is Developer Activation — a focused set of changes that make ApostropheCMS meaningfully easier to adopt, extend, and deploy. This release introduces JSX as a server-side templating option, a redesigned CLI installer, support for PostgreSQL and SQLite databases, and several security patches that warrant prompt attention from all users.
New.interactive.CLI.mp4
JSX Templates
Apostrophe page, widget, and component templates can now be written in JSX as an alternative to Nunjucks. For developers already comfortable with React or another JSX-aware framework, this means real JavaScript control flow, modern editor support, and accurate error reporting with source maps — without standing up a separate front-end project.
JSX templates are a server-side templating feature, not a React runtime. There is no virtual DOM, no client runtime, and no framework requirement. JSX and Nunjucks coexist freely in the same project and can be migrated incrementally, allowing teams to convert individual templates over time while keeping existing layouts in place. Nunjucks remains a fully supported, first-class option. And Astro continues to be a great option for those who need dynamic islands, support for multiple frontend frameworks on the back end, or static build support.
We're releasing JSX now to gather community feedback, and will be updating our documentation over time to show it as the preferred authoring path for new projects. See the JSX templates guide to get started.
A New Interactive CLI Installer
apos createnow delegates to the newcreate-apostrophepackage, delivering a guided interactive installer that walks developers through project name, starter kit selection, and database configuration via prompts. This was a heavily requested improvement on our roadmap, and substantially lowers the barrier to getting a new Apostrophe project running from scratch.Under the hood,
create-apostropheis a standalone installer that can also be invoked directly vianpm create apostrophe@latest. It supports SQLite, MongoDB, and PostgreSQL out of the box, handles sample data for demo kits, and creates an admin user — all in a single flow.PostgreSQL, SQLite, and Multi-Postgres Database Support
ApostropheCMS now supports PostgreSQL and SQLite databases, in addition to MongoDB. Connection is via standard URI:
postgres://,sqlite://and, for multisite projects,multipostgres://URIs are all recognized by the newdb-connectAPI, which covers all database operations used in our own core, Pro and Assembly modules.This opens the door for teams with existing PostgreSQL investments, and gives developers a lightweight SQLite option for local development.
Command-line utilities are also provided to dump and restore databases in a universal way, across all three databases.
See the database configuration documentation for details.
Security Updates
This release includes several proactively identified and responsibly disclosed security fixes across core,
@apostrophecms/seo, andsanitize-html. We recommend all users upgrade promptly withnpm update.Full details are available in the changelog below and in the published GitHub security advisories.
Additional Improvements
Beyond the headline features, this release focuses on editing stability and deployment ergonomics.
Resilient schemas: Adding or removing area fields from a schema no longer breaks existing documents on external front ends like Astro. Missing or orphaned areas now fail gracefully, and newly added fields are materialized as empty objects, so editors can work with them immediately in context.
Streamlined configuration: Session secrets and
uploadfskeys can now be set via environment variables, bringing them in line with the rest of Apostrophe's environment-based configuration and modern CI/CD practices.Community Contributions
Thanks to tonghuaroot, H3xV0rT3x, 5h1kh4r, EchoSkorJjj, hibrian827, and Dipanshu singh for their security reports and contributions in this release.
Node 20: End of Support
Node 20 has officially passed its end of life date upstream, and is not supported by Apostrophe 4.31.0. Those who are still using Node 20 should upgrade locally to Node 22 or 24, test their code, and deploy to Node 22 or 24.
Node 26: Start of Support
Node 26 is not yet an official long-term-support release upstream, so most users should continue to use Node 22 or 24 in production for now. However, we have introduced Node 26 support in this release of Apostrophe.
How to Update
Update your projects with
npm updateand let us know what you think on our roadmap.🚀 Happy coding!
The “stable” option
Everything above reflects our standard, “latest” module releases. Our Hosting, Pro and Assembly customers also have the option of following our “stable” releases. The difference is simple: The stable releases receive new features one full quarter later, but receive bug fixes and security fixes at the same time as “latest.” In order for this to be an effective technique to increase stability, customers still need to actively evaluate “latest” so that they have meaningful head start on what is coming in “stable.” Customers interested in following this path should reach out for complete information on how to point their dependencies to “stable.”
Everything we ship as “latest” is 100% ready for production. The “stable” series is an option for those with a large investment in training, automated testing, etc. It allows delayed implementation of new features without falling behind on fixes.
Apostrophe 4.31.0
Adds
draggable: falseon non-inlinearrayschema fields. Previously this option was only respected wheninline: true. When set on a standard (modal-based) array field, drag-and-drop reordering and keyboard reordering are now disabled in the array editor's slat list.disabledFileKeycan now be supplied via theAPOS_SESSION_SECRETandAPOS_UPLOADFS_DISABLED_FILE_KEYenvironment variables. As with other Apostrophe environment variables, these take precedence over the correspondingapp.jsconfiguration.Fixes
Fixed Tab navigation escaping out of modals when the form contained hidden sections or elements that became disabled after editing.
AposAreanow 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.apos.util.getManagerOfaccepts a{ log }option to suppress its error log when probing objects that may not have a manager.Security
apos.util.set()andapos.util.get()now refuse to traverse__proto__,constructorandprototypepath segments. Previously an authenticated editor could send a PATCH REST API request whose patch operators (for example$pullAllwith a key of__proto__.publicApiProjection) wrote toObject.prototype. A pollutedpublicApiProjectiondefeated thepublicApiCheck()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, H3xV0rT3x, and 5h1kh4r for reporting the vulnerability.@apostrophecms/filepretty URLs are enabled (prettyUrls: true), the upstream request used to serve the file is no longer built from the incomingHostheader. The self-request is now resolved against the site's configuredbaseUrl(viareq.baseUrl), falling back to the request host only when nobaseUrlis configured. This closes a server-side request forgery (SSRF) vector in which theHostheader 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 for reporting the issue.Pro Modules
@apostrophecms-pro/cypress-tools1.0.0-beta.29Automated functional browser tests are an important part of quality assurance for enterprise websites and web applications. Cypress is an industry-standard, open-source library for carrying out automated functional browser tests. This module provides a collection of conveniences for testing the ApostropheCMS admin UI within Cypress. Explore our documentation to learn how this extension can enhance your project. Once you're ready, obtain a license and install it through Apostrophe Workspaces. For further details or inquiries, feel free to contact us or visit our pricing page.
Fixes
db-connectdependency to the official one.@apostrophecms-pro/document-versions2.7.1This module automatically creates versions of your published documents and allows manual restore to any previously saved version. Explore our documentation to discover how this extension can enhance your project. Integrate it through Apostrophe Workspaces. For further details or inquiries, feel free to contact us or visit our pricing page.
Fixes
@apostrophecms-pro/multisite4.5.0This module lets you have many ApostropheCMS websites running on a single codebase in a single Node.js process. Each has its own database, users, media uploads, etc. Sites can be created and managed via a dashboard site. Explore our documentation to discover how this extension can enhance your project. For further details or inquiries, feel free to contact us or visit our pricing page.
Adds
@apostrophecms-pro/multisite-dashboard1.7.0This extension creates the new default multisite dashboard with infinite scroll, search functionality, and the ability to save templates. This extension requires that the project also have the
@apostrophecms-pro/multisiteextension installed and configured. Explore our documentation to discover how this extension can enhance your project. For further details or inquiries, feel free to contact us or visit our pricing page.Adds
Free Modules
@apostrophecms/apostrophe-astro1.13.0This module integrates ApostropheCMS into your Astro application.
Fixes
AposAreanow 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.apos.util.getManagerOfaccepts a{ log }option to suppress its error log when probing objects that may not have a manager.@apostrophecms/import-export3.6.1Changes
debug: trueoption on the@apostrophecms/import-exportmodule, or by setting theAPOS_DEBUG_IMPORT_EXPORT=1environment variable.@apostrophecms/redirect1.6.0Fixes
@apostrophecms/seo1.5.0Adds
Changes
seoSiteCanonicalUrlfield from global settings. The base URL is now derived automatically fromAPOS_BASE_URLor thebaseUrloption. The value remains available atreq.data.global.seoSiteCanonicalUrlfor backwards compatibility.Security
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 escapedjsonnodes, 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/seowith untrusted editors should upgrade promptly to close this vulnerability. Thanks to H3xV0rT3x and hibrian827 for reporting the issue.Utilities
@apostrophecms/cli3.7.0The Apostrophe CLI is a cross-platform starting point for creating and configuring ApostropheCMS projects, providing a simple boilerplate generator and wrapping other useful functions into an easy to use command line tool.
Adds
apos createis now an interactive guided installer (it delegates tocreate-apostrophe). The<shortname>positional argument and the--starterand--mongodb-urioptions have been removed - project name, starter kit, and database are now chosen through prompts. For scripted installs, usenpm create apostrophe@latest -- --unattendedinstead.create-apostrophe1.0.1create-apostropheis the guided installer behindnpm create apostrophe. It clones a starter kit, wires up your database, installs dependencies, and creates an admin user — so a fresh Apostrophe project is running in minutes. It can be used standalone vianpm create apostrophe@latestor through the Apostrophe CLI'sapos createcommand.Adds
Fixes
-Fix CLI link
sanitize-html2.17.5Security
javascript:and similar. None of these are used in the default configuration ofsanitize-htmlorapostropheor likely to be used there, and some attributes, like anactionfor aform, 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 for reporting the vulnerability.launder1.7.1Security
laundernow uses and exports the best available naughtyHref function for detecting malicious URLs. sanitize-html now depends on it, and apostrophe now uses type: 'url' for the link URL field of image widgets, which leverages it. Prior to this fix, it was possible for any user with editing privileges, including a contributor, to trigger arbitrary JavaScript via a javascript: URL in the link URL field of an image widget. A migration has been included to strip any such malicious URLs already present in the database. All users of apostrophe are encouraged to upgrade to get this security fix. Thanks to Muhammad Uwais for reporting the issue.Beta Was this translation helpful? Give feedback.
All reactions