fop-cli 5.3.1 → 5.4.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 +89 -4
  2. package/install.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ A Rust port of the EasyList FOP tool for sorting and cleaning ad-blocking filter
12
12
  - **Git integration**: Commit changes directly to repositories (can be disabled)
13
13
  - **easylist_adservers.txt validation**: Ensures rules start with `|` or `/`
14
14
  - **:has-text() merging**: Combines rules with same base selector into single regex
15
- - **Parallel processing**: Uses all CPU cores for faster processing via Rayon
15
+ - **Parallel processing**: Processes files in parallel via Rayon, using up to 8 worker threads. Past that, extra workers cost memory without improving throughput; set `RAYON_NUM_THREADS` to override
16
16
 
17
17
  ## Extended Syntax Support
18
18
 
@@ -111,7 +111,13 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
111
111
  | `--check-banned-list=FILE` | Check for banned domains in git additions |
112
112
  | `--auto-banned-remove` | Auto-remove banned domains and commit |
113
113
  | `--ci` | CI mode - exit with error code on failures (banned domains) |
114
- | `--rebase-on-fail` | Auto rebase and retry push if it fails |
114
+ | `--rebase-on-fail` | Auto `git pull --rebase --autostash` and retry when a push fails. **On by default** |
115
+ | `--no-rebase-on-fail` | Don't auto-rebase; print the suggested `git pull --rebase` command and stop |
116
+ | `--commit-mask=N` | Mask URLs in commit messages (1=`[.]`, 2=`(.)`, 3=space, 4=preserve subdomain dot, 5=Unicode lookalike `․`) |
117
+ | `--commit-mask-users=u1,u2` | Restrict `--commit-mask` to these `git config user.name` values (lowercased) |
118
+ | `--commit-mask-bare` | Also mask bare hostnames without `http(s)://`. Risks false positives on filenames |
119
+ | `--commit-mask-exempt-hosts=h1,h2` | Additional apex hosts exempt from masking (e.g. self-hosted Gitea/Forgejo/GitLab) |
120
+ | `--commit-url-template=TMPL` | Override the `Commit successful:` URL template. Placeholders: `{base}`, `{sha}`. Auto-detects Bitbucket (`/commits/`); everything else defaults to `/commit/` |
115
121
  | `--ignore-config` | Ignore .fopconfig file, use only CLI args |
116
122
  | `--output` | Output changed files with --changed suffix (no overwrite) |
117
123
  | `--check-file=FILE` | Process a single file |
@@ -218,8 +224,32 @@ auto-banned-remove = false
218
224
  # CI mode - exit with error code on failures
219
225
  ci = false
220
226
 
221
- # Auto rebase and retry if push fails
222
- rebase-on-fail = false
227
+ # Auto rebase and retry if push fails (default: true).
228
+ # On failure fop runs 'git pull --rebase --autostash' and pushes again, which
229
+ # reapplies your stashed changes and can leave conflicts to resolve. Set false
230
+ # to be told the command to run instead of having it run for you.
231
+ rebase-on-fail = true
232
+
233
+ # Mask URLs in commit messages: 1=[.], 2=(.), 3=space, 4=preserve subdomain dot, 5=Unicode lookalike
234
+ # github.com, gitlab.com, and codeberg.org (and subdomains) are always exempt so PR/issue links stay clickable.
235
+ commit-mask =
236
+
237
+ # If non-empty, --commit-mask only applies when git user.name matches one of these (case-insensitive).
238
+ commit-mask-users =
239
+
240
+ # Also mask bare hostnames (no http/https). Risks FP on filenames like config.toml.
241
+ commit-mask-bare = false
242
+
243
+ # Additional apex hosts (and subdomains) exempt from masking. Adds to the
244
+ # built-in github.com / gitlab.com / codeberg.org list. Use for self-hosted
245
+ # Gitea, Forgejo, or private GitLab instances.
246
+ commit-mask-exempt-hosts =
247
+
248
+ # Override the 'Commit successful:' URL template (placeholders: {base}, {sha}).
249
+ # Default is auto-detected per host: bitbucket.org gets {base}/commits/{sha},
250
+ # everything else gets {base}/commit/{sha}. Override here if your platform
251
+ # uses something different (e.g. cgit, trac, custom redirector).
252
+ commit-url-template =
223
253
 
224
254
  # Suppress most output (for CI)
225
255
  quiet = false
@@ -256,6 +286,61 @@ add-timestamp = true
256
286
 
257
287
  Supported per-file options: `no-sort`, `alt-sort`, `parse-adguard`, `localhost`, `add-checksum`, `add-timestamp`, `no-ubo-convert`, `abp-convert`, `convert-trusted`, `keep-empty-lines`, `ignore-dot-domains`, `fix-typos`.
258
288
 
289
+ ### Commit Message URL Masking
290
+
291
+ `--commit-mask=N` defangs URLs in commit messages so they're stored in git history in a non-clickable form. Useful for filter-list maintainers who don't want third-party scrapers, search engines, or auto-linkers to follow URLs cited in commit messages. Masking happens **after** commit-message validation (so `A:`/`P:` prefixes still validate against the real URL) but **before** `git commit -m`, so the masked form is what lands in git.
292
+
293
+ #### Levels
294
+
295
+ Using `https://www.example.com/foo/bar.html` and `https://www.example.co.nz/foo` as inputs:
296
+
297
+ | Level | Style | `www.example.com/...` | `www.example.co.nz/foo` |
298
+ |---|---|---|---|
299
+ | 1 | `[.]` | `https://www[.]example[.]com/foo/bar.html` | `https://www[.]example[.]co[.]nz/foo` |
300
+ | 2 | `(.)` | `https://www(.)example(.)com/foo/bar.html` | `https://www(.)example(.)co(.)nz/foo` |
301
+ | 3 | space | `https://www example com/foo/bar.html` | `https://www example co nz/foo` |
302
+ | 4 | preserve subdomain dot | `https://www.example[.]com/foo/bar.html` | `https://www.example[.]co[.]nz/foo` |
303
+ | 5 | Unicode `․` (U+2024) | `https://www․example․com/foo/bar.html` | `https://www․example․co․nz/foo` |
304
+
305
+ Notes:
306
+ - **Path/query/fragment dots are never masked** (only host dots), so file extensions like `bar.html` and query values like `?t=1.2` stay readable.
307
+ - **Level 4** masks only the registrable domain plus eTLD ("eTLD+1"). Compound TLDs (`co.uk`, `co.nz`, `com.au`, `co.jp`, `com.ng`, `com.hk`, `co.il`, `com.vn`, etc. — ~25 country codes) are recognised so `example.co.uk` is treated as a 2-label TLD. Apex-only inputs (`example.com`, no subdomain) still defang the only dot.
308
+ - **Level 5** is the strongest defang: U+2024 is visually nearly identical to `.` but is not in IDNA UTS #46 normalization tables, so URLs containing it won't resolve in browsers, `curl`, or most parsers — even after copy/paste. Reviewers won't realise the link is dead until they try to click it.
309
+ - **Unknown levels** (0, 6, 99…) silently fall through to level 1.
310
+ - **Exempt hosts:** `github.com`, `gitlab.com`, `codeberg.org`, and any of their subdomains (`gist.github.com`, `docs.gitlab.com`, etc.) are never masked, so PR/issue links remain clickable on the hosting platform. Lookalike hosts like `notgitlab.com` or `evil.gitlab.com.attacker.com` still get masked. For self-hosted Gitea/Forgejo/GitLab, add your host with `--commit-mask-exempt-hosts=git.company.internal,...`.
311
+
312
+ #### Choosing a level
313
+
314
+ | When to use | Level |
315
+ |---|---|
316
+ | Maximum visibility ("clearly defanged") | 1, 2, or 3 |
317
+ | Want the host structure to remain readable, only break TLD | 4 |
318
+ | Want the URL to look real but stay broken (anti-scraper) | 5 |
319
+
320
+ #### Restricting masking by user
321
+
322
+ `--commit-mask-users=name1,name2,...` (or `commit-mask-users = ...` in config) gates masking on the current `git config user.name`. If the list is empty, masking applies to whoever runs fop. If the list is non-empty, only matching users (case-insensitive) get masking; everyone else commits with the original URL.
323
+
324
+ ```ini
325
+ commit-mask = 4
326
+ commit-mask-users = fanboynz, ryanbr
327
+ ```
328
+
329
+ #### Bare hostnames (`--commit-mask-bare`)
330
+
331
+ Off by default. When enabled, also matches hostnames without an `http(s)://` prefix (e.g. `forums.lanik.us` or `www.example.com.ng`). The matcher requires at least one dot and a 2+ letter final label, so version numbers like `1.2.3` are not matched. Filenames like `config.toml` **will** match — that's the documented false-positive cost of opting in. Scheme URLs still take priority where both forms appear, and the host-exempt list (`github.com`, `gitlab.com`) applies to bare matches too.
332
+
333
+ #### Display label
334
+
335
+ After a successful commit, fop prints `Commit message:` followed by what landed in git. If masking actually changed the message, the label becomes `Commit message (masked):` instead, so it's obvious the displayed text is the masked form.
336
+
337
+ ```
338
+ Commit message (masked): A: https://www.example[.]com/foo
339
+ Commit successful: https://github.com/easylist/easylist/commit/abc1234
340
+ ```
341
+
342
+ If `commit-mask` is unset, or every URL was github/gitlab (a no-op mask), the plain `Commit message:` label is shown.
343
+
259
344
  ## Platform Support
260
345
 
261
346
  ### Pre-built Binaries
package/install.js CHANGED
@@ -7,7 +7,7 @@ const path = require('path');
7
7
  const { execSync } = require('child_process');
8
8
 
9
9
  // Configuration - UPDATE THESE FOR YOUR RELEASE
10
- const VERSION = '5.3.1';
10
+ const VERSION = '5.4.0';
11
11
  const GITHUB_REPO = 'ryanbr/fop-rs'; // Change to your repo
12
12
  const BINARY_NAME = 'fop';
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fop-cli",
3
- "version": "5.3.1",
3
+ "version": "5.4.0",
4
4
  "description": "Filter Orderer and Preener - A tool for sorting and cleaning ad-blocking filter lists",
5
5
  "keywords": [
6
6
  "adblock",