diff --git a/CHANGELOG.md b/CHANGELOG.md index d3d5ec7..2f61e08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## [Unreleased] +## [0.3.1] - 2026-11-27 + +### Changed +- SpamBlocker files renamed to spamwall-*.gz inside the spamblocker/ folder + ## [0.3.0] - 2026-11-27 ### Changed @@ -39,7 +44,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - One-click SpamBlocker import files and plain regex lists. - Unblock-request and new-pattern issue templates. -[Unreleased]: https://github.com/wasimness/spamwall/compare/v0.3.0...HEAD +[Unreleased]: https://github.com/wasimness/spamwall/compare/v0.3.1...HEAD +[0.3.1]: https://github.com/wasimness/spamwall/compare/v0.3.0...v0.3.1 [0.3.0]: https://github.com/wasimness/spamwall/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/wasimness/spamwall/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/wasimness/spamwall/releases/tag/v0.1.0 diff --git a/README.md b/README.md index 4088874..ed20892 100644 --- a/README.md +++ b/README.md @@ -19,30 +19,32 @@ SpamWall is an independent project, not made by or affiliated with SpamBlocker. ## Quick start (if you use SpamBlocker) 1. Export a backup first (**Settings > Backup > Export**), because an import replaces your number rules. -2. Download [`spamblocker/spamblocker-full-setup.gz`](spamblocker/spamblocker-full-setup.gz), then **Settings > Backup > Import** and pick it. +2. Download [`spamblocker/spamwall-full-setup.gz`](spamblocker/spamwall-full-setup.gz), then **Settings > Backup > Import** and pick it. 3. Follow the full guide, including the manual steps the import cannot do: [docs/IMPORT.md](docs/IMPORT.md). ## Files | Label | File | Description | Download | |---|---|---|---| -| Full setup (recommended) | `spamblocker-full-setup.gz` | App settings plus all spam rules in one import | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-full-setup.gz) | -| App settings only | `spamblocker-settings.gz` | Only the Others category: contacts, STIR, repeated call, dialed, answered, Recent Apps | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-settings.gz) | -| All spam rules | `spamblocker-all-rules.gz` | Allow rules plus the three default groups (not the bank group) | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-all-rules.gz) | -| Promo and telemarketing calls | `spamblocker-telemarketing.gz` | Group `telemarketing`: the 140 promotional series, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-telemarketing.gz) | -| Call-centre ranges | `spamblocker-call-centres.gz` | Group `call-centres`: call-centre landline and Bengaluru ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-call-centres.gz) | -| Spam mobile ranges | `spamblocker-spam-mobiles.gz` | Group `spam-mobiles`: bulk telemarketing mobile ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-spam-mobiles.gz) | -| Bank and government calls (optional) | `spamblocker-banks-govt.gz` | Group `banks-govt`: the official 1600 series (also blocks your real bank), plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-banks-govt.gz) | -| Raw list (CSV) | `spamwall-in.csv` | Every pattern and business number with its group, for any app or spreadsheet | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.csv) | -| Raw list (JSON) | `spamwall-in.json` | Same data with a meta object, for scripts and AI | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.json) | - -Groups don't stack in SpamBlocker (each rules import replaces the number rules), so to block two groups, import `spamblocker-all-rules.gz`, or import one group and add the other patterns by hand from `rules/in/`. For all rules plus banks, import `spamblocker-all-rules.gz`, then add the IN-1600 pattern by hand. +| Full setup (recommended) | `spamblocker/spamwall-full-setup.gz` | App settings plus all spam rules in one import | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-full-setup.gz) | +| App settings only | `spamblocker/spamwall-settings.gz` | Only the Others category: contacts, STIR, repeated call, dialed, answered, Recent Apps | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-settings.gz) | +| All spam rules | `spamblocker/spamwall-all-rules.gz` | Allow rules plus the three default groups (not the bank group) | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-all-rules.gz) | +| Promo and telemarketing calls | `spamblocker/spamwall-telemarketing.gz` | Group `telemarketing`: the 140 promotional series, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-telemarketing.gz) | +| Call-centre ranges | `spamblocker/spamwall-call-centres.gz` | Group `call-centres`: call-centre landline and Bengaluru ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-call-centres.gz) | +| Spam mobile ranges | `spamblocker/spamwall-spam-mobiles.gz` | Group `spam-mobiles`: bulk telemarketing mobile ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-spam-mobiles.gz) | +| Bank and government calls (optional) | `spamblocker/spamwall-banks-govt.gz` | Group `banks-govt`: the official 1600 series (also blocks your real bank), plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-banks-govt.gz) | +| Raw list (CSV) | `raw/spamwall-in.csv` | Every pattern and business number with its group, for any app or spreadsheet | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.csv) | +| Raw list (JSON) | `raw/spamwall-in.json` | Same data with a meta object, for scripts and AI | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.json) | + +Release downloads use the file name only; the folder shows where it lives in the repo. + +Groups don't stack in SpamBlocker (each rules import replaces the number rules), so to block two groups, import `spamwall-all-rules.gz`, or import one group and add the other patterns by hand from `rules/in/`. For all rules plus banks, import `spamwall-all-rules.gz`, then add the IN-1600 pattern by hand. Each `.gz` has a readable `.json` twin in `spamblocker/`. The raw list also exists as a Markdown table, [`raw/spamwall-in.md`](raw/spamwall-in.md), for reading in the repo (not a release download). Source rules: [`rules/in/`](rules/in/) (one file per pattern in `allow/`, `block/` and `optional/`, each block pattern with a `# Group:` line, plus [`allow-apps.txt`](rules/in/allow-apps.txt) and `numbers/`), table of every pattern: [`rules/in/patterns.md`](rules/in/patterns.md). -**What can be combined:** `spamblocker-settings.gz` + any ONE rules file is fine. `spamblocker-full-setup.gz` already has settings and all default rules. +**What can be combined:** `spamwall-settings.gz` + any ONE rules file is fine. `spamwall-full-setup.gz` already has settings and all default rules. -**Short version of the caveats:** settings never touch number rules; rules never touch settings. Importing `spamblocker-settings.gz` replaces your Recent Apps list and allow switches. Export a backup first, it is your undo. Not tested on every phone and SpamBlocker version, so report problems as issues. Details: [docs/IMPORT.md](docs/IMPORT.md). +**Short version of the caveats:** settings never touch number rules; rules never touch settings. Importing `spamwall-settings.gz` replaces your Recent Apps list and allow switches. Export a backup first, it is your undo. Not tested on every phone and SpamBlocker version, so report problems as issues. Details: [docs/IMPORT.md](docs/IMPORT.md). **Releases:** download the files from the [latest release](../../releases/latest). @@ -91,7 +93,7 @@ Numbers are matched without `+91` or a leading `0`. |---|---|---|---| | IN-1600 | `^1600\d{6}$` | Service and transactional calls from banks, insurers, brokers, mutual funds and government | This is the **official** series that regulated entities must use ([TRAI, PIB](https://pib.gov.in/PressReleasePage.aspx?PRID=2191647)). Blocking it also blocks your real bank. | -**Credit card and loan spam:** promotions must come from the 140 series, which is blocked. Official bank calls must come from 1600, which is not blocked by `spamblocker-full-setup.gz` or `spamblocker-all-rules.gz`. A loan or credit-card pitch from an ordinary mobile or landline breaks TRAI rules; report it in the **Report Spam** app (TRAI DND) and open a *New spam pattern* issue here. +**Credit card and loan spam:** promotions must come from the 140 series, which is blocked. Official bank calls must come from 1600, which is not blocked by `spamwall-full-setup.gz` or `spamwall-all-rules.gz`. A loan or credit-card pitch from an ordinary mobile or landline breaks TRAI rules; report it in the **Report Spam** app (TRAI DND) and open a *New spam pattern* issue here. ## Blocked by mistake? diff --git a/docs/IMPORT.md b/docs/IMPORT.md index 1be7319..95fdb50 100644 --- a/docs/IMPORT.md +++ b/docs/IMPORT.md @@ -2,9 +2,9 @@ > **Read this first** > -> - Settings and rules import separately. `spamblocker-settings.gz` only touches app settings (allow switches, Recent Apps) and never your number rules. `spamblocker-all-rules.gz` and the four group files (`spamblocker-telemarketing.gz`, `spamblocker-call-centres.gz`, `spamblocker-spam-mobiles.gz`, `spamblocker-banks-govt.gz`) only touch number rules. `spamblocker-full-setup.gz` does both. -> - Number-rule imports do not stack. Each import replaces ALL number rules, including your own and any earlier SpamWall import. To block two or three groups, import `spamblocker-all-rules.gz`, or import one group and add the other patterns by hand with "New" in Number Rules, copying the regex from `rules/in/block/.txt`. For all rules plus banks, import `spamblocker-all-rules.gz` and add IN-1600 (from `rules/in/optional/IN-1600.txt`) by hand. -> - Importing `spamblocker-settings.gz` replaces your Recent Apps list and the allow switches. +> - Settings and rules import separately. `spamwall-settings.gz` only touches app settings (allow switches, Recent Apps) and never your number rules. `spamwall-all-rules.gz` and the four group files (`spamwall-telemarketing.gz`, `spamwall-call-centres.gz`, `spamwall-spam-mobiles.gz`, `spamwall-banks-govt.gz`) only touch number rules. `spamwall-full-setup.gz` does both. +> - Number-rule imports do not stack. Each import replaces ALL number rules, including your own and any earlier SpamWall import. To block two or three groups, import `spamwall-all-rules.gz`, or import one group and add the other patterns by hand with "New" in Number Rules, copying the regex from `rules/in/block/.txt`. For all rules plus banks, import `spamwall-all-rules.gz` and add IN-1600 (from `rules/in/optional/IN-1600.txt`) by hand. +> - Importing `spamwall-settings.gz` replaces your Recent Apps list and the allow switches. > - Always export a backup first; importing it again is the undo. > - The maintainer has not tested this on every phone and SpamBlocker version. Report problems as [issues](../../issues). @@ -16,17 +16,19 @@ SpamBlocker for Android, from [F-Droid](https://f-droid.org/packages/spam.blocke | Label | File | Description | Download | |---|---|---|---| -| Full setup (recommended) | `spamblocker-full-setup.gz` | App settings plus all spam rules in one import | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-full-setup.gz) | -| App settings only | `spamblocker-settings.gz` | Only the Others category: contacts, STIR, repeated call, dialed, answered, Recent Apps | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-settings.gz) | -| All spam rules | `spamblocker-all-rules.gz` | Allow rules plus the three default groups (not the bank group) | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-all-rules.gz) | -| Promo and telemarketing calls | `spamblocker-telemarketing.gz` | Group `telemarketing`: the 140 promotional series, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-telemarketing.gz) | -| Call-centre ranges | `spamblocker-call-centres.gz` | Group `call-centres`: call-centre landline and Bengaluru ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-call-centres.gz) | -| Spam mobile ranges | `spamblocker-spam-mobiles.gz` | Group `spam-mobiles`: bulk telemarketing mobile ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-spam-mobiles.gz) | -| Bank and government calls (optional) | `spamblocker-banks-govt.gz` | Group `banks-govt`: the official 1600 series (also blocks your real bank), plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-banks-govt.gz) | -| Raw list (CSV) | `spamwall-in.csv` | Every pattern and business number with its group, for any app or spreadsheet | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.csv) | -| Raw list (JSON) | `spamwall-in.json` | Same data with a meta object, for scripts and AI | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.json) | - -Groups don't stack in SpamBlocker (each rules import replaces the number rules), so to block two groups, import `spamblocker-all-rules.gz`, or import one group and add the other patterns by hand from `rules/in/`. For all rules plus banks, import `spamblocker-all-rules.gz`, then add the IN-1600 pattern by hand. +| Full setup (recommended) | `spamblocker/spamwall-full-setup.gz` | App settings plus all spam rules in one import | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-full-setup.gz) | +| App settings only | `spamblocker/spamwall-settings.gz` | Only the Others category: contacts, STIR, repeated call, dialed, answered, Recent Apps | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-settings.gz) | +| All spam rules | `spamblocker/spamwall-all-rules.gz` | Allow rules plus the three default groups (not the bank group) | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-all-rules.gz) | +| Promo and telemarketing calls | `spamblocker/spamwall-telemarketing.gz` | Group `telemarketing`: the 140 promotional series, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-telemarketing.gz) | +| Call-centre ranges | `spamblocker/spamwall-call-centres.gz` | Group `call-centres`: call-centre landline and Bengaluru ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-call-centres.gz) | +| Spam mobile ranges | `spamblocker/spamwall-spam-mobiles.gz` | Group `spam-mobiles`: bulk telemarketing mobile ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-spam-mobiles.gz) | +| Bank and government calls (optional) | `spamblocker/spamwall-banks-govt.gz` | Group `banks-govt`: the official 1600 series (also blocks your real bank), plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-banks-govt.gz) | +| Raw list (CSV) | `raw/spamwall-in.csv` | Every pattern and business number with its group, for any app or spreadsheet | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.csv) | +| Raw list (JSON) | `raw/spamwall-in.json` | Same data with a meta object, for scripts and AI | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.json) | + +Release downloads use the file name only; the folder shows where it lives in the repo. + +Groups don't stack in SpamBlocker (each rules import replaces the number rules), so to block two groups, import `spamwall-all-rules.gz`, or import one group and add the other patterns by hand from `rules/in/`. For all rules plus banks, import `spamwall-all-rules.gz`, then add the IN-1600 pattern by hand. Each `.gz` also has a readable `.json` twin in `spamblocker/`. The Markdown table `raw/spamwall-in.md` is for reading in the repo, not a release download. Release assets are flat, so every file name is unique. @@ -45,12 +47,12 @@ The raw lists in `raw/` (CSV, JSON) are app-agnostic: the same rows as the SpamB 1. In SpamBlocker, open **Settings > Backup > Export** and save a backup of your current setup first. 2. Download the file you picked to your phone. 3. Open **Settings > Backup > Import** and pick the file. -4. In the **Include Settings** dialog, tap a category to move it between Include and Exclude. Keep only the category the file has (Others for `spamblocker-settings.gz`, Regex Settings for `spamblocker-all-rules.gz` and the four group files (`spamblocker-telemarketing.gz`, `spamblocker-call-centres.gz`, `spamblocker-spam-mobiles.gz`, `spamblocker-banks-govt.gz`), both for `spamblocker-full-setup.gz`). +4. In the **Include Settings** dialog, tap a category to move it between Include and Exclude. Keep only the category the file has (Others for `spamwall-settings.gz`, Regex Settings for `spamwall-all-rules.gz` and the four group files (`spamwall-telemarketing.gz`, `spamwall-call-centres.gz`, `spamwall-spam-mobiles.gz`, `spamwall-banks-govt.gz`), both for `spamwall-full-setup.gz`). 5. Confirm the import. ## Nuances -- Import REPLACES the whole section. Number rules are cleared and re-added, so importing a `spamblocker-all-rules.gz` or the four group files (`spamblocker-telemarketing.gz`, `spamblocker-call-centres.gz`, `spamblocker-spam-mobiles.gz`, `spamblocker-banks-govt.gz`) file (or `spamblocker-full-setup.gz`) deletes your own number rules. Export first, or add your own rules again afterwards. +- Import REPLACES the whole section. Number rules are cleared and re-added, so importing a `spamwall-all-rules.gz` or the four group files (`spamwall-telemarketing.gz`, `spamwall-call-centres.gz`, `spamwall-spam-mobiles.gz`, `spamwall-banks-govt.gz`) file (or `spamwall-full-setup.gz`) deletes your own number rules. Export first, or add your own rules again afterwards. - A file that lacks a category shows "This setting is missing from the backup file and cannot be restored" for that category. Exclude it, as in step 4. - Allow and block rules must never share a priority. Here allow is 15, the built-in allow checks are 10 and block is 5. - Numbers are matched without +91 or a leading 0. diff --git a/spamblocker/spamblocker-settings.gz b/spamblocker/spamblocker-settings.gz deleted file mode 100644 index 7b23fa0..0000000 Binary files a/spamblocker/spamblocker-settings.gz and /dev/null differ diff --git a/spamblocker/spamblocker-spam-mobiles.gz b/spamblocker/spamblocker-spam-mobiles.gz deleted file mode 100644 index e449e05..0000000 Binary files a/spamblocker/spamblocker-spam-mobiles.gz and /dev/null differ diff --git a/spamblocker/spamblocker-telemarketing.gz b/spamblocker/spamblocker-telemarketing.gz deleted file mode 100644 index 39748f2..0000000 Binary files a/spamblocker/spamblocker-telemarketing.gz and /dev/null differ diff --git a/spamblocker/spamblocker-all-rules.gz b/spamblocker/spamwall-all-rules.gz similarity index 53% rename from spamblocker/spamblocker-all-rules.gz rename to spamblocker/spamwall-all-rules.gz index 0b71581..979c62a 100644 Binary files a/spamblocker/spamblocker-all-rules.gz and b/spamblocker/spamwall-all-rules.gz differ diff --git a/spamblocker/spamblocker-all-rules.json b/spamblocker/spamwall-all-rules.json similarity index 100% rename from spamblocker/spamblocker-all-rules.json rename to spamblocker/spamwall-all-rules.json diff --git a/spamblocker/spamblocker-banks-govt.gz b/spamblocker/spamwall-banks-govt.gz similarity index 50% rename from spamblocker/spamblocker-banks-govt.gz rename to spamblocker/spamwall-banks-govt.gz index 3a19034..ff8262f 100644 Binary files a/spamblocker/spamblocker-banks-govt.gz and b/spamblocker/spamwall-banks-govt.gz differ diff --git a/spamblocker/spamblocker-banks-govt.json b/spamblocker/spamwall-banks-govt.json similarity index 100% rename from spamblocker/spamblocker-banks-govt.json rename to spamblocker/spamwall-banks-govt.json diff --git a/spamblocker/spamblocker-call-centres.gz b/spamblocker/spamwall-call-centres.gz similarity index 86% rename from spamblocker/spamblocker-call-centres.gz rename to spamblocker/spamwall-call-centres.gz index 1524128..553dddf 100644 Binary files a/spamblocker/spamblocker-call-centres.gz and b/spamblocker/spamwall-call-centres.gz differ diff --git a/spamblocker/spamblocker-call-centres.json b/spamblocker/spamwall-call-centres.json similarity index 100% rename from spamblocker/spamblocker-call-centres.json rename to spamblocker/spamwall-call-centres.json diff --git a/spamblocker/spamblocker-full-setup.gz b/spamblocker/spamwall-full-setup.gz similarity index 82% rename from spamblocker/spamblocker-full-setup.gz rename to spamblocker/spamwall-full-setup.gz index 00f2b61..b56fc0b 100644 Binary files a/spamblocker/spamblocker-full-setup.gz and b/spamblocker/spamwall-full-setup.gz differ diff --git a/spamblocker/spamblocker-full-setup.json b/spamblocker/spamwall-full-setup.json similarity index 100% rename from spamblocker/spamblocker-full-setup.json rename to spamblocker/spamwall-full-setup.json diff --git a/spamblocker/spamwall-settings.gz b/spamblocker/spamwall-settings.gz new file mode 100644 index 0000000..77a11e0 Binary files /dev/null and b/spamblocker/spamwall-settings.gz differ diff --git a/spamblocker/spamblocker-settings.json b/spamblocker/spamwall-settings.json similarity index 100% rename from spamblocker/spamblocker-settings.json rename to spamblocker/spamwall-settings.json diff --git a/spamblocker/spamwall-spam-mobiles.gz b/spamblocker/spamwall-spam-mobiles.gz new file mode 100644 index 0000000..b93feab Binary files /dev/null and b/spamblocker/spamwall-spam-mobiles.gz differ diff --git a/spamblocker/spamblocker-spam-mobiles.json b/spamblocker/spamwall-spam-mobiles.json similarity index 100% rename from spamblocker/spamblocker-spam-mobiles.json rename to spamblocker/spamwall-spam-mobiles.json diff --git a/spamblocker/spamwall-telemarketing.gz b/spamblocker/spamwall-telemarketing.gz new file mode 100644 index 0000000..8343a75 Binary files /dev/null and b/spamblocker/spamwall-telemarketing.gz differ diff --git a/spamblocker/spamblocker-telemarketing.json b/spamblocker/spamwall-telemarketing.json similarity index 100% rename from spamblocker/spamblocker-telemarketing.json rename to spamblocker/spamwall-telemarketing.json diff --git a/tools/build_spamblocker.py b/tools/build_spamblocker.py index 092708b..985b2eb 100644 --- a/tools/build_spamblocker.py +++ b/tools/build_spamblocker.py @@ -1,7 +1,7 @@ """Build the SpamBlocker import files from rules// and write patterns.md. Usage: python -I tools/build_spamblocker.py -Writes spamblocker/{spamblocker-full-setup,spamblocker-settings,spamblocker-all-rules,spamblocker-}.{gz,json}, +Writes spamblocker/{spamwall-full-setup,spamwall-settings,spamwall-all-rules,spamwall-}.{gz,json}, raw/spamwall-.{csv,json,md} and rules//patterns.md. Old spamwall-*.{gz,json} files are removed. """ import csv @@ -99,12 +99,12 @@ def files(d): s = settings(d) default = group_rules(d, DEFAULT_GROUPS) out = { - "spamblocker-full-setup": {**s, "categories": {"all": ["OTHERS", "REGEX_RULES"]}, **default}, - "spamblocker-settings": s, - "spamblocker-all-rules": {"categories": {"all": ["REGEX_RULES"]}, **default}, + "spamwall-full-setup": {**s, "categories": {"all": ["OTHERS", "REGEX_RULES"]}, **default}, + "spamwall-settings": s, + "spamwall-all-rules": {"categories": {"all": ["REGEX_RULES"]}, **default}, } for g in GROUPS: - out[f"spamblocker-{g}"] = {"categories": {"all": ["REGEX_RULES"]}, **group_rules(d, [g])} + out[f"spamwall-{g}"] = {"categories": {"all": ["REGEX_RULES"]}, **group_rules(d, [g])} return out diff --git a/tools/check.py b/tools/check.py index 5f11fe0..6de8515 100644 --- a/tools/check.py +++ b/tools/check.py @@ -98,18 +98,18 @@ def gen(): if blocks != set(group_of): errors.append(f"patterns without a valid group: {sorted(blocks - set(group_of))}") sb = ROOT / "spamblocker" -expected_files = {f"{n}.{e}" for n in ["spamblocker-full-setup", "spamblocker-settings", "spamblocker-all-rules"] + [f"spamblocker-{g}" for g in GROUPS] for e in ("gz", "json")} +expected_files = {f"{n}.{e}" for n in ["spamwall-full-setup", "spamwall-settings", "spamwall-all-rules"] + [f"spamwall-{g}" for g in GROUPS] for e in ("gz", "json")} if {p.name for p in sb.glob("*")} != expected_files: - errors.append("spamblocker/ must hold exactly spamblocker-full-setup, spamblocker-settings, spamblocker-all-rules and one spamblocker- file (gz + json)") + errors.append("spamblocker/ must hold exactly spamwall-full-setup, spamwall-settings, spamwall-all-rules and one spamwall- file (gz + json)") allow_ids = {r["id"] for r in build.read_dir(ROOT / "rules" / "in" / "allow")} for g in GROUPS: want = {i for i, gg in group_of.items() if gg == g} - rr = json.loads((sb / f"spamblocker-{g}.json").read_text(encoding="utf-8"))["numberRules"]["rules"] + rr = json.loads((sb / f"spamwall-{g}.json").read_text(encoding="utf-8"))["numberRules"]["rules"] got_b = {m.group(1) for r in rr if r["isBlacklist"] for m in [re.match(r"SpamWall (\S+):", r["description"])] if m} got_a = {m.group(1) for r in rr if not r["isBlacklist"] for m in [re.match(r"SpamWall (\S+):", r["description"])] if m} if got_b != want or got_a != allow_ids or len(rr) != len(want) + len(allow_ids): - errors.append(f"spamblocker-{g}.json must hold exactly its block rules {sorted(want)} plus the allow rules") -d = json.loads((ROOT / "spamblocker" / "spamblocker-full-setup.json").read_text(encoding="utf-8")) + errors.append(f"spamwall-{g}.json must hold exactly its block rules {sorted(want)} plus the allow rules") +d = json.loads((ROOT / "spamblocker" / "spamwall-full-setup.json").read_text(encoding="utf-8")) rl = d["numberRules"]["rules"] shared = {r["priority"] for r in rl if r["isBlacklist"]} & {r["priority"] for r in rl if not r["isBlacklist"]} if shared: