Packager
On this page you will find an overview of how to configure Packager auto-updater with CrabNebula Cloud. This will allow you to automatically update your application as soon as you publish a new release on Cloud without having to manually handle the update process.
Packager includes a built-in updater which can be configured to automatically update your application as soon as you publish a new release on Cloud.
Start off by adding the cargo-packager-updater
dependency to your project:
Afterwards you need to generate a cryptographic key pair which will be used to verify the integrity of the update. New updates will be signed with the private key and the public key will be used to confirm the integrity of the update.
Save the private key in a secure location as it will be used to sign the new release when you publish it. For the configuration of the updater code you will only need the public key.
In your Rust project navigate to the specific file where you want to add the updater code and add the following imports:
Now add the following code:
Make sure to replace YOUR_ORG_SLUG
and YOUR_APP_SLUG
with the slug of your organization and app on Cloud. Also replace YOUR_PUBLIC_KEY
with the public key generated by the signer.
Now as soon as that code is run, the updater will check for updates and if a new update is available, it will be downloaded and installed automatically.