Skip to content

Commit

Permalink
Document selectable disallow
Browse files Browse the repository at this point in the history
  • Loading branch information
WcaleNieWolny committed Oct 12, 2023
1 parent edb47d2 commit 88eafe0
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 9 deletions.
Binary file added public/cli-fail-no-metadata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cli-upload-with-metadata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/fail-channel-show.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/fail-metadata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/misconfigured-table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/set-min-update-version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/content/blog/how-to-release-major-version-in-capgo.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ For example, a new IOS target (15 to 16), or a new version of Capacitor (3 to 4)
This change means all tooling has to be aligned to handle the breaking change.

That why Capgo follows this system.
So if you release a major version, Capgo will not send it to a user who doesn't have it installed from the store.
So if you release a major version, Capgo will not send it to a user who doesn't have it installed from the store.\
This behavior can be customized. You can learn more about it [here](/docs/tooling/cli#disable-updates-strategy)

### Versions

Expand Down
8 changes: 2 additions & 6 deletions src/content/blog/how-version-work-in-capgo.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ Then the behavior become :

> Capgo sends his version to the user.
#### Disable auto-upgrade above major
#### Disable auto-upgrade strategy

If you change this setting to false, Capgo will consider upgrade to MAJOR is not an issue.
Then the behavior becomes:
- The native version (1.2.3) is MAJOR lower than Capgo version (2.2.3)

> Capgo send his version to the user.
There are a couple of stategies you can chose from. You can learn more about it [here](/docs/tooling/cli#disable-updates-strategy)

## JavaScript bundle version

Expand Down
34 changes: 33 additions & 1 deletion src/content/docs/docs/tooling/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ Optionally, you can give:

* `--bundle [1.2.3]` your app bundle already sent to the cloud, to link it to a channel.
* `--latest` get the bundle version from `package.json:version`, cannot be used with `--bundle`.
* `--state [ normal | default ]` set the channel state, can be `normal` or `default`. One channel needs to be `default`.
* `--downgrade` allows the channel to send downgrade version to devices.
* `--no-downgrade` disallows the channel to send downgrade version to devices.
* `--upgrade` allows the channel to send upgrade (major) version to devices.
Expand All @@ -275,8 +274,41 @@ Optionally, you can give:
* `--no-android` disallows the channel to send version to android devices.
* `--self-assign` allows devices to self assign to this channel.
* `--no-self-assign` disallows devices to self assign to this channel.
* `--disable-auto-update STRATEGY` Disable auto update strategy for this channel.The possible options are: major, minor, metadata, none.
* `--apikey [key]` API key to link to your account.

## Disable updates strategy

There are a few ways to handle disabling updates for too old versions.\
Capgo cannot update native code thus an update from a version with the old native code to a version with the updated native code should not be possible.
There are a couple of ways to achieve that.

First, the `major` strategy. It prevents an update from `0.0.0` -> `1.0.0`. The major is the highlighted number (**1**.0.0 and **0**.0.0).\
Second is the `minor` strategy. It prevents an update from `0.0.0` -> `1.1.0` or an update from `1.1.0` to `1.2.0`.
**BE AWARE** this strategy does not prevent an update from `0.1.0` -> `1.1.0`

Lastly the most complicated strategy. The `metadata` strategy.\
First you need to know that initially after you enable it the updates **WILL** fail as the channel is lacking the required metadata.\
If the channel is lacking metadata you will see a message like this:
<figure><img src="/fail-metadata.png" alt=""></figure>

If you see something like this you know that you have to go to the current bundle for the failing channel and set the metadata.\
First, figure out what channel is failing. You can do that by looking at the `misconfigured` column
<figure><img src="/misconfigured-table.png" alt=""></figure>

Then go to the failing channel and click on `Bundle number`. This should take you to the bundle page.
<figure><img src="/fail-channel-show.png" alt=""></figure>

Once there fill the `Minimal update version` field. This should be a [semver](https://devhints.io/semver).\
If the value you pass is not a semver you will get an error, but if everything goes correctly you should see something like this:
<figure><img src="/set-min-update-version.png" alt=""></figure>

Now, you likely do not want to set this data manually every time you update. Fortunately, the CLI will prevent you from sending an update without this metadata
<figure><img src="/cli-fail-no-metadata.png" alt=""></figure>

To properly upload a bundle when using the `metadata` option you need to pass the `--min-update-version` with the valid semver. Something like this:
<figure><img src="/cli-upload-with-metadata.png" alt=""></figure>

## End-to-End encryption (Trustless)

Capgo supports end-to-end encryption, this means that your bundle(code) is encrypted before sent to the cloud and decrypted on the device. For that, you need to generate an RSA key pair, you can use the following command to generate it.
Expand Down
2 changes: 1 addition & 1 deletion src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
/// <reference types="astro/client-image" />
/// <reference types="vite-plugin-pwa/client" />

0 comments on commit 88eafe0

Please sign in to comment.