pockethost 3.1.0 → 4.1.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  Formerly published as `phio`. Versions below 3.0.0 are phio's history.
4
4
 
5
+ ## 4.1.0
6
+
7
+ ### Minor Changes
8
+
9
+ - New file commands that work over HTTPS with your token, replacing SFTP:
10
+ - `pockethost files [path] [-r]` lists files on the instance.
11
+ - `pockethost pull [paths...]` downloads files into the current folder (everything except `pb_data` by default;
12
+ `--data` includes it, and `node_modules` is skipped unless you name it). Files that haven't changed since the last
13
+ pull are skipped.
14
+ - `pockethost upload <local> [remote]` uploads a file or folder, for example an existing `pb_data` or your
15
+ `node_modules` (deploys never touch `node_modules`). Large files go up in 32 MB chunks, eight files at a time.
16
+ - `pockethost rm <paths...> [-r]` deletes files, for example a migration that keeps the instance from starting.
17
+ - Add `-I <instance>` to target an instance other than the linked one. `pb_data` needs the instance powered off.
18
+ - `pockethost sftp`, `deploy --sftp` and `dev --sftp` print a notice: SFTP shuts down on February 6, 2027.
19
+
20
+ ## 4.0.0
21
+
22
+ ### Major Changes
23
+
24
+ - The CLI signs in with a personal access token only. Email/password login is gone: `pockethost login` opens
25
+ Account → API Tokens and saves the token you paste (`pockethost login <token>` works too), and
26
+ `POCKETHOST_USERNAME`/`POCKETHOST_PASSWORD` are ignored with a message pointing to `POCKETHOST_TOKEN`. A login saved
27
+ by 3.x no longer works; run `pockethost login` once.
28
+ - `list`, `link` and `logs` work with a token and show only the instances the token can reach. `logs` streams over
29
+ the instance's HTTPS endpoint, so it works from CI.
30
+ - `sftp`, `deploy --sftp` and `dev --sftp` no longer register an SSH key for you, because tokens can't add SSH keys.
31
+ Add the CLI's public key under Account → Keys once; the CLI prints it when it's missing. Keys registered by earlier
32
+ versions keep working.
33
+ - `info` shows the token, linked instance and whether the SFTP key is on your account.
34
+ - Dropped the `pocketbase` dependency.
35
+
5
36
  ## 3.1.0
6
37
 
7
38
  ### Minor Changes
package/LICENSE.md ADDED
@@ -0,0 +1,16 @@
1
+ The MIT License (MIT)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4
+ and associated documentation files (the "Software"), to deal in the Software without restriction,
5
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
7
+ is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or
10
+ substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13
+ BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -16,14 +16,14 @@ npm install -g pockethost
16
16
  npm rm -g phio && npm i -g pockethost
17
17
  ```
18
18
 
19
- Everything carries over on first run: your login and deploy key are copied from phio's config folder (`~/.config/phio-nodejs` on Linux), `.phioconfig` is
19
+ Your deploy key is copied from phio's config folder (`~/.config/phio-nodejs` on Linux), `.phioconfig` is
20
20
  renamed to `.pockethostconfig` (commit it), and the `PHIO_*` environment variables keep working with a warning until
21
21
  you rename them to `POCKETHOST_*`.
22
22
 
23
23
  ## Commands
24
24
 
25
25
  ```bash
26
- pockethost login # or: pockethost login --token
26
+ pockethost login [token] # save a personal access token
27
27
  pockethost token [set|clear|status]
28
28
  pockethost logout
29
29
  pockethost info # alias: pockethost whoami
@@ -31,14 +31,23 @@ pockethost list # alias: pockethost ls
31
31
  pockethost link [instance]
32
32
  pockethost dev [instance]
33
33
  pockethost deploy [instance]
34
- pockethost sftp [instance]
34
+ pockethost files [path]
35
+ pockethost pull [paths...]
36
+ pockethost upload <local> [remote]
37
+ pockethost rm <paths...>
38
+ pockethost sftp [instance] # shuts down Feb 6, 2027
35
39
  pockethost logs [instance]
36
40
  ```
37
41
 
38
42
  - **`pockethost dev`**: watch local changes and deploy them
39
43
  - **`pockethost deploy`**: deploy once
40
- - **`pockethost token`**: save, clear, or check a personal access token
41
- - **`pockethost sftp`**: interactive SFTP session (uses system `sftp` when available)
44
+ - **`pockethost login`**: open Account → API Tokens and save the token you paste
45
+ - **`pockethost token`**: save, clear, or check the token
46
+ - **`pockethost files`**: list files on the instance (`-r` for everything below a folder)
47
+ - **`pockethost pull`**: download instance files into this folder (`--data` includes `pb_data`)
48
+ - **`pockethost upload`**: upload a file or folder, such as an existing `pb_data`
49
+ - **`pockethost rm`**: delete files on the instance
50
+ - **`pockethost sftp`**: interactive SFTP session. SFTP shuts down on February 6, 2027
42
51
  - **`pockethost logs`**: tail instance logs
43
52
 
44
53
  `dev` and `deploy` accept `-v/--verbose`, `-i/--include`, `-e/--exclude`, and `--sftp` (sync over SFTP instead of
@@ -84,13 +93,16 @@ on the instance that aren't in your project are removed. `node_modules` and `.gi
84
93
 
85
94
  ## Authentication
86
95
 
87
- `deploy` and `dev` use, in order:
96
+ The CLI signs in with a personal access token (`ph_pat_…`) only. Every command uses, in order:
88
97
 
89
- 1. `POCKETHOST_TOKEN` (a personal access token, `ph_pat_…`)
90
- 2. a token saved with `pockethost token set` (or `pockethost login --token`)
91
- 3. your email/password login (`pockethost login`, or `POCKETHOST_USERNAME`/`POCKETHOST_PASSWORD`)
98
+ 1. `POCKETHOST_TOKEN`
99
+ 2. the token saved by `pockethost login` (or `pockethost token set`)
92
100
 
93
- Create tokens under Account → API Tokens in the dashboard. Deploy from GitHub Actions:
101
+ Create tokens under [Account → API Tokens](https://app.pockethost.io/account/tokens). A token sees only the instances
102
+ you give it; `list`, `link` and `logs` need read access, `deploy` and `dev` need write access. Email/password login
103
+ was removed in 4.0.
104
+
105
+ Deploy from GitHub Actions:
94
106
 
95
107
  ```yaml
96
108
  - run: npx pockethost@latest deploy myapp-${{ github.ref_name }}
@@ -100,12 +112,14 @@ Create tokens under Account → API Tokens in the dashboard. Deploy from GitHub
100
112
 
101
113
  Docs: https://pockethost.io/docs/deploy-from-ci
102
114
 
103
- ## Deploy key (`--sftp` and `pockethost sftp`)
115
+ ## SSH key (`--sftp` and `pockethost sftp`)
104
116
 
105
- `pockethost dev --sftp`, `pockethost deploy --sftp` and `pockethost sftp` use **SFTP** (`ftp.pockethost.io:2222`) using an Ed25519 deploy key
106
- stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`). The CLI auto-registers a **`PocketHost CLI`** key
107
- under Account → Keys on first use (an existing **`Phio`** key from phio is reused). Run `pockethost info` to inspect
108
- key status.
117
+ `pockethost dev --sftp`, `pockethost deploy --sftp` and `pockethost sftp` use **SFTP** (`ftp.pockethost.io:2222`)
118
+ with an Ed25519 key stored under `POCKETHOST_HOME` (default `~/.config/pockethost/`), created on first use. Tokens
119
+ can't add SSH keys, so add the public key (`pockethost_deploy_ed25519.pub`) under
120
+ [Account → Keys](https://app.pockethost.io/account/keys) once; the CLI prints it if it's missing. Keys you registered
121
+ with an earlier version (`PocketHost CLI` or `Phio`) keep working. `pockethost info` shows whether the key is on your
122
+ account.
109
123
 
110
124
  Customer docs: https://pockethost.io/docs/cli
111
125
 
@@ -113,16 +127,14 @@ Customer docs: https://pockethost.io/docs/cli
113
127
 
114
128
  | Variable | Purpose |
115
129
  | -------- | ------- |
116
- | `POCKETHOST_TOKEN` | Personal access token for `deploy`/`dev` (CI) |
117
- | `POCKETHOST_USERNAME` | Override saved email (non-interactive login) |
118
- | `POCKETHOST_PASSWORD` | Override saved password |
130
+ | `POCKETHOST_TOKEN` | Personal access token (CI); overrides the saved one |
119
131
  | `POCKETHOST_INSTANCE_NAME` | Override linked instance name |
120
132
  | `POCKETHOST_MOTHERSHIP_URL` | Override mothership API URL |
121
133
  | `POCKETHOST_HOME` | Override config directory |
122
134
  | `POCKETHOST_PROJECT_DIR` | Override project root detection |
123
135
 
124
136
  Environment variables take precedence over `.pockethostconfig`. The old `PHIO_*` names still work (with a deprecation
125
- warning) and will be removed in the next major version.
137
+ warning) and will be removed in a future major version.
126
138
 
127
139
  ## Development (monorepo)
128
140