@capgo/cli 5.0.0-alpha.7 β 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -41
- package/dist/index.js +335 -95820
- package/dist/package.json +83 -0
- package/package.json +48 -62
- package/.eslintignore +0 -4
- package/.github/FUNDING.yml +0 -1
- package/.github/workflows/build.yml +0 -46
- package/.github/workflows/bump_version.yml +0 -56
- package/.github/workflows/test.yml +0 -30
- package/.prettierignore +0 -6
- package/.vscode/launch.json +0 -23
- package/.vscode/settings.json +0 -5
- package/.vscode/tasks.json +0 -42
- package/CHANGELOG.md +0 -2861
- package/build.mjs +0 -23
- package/bun.lockb +0 -0
- package/capacitor.config.ts +0 -33
- package/crypto_explained.png +0 -0
- package/eslint.config.js +0 -3
- package/renovate.json +0 -23
- package/src/api/app.ts +0 -75
- package/src/api/channels.ts +0 -140
- package/src/api/crypto.ts +0 -121
- package/src/api/devices_override.ts +0 -41
- package/src/api/update.ts +0 -12
- package/src/api/versions.ts +0 -101
- package/src/app/add.ts +0 -191
- package/src/app/debug.ts +0 -220
- package/src/app/delete.ts +0 -106
- package/src/app/info.ts +0 -87
- package/src/app/list.ts +0 -67
- package/src/app/set.ts +0 -94
- package/src/bundle/check.ts +0 -42
- package/src/bundle/cleanup.ts +0 -127
- package/src/bundle/compatibility.ts +0 -70
- package/src/bundle/decrypt.ts +0 -65
- package/src/bundle/delete.ts +0 -53
- package/src/bundle/encrypt.ts +0 -69
- package/src/bundle/list.ts +0 -43
- package/src/bundle/unlink.ts +0 -86
- package/src/bundle/upload.ts +0 -516
- package/src/bundle/zip.ts +0 -139
- package/src/channel/add.ts +0 -73
- package/src/channel/currentBundle.ts +0 -72
- package/src/channel/delete.ts +0 -51
- package/src/channel/list.ts +0 -49
- package/src/channel/set.ts +0 -174
- package/src/index.ts +0 -290
- package/src/init.ts +0 -301
- package/src/key.ts +0 -158
- package/src/login.ts +0 -66
- package/src/types/capacitor__cli.d.ts +0 -6
- package/src/types/supabase.types.ts +0 -2471
- package/src/utils.ts +0 -738
- package/test/chunk_convert.ts +0 -28
- package/test/data.ts +0 -18769
- package/test/test_headers_rls.ts +0 -24
- package/test/test_semver.ts +0 -13
- package/tsconfig.json +0 -39
package/README.md
CHANGED
|
@@ -13,9 +13,11 @@ Before use the CLI, you should register here : https://capgo.app/
|
|
|
13
13
|
|
|
14
14
|
Then go to your account in `apikey` section and click in the `all` key to copy it.
|
|
15
15
|
|
|
16
|
+
Follow the documentation here : "https://capacitorjs.com/docs/getting-started/
|
|
17
|
+
|
|
16
18
|
### **Init**
|
|
17
19
|
|
|
18
|
-
`npx @capgo/cli init [apikey]`
|
|
20
|
+
`npx @capgo/cli@latest init [apikey]`
|
|
19
21
|
|
|
20
22
|
This method is here to onboard you step by step.
|
|
21
23
|
|
|
@@ -49,7 +51,7 @@ This command will also be useful for bug report.
|
|
|
49
51
|
|
|
50
52
|
`npx @capgo/cli app add [appId]`
|
|
51
53
|
|
|
52
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
54
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
53
55
|
|
|
54
56
|
> π‘ All option will be guessed in your config if not provided.
|
|
55
57
|
|
|
@@ -58,6 +60,7 @@ Optionally, you can give:
|
|
|
58
60
|
* `--icon [/path/to/my/icon]` to have a custom icon display in Capgo web app.
|
|
59
61
|
* `--name [test]` to have a custom name in the list.
|
|
60
62
|
* `--apikey [key]` API key to link to your account.
|
|
63
|
+
* `--retention [retention]` retention period of app bundle in days, 0 by default = infinite.
|
|
61
64
|
|
|
62
65
|
Example of `capacitor.config.json` for appId and AppName, the icon is guess in the resources folder
|
|
63
66
|
|
|
@@ -73,7 +76,7 @@ Example of `capacitor.config.json` for appId and AppName, the icon is guess in t
|
|
|
73
76
|
|
|
74
77
|
`npx @capgo/cli app set [appId]`
|
|
75
78
|
|
|
76
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
79
|
+
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
77
80
|
|
|
78
81
|
Optionally, you can give:
|
|
79
82
|
|
|
@@ -86,7 +89,7 @@ Optionally, you can give:
|
|
|
86
89
|
|
|
87
90
|
`npx @capgo/cli app list [appId]`
|
|
88
91
|
|
|
89
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
92
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
90
93
|
|
|
91
94
|
Optionally, you can give:
|
|
92
95
|
|
|
@@ -96,7 +99,7 @@ Optionally, you can give:
|
|
|
96
99
|
|
|
97
100
|
`npx @capgo/cli app delete [appId]`
|
|
98
101
|
|
|
99
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
102
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
100
103
|
|
|
101
104
|
Optionally, you can give:
|
|
102
105
|
|
|
@@ -107,38 +110,71 @@ Optionally, you can give:
|
|
|
107
110
|
|
|
108
111
|
`npx @capgo/cli app debug [appId]`
|
|
109
112
|
|
|
110
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
113
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
111
114
|
|
|
112
115
|
Optionally, you can give:
|
|
113
116
|
|
|
114
117
|
* `--apikey [key]` API key to link to your account.
|
|
115
118
|
* `--device` with the specific device you want to debug
|
|
116
119
|
|
|
120
|
+
### Setting
|
|
121
|
+
|
|
122
|
+
`npx @capgo/cli app setting [path]`
|
|
123
|
+
|
|
124
|
+
Edit the Capacitor config.
|
|
125
|
+
|
|
126
|
+
`[path]` - path of the setting that you would like to change. For example, to change the `appId`, provide `appId`.
|
|
127
|
+
If you wish to disable auto update in the `capacitor-updater` provide `plugins.CapacitorUpdater.autoUpdate`
|
|
128
|
+
|
|
129
|
+
You MUST provide either `--string` or `--bool`!
|
|
130
|
+
|
|
131
|
+
Options:
|
|
132
|
+
- `--string <string>` - sets the setting to a string
|
|
133
|
+
- `--bool <true | false>` - sets the setting to a boolean
|
|
134
|
+
|
|
117
135
|
## Bundle
|
|
118
136
|
|
|
119
137
|
### Upload
|
|
120
138
|
|
|
121
139
|
`npx @capgo/cli bundle upload [appId]`
|
|
122
140
|
|
|
123
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
* `--apikey
|
|
128
|
-
* `--path
|
|
129
|
-
* `--channel
|
|
130
|
-
* `--external
|
|
131
|
-
* `--key
|
|
132
|
-
* `--
|
|
133
|
-
* `--
|
|
134
|
-
* `--
|
|
135
|
-
* `--
|
|
136
|
-
* `--s3-
|
|
137
|
-
* `--s3-
|
|
138
|
-
* `--s3-
|
|
139
|
-
* `--
|
|
140
|
-
* `--
|
|
141
|
-
* `--
|
|
141
|
+
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
142
|
+
|
|
143
|
+
Options:
|
|
144
|
+
|
|
145
|
+
* `--apikey <apikey>` API key to link to your account.
|
|
146
|
+
* `--path <path>` Path of the folder to upload.
|
|
147
|
+
* `--channel <channel>` Channel to link to.
|
|
148
|
+
* `--external <url>` Link to external URL instead of uploading to Capgo Cloud.
|
|
149
|
+
* `--iv-session-key <key>` Set the IV and session key for bundle URL external.
|
|
150
|
+
* `--s3-endpoint <s3Endpoint>` URL of S3 endpoint. Do not work with Partial upload, or external option.
|
|
151
|
+
* `--s3-region <region>` Region for your S3 bucket.
|
|
152
|
+
* `--s3-apikey <apikey>` API key for your S3 endpoint.
|
|
153
|
+
* `--s3-apisecret <apisecret>` API secret for your S3 endpoint.
|
|
154
|
+
* `--s3-bucket-name <bucketName>` Name for your AWS S3 bucket.
|
|
155
|
+
* `--s3-port <port>` Port for your S3 endpoint.
|
|
156
|
+
* `--no-s3-ssl` Disable SSL for S3 upload.
|
|
157
|
+
* `--key <key>` Custom path for public signing key (v1 system).
|
|
158
|
+
* `--key-data <keyData>` Public signing key (v1 system).
|
|
159
|
+
* `--key-v2 <key>` Custom path for private signing key (v2 system).
|
|
160
|
+
* `--key-data-v2 <keyData>` Private signing key (v2 system).
|
|
161
|
+
* `--bundle-url` Prints bundle URL into stdout.
|
|
162
|
+
* `--no-key` Ignore signing key and send clear update.
|
|
163
|
+
* `--no-code-check` Ignore checking if notifyAppReady() is called in source code and index present in root folder.
|
|
164
|
+
* `--display-iv-session` Show in the console the IV and session key used to encrypt the update.
|
|
165
|
+
* `--bundle <bundle>` Bundle version number of the bundle to upload.
|
|
166
|
+
* `--min-update-version <minUpdateVersion>` Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel.
|
|
167
|
+
* `--auto-min-update-version` Set the min update version based on native packages.
|
|
168
|
+
* `--ignore-metadata-check` Ignores the metadata (node_modules) check when uploading.
|
|
169
|
+
* `--ignore-checksum-check` Ignores the checksum check when uploading.
|
|
170
|
+
* `--timeout <timeout>` Timeout for the upload process in seconds.
|
|
171
|
+
* `--partial` Does not upload partial files to Capgo cloud.
|
|
172
|
+
* `--tus` Upload the bundle using tus protocol.
|
|
173
|
+
* `--multipart` Uses multipart protocol to upload data to S3, Deprecated, use TUS instead.
|
|
174
|
+
* `--encrypted-checksum <encryptedChecksum>` An encrypted checksum (signature). Used only when uploading an external bundle.
|
|
175
|
+
* `--package-json <packageJson>` A path to package.json. Usefull for monorepos.
|
|
176
|
+
* `--auto-set-bundle` Set the bundle in capacitor.config.json.
|
|
177
|
+
* `--node-modules <nodeModules>` A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules).
|
|
142
178
|
|
|
143
179
|
> βοΈ External option helps to unlock 2 cases: corporate with privacy concern, don't send the code to a third part and app bigger than 200 MB. With this setting, Capgo store only the link to the zip and sends the link to all apps.
|
|
144
180
|
|
|
@@ -156,13 +192,13 @@ Example of `package.json` for version
|
|
|
156
192
|
|
|
157
193
|
> β Version should be greater than β0.0.0β.
|
|
158
194
|
|
|
159
|
-
> π‘ Don't forget to update the version number each time you send one, or
|
|
195
|
+
> π‘ Don't forget to update the version number each time you send one, version number cannot be overrode, or reused after deletion for security reason.
|
|
160
196
|
|
|
161
197
|
### **List**
|
|
162
198
|
|
|
163
199
|
`npx @capgo/cli bundle list [appId]`
|
|
164
200
|
|
|
165
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
201
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
166
202
|
|
|
167
203
|
Optionally, you can give:
|
|
168
204
|
|
|
@@ -172,7 +208,7 @@ Optionally, you can give:
|
|
|
172
208
|
|
|
173
209
|
`npx @capgo/cli bundle delete [appId]`
|
|
174
210
|
|
|
175
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
211
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
176
212
|
|
|
177
213
|
Optionally, you can give:
|
|
178
214
|
|
|
@@ -185,7 +221,7 @@ in a SemVer range for a major version to Cloud
|
|
|
185
221
|
|
|
186
222
|
`npx @capgo/cli bundle cleanup [appId] --bundle=[majorVersion] --keep=[numberToKeep]`
|
|
187
223
|
|
|
188
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
224
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
189
225
|
|
|
190
226
|
Optionally, you can give:
|
|
191
227
|
|
|
@@ -205,14 +241,31 @@ This command will ignore bundles which are currently in use in any channel.
|
|
|
205
241
|
|
|
206
242
|
### **Encrypt**
|
|
207
243
|
|
|
244
|
+
> **Warning**: This command is deprecated and will be removed in the next major release. Please use the new encryption system.
|
|
208
245
|
`npx @capgo/cli bundle encrypt [path/to/zip]`
|
|
209
246
|
|
|
210
|
-
This command is used when you use external source to store your code or for test purpose.
|
|
247
|
+
This command is used when you use external source to store your code or for test purpose.
|
|
211
248
|
|
|
212
249
|
Optionally, you can give:
|
|
213
250
|
|
|
214
251
|
`--key [/path/to/my/private_key]` the path of your private key.
|
|
215
|
-
`--key-data [privateKey]` the private key data, if you want to use inline.
|
|
252
|
+
`--key-data [privateKey]` the private key data, if you want to use inline.
|
|
253
|
+
The command will print your `ivSessionKey`y and generate an encrypted zip, to use it with the upload command or decryt command.
|
|
254
|
+
|
|
255
|
+
### **Encrypt V2**
|
|
256
|
+
|
|
257
|
+
`npx @capgo/cli bundle encryptV2 [path/to/zip] [checksum]`
|
|
258
|
+
|
|
259
|
+
This command is used when you use external source to store your code or for test purpose.
|
|
260
|
+
The checksum is the sha256 of the bundle (generated by --key-v2), it is used to verify the integrity of the file after decryption.
|
|
261
|
+
It will be enncrypted with the private key and sent along with the bundle.
|
|
262
|
+
In encryption v2 the checksum is upgraded to become a "signature" of the bundle.
|
|
263
|
+
|
|
264
|
+
Optionally, you can give:
|
|
265
|
+
|
|
266
|
+
`--key [/path/to/my/private_key]` the path of your private key.
|
|
267
|
+
`--key-data [privateKey]` the private key data, if you want to use inline.
|
|
268
|
+
`--json` to output info as json.
|
|
216
269
|
The command will print your `ivSessionKey`y and generate an encrypted zip, to use it with the upload command or decryt command.
|
|
217
270
|
|
|
218
271
|
### **Decrypt**
|
|
@@ -221,21 +274,49 @@ The command will print your `ivSessionKey`y and generate an encrypted zip, to us
|
|
|
221
274
|
|
|
222
275
|
Optionally, you can give:
|
|
223
276
|
|
|
224
|
-
`--key [/path/to/my/
|
|
277
|
+
`--key [/path/to/my/private_key]` the path of your private key.
|
|
278
|
+
|
|
279
|
+
`--key-data [privateKey]` the private key data, if you want to use inline. This command is mainly used for test purpose, it will decrypt the zip and print the base64 decrypted session key in the console.
|
|
225
280
|
|
|
226
|
-
|
|
281
|
+
### **Decrypt V2**
|
|
282
|
+
|
|
283
|
+
`npx @capgo/cli bundle decryptV2 [path/to/zip] [ivSessionKey]`
|
|
284
|
+
|
|
285
|
+
Optionally, you can give:
|
|
286
|
+
|
|
287
|
+
`--key [/path/to/my/private_key]` the path of your private key.
|
|
288
|
+
`--key-data [privateKey]` the private key data, if you want to use inline. This command is mainly used for test purpose, it will decrypt the zip and print the base64 decrypted session key in the console.
|
|
289
|
+
`--checksum [checksum]` the checksum of the file, it will verify the checksum after decryption.
|
|
227
290
|
|
|
228
291
|
### **Zip**
|
|
229
292
|
|
|
230
293
|
`npx @capgo/cli bundle zip [appId]`
|
|
231
294
|
|
|
232
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
295
|
+
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
233
296
|
|
|
234
297
|
Optionally, you can give:
|
|
235
298
|
|
|
236
299
|
* `--path [/path/to/my/bundle]` to upload a specific folder.
|
|
237
300
|
* `--bundle [1.0.0]` to set the bundle version number of the filename.
|
|
238
301
|
* `--name [myapp]` to override the filename.
|
|
302
|
+
* `--json` to output info as json.
|
|
303
|
+
* `--no-code-check` to ignore the code check and send the bundle anyway.
|
|
304
|
+
* `--key-v2` to use the new encryption system. This is required as new encryption system use better checksums to verify the integrity of the file.
|
|
305
|
+
|
|
306
|
+
### **Compatibility**
|
|
307
|
+
|
|
308
|
+
`npx @capgo/cli bundle compatibility [appId] -c [channelId]`
|
|
309
|
+
|
|
310
|
+
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
311
|
+
`[channelId]` the name of your new channel.
|
|
312
|
+
|
|
313
|
+
Optionally, you can give:
|
|
314
|
+
|
|
315
|
+
* `--apikey [key]` API key to link to your account.
|
|
316
|
+
* `--text` use text instead of emojis in the table
|
|
317
|
+
* `--channel [channel]` the channel to check the compatibility with.
|
|
318
|
+
* `--package-json <packageJson>` A path to package.json. Usefull for monorepos
|
|
319
|
+
* `--node-modules <nodeModules>` A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)
|
|
239
320
|
|
|
240
321
|
## Channel
|
|
241
322
|
|
|
@@ -243,19 +324,19 @@ Optionally, you can give:
|
|
|
243
324
|
|
|
244
325
|
`npx @capgo/cli channel add [channelId] [appId]`
|
|
245
326
|
|
|
246
|
-
`[channelId]` the name of your new channel. `[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
327
|
+
`[channelId]` the name of your new channel. `[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
247
328
|
|
|
248
329
|
### **Delete**
|
|
249
330
|
|
|
250
331
|
`npx @capgo/cli channel delete [channelId] [appId]`
|
|
251
332
|
|
|
252
|
-
`[channelId]` the name of your channel you want to delete. `[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
333
|
+
`[channelId]` the name of your channel you want to delete. `[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
253
334
|
|
|
254
335
|
### **List**
|
|
255
336
|
|
|
256
337
|
`npx @capgo/cli channel list [appId]`
|
|
257
338
|
|
|
258
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
339
|
+
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
259
340
|
|
|
260
341
|
Optionally, you can give:
|
|
261
342
|
|
|
@@ -265,7 +346,7 @@ Optionally, you can give:
|
|
|
265
346
|
|
|
266
347
|
`npx @capgo/cli channel set [channelId] [appId]`
|
|
267
348
|
|
|
268
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init).
|
|
349
|
+
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
269
350
|
|
|
270
351
|
Optionally, you can give:
|
|
271
352
|
|
|
@@ -282,8 +363,68 @@ Optionally, you can give:
|
|
|
282
363
|
* `--no-android` disallows the channel to send version to android devices.
|
|
283
364
|
* `--self-assign` allows devices to self assign to this channel.
|
|
284
365
|
* `--no-self-assign` disallows devices to self assign to this channel.
|
|
366
|
+
* `--disable-auto-update STRATEGY` Disable auto update strategy for this channel. The possible options are: major, minor, metadata, none.
|
|
285
367
|
* `--apikey [key]` API key to link to your account.
|
|
286
368
|
|
|
369
|
+
## Disable updates strategy
|
|
370
|
+
|
|
371
|
+
There are a few ways to handle disabling updates for too old versions.\
|
|
372
|
+
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.
|
|
373
|
+
There are a couple of ways to achieve that.
|
|
374
|
+
|
|
375
|
+
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).\
|
|
376
|
+
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`.
|
|
377
|
+
**BE AWARE** this strategy does not prevent an update from `0.1.0` -> `1.1.0`
|
|
378
|
+
|
|
379
|
+
Third, the `patch` strategy. It was added into capgo as a very strict mode. It's not recomended to be used unless you fully understand how it works.
|
|
380
|
+
In order for it to accept a update the following conditions must be meet:
|
|
381
|
+
- The major is the same between the new and the old version
|
|
382
|
+
- The minor is the same between the new and the old version
|
|
383
|
+
- The patch of the new version if greater then the patch of the old version
|
|
384
|
+
|
|
385
|
+
Here is an example of which scenarios the update is allowed or denied
|
|
386
|
+
|
|
387
|
+
- 0.0.311 -> 0.0.314 β
|
|
388
|
+
- 0.0.0 -> 0.0.314 β
|
|
389
|
+
- 0.0.316 -> 0.0.314 β
|
|
390
|
+
- 0.1.312 -> 0.0.314 β
|
|
391
|
+
- 1.0.312 -> 0.0.314 β
|
|
392
|
+
|
|
393
|
+
Lastly the most complicated strategy. The `metadata` strategy.\
|
|
394
|
+
First you need to know that initially after you enable it the updates **WILL** fail as the channel is lacking the required metadata.\
|
|
395
|
+
If the channel is lacking metadata you will see a message like this:
|
|
396
|
+
<img src="/fail-metadata.webp" alt="Cannot find metadata"/>
|
|
397
|
+
|
|
398
|
+
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.\
|
|
399
|
+
First, figure out what channel is failing. You can do that by looking at the `misconfigured` column
|
|
400
|
+
<img src="/misconfigured-table.webp" alt="Misconfigured table"/>
|
|
401
|
+
|
|
402
|
+
Then go to the failing channel and click on `Bundle number`. This should take you to the bundle page.
|
|
403
|
+
<img src="/fail-channel-show.webp" alt="Locate failing channel"/>
|
|
404
|
+
|
|
405
|
+
Once there fill the `Minimal update version` field. This should be a [semver](https://devhints.io/semver/).\
|
|
406
|
+
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:
|
|
407
|
+
<img src="/set-min-update-version.webp" alt="Set min version"/>
|
|
408
|
+
|
|
409
|
+
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
|
|
410
|
+
<img src="/cli-fail-no-metadata.webp" alt="CLI fail no metadata"/>
|
|
411
|
+
|
|
412
|
+
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:
|
|
413
|
+
<img src="/cli-upload-with-metadata.webp" alt="CLI upload with metadata"/>
|
|
414
|
+
|
|
415
|
+
The `--min-update-version` is not the ONLY way to do compatibility.
|
|
416
|
+
There also exists the `--auto-min-update-version`. Here is how it works.
|
|
417
|
+
|
|
418
|
+
First, it takes a look at the version curently uploaded to the channel. It checks compatibility same as `bundle compatibility` command would.
|
|
419
|
+
Second, if the new version is 100% compatible it reuses the `min_update_version` from the latest version in the channel.
|
|
420
|
+
If not, then it sets the `min_update_version` to the bundle number of the newly uploaded version.
|
|
421
|
+
|
|
422
|
+
You will always get an information what is the `min_update_version` when using this option. It will look something like this:
|
|
423
|
+
<img src="/min_update_version_info.webp" alt="Min update version"/>
|
|
424
|
+
|
|
425
|
+
If the new version is not compatible it should look something like this
|
|
426
|
+
<img src="/min_update_version_not_compatible.webp" alt="Min update version not compatible"/>
|
|
427
|
+
|
|
287
428
|
## End-to-End encryption (Trustless)
|
|
288
429
|
|
|
289
430
|
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.
|
|
@@ -294,11 +435,13 @@ See below for more information about the encryption system.
|
|
|
294
435
|
|
|
295
436
|
<figure><img src="/crypto_explained.png" alt=""><figcaption><p>Ecryption schema</p></figcaption></figure>
|
|
296
437
|
|
|
438
|
+
Ecryption schema
|
|
439
|
+
|
|
297
440
|
### Create key for your app
|
|
298
441
|
|
|
299
442
|
`npx @capgo/cli key create`
|
|
300
443
|
|
|
301
|
-
Optionally, you can give: `--force` to overwrite the existing key. This command will create for you a key pair in your app, and will ask you to save the private key in a safe place. It's recommended to not git commit the private
|
|
444
|
+
Optionally, you can give: `--force` to overwrite the existing key. This command will create for you a key pair in your app, and will ask you to save the private key in a safe place. It's recommended to not git commit the private key, and to not share it with anyone.
|
|
302
445
|
|
|
303
446
|
> After your local test, remove the key from the config file and add it on the CI step with `key save`
|
|
304
447
|
|
|
@@ -308,9 +451,22 @@ Optionally, you can give: `--force` to overwrite the existing key. This command
|
|
|
308
451
|
|
|
309
452
|
Optionally, you can give:
|
|
310
453
|
|
|
311
|
-
`--key [/path/to/my/
|
|
454
|
+
`--key [/path/to/my/private_key]` the path of your private key.
|
|
455
|
+
|
|
456
|
+
`--key-data [privateKey]` the private key data, if you want to use inline. This command is useful if you followed the recommendation and didn't commit the key in your app, and in the config.
|
|
457
|
+
|
|
458
|
+
## Ci integration
|
|
459
|
+
|
|
460
|
+
To automate your work, I recommend you make GitHub action do the job of pushing to our server
|
|
461
|
+
|
|
462
|
+
[GitHub action tutorial](https://capgo.app/blog/automatic-build-and-release-with-github-actions/)
|
|
463
|
+
|
|
464
|
+
## Our demo app
|
|
465
|
+
|
|
466
|
+
[GitHub - Cap-go/demo-app](https://github.com/Cap-go/demo-app/)
|
|
467
|
+
|
|
468
|
+
Donβt forget to configure CI env variable with your API key
|
|
312
469
|
|
|
313
|
-
`--key-data [publicKey]` the public key data, if you want to use inline. This command is useful if you followed the recommendation and didn't commit the key in your app, and in the config.
|
|
314
470
|
## Dev contribution
|
|
315
471
|
|
|
316
472
|
1. Install development dependencies
|