From 429b55d587770add7b15064ae540279284f85872 Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Wed, 2 Sep 2026 11:38:57 +0200 Subject: [PATCH] Release Network Tools 0.2.0 --- .gitea/workflows/verify.yml | 39 ++ CHANGELOG.md | 6 + README.md | 9 +- SOURCE.md | 4 +- THIRD_PARTY_NOTICES.md | 6 +- docs/ARCHITECTURE.md | 7 +- docs/PRIVACY-SECURITY.md | 6 +- package-lock.json | 45 ++- package.json | 10 +- playwright.config.ts | 22 +- public/CHANGELOG.md | 6 + public/LICENSES/npm-runtime-licenses.txt | 6 +- public/README.md | 9 +- public/SOURCE.md | 4 +- public/THIRD_PARTY_NOTICES.md | 6 +- public/docs/ARCHITECTURE.md | 7 +- public/docs/PRIVACY-SECURITY.md | 6 +- public/sw.js | 2 +- public/toolbox-app.json | 13 +- src/components/Workbench.tsx | 202 +++++++++- src/network/dns.ts | 450 ++++++++++++++++++++++- src/network/http.ts | 285 +++++++++++++- src/network/vlsm.ts | 147 ++++++++ src/styles.css | 23 +- src/toolbox/manifest.source.json | 28 +- src/version.ts | 2 +- tests/browser/app.spec.ts | 33 +- tests/browser/responsive.spec.ts | 18 + tests/network/http-mime.test.ts | 79 +++- tests/network/url-dns.test.ts | 90 ++++- 30 files changed, 1474 insertions(+), 96 deletions(-) create mode 100644 .gitea/workflows/verify.yml create mode 100644 src/network/vlsm.ts create mode 100644 tests/browser/responsive.spec.ts diff --git a/.gitea/workflows/verify.yml b/.gitea/workflows/verify.yml new file mode 100644 index 0000000..b84a7cb --- /dev/null +++ b/.gitea/workflows/verify.yml @@ -0,0 +1,39 @@ +name: Verify + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +concurrency: + group: verify-${{ gitea.repository }}-${{ gitea.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 45 + env: + CI: "true" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + - name: Select declared npm version + run: npm install --global npm@11.17.0 + - name: Install dependencies + run: npm ci + - name: Audit runtime dependencies + run: npm audit --omit=dev --audit-level=moderate + - name: Check, test, and build + run: npm run check + - name: Install browser engines + run: npx playwright install --with-deps chromium firefox webkit + - name: Browser tests + run: npm run test:browser diff --git a/CHANGELOG.md b/CHANGELOG.md index cfdb03c..7c9e463 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.2.0 - 2026-09-02 + +- Added largest-first IPv4 VLSM planning with bounded, atomic allocation. +- Added inert DNS zone parsing/validation with common record semantics and explicit syntax-only coverage. +- Added multi-field CSP and HTTP security-header analysis. + ## 0.1.0 - 2026-09-01 - Added the initial local-first Network Tools workbench. diff --git a/README.md b/README.md index b7880be..e4d1241 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,15 @@ Calculate and construct network values locally in the browser. Network Tools is a standalone local-first application in the [add·ideas Toolbox](https://git.add-ideas.de/lotobo/toolbox-portal). Inputs are processed in the browser and are not uploaded. -## Version 0.1 scope +## Current scope - IPv4 and IPv6 parsing, canonicalisation, prefix ranges and IPv4 broadcast calculation +- Largest-first IPv4 VLSM planning with conventional network/broadcast reservations, alignment and atomic fit failures - URL resolution, component/query inspection and password-redacted display without requesting the URL - Bounded A, AAAA, CNAME, MX, SRV, CAA and TXT zone-record construction -- Bounded response-header inspection and explicit CSP construction +- Inert, bounded zone-file parsing with `$ORIGIN`, `$TTL`, inherited owners, multiline records, common RDATA validation and explicit syntax-only coverage for unknown types; `$INCLUDE` is never followed +- Bounded response-header security analysis covering CSP, HSTS, cookies, CORS, framing, content sniffing, referrer and cross-origin policies +- CSP parsing/diagnostics and explicit conservative CSP construction - A compact offline extension/MIME reference The application treats pasted values as untrusted, applies explicit length and numeric limits, and makes no DNS, URL or HTTP request. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) and [docs/PRIVACY-SECURITY.md](docs/PRIVACY-SECURITY.md). @@ -26,7 +29,7 @@ npm run test:browser ## Release -`npm run release:artifact` creates a deterministic `release/network-tools-0.1.0.zip` and checksum sidecar. +`npm run release:artifact` creates a deterministic `release/network-tools-0.2.0.zip` and checksum sidecar. ## Licence diff --git a/SOURCE.md b/SOURCE.md index 8191516..fd47a7b 100644 --- a/SOURCE.md +++ b/SOURCE.md @@ -1,7 +1,7 @@ # Corresponding source -The corresponding source for Network Tools 0.1.0 is available at: +The corresponding source for Network Tools 0.2.0 is available at: -https://git.add-ideas.de/lotobo/network-tools/src/tag/v0.1.0 +https://git.add-ideas.de/lotobo/network-tools/src/tag/v0.2.0 Build with Node.js 22, npm 11, `npm ci`, and `npm run release:artifact`. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index fea3c6d..0360850 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -4,9 +4,9 @@ Network Tools 0.1.0 directly depends on these runtime packages: | Package | Pinned version | Declared licence | | -------------------------------- | -------------: | ---------------- | -| `@add-ideas/toolbox-contract` | 0.2.3 | Apache-2.0 | -| `@add-ideas/toolbox-helpers` | 0.1.0 | GPL-3.0-or-later | -| `@add-ideas/toolbox-shell-react` | 0.2.3 | Apache-2.0 | +| `@add-ideas/toolbox-contract` | 0.3.0 | Apache-2.0 | +| `@add-ideas/toolbox-helpers` | 0.2.0 | GPL-3.0-or-later | +| `@add-ideas/toolbox-shell-react` | 0.3.0 | Apache-2.0 | | `react` | 19.2.8 | MIT | | `react-dom` | 19.2.8 | MIT | diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 23a6f40..c2a63c3 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -3,8 +3,9 @@ Network Tools is a static React/Vite application wrapped in the shared Toolbox shell. `Workbench.tsx` owns only transient view state and delegates to small pure modules: - `network/url.ts` resolves and decomposes URLs with the platform `URL` parser and returns a password-redacted display value. -- `network/dns.ts` constructs one bounded zone-file record; IPv4 and IPv6 parsing comes from `@add-ideas/toolbox-helpers`. -- `network/http.ts` parses a pasted header block and constructs an explicit CSP from source tokens. +- `network/vlsm.ts` parses bounded `name,hosts` requirements, sorts largest-first and allocates aligned IPv4 blocks atomically inside one parsed base CIDR. +- `network/dns.ts` constructs one bounded zone-file record and inertly parses complete pasted zone text. The zone parser joins bounded parenthesized records, honours local `$ORIGIN`/`$TTL`, validates common RDATA and retains unsupported record types as clearly marked syntax-only data. It rejects rather than follows external/generative directives such as `$INCLUDE`. +- `network/http.ts` parses a pasted header block, analyses a deployed CSP plus baseline response-header protections, and constructs an explicit CSP from source tokens. - `network/mime.ts` is a project-authored offline reference table. -All version 0.1 operations are short, bounded and synchronous, so the app does not create a worker. There is no server API, service worker, persistence layer or runtime lookup. Relative entry and asset URLs keep the production build relocatable below a nested portal path. +All operations are short, bounded and synchronous, so the app does not create a worker. VLSM is capped at 1,024 requirements; zone text at 2 MiB/50,000 physical lines/20,000 records; headers at 256 KiB/2,048 fields and CSP at 128 KiB. There is no server API, persistence layer or runtime lookup. Relative entry and asset URLs keep the production build relocatable below a nested portal path. diff --git a/docs/PRIVACY-SECURITY.md b/docs/PRIVACY-SECURITY.md index a85e62c..9858d35 100644 --- a/docs/PRIVACY-SECURITY.md +++ b/docs/PRIVACY-SECURITY.md @@ -1,7 +1,7 @@ # Privacy and security -Network Tools has no runtime network operation. Entering a URL does not visit it; constructing a DNS record does not perform a DNS query; and the MIME reference is bundled in the app. There is no account, telemetry, analytics, persistence or imported active content. +Network Tools has no runtime network operation. Entering a URL does not visit it; constructing or parsing DNS data does not perform a DNS query; `$INCLUDE` and other external zone directives are rejected; pasted headers are never requested; and the MIME reference is bundled in the app. There is no account, telemetry, analytics, persistence or imported active content. -Inputs and results stay in React memory until they are replaced or the page is closed. URL passwords are removed from the displayed resolved URL, but query strings, fragments and the original input remain visible and may still contain secrets. Header findings and generated CSP are advisory, not a complete security audit. +Inputs and results stay in React memory until they are replaced or the page is closed. URL passwords are removed from the displayed resolved URL, but query strings, fragments and the original input remain visible and may still contain secrets. VLSM output assumes conventional IPv4 network/broadcast reservations. Zone validation covers common record semantics and labels all other records as syntax-only. Header/CSP findings are defensive review prompts, not proof that an application is secure or correctly deployed. -The URL parser rejects inputs above 16 KiB, the header parser rejects blocks above 256 KiB and obsolete folding/control characters, TXT character strings are limited to 255 UTF-8 bytes, and DNS names/numbers are syntax- and range-checked. These limits reduce accidental resource use; they do not make copied output trustworthy for an unrelated system. +The URL parser rejects inputs above 16 KiB, the header parser rejects blocks above 256 KiB and obsolete folding/control characters, TXT character strings are limited to 255 UTF-8 bytes, and DNS names/numbers are syntax- and range-checked. Zone and VLSM bounds are documented in the architecture. These limits reduce accidental resource use; they do not make copied output trustworthy for an unrelated system. diff --git a/package-lock.json b/package-lock.json index 4652d45..81a3d88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "network-tools", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "network-tools", - "version": "0.1.0", + "version": "0.2.0", "license": "GPL-3.0-or-later", "dependencies": { - "@add-ideas/toolbox-contract": "0.2.3", - "@add-ideas/toolbox-helpers": "0.1.0", - "@add-ideas/toolbox-shell-react": "0.2.3", + "@add-ideas/toolbox-contract": "0.3.0", + "@add-ideas/toolbox-helpers": "0.2.0", + "@add-ideas/toolbox-shell-react": "0.3.0", "react": "19.2.8", "react-dom": "19.2.8" }, "devDependencies": { - "@add-ideas/toolbox-testkit": "0.2.3", + "@add-ideas/toolbox-testkit": "0.3.0", "@eslint/js": "10.0.1", "@playwright/test": "1.62.1", "@testing-library/jest-dom": "6.9.1", @@ -42,24 +42,24 @@ } }, "node_modules/@add-ideas/toolbox-contract": { - "version": "0.2.3", - "license": "Apache-2.0", - "engines": { - "node": ">=20" - } + "version": "0.3.0", + "resolved": "https://git.add-ideas.de/api/packages/lotobo/npm/%40add-ideas%2Ftoolbox-contract/-/0.3.0/toolbox-contract-0.3.0.tgz", + "integrity": "sha512-dKrK7BjOFwqJaBfJuhKxZKIld4sH0AKjEn6a0yLnbdMUFY+fFv4VSLGV2tNSBD016gumc2iNqOjUj/ld7x4rtA==", + "license": "Apache-2.0" }, "node_modules/@add-ideas/toolbox-helpers": { - "version": "0.1.0", - "license": "GPL-3.0-or-later", - "engines": { - "node": ">=22" - } + "version": "0.2.0", + "resolved": "https://git.add-ideas.de/api/packages/lotobo/npm/%40add-ideas%2Ftoolbox-helpers/-/0.2.0/toolbox-helpers-0.2.0.tgz", + "integrity": "sha512-SdOqkw+P+3J3fa5iVkzb5P15rVepB001GNV21Oh8w0CZcVL+YRltgD/s+MVcTyrNijWQf3E5vtQON/3N2LLyKg==", + "license": "GPL-3.0-or-later" }, "node_modules/@add-ideas/toolbox-shell-react": { - "version": "0.2.3", + "version": "0.3.0", + "resolved": "https://git.add-ideas.de/api/packages/lotobo/npm/%40add-ideas%2Ftoolbox-shell-react/-/0.3.0/toolbox-shell-react-0.3.0.tgz", + "integrity": "sha512-74p6JzAOG0YCAKdlc1hLofV4ZIko7vb448S75cIiM88PKm93EHl5VD7g8YVyfM56Ui97UY9dmy+Whiq4sGzpsg==", "license": "Apache-2.0", "dependencies": { - "@add-ideas/toolbox-contract": "0.2.3" + "@add-ideas/toolbox-contract": "0.3.0" }, "peerDependencies": { "react": ">=18 <20", @@ -67,17 +67,16 @@ } }, "node_modules/@add-ideas/toolbox-testkit": { - "version": "0.2.3", + "version": "0.3.0", + "resolved": "https://git.add-ideas.de/api/packages/lotobo/npm/%40add-ideas%2Ftoolbox-testkit/-/0.3.0/toolbox-testkit-0.3.0.tgz", + "integrity": "sha512-4Fk+oSvZFspOMIXr8Xy040nhAaBsIQAzsGyXWSpjn3+k3yBKq7nB1r5zCHhsXzfdLzvPDAx2KcmSNOhM330D9w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@add-ideas/toolbox-contract": "0.2.3" + "@add-ideas/toolbox-contract": "0.3.0" }, "bin": { "toolbox-check": "dist/cli.js" - }, - "engines": { - "node": ">=20" } }, "node_modules/@adobe/css-tools": { diff --git a/package.json b/package.json index 6fe918f..41fedba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "network-tools", - "version": "0.1.0", + "version": "0.2.0", "description": "Calculate and construct network values locally in the browser.", "license": "GPL-3.0-or-later", "author": "Albrecht Degering", @@ -39,14 +39,14 @@ "release:artifact": "npm run check && npm run test:browser && npm run package:release -- --force" }, "dependencies": { - "@add-ideas/toolbox-contract": "0.2.3", - "@add-ideas/toolbox-helpers": "0.1.0", - "@add-ideas/toolbox-shell-react": "0.2.3", + "@add-ideas/toolbox-contract": "0.3.0", + "@add-ideas/toolbox-helpers": "0.2.0", + "@add-ideas/toolbox-shell-react": "0.3.0", "react": "19.2.8", "react-dom": "19.2.8" }, "devDependencies": { - "@add-ideas/toolbox-testkit": "0.2.3", + "@add-ideas/toolbox-testkit": "0.3.0", "@eslint/js": "10.0.1", "@playwright/test": "1.62.1", "@testing-library/jest-dom": "6.9.1", diff --git a/playwright.config.ts b/playwright.config.ts index 731da62..2ab6a22 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -15,7 +15,25 @@ export default defineConfig({ timeout: 180_000, }, projects: [ - { name: "chromium", use: { ...devices["Desktop Chrome"] } }, - { name: "firefox", use: { ...devices["Desktop Firefox"] } }, + { + name: "chromium", + testIgnore: /responsive\.spec\.ts/, + use: { ...devices["Desktop Chrome"] }, + }, + { + name: "firefox", + testIgnore: /responsive\.spec\.ts/, + use: { ...devices["Desktop Firefox"] }, + }, + { + name: "webkit", + testIgnore: /responsive\.spec\.ts/, + use: { ...devices["Desktop Safari"] }, + }, + { + name: "mobile-chromium", + testMatch: /responsive\.spec\.ts/, + use: { ...devices["Pixel 5"] }, + }, ], }); diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md index cfdb03c..7c9e463 100644 --- a/public/CHANGELOG.md +++ b/public/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.2.0 - 2026-09-02 + +- Added largest-first IPv4 VLSM planning with bounded, atomic allocation. +- Added inert DNS zone parsing/validation with common record semantics and explicit syntax-only coverage. +- Added multi-field CSP and HTTP security-header analysis. + ## 0.1.0 - 2026-09-01 - Added the initial local-first Network Tools workbench. diff --git a/public/LICENSES/npm-runtime-licenses.txt b/public/LICENSES/npm-runtime-licenses.txt index 45a7c95..4f412f1 100644 --- a/public/LICENSES/npm-runtime-licenses.txt +++ b/public/LICENSES/npm-runtime-licenses.txt @@ -1,5 +1,5 @@ ============================================================================== -@add-ideas/toolbox-contract@0.2.3 +@add-ideas/toolbox-contract@0.3.0 Declared licence: Apache-2.0 ============================================================================== --- LICENSE --- @@ -198,7 +198,7 @@ Declared licence: Apache-2.0 ============================================================================== -@add-ideas/toolbox-helpers@0.1.0 +@add-ideas/toolbox-helpers@0.2.0 Declared licence: GPL-3.0-or-later ============================================================================== --- LICENSE --- @@ -879,7 +879,7 @@ Public License instead of this License. But first, please read ============================================================================== -@add-ideas/toolbox-shell-react@0.2.3 +@add-ideas/toolbox-shell-react@0.3.0 Declared licence: Apache-2.0 ============================================================================== --- LICENSE --- diff --git a/public/README.md b/public/README.md index b7880be..e4d1241 100644 --- a/public/README.md +++ b/public/README.md @@ -4,12 +4,15 @@ Calculate and construct network values locally in the browser. Network Tools is a standalone local-first application in the [add·ideas Toolbox](https://git.add-ideas.de/lotobo/toolbox-portal). Inputs are processed in the browser and are not uploaded. -## Version 0.1 scope +## Current scope - IPv4 and IPv6 parsing, canonicalisation, prefix ranges and IPv4 broadcast calculation +- Largest-first IPv4 VLSM planning with conventional network/broadcast reservations, alignment and atomic fit failures - URL resolution, component/query inspection and password-redacted display without requesting the URL - Bounded A, AAAA, CNAME, MX, SRV, CAA and TXT zone-record construction -- Bounded response-header inspection and explicit CSP construction +- Inert, bounded zone-file parsing with `$ORIGIN`, `$TTL`, inherited owners, multiline records, common RDATA validation and explicit syntax-only coverage for unknown types; `$INCLUDE` is never followed +- Bounded response-header security analysis covering CSP, HSTS, cookies, CORS, framing, content sniffing, referrer and cross-origin policies +- CSP parsing/diagnostics and explicit conservative CSP construction - A compact offline extension/MIME reference The application treats pasted values as untrusted, applies explicit length and numeric limits, and makes no DNS, URL or HTTP request. See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) and [docs/PRIVACY-SECURITY.md](docs/PRIVACY-SECURITY.md). @@ -26,7 +29,7 @@ npm run test:browser ## Release -`npm run release:artifact` creates a deterministic `release/network-tools-0.1.0.zip` and checksum sidecar. +`npm run release:artifact` creates a deterministic `release/network-tools-0.2.0.zip` and checksum sidecar. ## Licence diff --git a/public/SOURCE.md b/public/SOURCE.md index 8191516..fd47a7b 100644 --- a/public/SOURCE.md +++ b/public/SOURCE.md @@ -1,7 +1,7 @@ # Corresponding source -The corresponding source for Network Tools 0.1.0 is available at: +The corresponding source for Network Tools 0.2.0 is available at: -https://git.add-ideas.de/lotobo/network-tools/src/tag/v0.1.0 +https://git.add-ideas.de/lotobo/network-tools/src/tag/v0.2.0 Build with Node.js 22, npm 11, `npm ci`, and `npm run release:artifact`. diff --git a/public/THIRD_PARTY_NOTICES.md b/public/THIRD_PARTY_NOTICES.md index fea3c6d..0360850 100644 --- a/public/THIRD_PARTY_NOTICES.md +++ b/public/THIRD_PARTY_NOTICES.md @@ -4,9 +4,9 @@ Network Tools 0.1.0 directly depends on these runtime packages: | Package | Pinned version | Declared licence | | -------------------------------- | -------------: | ---------------- | -| `@add-ideas/toolbox-contract` | 0.2.3 | Apache-2.0 | -| `@add-ideas/toolbox-helpers` | 0.1.0 | GPL-3.0-or-later | -| `@add-ideas/toolbox-shell-react` | 0.2.3 | Apache-2.0 | +| `@add-ideas/toolbox-contract` | 0.3.0 | Apache-2.0 | +| `@add-ideas/toolbox-helpers` | 0.2.0 | GPL-3.0-or-later | +| `@add-ideas/toolbox-shell-react` | 0.3.0 | Apache-2.0 | | `react` | 19.2.8 | MIT | | `react-dom` | 19.2.8 | MIT | diff --git a/public/docs/ARCHITECTURE.md b/public/docs/ARCHITECTURE.md index 23a6f40..c2a63c3 100644 --- a/public/docs/ARCHITECTURE.md +++ b/public/docs/ARCHITECTURE.md @@ -3,8 +3,9 @@ Network Tools is a static React/Vite application wrapped in the shared Toolbox shell. `Workbench.tsx` owns only transient view state and delegates to small pure modules: - `network/url.ts` resolves and decomposes URLs with the platform `URL` parser and returns a password-redacted display value. -- `network/dns.ts` constructs one bounded zone-file record; IPv4 and IPv6 parsing comes from `@add-ideas/toolbox-helpers`. -- `network/http.ts` parses a pasted header block and constructs an explicit CSP from source tokens. +- `network/vlsm.ts` parses bounded `name,hosts` requirements, sorts largest-first and allocates aligned IPv4 blocks atomically inside one parsed base CIDR. +- `network/dns.ts` constructs one bounded zone-file record and inertly parses complete pasted zone text. The zone parser joins bounded parenthesized records, honours local `$ORIGIN`/`$TTL`, validates common RDATA and retains unsupported record types as clearly marked syntax-only data. It rejects rather than follows external/generative directives such as `$INCLUDE`. +- `network/http.ts` parses a pasted header block, analyses a deployed CSP plus baseline response-header protections, and constructs an explicit CSP from source tokens. - `network/mime.ts` is a project-authored offline reference table. -All version 0.1 operations are short, bounded and synchronous, so the app does not create a worker. There is no server API, service worker, persistence layer or runtime lookup. Relative entry and asset URLs keep the production build relocatable below a nested portal path. +All operations are short, bounded and synchronous, so the app does not create a worker. VLSM is capped at 1,024 requirements; zone text at 2 MiB/50,000 physical lines/20,000 records; headers at 256 KiB/2,048 fields and CSP at 128 KiB. There is no server API, persistence layer or runtime lookup. Relative entry and asset URLs keep the production build relocatable below a nested portal path. diff --git a/public/docs/PRIVACY-SECURITY.md b/public/docs/PRIVACY-SECURITY.md index a85e62c..9858d35 100644 --- a/public/docs/PRIVACY-SECURITY.md +++ b/public/docs/PRIVACY-SECURITY.md @@ -1,7 +1,7 @@ # Privacy and security -Network Tools has no runtime network operation. Entering a URL does not visit it; constructing a DNS record does not perform a DNS query; and the MIME reference is bundled in the app. There is no account, telemetry, analytics, persistence or imported active content. +Network Tools has no runtime network operation. Entering a URL does not visit it; constructing or parsing DNS data does not perform a DNS query; `$INCLUDE` and other external zone directives are rejected; pasted headers are never requested; and the MIME reference is bundled in the app. There is no account, telemetry, analytics, persistence or imported active content. -Inputs and results stay in React memory until they are replaced or the page is closed. URL passwords are removed from the displayed resolved URL, but query strings, fragments and the original input remain visible and may still contain secrets. Header findings and generated CSP are advisory, not a complete security audit. +Inputs and results stay in React memory until they are replaced or the page is closed. URL passwords are removed from the displayed resolved URL, but query strings, fragments and the original input remain visible and may still contain secrets. VLSM output assumes conventional IPv4 network/broadcast reservations. Zone validation covers common record semantics and labels all other records as syntax-only. Header/CSP findings are defensive review prompts, not proof that an application is secure or correctly deployed. -The URL parser rejects inputs above 16 KiB, the header parser rejects blocks above 256 KiB and obsolete folding/control characters, TXT character strings are limited to 255 UTF-8 bytes, and DNS names/numbers are syntax- and range-checked. These limits reduce accidental resource use; they do not make copied output trustworthy for an unrelated system. +The URL parser rejects inputs above 16 KiB, the header parser rejects blocks above 256 KiB and obsolete folding/control characters, TXT character strings are limited to 255 UTF-8 bytes, and DNS names/numbers are syntax- and range-checked. Zone and VLSM bounds are documented in the architecture. These limits reduce accidental resource use; they do not make copied output trustworthy for an unrelated system. diff --git a/public/sw.js b/public/sw.js index 636a76e..c699d2f 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,5 +1,5 @@ const CACHE_PREFIX = "network-tools-shell-"; -const CACHE_NAME = CACHE_PREFIX + "0.1.0"; +const CACHE_NAME = CACHE_PREFIX + "0.2.0"; const CORE = ["./", "./manifest.webmanifest", "./favicon.svg"]; self.addEventListener("install", (event) => { event.waitUntil( diff --git a/public/toolbox-app.json b/public/toolbox-app.json index e00ddb1..634909b 100644 --- a/public/toolbox-app.json +++ b/public/toolbox-app.json @@ -3,7 +3,7 @@ "schemaVersion": 1, "id": "de.add-ideas.network-tools", "name": "Network Tools", - "version": "0.1.0", + "version": "0.2.0", "description": "Calculate and construct network values locally in the browser.", "entry": "./", "icon": "./favicon.svg", @@ -21,6 +21,17 @@ "crossOriginIsolated": false, "topLevelContext": false }, + "io": { + "accepts": [ + { "mediaType": "text/plain", "extensions": [".txt", ".zone"] }, + { "mediaType": "application/json", "extensions": [".json"] } + ], + "produces": [ + { "mediaType": "text/plain", "extensions": [".txt", ".zone"] }, + { "mediaType": "application/json", "extensions": [".json"] } + ] + }, + "capabilities": { "required": [], "optional": [] }, "privacy": { "processing": "local", "fileUploads": false, diff --git a/src/components/Workbench.tsx b/src/components/Workbench.tsx index e328915..3291931 100644 --- a/src/components/Workbench.tsx +++ b/src/components/Workbench.tsx @@ -1,14 +1,21 @@ import { useMemo, useState } from "react"; import { parseCidr } from "@add-ideas/toolbox-helpers"; -import { buildDnsRecord, type DnsRecordType } from "../network/dns"; +import { + buildDnsRecord, + inspectDnsZone, + type DnsRecordType, +} from "../network/dns"; import { buildCsp, inspectHeaders } from "../network/http"; import { lookupMime } from "../network/mime"; import { inspectUrl } from "../network/url"; +import { parseVlsmRequirements, planVlsm } from "../network/vlsm"; const tabs = [ ["cidr", "IP & CIDR"], + ["vlsm", "VLSM planner"], ["url", "URL"], ["dns", "DNS"], + ["zone", "Zone file"], ["http", "HTTP & CSP"], ["mime", "MIME types"], ] as const; @@ -191,6 +198,101 @@ function UrlWorkspace() { ); } +function VlsmWorkspace() { + const [base, setBase] = useState("10.20.0.0/22"); + const [requirements, setRequirements] = useState( + "Office,300\nLab,120\nGuest Wi-Fi,50\nInfrastructure,20", + ); + const plan = useMemo( + () => attempt(() => planVlsm(base, parseVlsmRequirements(requirements))), + [base, requirements], + ); + return ( +
+
+

IPv4 VLSM planner

+

+ Allocate largest requirements first inside one base network. No router + or IP address is contacted. +

+
+ +