tori.host 0.0.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Tori (tori.host)
3
+ Copyright (c) 2026 Fortion Networks s.r.o.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,13 +1,109 @@
1
1
  # tori.host
2
2
 
3
- **Tell Tori. It's live.**
3
+ Deploy static sites to [tori.host](https://tori.host). Nothing to install:
4
4
 
5
- This is a placeholder for the Tori CLI — the gate opens soon.
5
+ ```sh
6
+ npx tori.host
7
+ ```
8
+
9
+ ## Signing in
10
+
11
+ There is nothing to set up first. Run the deploy; if this machine has never
12
+ signed in, a browser opens, you sign in (or sign up — they are the same click,
13
+ auth here is a magic link), and the deploy carries on:
6
14
 
7
15
  ```sh
8
16
  npx tori.host
9
17
  ```
10
18
 
11
- For now it just says hello. Leave your email at [tori.host](https://tori.host) and you'll be first through the gate.
19
+ What gets saved to `~/.config/tori/config.json` is an API token the sign-in
20
+ mints, named after this machine — `CLI · macbook-vaclav`. It shows up in the
21
+ Console under Settings → API tokens, and revoking it there stops this machine
22
+ deploying, immediately and by itself.
12
23
 
13
- Hosted in Europe, by default.
24
+ ### On a machine with no browser
25
+
26
+ Over SSH, in a container, or anywhere with no `DISPLAY`, the CLI does not try to
27
+ open anything. It prints a short code and a URL instead; open the URL on any
28
+ device you are signed in on, type the code, and the terminal carries on:
29
+
30
+ ```
31
+ $ npx tori.host
32
+ → no browser here (this is an SSH session) — sign in from any other device
33
+ Open: https://my.tori.host/cli-auth
34
+ Code: PQXR-4K7M
35
+ ⠧ waiting for approval…
36
+ ```
37
+
38
+ `--no-browser` picks that flow deliberately on a machine that does have a
39
+ browser. `BROWSER=none` does the same through the environment.
40
+
41
+ ### In CI
42
+
43
+ There is nobody there to approve anything, so `tori deploy` does not try: set
44
+ `TORI_TOKEN` to a token minted in the Console (Settings → API tokens), and
45
+ `TORI_API_URL` if you are not pointing at the default.
46
+
47
+ ## Commands
48
+
49
+ | Command | What it does |
50
+ | --- | --- |
51
+ | `tori` / `tori deploy [dir]` | Deploy, signing in first if needed. Auto-detects `dist/`, `build/`, `out/`, or `_site/` (runs `npm run build` if needed), packs it, uploads, and waits until it's live. First deploy creates the app and writes its slug to `tori.json`. |
52
+ | `tori login` | Sign in through the browser (or with a code) and save the token. |
53
+ | `tori whoami` | Show the logged-in account and plan. |
54
+ | `tori --version` / `--help` | The usual. |
55
+
56
+ Example:
57
+
58
+ ```
59
+ $ npx tori.host
60
+ → opening your browser to sign in…
61
+ ✓ signed in as you@somewhere.com
62
+ Saved as "CLI · macbook-vaclav" — revoke it any time in the console.
63
+ → created app plucky-wren
64
+ ⠹ uploading 8.4 MB / 30.0 MB 28% 1.1 MB/s ETA 19s
65
+ → uploaded 30.0 MB in 27s (1.1 MB/s)
66
+ ✓ live: https://plucky-wren.tori.cloud
67
+ ```
68
+
69
+ ## Uploads
70
+
71
+ The server holds the request open for the whole upload and only answers once the
72
+ last byte has arrived, so on a slow uplink `tori deploy` can legitimately run for
73
+ several minutes — a 100 MB artifact over 1 Mbit/s is about fourteen. The progress
74
+ line is there so that wait is distinguishable from a hang; when stderr is a pipe
75
+ (CI), progress is printed as periodic lines instead.
76
+
77
+ Limits and timeouts, all matched to the server rather than guessed:
78
+
79
+ | | |
80
+ | --- | --- |
81
+ | Largest artifact | 100 MB compressed (refused locally before the upload starts) |
82
+ | Upload deadline | 20 minutes, the same as the API ingress and the server's build watchdog |
83
+ | Stall detection | 2 minutes without the socket accepting a byte |
84
+ | Wait for the build | 20 minutes; timing out here abandons the wait, it does not cancel the deploy |
85
+
86
+ Environment overrides, mainly for tests: `TORI_UPLOAD_TIMEOUT_MS`,
87
+ `TORI_UPLOAD_STALL_MS`, `TORI_DEPLOY_TIMEOUT_MS`, `TORI_LOGIN_TIMEOUT_MS`.
88
+
89
+ **Known ceiling, server-side:** the API today closes any single request after
90
+ five minutes (Node's `server.requestTimeout` default, not overridden), so an
91
+ upload slower than roughly 2.8 Mbit/s at the 100 MB cap will be cut off with
92
+ HTTP 408 no matter what the client does — [issue 48]. The CLI reports that as
93
+ what it is rather than as a connection error, but it cannot work around it.
94
+
95
+ [issue 48]: https://git.int.fortion.net/websites/tori/-/issues/48
96
+
97
+ ## Tests
98
+
99
+ ```sh
100
+ npm test -w packages/cli
101
+ ```
102
+
103
+ The suite drives the real binary as a child process against a mock control plane
104
+ on a real socket. Two tests reproduce the five-minute ceiling at real speed and
105
+ take five and a half minutes each, so they are opt-in:
106
+
107
+ ```sh
108
+ TORI_SLOW_TESTS=1 npm test -w packages/cli
109
+ ```
@@ -0,0 +1,40 @@
1
+ <!-- Generated by packages/cli/scripts/gen-notices.ts. Do not edit by hand:
2
+ `npm run gen:notices -w packages/cli` rewrites it, and `npm test` fails
3
+ when it is stale. -->
4
+
5
+ # Third-party notices
6
+
7
+ `tori.host` ships a single bundled file, `dist/cli.js`. The code below is
8
+ compiled into it, so its licence terms travel with this package.
9
+
10
+ Dependencies that stay external — declared in `dependencies` and installed by
11
+ npm alongside this package — are not listed here: npm installs them with their
12
+ own licence files intact.
13
+
14
+ ## zod 3.25.76
15
+
16
+ SPDX: MIT
17
+
18
+ ```
19
+ MIT License
20
+
21
+ Copyright (c) 2025 Colin McDonnell
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in all
31
+ copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ SOFTWARE.
40
+ ```