norc-cli 0.3.2 → 0.3.3
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 +29 -2
- package/dist/index.js +650 -221
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# norc-cli
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/norc-cli)
|
|
4
|
+
[](https://www.npmjs.com/package/norc-cli)
|
|
5
|
+
[](https://www.npmjs.com/package/norc-cli)
|
|
6
|
+
|
|
3
7
|
Headless cron job scheduler for [norc](https://norc.app). Manage your machine's crontab from a CLI, pair it with your norc account, and keep a background bridge daemon online for remote admin from the norc web app.
|
|
4
8
|
|
|
5
9
|
## Install
|
|
@@ -16,7 +20,7 @@ Via Homebrew:
|
|
|
16
20
|
brew install norcapp/norc/norc-cli
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
Requires Node.js >= 24 (via npm — brew/apt/
|
|
23
|
+
Requires Node.js >= 24 (via npm — brew/apt/scoop bundle their own runtime, no system Node needed).
|
|
20
24
|
|
|
21
25
|
## Setup
|
|
22
26
|
|
|
@@ -74,7 +78,30 @@ Useful for anything that fails with a generic message like `pairing failed (500)
|
|
|
74
78
|
|
|
75
79
|
## End-to-end encryption
|
|
76
80
|
|
|
77
|
-
Everything the norc web, mobile and desktop apps send to `norc bridge` (and its replies) is end-to-end encrypted: ECIES with ECDH P-256 and AES-256-GCM, sealed to this machine's own key. The private key never leaves the machine
|
|
81
|
+
Everything the norc web, mobile and desktop apps send to `norc bridge` (and its replies) is end-to-end encrypted: ECIES with ECDH P-256 and AES-256-GCM, sealed to this machine's own key. The private key never leaves the machine. Pairing again (`norc pair`, `norc login --key`) or `norc logout` discards it, so a new pairing always gets a new key. Machines must run norc-cli 0.2.0 or later to be reachable; older versions show as "Update required".
|
|
82
|
+
|
|
83
|
+
## Where credentials are stored
|
|
84
|
+
|
|
85
|
+
`~/.config/norc/config.json` (mode 0600, owner-only ACL on Windows) holds your login session, this machine's device token and the relay private key. `NORC_SECRET_STORE` decides where the device token and the relay private key go:
|
|
86
|
+
|
|
87
|
+
| `NORC_SECRET_STORE` | Device token + relay private key |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `keychain` | OS keychain, service `app.norc.cli`: macOS Keychain, the Secret Service via `secret-tool` on Linux, Windows Credential Manager. `config.json` keeps only a hash and the public key. |
|
|
90
|
+
| `file` | `config.json` itself. |
|
|
91
|
+
| unset | macOS: `keychain`. Linux and Windows: `file`. Headless Linux agents (cron, systemd at boot) usually have no unlocked Secret Service. Windows switches to `keychain` once its Credential Manager path is verified. |
|
|
92
|
+
|
|
93
|
+
If the keychain can't be written, norc prints a one-line warning and keeps the secrets in the file. Any other value of the variable prints a warning and uses the default. The login session always stays in `config.json`.
|
|
94
|
+
|
|
95
|
+
The variable only decides where secrets are written. Once `config.json` points at the keychain, every norc process reads them from there, including cron jobs and services that never see your shell's environment. With `file` set, the next time norc saves the config while holding the secrets it moves them back into `config.json` and deletes the keychain items. `norc bridge` does this when it starts.
|
|
96
|
+
|
|
97
|
+
Headless Macs: after a reboot, a Mac that nobody has logged in to (reached only over SSH, or running jobs from cron) has a locked login keychain, so norc can't read the device token. `norc run` still runs the job: it takes env vars from its local cache and queues the run report until it can send it. To keep such a Mac working, put the secrets back in the file. While logged in at the Mac (keychain unlocked), run `NORC_SECRET_STORE=file norc bridge`, stop it with Ctrl-C once it has started, and set `NORC_SECRET_STORE=file` wherever norc runs from then on.
|
|
98
|
+
|
|
99
|
+
Downgrading: norc-cli 0.3.2 and earlier can't read the keychain. After a newer version has moved the device token there, an older `norc` (a downgrade, or a second install earlier on `PATH`) reports the machine as not paired. Move the secrets back into the file first (see above), or run `norc pair` again with the older version.
|
|
100
|
+
|
|
101
|
+
What this protects against: the keychain keeps the device token and key out of copies of `config.json` at rest, such as backups and synced dotfiles. It does not protect against malware running as your user, which can read the keychain too, and the background service must run with no one there to unlock anything. What limits a stolen device token is rotation: norc replaces the token about once a day, and if a replaced token is ever used again, norc revokes the machine and alerts you. The machine then prints `norc revoked this machine because its credentials were used from somewhere else` and needs `norc pair` again.
|
|
102
|
+
|
|
103
|
+
Restoring this machine from a VM snapshot, a backup or a cloned disk image brings back a device token that has since been replaced. norc treats that the same way: the machine is revoked, you get an alert, and it needs `norc pair` again. This is expected. Pair a restored or cloned machine again rather than relying on its old pairing.
|
|
104
|
+
|
|
78
105
|
|
|
79
106
|
## Background service
|
|
80
107
|
|