PhoenixKit 2.65.0: The last 2.x release, the bridge to 3.0
PhoenixKit 2.65.0 is the last 2.x release and the step every existing site has to take before PhoenixKit 3.0. It also gives every file a short code, keeps HDR in iPhone and AVIF photos, and fixes how S3 serves copied files.
The bridge to 3.0
PhoenixKit 3.0 stops creating the tables of the optional modules and can only upgrade a database at migration V225, which this release brings. Upgrade to 2.65.0, run mix phoenix_kit.update until it reports V225, and only then move to 3.0.
To prepare for that, mix phoenix_kit.update now runs module migrations in dependency order: Staff and Entities before Projects, Billing before E-commerce. Before, the order was by display name. Modules can also name the places in their tables that point at stored files and supply a manifest of their own tables, which mix phoenix_kit.repair and mix phoenix_kit.doctor check. Those two tools now check only core’s own tables. Nothing in any database is created, changed or dropped by this.
Short codes for files
Every file now has a random 8-character code, such as k3Fq9xA2, that can name it in a URL instead of its UUID. The migration gives every existing file a code in one UPDATE and then builds a unique index, which blocks writes to the files table while it is built. The code is not a secret and grants nothing: the file’s library still decides who may read it.
HDR photos from iPhone and Android
Thumbnails and previews of HEIC and AVIF photos with a gain map, as iPhones and Android phones take them, are now made as Ultra HDR JPEGs, as JPEG sources already were. This needs ffmpeg 7.1 or later. A size that cannot be made this way is made the ordinary way, as before.
Libraries and reserved names
A host can give its accounts a public library next to the personal one, and change a library’s slug. With config :phoenix_kit, :reserved_library_slugs and :reserved_usernames (both empty by default) a host keeps names for its own pages: a reserved username is refused, and a library slug that would match one gets a number.
Fix: S3 content types
Files copied between S3 buckets, such as after a storage profile change, or stored without options, were served as binary/octet-stream, so the browser downloaded them instead of showing them. The type now comes from the file’s extension. Objects already stored without a type keep it until their metadata is rewritten.
Upgrading
Run mix phoenix_kit.update for V224 (an index on the activity log) and V225 (the file short codes). On a very large site, run it in a quiet window. Then stay on 2.65.0 until you are ready for 3.0.
Full release notes: PhoenixKit 2.65.0
2.65.0 · 27 October 2026
The last 2.x release. Core 3.0 stops creating the tables of the optional modules (each module’s own migration chain creates
its tables) and strips that DDL from its migration modules, so it can only upgrade a database that is already at V225.
Upgrade to 2.65.0, run mix phoenix_kit.update until it reports V225, and only then move to 3.0; 3.0 refuses a lower
database with a message that names this release. This release also carries what 3.0 needs from the modules: the
file_references/0 and expected_schema/0 callbacks, the per-module manifests, and dependency-ordered module migrations.
Nothing in 2.65.0 changes behaviour for a host that does not use them.
Migrations V224 and V225 (V224, PR #983: an index on phoenix_kit_activities (resource_uuid, inserted_at); V225: phoenix_kit_files.short_code, below). Nothing else here migrates.
Fixed
- Objects copied between S3 buckets, or stored without options, are served with the right
Content-Type(#951).Providers.S3set the type only when the caller passed:content_type, andManager.copy_object/3(the reconcile after a profile change) andStorage.store_new_file/8pass none, so S3 served the object asbinary/octet-streamand a browser downloaded it instead of showing it. The provider now falls back to the type of the key’s extension. Objects already stored without a type keep it until their metadata is rewritten (for exampleput_object_copywithmetadata_directive: :REPLACE).
Added
-
mix phoenix_kit.updateruns module migrations in dependency order.Migrations.Modules.pending/1(and the neworder_by_dependencies/1) place a module after every pending module its OTP application depends on, sophoenix_kit_staffandphoenix_kit_entitiesmigrate beforephoenix_kit_projects, andphoenix_kit_billingbeforephoenix_kit_ecommerce. Until now the order was the display name, which only worked because core created every module’s tables first. No module change is needed; a cycle keeps name order instead of failing. -
A short code on every file (V225).
phoenix_kit_files.short_codeis a random 8-character base58 code (k3Fq9xA2: no0,O,Iorl) that names a file in a URL instead of its UUID, with a unique partial index.Storage.ShortCodemakes and checks them; theFilechangeset gives one to every new file (never cast from attrs, never changed), andStorage.get_file_by_short_code/1finds the file. The migration gives every existing file a code in SQL (duplicates redrawn until none repeat, then the index is built); the backfill is oneUPDATEof the table and the index build takes a SHARE lock on it, so run it in a quiet window on a very large site. A code is not a secret and grants nothing: the file’s library decides who may read it. -
Libraries.ensure_public_library/2andbackfill_public_libraries/1: a host may give its accounts a public library. The counterpart ofensure_personal_library/2, with the same rules (the host’s decision, no permission and no room under the limit, never a second one, not even after the user trashed theirs), except that it is public (visibility: "site") and never the user’s default; make the personal one first. Named “Public” unless:namesays otherwise. Making one is written to the history asstorage.library_publishedwith"by" => "system". -
Libraries.change_library_slug/3, for a host that names its pages by a library’s slug (the admin libraries page and any/<username>/<slug>address): unscoped likerename_library/3, written to the history, refuses a badly shaped, reserved or already used slug. -
Names a host keeps for its own pages.
config :phoenix_kit, :reserved_library_slugsand:reserved_usernames(both empty by default). A name that slugs to a reserved word is given the next free slug (photos-2),change_library_slug/3and a username that is reserved are refused ("is reserved"), and a username generated from an email address that is reserved gets a number (admin_1). Case does not matter; names already taken are not changed.Libraries.reserved_slug?/1,User.reserved_username?/1. -
HDR renditions of HEIC and AVIF photos.
HdrResizekept a gain map for a JPEG source only, so an iPhone photo (a HEIC) got ordinary thumbnails and previews.HeifHdrnow makes the same Ultra HDR JPEG from a HEIC or AVIF that has atmapitem (iPhone, Android):HeifBoxesreads the file’s boxes and its ISO 21496-1 parameters, ImageMagick cuts the picture,ffmpegdecodes the gain map (a tile grid, or a single picture), andHdrResize‘s writer assembles the picture, the map and the Multi-Picture directory.VariantGeneratorpicks the writer by container; a size that cannot be made this way (noffmpeg7.1+, a map with a value per colour channel or running backwards, a map of other proportions, anything unexpected) is made the ordinary way, as before. A photo’s rotation (irot) is applied to both pictures,strip_metadataand the focus crop work as for JPEG sources. Tested against a real iPhone HEIC (pixel-identical to the prototype that was checked in Safari on an iPad) and a synthetic AVIF. -
Hdr.read/1of a HEIC or AVIF reads the file’s boxes instead of matching bytes:"headroom"and"gain_map_bytes"are filled, and a new"parameters"map holds the gain map’s numbers under the names of Ultra HDR’shdrgmproperties. A HEIC whosemetabox is larger than 512 KB is now recognised too. -
Storage.VariantSets.remake_hdr_renditions/1remakes only the HDR-eligible sizes (keep_hdr, JPEG, a shape the map can follow) of files that have a gain map (HEIC and AVIF by default,containers:to choose), without the cost ofremake_all/1. Existing HEIC renditions are not seen as out of date otherwise, sincekeep_hdris not in the spec hash. -
PhoenixKit.Module.file_references/0: a module names the places in its own tables that point at a stored file. It returns{table, condition}pairs, the sameNOT EXISTSshape core’s orphan-file check has always used for module tables;PhoenixKit.ModuleRegistry.all_file_references/0collects them from every module, enabled or not. A module that implements it takes over its own tables: core’s built-in check for them steps aside, decided byPhoenixKit.Migrations.ModuleOwnedTables. A module that does not implement it keeps core’s built-in check, so nothing changes for a module version that predates the callback. A callback that raises or returns a malformed entry fails closed: no file is treated as orphaned until it is fixed. No default implementation exists on purpose, since an empty default would switch core’s protection off for every module. -
PhoenixKit.Module.expected_schema/0: a module supplies the manifest of its own tables. It returns a module implementingPhoenixKit.Migrations.ExpectedSchema.Behaviour, generated from the module’s own chain bydev_docs/squash/generate_module_manifest.exs(catalog queries only).PhoenixKit.ModuleRegistry.all_expected_schemas/0collects them from every module, enabled or not, andmix phoenix_kit.repair/doctorrun one more pass per manifest after core’s, through the same differ and the same additive-only executor. A module is checked only while its recorded version equals its chain head: one that is behind gets an info finding (:module_behind), one that was never migrated none. Findings carrymodule:(the OTP app) and their message starts with the app. No default implementation: a module without a manifest is simply not checked, as since the manifest was narrowed to core’s tables.PhoenixKit.TestSupport.ModuleChainCheck.build_alone/4builds core’s chain and then the module’s alone in a scratch schema, for generating and testing a manifest.
Changed
mix phoenix_kit.doctorandmix phoenix_kit.repaircheck core’s tables only. The manifest no longer lists the 141 tables that belong to modules (PhoenixKit.Migrations.ModuleOwnedTables), their columns, constraints, indexes, seed rows and the two email-table data invariants. A damaged module table is no longer reported or repaired by core; the module’s own chain puts it back onmix phoenix_kit.update. Nothing is created, changed or dropped in any database, and core’s migrations still create the module tables on a fresh install.
PhoenixKit 2.65.0. Install or update: {:phoenix_kit, "~> 2.65"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.