Commit Graph
1750 Commits
Author SHA1 Message Date
e8f0677f94 feat(xml-diff): add XML diff tool
Compare two pasted XML documents and highlight the differences, mirroring
the JSON diff tool's UI and diff engine. XML is parsed with a native
DOMParser-based normalizer (attributes as @name, text-only leaves as plain
strings) instead of xml-js, and a reconciliation step coerces mismatched
single/repeated element shapes into arrays before diffing so a repeated
element compares cleanly instead of producing a garbled type-mismatch diff.

From PR #1840
Fix #1839

Co-Authored-By: @sharevb
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-22 21:06:08 +01:00
ShareVB d10b89b995 ci: fix e2e 2026-11-22 18:55:30 +01:00
JoAdo07 7632d99cba fix(percentage-calculator): clear the result when an input is cleared
n-input-number emits null when its text is cleared, while the computeds only
treated undefined as a missing value. The arithmetic then coerced null to 0,
so emptying To showed -100 and emptying X showed 0.

The three formulas moved into a service that treats null and undefined alike,
with unit tests for the cleared cases and an e2e case that clears a filled
field.

From PR #1913
Fixes #1906
2026-11-22 18:54:52 +01:00
ShareVB 1d77ed3bbe i18n: extract and translate remaining 2026-11-15 22:48:16 +01:00
0295223a3d feat(new tool): Paste Image
Paste an image from the clipboard with Ctrl+V or Cmd+V, or with a
"Paste from clipboard" button for touch devices, then download it.

- Converts to PNG (default), JPEG, or WebP, with a quality slider for
  JPEG and WebP. The format and quality persist across visits.
- Keeps every image pasted in the session, with remove and clear all.
- Shows dimensions, original and output type and size.
- Edits the file name, copies the image as PNG, or copies a base64
  data URL.
- Converts images one at a time in the browser only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEUYi3h8enZM5rmJAZ1UAF

Taken from https://github.com/CorentinTh/it-tools/pull/1912/changes/d19824e7ea42a192808b585f02e2479d6fe87cb3

Co-Authored-By: @destan
2026-11-15 22:48:16 +01:00
8974b3048d feat(new tool): Whitespace cleaner tool
Add a tool that cleans terminal and Claude Code output. The cleaner strips line numbers, ANSI escape sequences, box drawing, bullet markers, diff markers, trailing whitespace, and the common indent. Smart unwrap and Markdown / Reddit mode are optional. Options persist in localStorage. The pasted input is not saved.

Co-Authored-By: @destan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEUYi2gRxcytxRFXjPjH3U
2026-11-15 22:48:16 +01:00
ShareVB 6e021e9848 feat(new tool): CLI Banner Generator
Fix part of #598
2026-11-15 22:48:16 +01:00
ShareVB 8d13f0a176 fix(Fortune Wheel): better color choosing and UI enhancement
Add a remove winner option
Better choose color
Better UI for small screen
Better NaiveUI UI

Fix #597
2026-11-15 19:16:25 +01:00
AlgoVeria b5eace85db feat(new tools): 4-20 mA, 0-10 V and analog scaling converters (#596)
Add an Automation category with three tools for PLC programmers and
instrumentation technicians, built on a shared AnalogSignalConverter
component and a tested src/utils/analog-signal.ts module:

- 4-20 mA converter: current <-> engineering value, 4-20 / 0-20 mA, with the
  NAMUR NE 43 loop diagnostic (failure, undefined zone, under/over-range)
- 0-10 V converter: 0-10, 2-10, 0-5, 1-5 and ±10 V, warns below the live
  zero (broken wire)
- Analog scaling calculator: raw PLC values (Siemens 0-27648 / ±27648,
  Schneider 0-10000, 12/15/16 bits) <-> engineering value, with the rounded
  raw value

Three-column layout: input, parameters and output, each side with a gauge and
a coloured status. A swap button inverts the conversion direction and keeps
the operating point. Also shows the y = gain × x + offset formula for the PLC
and a 0-25-50-75-100 % reference table. Ranges are validated (min < max).

English and French translations.
2026-11-08 18:45:54 +01:00
Zachary Thompson e7758934a8 fix(hash-text): refresh added hashes when digest encoding changes (#594) 2026-11-03 08:34:28 +01:00
ozil 324a6be4d0 fix: keep the language dropdown scrollable within the viewport (#592) 2026-11-02 13:35:16 +01:00
ShareVB 8f94ed3619 i18n: extract and translated remaining 2026-10-30 22:38:27 +01:00
ShareVB 41297c80f8 feat(new tool): Fraction Decimal Converter
Fix #586
2026-10-30 22:28:58 +01:00
ShareVB f122bafaa9 feat(new tool): Sound Tester
Fix #589
2026-10-30 22:12:06 +01:00
ShareVB ec33d7df26 fix(Regex Memo): fix Escaping table formatting
Fix #591
2026-10-30 21:00:07 +01:00
顾吕灏 d6e478c277 i18n: add Traditional Chinese (zh-TW) locale (#587)
* i18n: add Traditional Chinese (zh-TW) locale

- locales/zh-TW.yml: converted 1:1 from the freshly reviewed zh.yml (#584),
  8459 keys, key parity and {placeholder} parity both verified (0 diffs)
- src/tools/fstab-generator/locales/zh-TW.yml: per-tool locale converted as well
- src/components/NavbarButtons.vue: register the display name

Method: OpenCC s2twp + a manual Taiwan terminology pass
(104 phrase fixes). Locales are auto-discovered via import.meta.glob,
so the new file needs no further wiring.

* fix(i18n): correct Traditional Chinese terminology and spacing

* i18n: zh-TW second-pass terminology audit

Full-file sweep for s2twp conversion artifacts beyond dc031df:
- 許可權→權限 ×26, 轉義→跳脫 ×33, 質量→品質 ×14, 攝像頭→攝影機 ×6
- 佔點陣圖→佔位圖 ×1 (s2twp hit 位图 inside 占位图), 原始原始碼→原始碼 ×1
- 超時→逾時 ×7, 倒計時→倒數計時 ×3, 檢測器→偵測器 ×2, 分隔符→分隔符號 ×13

Both files re-validated: key parity (8459 / 26), placeholder parity 0 diffs,
no replacement-chain duplication left.

* fix(i18n): refine zh-TW terminology with context checks
2026-10-25 18:54:43 +01:00
Sebastian DanielssonandClaude Opus 5.5 788d4fdded fix(dns-query, gitattributes-generator): hide dns-query offline, pin commands to the snapshot
dns-query calls Cloudflare DNS over HTTPS and rdap.org, so offline mode
now hides it like dns-queries.

The gitattributes download commands are now built from the URLs the
preview was generated from. When the snapshot was used, they point at the
snapshot commit instead of master, so they reproduce what is shown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 8ec559012d fix(explainshell, ocr-image): honour the configured mirrors
Offline, explainshell now always uses the configured explainchain.url.
Before, a URL the browser had stored earlier (the public
explainshell.com) overrode it.

ocr-image's lang-url template may now name the file
(.../{lang}.traineddata.gz). tesseract.js appends that file name itself,
so the template is reduced to its directory instead of requesting a
duplicated path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 3af8e4a4cd feat(json-viewer, yaml-viewer, currency-converter, geo-coordinates-converter): support intranet mirrors
Add json-schemas.catalog-url, currency-converter.url and
geo-coordinates-converter.tile-url. Offline without a mirror, schema
validation offers custom schemas only, the map is not shown and the
currency converter is hidden. Show the external-access badge on the
YAML viewer and the coordinates converter.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 81c12017ce feat(gitignore-generator, gitattributes-generator): fall back to a bundled template snapshot
Offline mode uses the snapshot only; online, it replaces the hardcoded
fallback list when GitHub can't be reached. Refresh it with
pnpm script:update:git-templates.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 d53e745854 feat(translator, remove-background, math-ocr, ocr-image, gif-to-mp4): ship runtimes with the app
Ship the ONNX runtime, the ffmpeg core, the tesseract worker and core and
English/Simplified Chinese OCR data instead of loading them from
jsdelivr. They load only when their tool runs and are left out of the
PWA precache. Models and other OCR languages can come from an intranet
mirror (transformers.models-url, ocr-image.lang-url). Remove math-ocr's
leftover MathJax typings: MathJax is no longer used.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 94c0bbfcbc fix(countdown, cron-alarm, time-alarm): resolve Beep.mp3 against the app base
The root-absolute /Beep.mp3 (also fixed in pomodoro-timer, in the previous commit) broke when IT-Tools is served from a subfolder.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 b536f040be fix(markdown-editor, unicode-formatter, pomodoro-timer): bundle editor extensions and fonts
md-editor-v3 loaded highlight.js, katex, mermaid, prettier, cropper,
screenfull and echarts from unpkg.com; the two other tools loaded Google
Fonts. All of them now come from the app.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 4a80283786 feat(settings): add an offline mode that hides internet-only tools
"offline": true in tools-settings.json hides tools that need internet
access (menus and routes). Tools declare it with requiresInternet, either
always or unless an intranet mirror is configured. The settings helper
lives in a module without top-level await so eagerly loaded tool
index.ts files can use it without delaying app boot.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 ea30976669 build(deps): add the assets offline mode ships, drop unused currency and ffmpeg helpers
Add fonts, md-editor extensions, the ffmpeg core, the tesseract core and
English/Simplified Chinese OCR data so tools stop loading them from
third-party CDNs. Remove currency-exchanger-js and @ffmpeg/util, which
nothing imports anymore. Patch curlconverter to resolve its wasm files
against the page's <base href> so curl-converter works in a subfolder.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 1b8d4879ac fix(database-builder): quote names and passwords in generated SQL
The database name, account and server address are prefilled from URL query
parameters and were pasted into the script as is, so a crafted link could
add statements to the SQL a user copies and runs (e.g. a database name
containing `` `; DROP DATABASE prod; -- ``). A password containing `'` also
produced invalid SQL.

- Quote identifiers and string literals per dialect.
- PostgreSQL passwords containing a backslash are emitted as E'' strings,
  which parse the same whatever standard_conforming_strings is set to.
- Oracle has no escape for `"` in quoted names or passwords, so either one
  containing `"` shows a validation error instead of generating SQL. Plain
  Oracle names stay unquoted since quoting makes them case-sensitive.
- Newlines in values that land in SQL comments are flattened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 0203c2388a fix(random): use crypto.getRandomValues for generated secrets
`src/utils/random.ts` was built on Math.random(), and it backs the token
generator, htpasswd salts and the passphrase suffixes. The PIN code
generator and the database builder's default password called Math.random()
directly. All now go through crypto.getRandomValues() with rejection
sampling, so indices are unbiased, for ranges up to 2^53.

The passphrase generator no longer calls generateSillyPassword(), which also
picks words with Math.random(). It uses the package's word lists with the
secure helpers, and skips pulling lodash and zxcvbn into the bundle.

Behaviour changes that came with it:
- randIntFromInterval() now includes its upper bound. The lorem ipsum
  sliders could never reach their maximum and the passphrase generator never
  put a number on the last word. The coin flipper used `0..10 % 2`, which
  would be biased with an inclusive range, so it now draws 0 or 1.
- randIntFromInterval() orders reversed bounds, rounds fractional ones
  inward and returns NaN for non-finite input instead of throwing.
- The lorem ipsum generator falls back to its defaults for malformed
  `paragraphs`, `sentences` and `words` URL values and clamps them to the
  slider ranges, so a link like `?sentences=[1,4294967297]` cannot freeze
  the page.
- Passphrases whose length equals the min or max length are accepted.
- Multi-word list entries ("wide eyed") count as one word, so the word count
  and number placement match the settings.
- Token generator draws each character independently instead of shuffling
  the alphabet repeated `length` times.

Fixes the CodeQL js/insecure-randomness alert in the passphrase generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 d785329e74 fix(layout): escape every bracket and paren in footer package links
String replace() only replaced the first `[`, `]`, `(` and `)`, and link
text backslashes were left as is. Use global regexes and escape
backslashes too.

Fixes CodeQL js/incomplete-sanitization alerts in the tool layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 f1b20c7c18 refactor(turndown): remove text-node escape rules that never run
Turndown only applies rules to element nodes; text nodes always go through
its built-in escape(). The `escapeText` rules and their `escapeMarkdown`
helpers in HTML to Markdown, HTML to data and EPUB to Markdown were never
called. They also escaped `|` twice, which would have produced `\\|` had
anyone wired them up. Output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 3872432a07 fix(markdown): escape backslashes in generated table cells
Pipes were escaped but backslashes were not, so a cell ending in `\` turned
the added `\|` into `\\|` and the pipe split the cell. The object-array
Markdown export also left newlines in cells, which broke the row; they now
become `<br>` like in the Markdown table generator.

Fixes CodeQL js/incomplete-sanitization alerts in the Markdown table
generator and the object-array export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 9b655473bc fix(json-viewer): unescape JSON strings in a single pass
Unescaping backslashes before `\n`, `\t` and friends decoded escaped
backslashes twice: `\\n` in an escaped JSON string became a raw newline
instead of `\n`, so parsing failed with "invalid character". A single
replace with a lookup table decodes each escape exactly once.

Fixes the CodeQL js/double-escaping alert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 b688f528bd fix(objgen): comment detection and whitespace stripping
The comment check passed its pattern as a string, so every `\s` became a
literal `s`. Lines starting with `s` that contained `//` or ended in `/`
(e.g. `site = https://example.com`) were dropped as comments. Lines are
already trimmed, so only `//` and lone `/` lines need skipping.

`spacesRegx` and `newLineRegx` lacked the global flag: prop names kept all
but their first space, and whitespace-only lines were treated as content.

Fixes CodeQL js/useless-regexp-character-escape and js/incomplete-sanitization
alerts in src/utils/objgen.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Luoxingchen935 e179bd5b9b docs(zpool-memo): reformat vdev type table 2026-10-03 12:45:21 +02:00
Luoxingchen935 f196182261 feat(zpool-memo): add localized content and recategorize 2026-10-03 12:45:21 +02:00
Luoxingchen935 cba443dc39 i18n: update translations for iptables and fstab generator tools 2026-10-03 12:45:21 +02:00
ShareVB 6aa2e1cebb i18n: extract and translate remaining 2026-09-27 22:47:42 +02:00
ShareVB 90b779356f chore: update deps 2026-09-27 22:37:42 +02:00
ShareVB 7fc4b79172 feat(Timezone Converter): add POSIX string filterable list
Fix #579
2026-09-27 12:45:47 +02:00
641fa857b4 perf(bundle): improve initial load + loading of tools (#575)
* perf(bundle): improve initial load + loading of tool

Render the sider once and only build the parts of it that are visible.

- App.vue renders BaseLayout around the layout switch instead of inside each
  layout, so moving between a plain route and a tool route no longer unmounts
  and rebuilds the whole sider (~460 menu items) on every navigation.
- CollapsibleToolMenu mounts a category's items the first time it opens. Every
  category starts collapsed, so the menu was built entirely out of view.
- Its menuOptions computed no longer folds in the collapsed/active flags, which
  rebuilt every category's tools array -- and re-rendered every item -- per route
  change. They are read from the template instead.
- MenuItemTooltip measures truncation with scrollWidth/clientWidth rather than a
  canvas measureText(), dropping a throwaway <canvas> and a getComputedStyle per
  menu item.

Production build, 3 runs each, fresh profile per run:

  first contentful paint   2476-2735ms -> 814-974ms
  main-thread blocking     1806-2024ms -> 250-294ms
  requests at boot         384         -> 208
  click a tool from home   991-1014ms  -> 178-197ms
  switch between tools     281-322ms   -> 74-125ms

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Fix small width in mermaid exporter

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>
2026-09-27 12:04:23 +02:00
ShareVB 0f4c7b1d68 feat(JSON Editor): store data and add an auto height option
Fix #572
2026-09-26 11:16:58 +02:00
Shaquille_Oatmeal c96fd39482 feat(new tool): Restic Command Generator (#573)
Generates restic CLI commands, with the focus on getting data back out of a
repository when the Backrest UI is not available: a full restore, a restore
limited to some files or a subfolder, a single-file dump, or a FUSE mount.

Covers the backends Backrest points at (S3 compatible such as Backblaze B2,
B2 native, local, SFTP, REST, rclone, Azure, GCS, raw URI), builds the
matching environment setup without ever putting a secret in the command
(the default reads them with `read -rs`), and turns the Backrest plan and
instance IDs into the `plan:` / `created-by:` tag filters restic expects.

Also generates the whole recovery sequence (snapshots, find, ls, restore,
mount) from the same repository settings, and ships a small Backrest cheat
sheet pointing at the config file, the data directory and the tag formats.

Generator only: nothing is executed and no input leaves the browser.
2026-09-26 10:47:09 +02:00
ShareVB bc1d9a3199 feat(Keys Generator): add fingerprint
Fix #574
2026-09-19 20:15:46 +02:00
ShareVB c80a08be64 feat(new tool): EPC QR Code Generator
Fix #570
2026-09-08 08:34:33 +02:00
ShareVB 0039bd7213 feat(new tool): URL Redirection Checker
Depending on https://github.com/sharevb/network-utils-ws
Fix #550
2026-09-06 20:29:27 +02:00
ShareVB 62ab0bf92f fix: c-link to vs href
Fix #569
2026-09-06 09:59:14 +02:00
ShareVB bc44870665 chore: global code formatting 2026-09-06 09:02:45 +02:00
Shaquille_Oatmeal 5bf94bc567 Restructure and enhance cheat sheets for improved readability (#566)
* docs(cheatsheets): expand and align the chmod, git, docker and swarm memos

Unify the four cheat sheets on one layout: short intro, emoji section
headings, grouped command blocks with aligned inline comments, reference
tables and a resources section. Placeholders are consistently <angled>.

- chmod: ls -l breakdown, octal and symbolic tables, special bits, umask,
  recursive/selective changes, recipes, related commands and gotchas;
  fix the directory access matrix (r alone does not grant file access)
  and the --preserve-root default
- git: config and aliases, staging, commit, branching, merge/rebase with
  conflict flow, remotes, stashing, inspection, cherry-pick, tags, undo
  with a reset-mode table, cleaning, bisect, submodules and worktrees
- docker: contexts and events, build flags, registries, run/exec/inspect,
  volumes and mounts, networks, the full compose workflow, cleanup and
  one-liners
- swarm: required firewall ports, node and manager operations, live
  service updates, job modes, placement expressions, publish modes,
  health checks, secret and config rotation, task states and a
  troubleshooting table

* docs(cheatsheets): put descriptions above commands so each line copies clean

Trailing inline comments meant selecting a single command also picked up
the padding and its description. Move every description onto its own line
above the command it documents, keeping one code block per topic.

- each command now stands alone on its line: triple-click copies exactly
  the command, nothing else
- no comment column to re-pad when a longer command is added later, so
  adding a line no longer reindents the whole block
- code lines drop from a median of 78 columns to ~22 (p90 42), so blocks
  no longer scroll sideways on narrow screens
- wrap the three remaining long commands over several lines
- reword the descriptions that only made sense trailing a command

* docs(cheatsheets): rework the tmux, screen, zellij, nano, jq, zpool, CSS and JSONPath memos

Bring eight more cheat sheets onto the same layout as the Docker and Git
ones: short intro, emoji section headings, one code block per topic with
the description above each command, reference tables, resources at the end.

- tmux: session/window/pane/copy-mode tables, scripting with send-keys and
  capture-pane, a starting .tmux.conf
- screen: shared and detached attach modes, split regions, copy mode,
  logging and monitoring, nested-screen prefix
- zellij: correct the pane-mode bindings (d/r split, not v/h), add tab,
  resize, move, search and session modes, layouts, zellij run/edit/action
- nano: add the command-line options and .nanorc settings the sheet was
  missing, drop the stray H1 and broken headings
- jq: flags, core syntax, object/array/string tables, conditionals,
  variables, reduce, and runnable recipes; drop the stale AWS AMI note
  and the HTML pipe entities
- zpool: vdev and support-vdev types, import/export, properties, dataset
  and snapshot/replication commands, tuning notes
- CSS selectors: split one 60-row table into basic, combinator, attribute,
  structural, state, form, functional and pseudo-element groups; add
  :is()/:where()/:has() and a specificity table
- JSONPath: RFC 9535 functions, worked example document, filter operators

* docs(cheatsheets): rework the Dockerfile, Compose and kubectl memos

- Dockerfile: instruction reference table, BuildKit cache/secret/bind
  mounts and heredocs, COPY --chown/--chmod/--from, HEALTHCHECK,
  STOPSIGNAL, a CMD vs ENTRYPOINT table, build commands and a worked
  multi-stage example
- Compose: drop the obsolete version: framing, merge the two duplicated
  "Compose vs Swarm" sections into one table, correct the claim that
  file-based secrets are Swarm-only, and add depends_on conditions,
  profiles, watch mode, include/extends/anchors, env interpolation and
  the full CLI section
- kubectl: replace the removed rolling-update and the retired Heapster
  section, add contexts, custom-columns and JSONPath output, rollouts,
  debug containers, port-forward, secrets, labels, node maintenance and
  one-liners; tag the code blocks so they highlight

* docs(cheatsheets): rework the sed, regex and common-regex memos

- sed: how the pattern space works, an addressing table, the full command
  reference including hold-space and branching, multi-line recipes, and a
  warning about BSD/macOS -i; merge the duplicated deletion and addressing
  sections
- regex: add flags, lazy quantifiers, named groups and backreferences,
  Unicode property escapes, replacement tokens, the JavaScript methods
  that expose groups, and a gotchas section (stateful /g, catastrophic
  backtracking, escaping user input)
- common-regex: rewrite the patterns that markdown escaping had mangled
  into unusable text, group them by subject, and add UUID, semver, CIDR,
  MAC, ISO 8601, duration, log-line and CSV patterns

Every pattern in common-regex now compiles, and the ones people copy most
(IPv4, UUID, semver, E.164, ISO dates, password rules, slug, duration,
MAC) were checked against matching and non-matching input.

* docs(cheatsheets): rework the XPath, conventional-commits and RJ45 memos

- XPath: give every table a CSS-equivalent column, fix the broken
  "only children of type" expression, flag which functions are 2.0+ and
  give the 1.0 workarounds for ends-with and case folding, add the axes
  short forms, worked examples, and how to run XPath from devtools,
  xmllint, lxml, Selenium and Playwright
- conventional commits: types table with the release effect each one
  has, description do/don't table, footer reference, both ways to mark a
  breaking change, a version-bump table, and husky v9 hook syntax
- RJ45: keep the colour swatches and the pinout image, add what each pin
  carries on 10/100 vs Gigabit, the PoE standards table (correcting the
  claim that the blue pair is the PoE pair), gigabit crossover, Cat8,
  length and solid-vs-stranded rules, and a fault-finding table

* docs(cheatsheets): rework the nginx and PowerShell memos

- nginx: the whole sheet was a single 218-line code block; split it into
  sections with a service/CLI block, a file-layout table, location
  matching priority, root vs alias, reverse proxy and WebSocket headers,
  load-balancing methods, TLS, rate limiting, caching and gzip, a
  variable reference and a 502/504 troubleshooting table
- PowerShell: add discovery (Get-Help/Get-Command/Get-Member), functions
  and param blocks, try/catch and error preferences, Invoke-RestMethod
  and JSON/CSV conversion, services, jobs, remoting, modules and
  execution policy, PowerShell 7 operators, an alias table, and repair
  the mangled escape-character rows

* docs(cheatsheets): rework the vim and bash memos

Both sheets were a single unbroken code block with ASCII banners, so the
whole page rendered as one <pre> with nothing to scan. Rebuild them as
sections with key/action tables and runnable blocks.

- vim: explain the count + operator + motion grammar, add the text-object
  table (ciw, ci", da(), registers and why "0p exists, the :g and :v
  global commands, folds, completion, diff mode, undo by time, a :set
  reference and a starter vimrc
- bash: parameter expansion, arrays including associative ones, the test
  operator tables, redirection and process substitution, job control and
  traps, set -euo pipefail with its caveat, shellcheck, and an ANSI
  colour table in place of sixty lines of colour variables

The vim sheet dropped roughly a hundred lines of one person's leader-key
mappings and plugin bindings (NERDTree, Taglist, sparkup, PHP DOC), which
only worked with their dotfiles; a note now explains that leader mappings
come from your own vimrc.
2026-08-30 16:38:56 +02:00
ShareVB 39c616f609 feat(QRCode Generator): add embeddable link and cropy dataurl
Fix #555
2026-08-23 10:48:30 +02:00
Shaquille_Oatmeal 002a211ca5 Enhance Docker Swarm documentation (#564)
Updated Docker Swarm documentation with improved clarity and additional details on commands and features.
2026-08-19 22:34:02 +02:00
0a1f5dc450 feat(docker): serve the app from any subpath with a runtime BASE_URL (#565)
* feat(docker): serve the app from any subpath with a runtime BASE_URL

BASE_URL was a build argument, so hosting under a subfolder meant building
your own image (or pulling the separate baseurl-it-tools tag, which is only
ever right for /it-tools/). Make it a runtime setting instead, so the regular
image works anywhere:

    docker run -e BASE_URL=/it-tools/ ghcr.io/sharevb/it-tools:latest

The build is now path-agnostic. Vite's base is relative, so hashed assets and
lazy chunks resolve against the chunk that imports them, and the single
absolute anchor left in the output is a `<base href="/">` injected into
index.html. nginx rewrites that one tag per request (sub_filter) from the
normalised BASE_URL, and the app reads its base back from it at runtime
(src/utils/base-url.ts) for the router and for every URL it builds into
public/ -- import.meta.env.BASE_URL is meaningless in a relative build.

Also handled:

- both reverse-proxy styles: the prefix may reach the container (stripped by
  the rewrite) or be stripped by the proxy first (nothing to do). The assets
  location matches with or without it, so a missing chunk is still a 404
  rather than the SPA shell.
- `/it-tools` redirects to `/it-tools/`, with a relative Location so the
  scheme of the proxy hop does not leak into it.
- the PWA: manifest URLs are relative to the manifest, workbox precache
  entries relative to the service worker, and the worker is registered
  against the runtime base rather than the build-time one.
- BASE_URL is normalised (`it-tools`, `/it-tools`, `/it-tools/` all work) and
  rejected if it is not a plain path, since it lands in an HTML attribute and
  in an nginx regex.

Defaults are unchanged: with BASE_URL unset the rendered config and the
served page are what they were, except that index.html loses ETag/Last-Modified
to sub_filter. On a read-only filesystem the template cannot be re-rendered,
so BASE_URL is ignored there and the container now says so, like it already
had to for PORT.

Building with --build-arg BASE_URL still works but only moves the image
default; the baseurl-it-tools tag is now just latest with that default.

Closes sharevb/it-tools#403

* fix(docker): restore the PWA update reload, escape BASE_URL in the nginx regexes

Follow-up from review of the runtime BASE_URL change.

- registerSW() in autoUpdate mode reloaded the page when a newly deployed
  worker took over (workbox-window's `activated` handler); hand-rolling the
  registration dropped that, so a tab kept running the previous bundle until
  it navigated. Reimplemented on `controllerchange`, guarded so a first
  install -- which also claims the page -- does not reload. Verified by
  counting document loads across an install and a simulated deploy: 1 load on
  first visit, exactly 1 reload when a new worker takes over.
- The comment justifying the hand-rolled registration was wrong: register()
  does resolve a relative URL against `<base href>`. The real reason is
  workbox-window's own urlsMatch(), which resolves against location.href, so
  a relative sw URL misidentifies the worker on a route deeper than one
  segment. Comment now says that.
- BASE_URL allows `.`, which is a metacharacter in the two nginx regexes it
  is spliced into: `/it.tools/` also matched `/itXtools/`. The entrypoint now
  exports regex-escaped forms for those, keeping the literal value for the
  sub_filter replacement and the redirect target.
- Dropped `$uri/` from try_files. Nothing in the build is a directory with an
  index, so the only thing it ever produced was nginx's trailing-slash
  redirect -- computed after the prefix rewrite, so `/it-tools/figlet-fonts`
  answered `301 /figlet-fonts/` and bounced the browser out of the app.
- The sub_filter comment claimed index.html was the only response losing
  ETag/Last-Modified; public/visualsubnetcalc/calc.html is HTML too and is
  equally affected. Comment corrected.
- README: in the prefix-stripping proxy setup, `/it-tools` without the
  trailing slash never reaches the container, so the proxy has to redirect it
  (as the sample does). Said so.
- The new e2e test reloaded a page that had just started pulling in a tool's
  chunks; WebKit cancelled the load ~1 run in 3 (the app reloads itself on an
  aborted chunk fetch). It opens the URL in a second tab instead: 8/8 on
  WebKit, 3/3 browsers green.

* fix(build): validate BASE_URL before it reaches the <base href>

From Copilot's review of #10.

The container validates its runtime BASE_URL, but the build-time one went
straight into an HTML attribute unchecked: a value carrying a quote rewrote
the tag around it, and one carrying a space or `..` quietly produced a page
that loads from the wrong place. Apply the same rule the entrypoint does --
a plain path of unreserved characters -- and fail the build otherwise.

Also: "can not" -> "cannot" in the read-only filesystem warning.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-19 22:16:54 +02:00