Liftbay

Signed updates

Sign every update with a key that never leaves your machine; apps reject anything else.

With signed updates, a compromised server, a leaked API token or a mistake on our side still can't push code to your users: apps only install updates signed with your private key, and Liftbay only ever holds the public certificate.

Signing works with all three clients: expo-updates, hot-updater and CodePush.

Set up

Run this once in your app's folder:

npx liftbay update signing init

It creates an RSA 2048 key pair and a self-signed code signing certificate (valid 10 years), the same kind expo-updates codesigning:generate makes.

The private key goes to keys/liftbay-private-key.pem, readable only by you, and keys/ is added to .gitignore. The certificate goes to certs/liftbay-certificate.pem; commit it.

The certificate is registered with Liftbay, with a signature proving you hold the private key.

app.json gets "codeSigningCertificate": "./certs/liftbay-certificate.pem" in the Liftbay plugin options, so expo-updates embeds the certificate in your app.

Optionally, every channel is set to signed updates only.

Then rebuild your apps once: the certificate is part of the binary.

Back up the private key

Keep a copy of keys/liftbay-private-key.pem somewhere safe, like a password manager. If it's lost, you need a new key and a new build of your apps; Liftbay can't recover it because it never has it.

Publish

liftbay update publish signs automatically when it finds the key:

SourceUse
--private-key <file>An explicit path
LIFTBAY_UPDATE_PRIVATE_KEYCI: the PEM itself as a secret (or a path)
keys/liftbay-private-key.pemThe default written by signing init

Publishing becomes two steps, done for you by the CLI: Liftbay prepares the exact bytes each client will verify, your machine signs them, and Liftbay checks every signature against the certificate before the release goes live. A signature made with any other key is rejected, so a wrong key can never ship.

What gets signed

ClientSigned bytesHow the app checks
expo-updatesThe manifest JSON, and the noUpdateAvailable / rollBackToEmbedded directivesexpo-signature header, verified with the embedded certificate
hot-updater 1.xThe SHA-256 of the bundle manifest, and of each filemanifestFileHash: "sig:…" and each file's signature in the manifest, verified with the app's public key
hot-updater 0.xThe SHA-256 of the bundle zipfileHash: "sig:…", verified with the app's public key
CodePushA JWT with the package hashCodePush/.codepushrelease in the package, verified with the app's public key

Asset files are covered too: their hashes are in the signed manifest or package.

Signed updates only

On a channel set to signed updates only (dashboard: the channel's Signed updates card), unsigned publishes are refused and only signed releases are served. Apps that send expo-expect-signature only ever receive signed releases, on any channel.

Apps built before signing was set up don't check signatures, so they keep receiving signed releases normally.

hot-updater and CodePush

signing init also writes the public key to certs/liftbay-public-key.pem. Add it to your app's native config:

ClientiOS (Info.plist)Android
hot-updaterHOT_UPDATER_PUBLIC_KEY<meta-data android:name="com.hotupdater.PUBLIC_KEY" android:value="…" /> in AndroidManifest.xml
CodePushCodePushPublicKeyCodePushPublicKey string resource (moduleConfig="true")

Replace or remove the key

  • liftbay update signing init --force creates a new key and certificate. Apps built with the old certificate reject updates signed with the new key until they're rebuilt.
  • Removing the certificate (DELETE /updates/signing in the API) turns off signed-only on every channel. Apps built with the certificate keep rejecting unsigned updates until rebuilt without it.

On this page