@domsync/win32-arm64 1.0.0 → 1.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.
Files changed (3) hide show
  1. package/README.md +33 -8
  2. package/domsync.exe +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -19,9 +19,17 @@ The cask works on macOS and, with Homebrew 6.0 or newer, on Linux.
19
19
  npm (macOS, Linux and Windows):
20
20
 
21
21
  ```sh
22
- npm i -g domsync
22
+ npm i -g @domsync/cli
23
23
  ```
24
24
 
25
+ Go (any platform with a Go toolchain, built from source):
26
+
27
+ ```sh
28
+ go install github.com/neiromaster/domsync/cmd/domsync@latest
29
+ ```
30
+
31
+ `go install` places the binary in `$GOBIN` (or `$HOME/go/bin`). The toolchain version is pinned in `go.mod`.
32
+
25
33
  Install script (macOS and Linux):
26
34
 
27
35
  ```sh
@@ -141,7 +149,9 @@ After a successful sync the `-` lines disappear from the local file: the domain
141
149
 
142
150
  Within each section, patterns are sorted; section order is otherwise preserved; the `other_section` is last. The local file is rewritten as a snapshot of the merged state, comments included. When the local file has sections, the router file contains `# [section]` headers followed by the same sorted patterns; a flat local file produces a flat router file. Router-only domains are added to `other_section`; if the local file already has that section it is reused, so a second one is never created.
143
151
 
144
- An empty local file, or a plan whose final list would be empty, is an error: domsync refuses to wipe the router.
152
+ A missing local file is treated as an empty list, so the first run bootstraps the local snapshot from the router: every router domain is adopted and written locally. An empty local file with an empty router is a no-op. A plan whose final list would be empty while the router is not is an error: domsync refuses to wipe the router.
153
+
154
+ Concurrent runs are refused. A run holds an exclusive lock on `<source.domains>.domsync.lock` from the moment the configuration is loaded until every write and post-write command has finished, so a cron job and a manual run cannot interleave their reads and writes. The lock file stays on disk after the run; the lock itself is released by the operating system when the process exits, including after a crash.
145
155
 
146
156
  ### Router file validation
147
157
 
@@ -185,12 +195,23 @@ YAML parsing is strict: unknown fields, multiple YAML documents and an empty fil
185
195
 
186
196
  Config validation runs before SSH is dialled: a missing key file, a missing `known_hosts`, or an empty `target.ssh_key` with `SSH_AUTH_SOCK` unset fails with exit code 1 before any connection is attempted.
187
197
 
198
+ ## Validation
199
+
200
+ `domsync validate` loads the configuration and parses the local list without opening an SSH connection. It covers everything `domsync` checks before dialing the router — the config schema, path resolution, the existence of `target.ssh_key` and `target.known_hosts`, and the local list syntax — and nothing that needs the router.
201
+
202
+ ```sh
203
+ domsync validate
204
+ domsync --json validate
205
+ ```
206
+
207
+ Exit codes follow the table below: `1` for a configuration or read error and `2` for an invalid local list. With `--json` the output is one object with `ok`, `config`, `domains`, `total` and `sections`; on failure it carries an `error` object with the exit code and message.
208
+
188
209
  ## Exit codes
189
210
 
190
211
  | Code | Meaning |
191
212
  |---|---|
192
213
  | `0` | Success, including "no changes". Also `--help` and `--version`. |
193
- | `1` | Usage or configuration error, local file read/write error, or log write error. |
214
+ | `1` | Usage or configuration error, local file read/write error, log write error, or another run holding the local lock. |
194
215
  | `2` | Validation error in the local list or the router provider file, including `--strict` warnings, and an empty final list. |
195
216
  | `3` | SSH connection, authentication, host-key or remote read/write/verify error. |
196
217
  | `4` | Update error, including the Homebrew/npm refusal. |
@@ -221,10 +242,10 @@ domsync does not replace binaries installed by Homebrew or npm. The install meth
221
242
 
222
243
  ```text
223
244
  domsync установлен через Homebrew. Обновление: brew upgrade --cask domsync
224
- domsync установлен через npm. Обновление: npm i -g domsync@latest
245
+ domsync установлен через npm. Обновление: npm i -g @domsync/cli@latest
225
246
  ```
226
247
 
227
- So update those installs with `brew upgrade --cask domsync` or `npm i -g domsync@latest`. The same refusal applies to `domsync update --check`, because install detection happens first. A standalone binary is replaced atomically after its archive has been checked against `checksums.txt`.
248
+ So update those installs with `brew upgrade --cask domsync` or `npm i -g @domsync/cli@latest`. The same refusal applies to `domsync update --check`, because install detection happens first. A standalone binary is replaced atomically after its archive has been checked against `checksums.txt`.
228
249
 
229
250
  ## Output
230
251
 
@@ -251,7 +272,7 @@ domsync: 14 доменов, 3 секции
251
272
 
252
273
  ## Security
253
274
 
254
- - **Strict host key checking.** Every connection verifies the router key against `known_hosts` using `golang.org/x/crypto/ssh/knownhosts`, whether authentication uses a key file or the ssh-agent. An unknown key aborts with its SHA-256 fingerprint and a `ssh-keyscan` hint; a changed key aborts naming both the presented and the expected fingerprints. TOFU does not exist in v1.
275
+ - **Strict host key checking.** Every connection verifies the router key against `known_hosts` using `golang.org/x/crypto/ssh/knownhosts`, whether authentication uses a key file or the ssh-agent. An unknown key aborts with its SHA-256 fingerprint and a `ssh-keyscan` hint; a changed key aborts naming both the presented and the expected fingerprints. TOFU does not exist in v1. The host key type is negotiated from the algorithms recorded for the host in `known_hosts`, so a host with only one recorded key type is not rejected merely because the server also offers another.
255
276
  - **Updates in v1 rely on SHA-256 only.** The binary checks the downloaded archive against `checksums.txt` from the release and extracts only the expected executable, rejecting path traversal. GoReleaser also publishes a cosign keyless signature bundle (`checksums.txt.sigstore.json`) and GitHub build attestations; these are for manual verification, not checked by the CLI. To verify a release by hand:
256
277
 
257
278
  ```sh
@@ -289,13 +310,17 @@ go test ./internal/domainlist -run '^$' -fuzz FuzzParseRemote -fuzztime 30s
289
310
 
290
311
  Tagging `v*` runs `.github/workflows/release.yml`. Maintainers need:
291
312
 
292
- - **No npm token.** The `npm` job requests `id-token: write` and `.github/scripts/publish-npm.sh` publishes the `domsync` launcher and the six `@domsync/<os>-<cpu>` platform packages through [trusted publishing](https://docs.npmjs.com/trusted-publishers/): npm exchanges the GitHub OIDC token for a short-lived credential and attaches provenance. Each of the seven package names needs a trusted publisher configured on npmjs.com (`neiromaster` / `domsync` / `release.yml`, no environment), or on the command line with `npm trust github <package> --file release.yml --repo neiromaster/domsync --allow-publish`.
293
- npm only accepts a trusted publisher for a package that already exists, so the first release is published once by a maintainer: run `npm login` (2FA), then, after the GitHub release exists, `GITHUB_TOKEN=$(gh auth token) GITHUB_REF_NAME=<tag> GITHUB_REPOSITORY=neiromaster/domsync ./.github/scripts/publish-npm.sh`. After that, tag pushes publish without credentials.
313
+ - **No npm token.** The `npm` job requests `id-token: write` and `.github/scripts/publish-npm.sh` publishes the `@domsync/cli` launcher and the six `@domsync/<os>-<cpu>` platform packages through [trusted publishing](https://docs.npmjs.com/trusted-publishers/): npm exchanges the GitHub OIDC token for a short-lived credential and attaches provenance. Each of the seven package names needs a trusted publisher configured on npmjs.com (`neiromaster` / `domsync` / `release.yml`, no environment), or on the command line with `npm trust github <package> --file release.yml --repo neiromaster/domsync --allow-publish`.
314
+ npm only accepts a trusted publisher for a package that already exists, so the first release is published once by a maintainer: run `npm login` (2FA), then, after the GitHub release exists, `GITHUB_TOKEN=$(gh auth token) GITHUB_REF_NAME=<tag> GITHUB_REPOSITORY=neiromaster/domsync ./.github/scripts/publish-npm.sh`. After that, tag pushes publish without credentials. The script generates provenance only inside GitHub Actions, so the bootstrap version is published without it.
294
315
  - A `neiromaster/homebrew-tap` repository and a `HOMEBREW_TAP_TOKEN` secret with write access to it, used by the cask publisher.
295
316
  - A **public** repository. The Scorecard workflow sets `publish_results: true`, which requires public visibility.
296
317
 
297
318
  GoReleaser builds the archives, `checksums.txt`, the cosign bundle and SBOMs, publishes the GitHub release and the Homebrew cask; the release workflow adds build provenance attestations and then publishes the npm packages.
298
319
 
320
+ ## Contributing
321
+
322
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup, commit conventions and the pull request workflow. Report vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
323
+
299
324
  ## License
300
325
 
301
326
  MIT
package/domsync.exe CHANGED
Binary file
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@domsync/win32-arm64","version":"1.0.0","os":"win32","cpu":"arm64","files":["domsync","domsync.exe"],"license":"MIT","repository":{"type":"git","url":"https://github.com/neiromaster/domsync"},"publishConfig":{"provenance":false,"access":"public"}}
1
+ {"name":"@domsync/win32-arm64","version":"1.1.0","os":"win32","cpu":"arm64","files":["domsync","domsync.exe"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/neiromaster/domsync.git"},"publishConfig":{"provenance":true,"access":"public"}}