otaflow 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +90 -2
- package/dist/otaflow.mjs +487 -0
- package/package.json +46 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Otaflow
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,91 @@
|
|
|
1
|
-
#
|
|
1
|
+
# otaflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Over-the-air updates for Expo apps. Sign an update on your machine, publish it to a preview channel, promote it to production with an approval, and roll it back when something breaks. Your code-signing key never leaves your hands.
|
|
4
|
+
|
|
5
|
+
This is the command line for [Otaflow](https://otaflow.com). You need an Otaflow account (accounts are opened by Otaflow during the partner period) and Node.js 22 or newer.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx otaflow --help
|
|
9
|
+
# or install it
|
|
10
|
+
npm install --global otaflow
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
otaflow login # opens a browser page: confirm the code, allow
|
|
17
|
+
otaflow apps create --name "My App" --slug my-app
|
|
18
|
+
cd my-expo-project
|
|
19
|
+
otaflow init --app my-app # link the folder to the app
|
|
20
|
+
otaflow keys init # make the code-signing key and register its public half
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`keys init` writes the **certificate** to `./certs/certificate.pem` (commit it) and keeps the **private key** outside the project, in your user config folder. Back the key up: Otaflow cannot recover it, and without it no update reaches installed apps until a new build ships. Add what the command prints to your `app.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"expo": {
|
|
28
|
+
"updates": {
|
|
29
|
+
"url": "https://ota.otaflow.com/u/my-app/manifest",
|
|
30
|
+
"codeSigningCertificate": "./certs/certificate.pem",
|
|
31
|
+
"codeSigningMetadata": { "keyid": "main", "alg": "rsa-v1_5-sha256" }
|
|
32
|
+
},
|
|
33
|
+
"runtimeVersion": { "policy": "fingerprint" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Your project needs `expo-updates`. Build a release binary with this configuration once; updates reach it from then on.
|
|
39
|
+
|
|
40
|
+
## Every day
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git commit -am "Fix the checkout crash"
|
|
44
|
+
otaflow publish -m "Fix the checkout crash" # to preview: exports, signs, uploads what changed
|
|
45
|
+
otaflow promote # preview to production (the owner directly; others ask)
|
|
46
|
+
otaflow promotions list # pending requests
|
|
47
|
+
otaflow promotions approve --request <id> # owner or manager
|
|
48
|
+
otaflow rollback --channel production --previous # go back one update
|
|
49
|
+
otaflow rollback --channel production --embedded # back to the JavaScript inside the binary
|
|
50
|
+
otaflow pause --channel production # stop devices getting updates, now
|
|
51
|
+
otaflow resume --channel production
|
|
52
|
+
otaflow list # channels, heads, recent updates
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`publish` refuses a dirty git tree and a commit that is already a channel's head, and refuses an update whose bundle contains values from your `.env` files.
|
|
56
|
+
|
|
57
|
+
A rollback is a new update that carries an older update's content. Each publish also signs, ahead of time, the rollbacks that could undo it, so a manager can roll back from the dashboard or with `otaflow rollback --prepared` **without** the signing key.
|
|
58
|
+
|
|
59
|
+
## In CI
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
export OTAFLOW_API_KEY=otk_... # otaflow apikey create --app my-app --name CI --actions publish,request_promote
|
|
63
|
+
export OTAFLOW_SIGNING_KEY="$(cat private-key.pem)" # or OTAFLOW_SIGNING_KEY_PATH=/path/to/key.pem
|
|
64
|
+
otaflow publish -m "$GITHUB_SHA"
|
|
65
|
+
otaflow promote --wait
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
A key can publish to preview and ask for a promotion; it can never approve one. Approving needs a person.
|
|
69
|
+
|
|
70
|
+
## Reference
|
|
71
|
+
|
|
72
|
+
| Command | What it does |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `login`, `whoami`, `logout` | Sign in through the browser, see who you are, forget the login |
|
|
75
|
+
| `apps list`, `apps create` | List and create apps |
|
|
76
|
+
| `init` | Link this folder to an app |
|
|
77
|
+
| `keys init`, `keys register`, `keys list`, `keys public`, `keys revoke` | The code-signing key |
|
|
78
|
+
| `apikey create`, `apikey list`, `apikey delete` | CI keys, scoped to an app and some actions |
|
|
79
|
+
| `publish` | Export, sign and publish to a channel |
|
|
80
|
+
| `promote`, `promotions list/approve/reject/cancel` | Move preview to production; decide requests |
|
|
81
|
+
| `rollback` | `--previous`, `--to <id>`, `--embedded`, `--prepared` |
|
|
82
|
+
| `pause`, `resume` | The brake on a channel |
|
|
83
|
+
| `list` | Channel status |
|
|
84
|
+
|
|
85
|
+
Every command takes `--json` for machine-readable output and `--api-url` (or `OTAFLOW_API_URL`) to point at another Otaflow address.
|
|
86
|
+
|
|
87
|
+
Where the login is kept: the OS keychain when there is one, otherwise `~/.config/otaflow/credentials.json` with mode 0600. Set `OTAFLOW_CREDENTIALS=file` to force the file (containers, CI).
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT. See `LICENSE`.
|