Flat illustration of a verified release flowing to a health-checked server, next to an image picker with an upload button.

oCMS 0.33.0 is available. Deployment moves from shell scripts to ocmsctl, a Go tool that verifies each binary before installing it, restarts sites behind a health check and keeps earlier releases for rollback. Editors can now upload an image from inside every image picker without leaving an unsaved page.

Get the archives and checksums.txt from the v0.33.0 release. Upgrading from 0.31.x? Read the 0.32.0 requirements first.

Deployments with ocmsctl

ocmsctl is one Go program used in two places. On your machine it builds the Linux binary, uploads it and calls the server over SSH, so your ~/.ssh/config, agent and jump hosts apply. On the server it installs releases, restarts and provisions sites, backs them up and monitors them. Each site runs as its own systemd unit, ocms@<site>, behind Nginx.

A deploy, ocmsctl deploy <host> <site>..., follows a fixed sequence:

  1. Verify. The binary's SHA-256 is computed locally and checked on the server, which also confirms the file is a Linux executable. A bad upload stops here: nothing is installed and no site is stopped.
  2. Install. The binary becomes a new release under /opt/ocms/releases/, and /opt/ocms/bin/ocms switches to it by renaming a symlink. Running sites keep the binary they started with.
  3. Restart and check. The named sites restart and must answer /health within 30 seconds. Each healthy site is asked again after 3 seconds, so a binary that crashes right after its first answer still fails the deploy.
  4. Report. Each site is reported OK or FAILED. A failed site's report includes the last lines of its log.

There is no automatic rollback, because the new binary may already have migrated the database. The failed release stays installed and the output names the rollback command. A deploy that passes keeps the newest three releases; ocmsctl rollback switches back to one of them behind the same health check. If an older binary cannot run on a database a newer one migrated, restore the database from a backup.

Backups, monitoring and production copies

  • Backups: ocmsctl backup runs nightly from cron. Each site gets an integrity-checked online snapshot of its SQLite database and archives of its uploads and custom files, all written as the site's own user. Archives older than 30 days are removed only after a successful backup.
  • Alerts: a failed backup prints a line that cron mails when MAILTO is set, and calls the optional executable /etc/ocms/alert with BACKUP FAILED. The five-minute check reports a site going down, its restart attempts (at most three per outage) and its recovery, and reports failures of the check itself as MONITOR FAILED. It prints only when something changes, so a long outage does not mail every five minutes.
  • Production copies: ocmsctl pull copies a site into a development checkout while production keeps serving. The database arrives as an online snapshot and is scrubbed of sessions, OAuth tokens, preview links, webhook secrets and the hCaptcha secret. It still holds password and API-key hashes, sealed MFA secrets and form submissions, so treat the copy as production data.

The logic lives in internal/sitectl, which imports nothing from oCMS; a test enforces that boundary. The complete reference is Deploying oCMS with ocmsctl.

Moving from the shell scripts

This applies to servers set up with the earlier deployment scripts. An installation that follows the manual deployment guide can keep replacing the binary as before. The site registry and site directories stay compatible, but updating the source checkout alone does not switch a server:

  1. Before replacing the installed tool, stop any site still running in PID-file mode with that tool. Enabled systemd sites can keep running.
  2. From the core checkout, run make server-setup HOST=root@server. It installs the Go ocmsctl and creates /etc/cron.d/ocms if it is missing. Once the new backup and monitor jobs work, retire /etc/cron.d/ocms-multi and other old deployment cron entries so nothing runs twice.
  3. The first ocmsctl deploy keeps the existing /opt/ocms/bin/ocms as a -legacy release, so you can roll back to it.
  4. For each site moved from PID-file mode, run systemctl enable --now ocms@<site>, then check ocmsctl status and ocmsctl health <site>.

Update site Makefiles to include core/site.mk and set DEPLOY_HOST and DEPLOY_SITES; make deploy and make pull replace the old wrappers. See the migration guide for the details.

Upload images from the picker

The Featured Image, Open Graph, content editor and theme settings pickers each offer Upload Image, even when the media library is empty. Choose one JPG, PNG, GIF or WebP image up to 20 MB; the editor and theme pickers also accept ICO. The upload shows its progress inside the picker and then highlights the new image. Confirm with Select Image or Insert Image and save as usual: unsaved edits in the form stay where they were. Picker uploads are stored as uncategorized media.

In the editor, the picker now opens above TinyMCE's Insert → Image and Insert → Media dialogs instead of behind them, and it scrolls on short screens with Insert still visible. The Small and Medium sizes insert the matching image variant when it exists and the original image otherwise. Small no longer inserts the cropped thumbnail.

For REST and MCP clients

  • Media responses in REST v2 and MCP list thumbnail, medium and large URLs only for variants that were generated. An ICO gets none, a source under 400×300 has no medium, and one under 960×540 has no large. Treat these fields as optional and fall back to original; add ?include=variants to list every generated variant.
  • POST /api/v2/media returns 422 validation_error for corrupt images and for images that exceed decoding limits.

Other changes

  • Building from source requires Go 1.27.4, which includes security fixes for net/http and the build toolchain. Custom modules must regenerate their views with templ 0.3.1100 before rebuilding.
  • Unsafe menu URL schemes are blocked during import and rendering.
  • Site settings validate site_logo on save and import, and site_url must be an HTTP or HTTPS origin.
  • The repository adds issue and pull request templates, a Code of Conduct and an accessibility statement.

Before upgrading

  1. Back up the database, uploads, custom files and configuration with the installed binary.
  2. Verify the archive against checksums.txt and rehearse the update on a restored copy. Use the complete upgrade walkthrough.
  3. If you move to ocmsctl, follow the migration steps above, run ocmsctl backup once and confirm ocmsctl status before retiring the old cron entries.
  4. In an unsaved draft, upload an image from the Featured Image picker, insert another at Small size in the editor, and save.
  5. If an integration reads media URLs, check how it handles a missing medium or large URL.

Coming from 0.31.x: 0.32.0 has its own requirements. Everyone signs in again, because session tokens are now hashed in storage. An unset OCMS_ENV now selects production, so set it explicitly. Recognized Event Log diagnostics older than 90 days become eligible for deletion on the first run. Read the v0.32.0 release notes before upgrading.

Thanks to @c-nv-s for requesting in-picker uploads and for reporting the picker that opened behind TinyMCE dialogs. Read the complete v0.33.0 release notes for every change.

Source: https://ocms.tech/ocms-0-33-go-deployment-media-tools

Written by OIV