Mishka CMS 0.0.3: A Stable Editor and Smarter Phoenix LiveView Admin

The visual editor reaches its first stable release, the admin shows what needs you, the blog gets feeds and analytics, and old links keep working. Built with Elixir, Phoenix LiveView and Ash.

Mishka CMS 0.0.3: A Stable Editor and Smarter Phoenix LiveView Admin

Mishka CMS 0.0.3 is out, three weeks after 0.0.2. The visual editor reaches its first stable release, the admin now tells you what needs your attention, and old links keep working when an address changes.

Phoenix LiveView apps are fast and live by default, yet a team that wanted a real CMS on them had two choices: build one from scratch, or run a second stack beside the app. Mishka CMS closes that gap. Pages, a blog, versioned docs and a visual editor live inside one Phoenix app and change while it runs, with no redeploy. It is open source under Apache 2.0 and free, for one site or many.

Why a lifetime seat

Free software still runs on someone's time.

Eleven packages moved forward in three weeks, each one written, tested and documented by a small team. Elixir has great libraries, but few products a whole team can run a website on. If you want Mishka CMS to become that product, a founding seat is how you keep it moving.

Pay once, $250Down from $1,200 until the countdown ends. No subscription.
First in lineYour questions and bug reports go to the front of our queue.
Every paid extensionWhatever we release that costs money is yours at no cost, for life.
Time left until the offer ends
105
D
22
H
35
M
37
S
Claim your seat · $250One payment, no subscription. Questions first? Contact us.

If you are new here, start with Introducing Mishka CMS: How We Built a Runtime CMS on Phoenix LiveView, then Mishka CMS 0.0.2: Visual Editor Package and Faster Previews. This post covers what changed since then, in plain words first and code second.

Newsletter

Mishka CMS releases. Once a month.

New Mishka CMS releases, Elixir and Phoenix patterns, and case studies from the team. No spam, unsubscribe anytime.

✓ once a month✓ no spam

What is new in Mishka CMS 0.0.3

Mishka CMS 0.0.3 updates every package the CMS is made of and adds one new package. Here is the release on one screen.

0.0.1first stable visual editor
11packages updated
1new package, mishka_slug
4security advisories closed

The visual editor is stable

The visual editor has its first stable release, 0.0.1 (see the Mishka CMS Builder documentation). It now checks your page while you work, so a mistake shows up before a visitor sees it.

A red dot in the top bar counts what would stop a Publish: a required field left empty, a missing slot, markup that will not compile. Click it and you get the list, element by element.

The Mishka CMS visual editor with the red problems dot open, listing what would stop the page from being published

The red dot lists what would stop a Publish, before you press it.

The editor also refuses markup the browser would quietly rewrite. Drag a form onto a paragraph and the paragraph turns red, with the rule written on it. The same check runs when you apply code by hand, and it gives the line and the column.

Animation: a form dragged over a paragraph in the Mishka CMS visual editor turns the paragraph red with the rule it would break

Drag a form onto a paragraph, and the editor says why it cannot go there.

Clear errors in the Code window"</span> does not close <div>" at the right line, in place of a stack trace.
CSS checked by a real parserA missing } or an unknown @apply class is refused before it can break the site's stylesheet.
Many elements at onceDuplicate, wrap, delete or paste styles on several elements in one undo step.
Tables in the content editorA Table button for posts and pages, on TipTap 3.35.0.

Two guides cover the editor end to end: Build a page in the visual editor and Visual editor keys, commands, blocks and starters.

An admin that tells you what needs you

The admin now tells you how the site is doing without you going to look. The bottom of the sidebar shows what the CMS checked a minute ago: all green, a note, or an issue with its worst line.

The Mishka CMS admin sidebar with its status card reading 7 issues and 1 failed job, beside the admin home on a phone with the compact top bar and the bell

Left: the sidebar card says what the CMS checked. Right: the admin on a phone.

  • One search box for every extension. The top bar asks each installed extension as you type and lists their answers in groups, and it is all keyboard friendly.
  • What needs you. The bell lists the things waiting for you, such as a background job that failed, above your notifications.
  • Skip a failed job. Mark it skipped with a reason, and bring it back later if you need to.
  • An admin for your phone. A phone top bar, a full-screen search and a sidebar that shows one level at a time.
The Mishka CMS activity log filtered to Skipped, showing a skipped background job with its reason and a Bring back link

A failed job skipped with a reason, ready to bring back.

Read The admin console: sidebar and top bar for every part of it, and Check the activity log for failed and skipped jobs.

The blog grows up

Mishka Blog 0.0.3 fills in what a working blog needs. A scheduled post now goes out on time, readers can follow the blog in their feed reader, and the analytics page shows real numbers.

Scheduled postsPublish at a time you pickA worker checks every minute and publishes every post that is due.
FeedsRSS, Atom and JSON FeedFor the whole blog and for each category, tag or author.
AddressesChoose where posts live/blog/post or /blog/category/post, one setting.
AnalyticsViews, readers, engagementFilter by category, tag, author or team, and compare with the previous period.
Animation: a click on Follow by RSS on the Mishka blog sends mishka.tools/feed into a feed reader, where the Mishka CMS 0.0.3 post appears

One click, and every new post reaches your feed reader.

Follow this blog in your feed reader

Click a feed, or paste https://mishka.tools/feed into Feedly, Inoreader, NetNewsWire or any reader you use.

The Mishka Blog analytics page with total views, unique readers and engagement, and filters by category, tag, author and team

Blog analytics with real numbers and filters.

Views are counted without a database write for each view, and a bot that runs no JavaScript is never counted. Editors also get control: a writer without the "Can Publish Directly" right saves a draft for an editor instead of publishing.

The new guides are Blog feeds, Choose where posts are read and Read the blog analytics. For the search side of a blog, read Blog SEO in Elixir: Structured Data, Sitemaps and Redirects with Mishka Blog.

When a page moves, the people and search engines that knew the old address still find it. Mishka CMS 0.0.3 finishes the redirect work we started in 0.0.2 and adds the parts a site moving from WordPress needs.

What happens to an old address
01

A visitor asks for an old address, say /2019/04/hello-world.

02

A redirect rule matches and does one of four things: sends a 301, shows another page at the same address (rewrite), answers 410 Gone, or answers 404. A rule can also match a query string.

03

Or the post moved inside the blog. When a post, category, tag or author changes its address, the CMS wrote a 301 rule for you at save time.

04

Nothing matches. The next page the address fits is tried, and then the visitor gets a real 404 with your error page.

The Mishka CMS redirect rules list with a query string rule, a 404 rule, a 410 rule, a rewrite and a 301 redirect

A redirect rule can send, rewrite, or answer 410 or 404.

A site can also keep WordPress address shapes such as /:year/:monthnum/:slug or /archives/:post_id. The companion extension Mishka CMS Migration 0.0.4 uses that: a WordPress import can keep every post at its old address and redirect only what moved, including comment pages.

Start with Redirect an old address and Import a WordPress site. The full move is in How to Move WordPress to Phoenix LiveView with Mishka CMS.

Analytics and verification tags, safely

A site admin can now add analytics, site verification and font tags to the public pages from the admin, with no code change. Open Pages, then Head code, and choose all pages, some pages, or all but some.

The Head code window of the Mishka CMS Pages screen with an analytics script entry for all public pages

Head code: analytics and verification tags, without a deploy.

Head code is parsed, never trusted. Only script, meta, link and noscript are kept, inline handlers are removed, and every script gets the page's nonce. The admin and the editor never load it. Read Add head code to public pages.

Smaller SEO fixes came with it: a site tagline you can use in titles, a post's own SEO title now wins over the layout's, and a site with no favicon serves the Mishka mark in place of a 404. See Set a page's SEO and share card.

Addresses in every language

The new package Mishka Slug (see the Mishka Slug documentation) makes web addresses that keep the reader's own alphabet. Latin text is cleaned the way WordPress does it, and other scripts stay as written. We ran these through MishkaSlug.slugify/2:

TitleLanguageSlug
Café au lait: 10 recipesEnglishcafe-au-lait-10-recipes
नमस्ते दुनियाHindiनमस्ते-दुनिया
東京の天気Japanese東京の天気
Привет, мир!Russianпривет-мир

The Blog, Mishka Document and the WordPress import all use it now. The story behind it is in Unicode Slugs in Elixir, and the package has its own docs at Mishka Slug.

Error pages and production

A site can now have one Default error page for every status it has no page of its own for, and the visitor still gets the real status code. A broken error page can no longer take the site down: it falls back to a plain message and one log line.

The Mishka CMS error page editor with an Offline entry and a Default entry for any error with no page of its own

One Default error page for every status without its own.

For deploys, GET /_health answers ok only when the CMS is really ready: every site's CSS and JS built, the extensions answering and the database up. Your deploy tool can wait on it before it sends traffic. The guides are Customize error pages and Deploy Mishka CMS to production.

Two changes we promised in the 0.0.2 post are now finished in released packages: a page with no layout is drawn exactly as its author wrote it, and the draft preview builds its stylesheet on every open under a strict Content-Security-Policy.

Docs keep every version

Mishka Document 0.0.3 keeps a version of every edit to a page, a note and their drafts. Open a page's history, look at any version and restore it.

The version history of a Mishka Document page, with Show and Restore for each version

Every edit of a docs page is kept, and any version can come back.

The Document admin page also does far less work: it reads its figures in one query per page in place of two per card. See Write pages and notes, and for the bigger picture, Versioned Docs in Phoenix LiveView with Mishka Document.

Security

  • Input sanitizers in GuardedStruct now fail closed: a sanitizer that raises no longer lets the raw value through.
  • An extension's API routes cannot take the CMS's own addresses such as /admin or /auth; the router refuses to compile.
  • A site's name can no longer leave its folder in the generated JavaScript entry.

An extra lock on page code: CODE_SIGNING_KEY

Set one environment variable, CODE_SIGNING_KEY, and code that did not come through the CMS will not run on your site. Mishka CMS pages can hold Elixir, and that code lives in the database. The signing key makes sure only code the CMS itself saved is ever executed.

Why it matters: if an attacker ever writes to your database, through a bug, a leaked password or a tampered backup, the code they slip in is not signed. The page still renders, but their code does nothing. Without the key, such a write could run code on your server.

1 · SaveThe CMS signs the codeEach snippet an author saves gets a signature made with your key.
2 · CompileThe signature is checkedBefore a page's code is built into the site, its signature must match.
3 · Tampered?It does nothingA missing or wrong signature becomes an empty step, and the rest of the site keeps serving.

The lock has been there since an early core release, but it had a bug: with the key set, page handlers lost their signature, so buttons such as Sign in did nothing. A user reported it in mishka_cms#72, and 0.0.3 fixes it with a test that writes every kind of stored code and reads its signature back.

0.0.3 also tells you when stored code cannot be checked, for example after you restore a backup from another server with another key. The boot log counts the unsigned snippets once and names the fix: sign them again on the running node, or run mix mishka.resign_code in development. Never re-sign a database someone edited by hand.

bin/mishka_cms rpc 'MishkaCmsCore.Runtime.Authoring.CodeAudit.resign()'
How-to guide · Mishka CMS documentationProtect page code with a signing keyTurn on code signing, read the boot warning, sign stored code again after a restore, and stop hand-written server code with PAGE_CODE.

For Elixir developers

The libraries under Mishka CMS are open source on their own, and each one moved forward in this release.

Mishka Gervaz 0.0.12, the admin kit for Ash, opens a row in a drawer, a phone sheet or a window, asks its confirm questions in a server-drawn window, and shows toasts with Undo. It also has choice cards, segmented controls and named table views. Start with Open a row in a drawer, Ask before an action and Show a toast, or read Mishka Gervaz: Build an Ash Admin with Tables and Forms.

GuardedStruct 0.1.11 refuses a nested value of the wrong shape, takes doc: on fields and writes a table into the generated type's docs. See Document a struct and its types and Validate and Sanitize Input in Elixir with GuardedStruct.

Mishka Installer 0.1.17 makes plugin events much faster. These are the numbers from its own benchmark on an Apple M4:

Build an event with 99 plugins

before2.5 s
0.1.170.22 s

Read an event from the registry

before7.5 µs
0.1.170.9 µs

Call a chain of 5 plugins

before58 ns
0.1.1738 ns

Shorter is faster. Bars are to scale within each row.

A plugin that raises no longer kills a request waiting inside it. The details are in Changes and upgrade notes, and the idea behind it in Runtime Plugins in Elixir: Add Features Without a Redeploy.

Everything else in 0.0.3, by package

The sections above are the highlights. Open a package to see the rest of what it added in this release.

  • The Users table has a Confirm email bulk action.
  • Two pages can no longer share a path, and /about/ and /about are the same page.
  • A page path can hold a wildcard in the middle, such as /:lang/*category/:slug, and can be written in any script.
  • An address with doubled slashes is sent to its single-slash path.
  • The media library takes .woff2 fonts, so a site can serve its own fonts, and it keeps its grid or table view in the address.
  • Every list ends in the same footer: a page-size picker, Load more, Load earlier and "Showing 1-40 of 136".
  • The sidebar nests two levels, remembers folded groups and shows live counts.
  • A number outside a setting's limits is refused with a message, not saved quietly.
  • Every address in a page's head, the sitemap and the feeds is encoded the same way, so pages in other scripts match their language versions.
  • Notices show success, info, warning and error in their own colour, and Mark all read updates your other tabs.
  • New permission: admin:dashboard:runtime:head_code for head code.
  • For developers: new extension events topbar:items, topbar:status, topbar:needs, topbar:search, topbar:bands, sidebar:status, settings:panels, runtime:page:moved, runtime:health:ready and feeds:entries.
  • Changed: internal names (components, layouts, pages, sites, media) keep Latin letters and digits only. Public addresses keep every script.

Read The mishka_cms_core package

  • Drawers and sidebars stay closed on the canvas until you open them with their chip, the Inspector or the layers pin.
  • Undo while typing undoes the typing, not an earlier change to the page.
  • Escape closes Code, Find, Settings and Examples, and no dark backdrop is left behind.
  • The Desktop canvas is at least 1180px wide, so it no longer shows the tablet layout.
  • A click on any element opens its Inspector, whatever tab was open.
  • Canvas frames and hover previews draw on white, as the published page does, even in dark theme.
  • A component dropped inside a paragraph is boxed as an inline element and no longer splits the paragraph.
  • The error page editor adds a Default entry from + Status.
  • A refused save says why, in place of "Autosave is failing".

Read The mishka_cms_builder package

  • Feed settings: turn feeds on or off, choose how many posts a feed holds (20 by default), and put the whole post in it or just a summary.
  • Blog pages tell feed readers where their feeds are, and category, tag and author pages name their own feeds.
  • Categories, tags, authors and teams show how many times their posts were read.
  • Keep daily views for 1 to 3650 days (730 by default); older counts are cleared each night.
  • Nested categories live at their whole chain, like /category/design/accessibility, and have their own heading and description.
  • Every post has a number, so /archives/123 works as it did on WordPress.
  • An admin can add a comment for a guest with a name, email and website; the website link is nofollow.
  • A post's content keeps figure, figcaption and responsive images, and drops style and object.
  • Unpublishing a scheduled post clears its schedule.
  • New permission: admin:dashboard:blog:publish.
  • For developers: events blog:dashboard:actions, blog:analytics:panels and blog:analytics:filters.

Read more about Mishka Blog

  • The documents page refreshes its figures once for a burst of changes, not on every change.
  • Slugs of workspaces, pages and tags come from mishka_slug, in the scripts the site publishes in.

Read more about Mishka Document

  • A new Blog pages choice: use the site's Blog pages, or create the missing ones at /blog.
  • Feeds, sitemaps, archives, paged posts and old slugs from WordPress all become redirects, written only to addresses the site serves.
  • The WordPress tagline and site icon come along.
  • A redirect you edited by hand waits for your decision before a re-run changes it.
  • The dry run plans everything exactly as the import will write it.

Read more about Mishka CMS Migration

  • Add extensions: [MishkaSlug.Ash] and write change slugify(:title, into: :slug) in an Ash action.
  • A taken slug gets a number: slug, slug-2, slug-3.
  • Shared option sets, your own separator, and keep-the-case if you want it.

Read more about Mishka Slug

  • Tab forms with free or step-by-step navigation, a Discard button and an unsaved-changes flag.
  • Whole-row links, a table footer slot, loading placeholder rows and a highlight for rows that arrive live.
  • Units beside inputs, min and max on dates and numbers, and errors while you type.
  • Fixed: a bulk action now runs only on the rows the table shows; before, Select all on a filtered table reached every row.
  • Fixed: a bad value in the address no longer crashes a table, and a failed read shows a Retry state.
  • On a phone, forms in drawers keep Save in reach and buttons are 44px tall.

Read more about Mishka Gervaz

  • Hook.call/3 takes raised:, the answer when a plugin raises.
  • PluginSupervisor runs a plugin group inside your own supervision tree.
  • A plugin no longer crashes in a loop while Mnesia is stopped, and rebuilt events stop piling up old modules.
  • Changed: call start/0 after register/0; a registered-only plugin is not in the chain.

Read more about Mishka Installer

  • A bad value deep inside an Ash action now comes back as an error on the nested field, with its path.
  • The generated t() names real nested types, so ExDoc links them and Dialyzer checks them.
  • validate(not_nil_value) refuses an explicit nil.
  • Changed: needs Elixir 1.20.

Read more about GuardedStruct

Still young, and honest about it

Try Mishka CMS 0.0.3

The fastest way is the demo image, and Try Mishka CMS with the demo image shows how to run it:

docker pull ghcr.io/mishka-group/mishka_cms-demo:0.0.3

To build on it, clone the repository and follow Install Mishka CMS and sign in.

Mishka CMS stays open source and free, today and after the offer. What the seat changes is how fast it grows: each one buys focused weeks on the editor, the extensions and the docs you just read about. Take yours while it is $250, down from $1,200, before the countdown ends.

Time left until the offer ends
105
D
22
H
35
M
37
S
Claim your seat · $250One payment, no subscription. Questions first? Contact us.

You can also sponsor our open source work, or hire our team for a Phoenix LiveView project.

Newsletter

Mishka CMS releases. Once a month.

New Mishka CMS releases, Elixir and Phoenix patterns, and case studies from the team. No spam, unsubscribe anytime.

✓ once a month✓ no spam

Questions people ask about Mishka CMS 0.0.3

The visual editor reaches its first stable release, the admin shows what needs your attention, the Blog gets scheduled posts, feeds and analytics, redirect rules can rewrite or answer 410, and a site can add analytics tags with head code.

Yes. When a Blog post, category, tag or author changes its address, Mishka CMS writes a 301 redirect rule for the old one, and a WordPress import can keep every post at its old address.

Yes. mishka_cms_builder 0.0.1 is the editor's first stable release. It lists what would stop a Publish and refuses markup the browser would rewrite.

Yes. The Head code window on the Pages screen adds analytics, verification and font tags to public pages. Only script, meta, link and noscript tags are kept, and admin pages never load them.

With the key set, the CMS signs every piece of Elixir an author saves and runs only code whose signature matches. Code written into the database any other way does nothing.

Yes. Mishka CMS is open source under the Apache 2.0 license. A founding seat is optional and gives lifetime access, priority support and every paid extension we release.

Run the demo image ghcr.io/mishka-group/mishka_cms-demo:0.0.3, or clone the repository and follow Install Mishka CMS and sign in.

Thank you

Mishka CMS stands on Elixir, Phoenix LiveView, Ash Framework, Oban, TipTap and Tailwind CSS, and on every package in its dependency list. Thank you to the people who build them, to everyone who opened an issue for this release, and to you for reading this far.

Contributors Mishka Group Core
Shahryar Tavakkoli
LEAD
Shahryar Tavakkoli @shahryar-tavakkoli
Elixir · Phoenix · LiveView

Shahryar Tavakkoli writes about Elixir and Phoenix LiveView: Mishka Chelekom releases, GuardedStruct validation, static sites, service workers and SEO.

Comments

Sign in to comment

No comments yet.