SebastianandClaude Opus 5 ec740dd063 ci: rework the test and lint toolchain — per-browser E2E, scoped jsdom, type-aware oxlint (#561)
* ci(e2e): one job per browser with three workers

Replace the 3-way shard matrix with a per-browser matrix. Each job now
runs one Playwright project with three workers instead of three jobs each
running a mixed slice of all browsers at one worker.

The old layout gave each of three runners a single worker, so each job
used one of its four cores; a browser failure also showed up as
"shard 2/3" with no indication of which engine broke.

- `workers: 1` -> `3` on CI. Measured on a 4-core box: 9.4 min at one
  worker vs 5.1 min at three, with the box ~95% busy. A fourth worker
  added nothing and left no core for the preview server.
- `fail-fast: false` so one engine failing still reports the other two.
- Install and cache only the browser a job actually needs, instead of all
  three in every job.
- Fix the cache key, which read `.dependencies.playwright` and always
  resolved to `null`; the package is `devDependencies["@playwright/test"]`,
  so the key never changed when Playwright was upgraded.
- `set_node_mem.sh` grows a `NODE_MAX_OLD_SPACE_MB` override, used to cap
  each worker at 4GB. Playwright workers inherit `NODE_OPTIONS`, so
  otherwise every worker claims a machine-sized heap ceiling.

The script is now POSIX. It is sourced from package.json scripts, which
run under dash, where `[[` does not exist -- every run was logging
"[[: not found" and silently falling through to the Linux branch, so the
macOS detection never worked when invoked that way.

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

* refactor(set_node_mem): capture memory sizes before the arithmetic

Addresses review feedback on the sourced heap-sizing script. Reads
closer to the original, which also assigned the raw value first.

Behaviour is unchanged: dash still produces --max-old-space-size=15051
by default and honours NODE_MAX_OLD_SPACE_MB.

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

* fix(e2e): give CI more timeout headroom now that workers share a runner

The webkit job failed on `markdown-diff`, which mounts a Monaco diff
editor -- the heaviest tool in the suite -- on the slowest engine:

  1 failed   [webkit] markdown-diff Has correct title
  1 flaky    [webkit] markdown-diff Diff editor is visible with two panes
  107 passed (9.3m)

Both are first-paint timing, not behaviour. The 15s expect timeout was
sized for one worker per runner; with three sharing four cores, first
paint of a lazy-loaded tool takes longer, and the failure survived two
retries.

Raise the CI budget to 30s for assertions. The test timeout has to move
with it -- it defaults to 30s, so a 30s expect timeout would trip the
test timeout first and report a timeout instead of the failing
assertion. Local runs keep the previous 15s/30s.

Timeouts are upper bounds, so passing tests are unaffected.

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

* fix(e2e): drop the inline timeout that caps markdown-diff below the CI budget

Raising the CI expect timeout to 30s fixed one of the two webkit
failures in markdown-diff but not the other:

  before: 1 failed + 1 flaky, 107 passed
  after:  1 failed,           108 passed

The surviving failure asserts the title with an inline
`{ timeout: 15000 }`, which overrides the global expect timeout, so it
kept the old budget while its neighbour picked up the new one.

The inline value only restated what the global used to be, so removing
it is a no-op locally (still 15s) and lets CI use its 30s budget.

The four inline overrides in mermaid-exporter are left alone: those
raise the timeout to 30s rather than capping it.

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

* perf(test): scope jsdom to the suites that need it

`test:unit` ran `vitest --environment jsdom`, which builds a jsdom for
every test file. Only 7 of 128 need one -- the other 121 are pure
functions and pass unchanged under the node environment.

Measured on a 4-core box, `pnpm test`, warm cache:

  before  89s wall, environment 128.79s, tests 4.70s
  after   ~56s wall, environment   7.37s, tests 5.30s

Environment setup was the single largest cost in the run and is now
~7s. The tests themselves were always ~5s.

Default to the node environment and let the 7 DOM-dependent suites opt
in with a `// @vitest-environment jsdom` docblock:

  src/ui/c-input-text                      (@vue/test-utils mount)
  src/ui/n-input-number-i18n               (@vue/test-utils mount)
  src/tools/certificate-key-parser         (webcrypto-liner-shim)
  src/tools/extract-text-from-html
  src/tools/markdown-preview
  src/tools/file-splitter
  src/tools/django-secret-generator

Same 128 files and 1035 tests pass before and after.

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

* test: drop jsdom from three more suites and fix two assertions

Down from 7 jsdom suites to 4. The three removed did not need a DOM;
they needed it by accident.

certificate-key-parser
  The service and its infos module each did a side-effect
  `import 'webcrypto-liner-shim'`. That shim polyfills WebCrypto for
  browsers without a secure context (see README: WebCrypto needs HTTPS),
  and it touches browser globals at import time, so pulling it into a
  node process fails before any test runs.

  Node has WebCrypto natively, so the polyfill only belongs on the
  browser path. Move the import to certificate-key-parser.vue, which is
  what pgp-keygen.vue and pgp-encryption.vue already do. It now also
  evaluates before sshpk rather than after it, and no longer loads
  eagerly through the tool's infos module.

  That let the test drop its jsdom workaround too: it was replacing
  global.TextEncoder/TextDecoder with the text-encoding-utf-8 polyfill,
  which node does not need. The `no-restricted-globals` disable existed
  only for those writes and is gone with them.

  Side effect: the run no longer emits the shim's asm.js linking
  warning, which was the only warning left in the unit suite.

extract-text-from-html
  `validateHtml` parsed the input with DOMParser, discarded the
  document, and validated with a regex instead. `parseFromString` with
  'text/html' recovers from bad markup rather than throwing, so the
  catch was unreachable and the whole block was dead -- and the only
  reason the file needed a DOM.

django-secret-generator
  Used `window.crypto`; `globalThis.crypto` is the same API in browsers
  and in node.

Two assertions did not test what they claimed:

  expect(getTextFromHtml('<p>..</p>')).toString();

`.toString()` on the assertion object asserts nothing -- this passed
even if the function returned null. Now checks the type.

  expect(getSecretKey()).toMatch(/[a-z0-9!@#$%^&*(-_=+)]{50,60}/);

`toMatch` searches rather than anchors, so any key of 50 chars or more
passed regardless of length. Split into an explicit length range and an
anchored charset check. The old class was also wrong: `(-_` reads as the
range `(` to `_`, which accepts digits and uppercase.

Also moved a valid-html case that sat in the invalid block, and fixed
the `invlid` / `django-secret-generato` typos.

128 files pass, 1035 tests -> 1036 (the django assertion is now two).

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

* chore(deps): drop the now-unused text-encoding-utf-8

The certificate-key-parser test was the only consumer: it replaced
global.TextEncoder/TextDecoder with this polyfill so the suite could run
under jsdom. That workaround went away when the suite moved to the node
environment, which provides both natively.

pnpm also prunes an orphaned transitive crypto-js@4.2.0, whose own
metadata marks it as no longer maintained. The lockfile change is 22
deletions and no additions.

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

* ci: enable oxlint type-aware linting, drop typecheck from build and CI

Adds oxlint-tsgolint and turns on `options.typeAware`, which brings 59
type-aware rules from typescript-eslint into `pnpm lint`. It found 59
issues; `--fix` resolved 3 (useless `= undefined` defaults).

The remaining 56 are semantic -- floating promises, base-to-string,
misused string spread -- spread over ~20 files, so they are staged as
`warn` rather than fixed blind in a CI change. Lint exits 0 and the
findings are visible in the output, ready to burn down by rule.

TypeScript stays on 6.0.3. The docs ask for TypeScript 7+, but that is
about tsgolint's own toolchain, not the project's: oxlint-tsgolint ships
a self-contained binary with no npm dependencies, and produces the same
56 findings against TypeScript 6.

Upgrading the project to TypeScript 7.0.2 was tried and reverted -- it
breaks the build:

  [@vue/compiler-sfc] No fs option provided to `compileScript` in
  non-Node environment. File system access is required for resolving
  imported types.

Isolated by rebuilding with the same scripts on 6.0.3, which passes. TS
7's native port also drops the `./lib/tsc` subpath export, so vue-tsc
cannot start at all -- neither 3.3.6 nor the current 3.3.10.

Script and workflow cleanup:

- `build` no longer runs `vue-tsc --noEmit` first; it just builds.
- The `ci` workflow drops its Type check step. It already runs `pnpm
  lint`, which now carries the type-aware rules. No other workflow had
  a typecheck step.
- `precommit` and the PR template drop `pnpm typecheck` for the same
  reason.

The `typecheck` script itself is kept, and so is vue-tsc. tsgolint
analyses no .vue files at all -- 0 of the 59 findings came from one --
so vue-tsc remains the only thing that type-checks single-file
components, and deleting it would drop that coverage with nothing
replacing it. It is simply no longer wired into the build or CI.

Renovate's TypeScript toolchain group gains oxlint-tsgolint, whose
version tracks TypeScript releases.

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

* refactor(oxlint): move config to oxlint.config.ts

Replaces .oxlintrc.json with a typed config built from oxlint's own
`defineConfig`, so rule names and options are checked by the editor
instead of being free-form JSON strings, and the staged type-aware rules
can carry an explanation next to them.

Verified as a faithful translation by diffing `oxlint --print-config`
between the two: identical resolved rule set (167 rules), no rule added,
dropped or re-levelled, and `options.typeAware` equal. Same 56 warnings
and 0 errors either way.

TypeScript configs are auto-discovered but marked experimental upstream
and require running under Node, which `pnpm lint` already does.

Also records why vue-tsc stays, since oxlint's vue plugin invites the
opposite conclusion: those 46 vue rules are style and correctness lint
rules, not a type checker. Planting

  const deliberateTypeError: number = getSecretKey();

in a .vue script block is reported by neither `--type-aware` nor
`--type-check` -- oxlint exits 0 -- while vue-tsc catches it as TS2322.
tsgolint only analyses .ts files.

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

* ci: restore typecheck and run lint + typecheck on every build path

oxc-project/oxc#15761 ("oxlint: better vue support") is the tracking
issue for Vue in oxlint. It is open, unimplemented, and scoped to
parsing template bindings so structural lint rules can work -- not to
type checking. Even once it ships it would not cover what vue-tsc does,
and the maintainer notes eslint-plugin-vue cannot be fully replicated
because Vue templates carry no JavaScript bindings for the linter.

So vue-tsc stays and goes back into CI. Confirmed the gap is real by
planting `const x: number = getSecretKey()` in a .vue script block:
oxlint exits 0 under both --type-aware and --type-check, vue-tsc reports
TS2322.

Every job that runs `pnpm build` directly now runs lint and typecheck
first:

  sharevb-ci                        + typecheck
  sharevb-docker-nightly-release    + typecheck
  sharevb-docker-realease-latest    + typecheck
  sharevb-docker-realease-baseurl   + typecheck
  sharevb-github-pages-publish      + lint, typecheck  (had none)
  sharevb-releases                  + lint, typecheck  (had none)

The two publish workflows were building and shipping without any check
at all. Left alone: the nightly github-release job, already gated by
`needs: ci` on the same commit, and the e2e workflow, whose three
browser jobs build on the same commit that the ci workflow is already
checking in parallel.

`precommit` and the PR template get typecheck back for the same reason.

oxfmt config moves to oxfmt.config.ts alongside oxlint's, using oxfmt's
own defineConfig. Same 832 files are flagged before and after, so the
translation is faithful.

Format checking is deliberately NOT wired into CI yet: `pnpm fmt:check`
currently fails on 832 of 1613 files (410 .vue, 359 .ts, 50 .md, 12
other). The scripts exist but have never been enforced, so the tree has
drifted. Enabling the gate needs a repo-wide reformat, which belongs in
its own commit rather than buried here.

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

* ci: report formatting drift without enforcing it

Adds `pnpm fmt:check` to the ci workflow with continue-on-error, so the
832 files that predate oxfmt being run in CI are visible on every PR
without blocking anything. Drop continue-on-error once a repo-wide
reformat lands.

Only the ci workflow gets it. It is the one that runs on pull_request,
so it is where a non-blocking signal is actually read; adding it to the
docker and release workflows would just add noise to logs nobody opens.

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

* refactor(test): pin the timezone in config instead of every script

`TZ=UTC` was repeated across four scripts, including once redundantly
(`test` set it and then called `test:unit`, which set it again).

It is genuinely load-bearing for the unit suite. Running vitest on
America/New_York fails 7 tests across 5 files -- date-time-converter,
days-calculator, crontab-generator and friends assert on formatted dates
and offsets. Moved to `test.env` in vite.config.ts, which is enough on
its own: the full suite passes with the host on America/New_York and on
Asia/Tokyo with no inline prefix.

That also fixes `pnpm coverage`, which never had the prefix and so would
fail those same 7 tests on any machine not set to UTC.

For e2e it was doing nothing. The browser timezone is already pinned by
`timezoneId: 'Europe/Paris'`, and the specs do no date maths on the node
side -- the one `Date.now` override runs inside `addInitScript`, so it
is browser-side. The timezone-sensitive specs pass on Asia/Tokyo without
it. Pinned in playwright.config.ts anyway so the runner stays
deterministic if a spec ever does compute a date in node.

Also switches `test` from `npm run` to `pnpm run`, since everything else
in the repo uses pnpm.

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

* chore: drop the `test` alias in favour of `test:unit`

`test` was a pass-through to `test:unit` and nothing else, so it only
added a level of indirection and a second name for the same thing --
confusing next to `test:e2e`, which is a different suite.

Repointed all five callers: the ci, nightly-release and two docker
release workflows, plus the README's "Run Unit Tests" snippet.

Note `pnpm test` no longer resolves, since npm's implicit test
lifecycle has nothing to fall back on now.

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

* refactor(e2e): fold test:e2e:dev into test:e2e

The two scripts were not two environments, they were two answers to
"who owns the web server":

  test:e2e      Playwright starts `pnpm preview` on :5050 and tests the
                production build
  test:e2e:dev  assumes `pnpm dev` is already up on :5173 and starts
                nothing

That is one variable, not a second workflow, so it does not need a
second script. The config now derives it: if E2E_BASE_URL points
somewhere other than the preview URL, you are supplying the server and
Playwright leaves the lifecycle alone. NO_WEB_SERVER is gone -- it only
ever restated what a custom base URL already implies.

Renamed BASE_URL to E2E_BASE_URL along the way. vite.config.ts reads
BASE_URL as the app's base path (`/it-tools/`, set by the Pages and
Docker builds), so one exported value meant two incompatible things and
would have pointed Playwright at a path instead of a URL.

Both paths verified:
  pnpm test:e2e                                  5/5, preview started
  E2E_BASE_URL=http://localhost:5173 pnpm ...    5/5, dev server reused

Documented both in the README, which had no e2e section at all -- the
script was the only place the dev flow was written down. Also notes that
a cold dev server compiles on demand and can blow the assertion timeouts
on a first run; that cost 2 failures until the routes were warmed.

Also fixes webServer.command, which shelled out to `npm run preview`.

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

* chore: delete set_node_mem.sh

The script raised the V8 heap to total RAM minus 1GB and was sourced by
build, test:unit and test:e2e. Nothing needs it any more.

The build does not come close to the heap. It completes on Node's
default (2096MB here) and still completes when capped at 512MB -- a
thirtieth of what the script was handing out:

  cap 15051MB (script)   92s, 93s
  default 2096MB         94s, 103s
  cap 1024MB             91s
  cap  512MB             95s

Unit tests are the same story: 35s and 37s with, 36s and 37s without.
No measurable difference anywhere, so the script was not buying speed
either.

The reason is that the build is not a JavaScript-heap workload. It peaks
around 6.5GB of system memory while running fine under a 512MB heap cap,
because rolldown does the work in Rust, outside V8. The README's "you
need around 16GB" dates from the old JS bundler; corrected to ~8GB with
the measured figure.

Removing it also retires two things it dragged along: the
NODE_MAX_OLD_SPACE_MB override added for Playwright, which existed only
because every worker inherited a machine-sized ceiling from this script,
and a POSIX bug where `[[` failed under dash on every single run.

Verified with NODE_OPTIONS unset, so at the 2096MB default CI will see:
build 87s, 129 files / 1072 unit tests, e2e 5/5.

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

* fix(e2e): key the browser cache on the installed Playwright version

The key read the range from package.json, so it was `^1.62.0` rather
than `1.62.0`. Those agree today, but the range also matches 1.62.3 and
1.63.0: a lockfile bump inside the same range leaves the key unchanged,
so the run restores browsers for the old version and the cache is never
refreshed, because that key already exists.

Read node_modules/@playwright/test/package.json instead. pnpm/setup has
already installed dependencies by this step, so the resolved version is
available.

Raised by Copilot on the upstream PR.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-18 21:55:58 +02:00
2022-04-16 13:41:10 +02:00
2023-03-01 23:35:17 +01:00
2026-01-17 13:03:06 +01:00
2026-01-17 13:03:06 +01:00
2022-07-21 21:06:22 +02:00
2022-03-31 00:33:29 +02:00

BREAKING CHANGE for Container Image

Since the base image is now nginx-unpriviledged the container will now listen to port 8080 and not 80. So you need to update your port mapping, i.e. from 8080:80 to 8080:8080.

You can override listening port using environment variable PORT (docker option -e PORT=8888).

If the container needs to listen to IPv6, it needs to be enabled: https://serverfault.com/questions/1147296/how-to-enable-ipv6-on-ubuntu-20-04. Alternatively, you can mount your own nginx.conf own using docker option -v "./nginx.conf:/etc/nginx/templates/default.conf.template" (with listen [::]:8080; removed)

Build requirements

To build this project, around 8GB of RAM is enough. Measured on a 4-core machine, pnpm build peaks at roughly 6.5GB of system memory and completes on Node's default heap — most of the work happens inside rolldown, in Rust, rather than on the JavaScript heap.

PR Welcome

Especially for UI improvements and translation. And for anything else.

Want to support this fork of IT Tools: Buy me a coffee

Some tools like PGP encryption rely on WebCrypto API that is only available in HTTPS/SSL. Also, if you want to use PWA, HTTPS is required.

So even on internal installations, you should enable HTTPS using Let's Encrypt using DNS Challenge

Some docs about DNS Challenge:

Related doc for CyberPanel: https://community.cyberpanel.net/t/reverse-proxy-traffic-to-docker-container-on-cyberpanel/30644

Check out these change here: https://sharevb-it-tools.vercel.app/ or https://sharevb.github.io/it-tools/

You can use my image in your docker-compose/quadlet file if you want an up-to-date version of it-tools (with my PR and some of others) until the main branch has been updated.

(Thanks to gitmotion for this model of README fork)

Contributors

Big thanks to all the people who have already contributed!

contributors

Development under Windows

Use of WSL2 is recommended to develop using VSCode on Windows. Direct development is tricky (because of some dependencies)

Added features

Container images

GitHub Container Registry: ghcr.io/sharevb/it-tools:latest

Docker Hub: sharevb/it-tools:latest

docker run --pull always --restart unless-stopped -p 8080:8080 sharevb/it-tools:latest

Other existing docker tags: latest-en (english only)

Use in Docker Compose file

services:
  it-tools:
    container_name: it-tools
    image: sharevb/it-tools:latest
    pull_policy: always
    restart: unless-stopped
    ports:
      - 8080:8080

Use in Podman Quadlet file

[Unit]
Description=IT Tools container
After=network-online.target

[Container]
AutoUpdate=registry
Image=ghcr.io/sharevb/it-tools:latest
PublishPort=8080:8080
Label=io.containers.autoupdate=registry

[Install]
WantedBy=multi-user.target default.target

[Service]
Restart=always

Use with companion Self Hosted docker services

Some tools requires additional docker services: HTTPS/DNS tools/Ping, HTML to PDF, Docker Image Download, Multi Links Download, Short Url Expander and TCP/UDP Port tester.

See complete example here: docker-with-services

Filter tools and add home custom content

You can add custom content in Home page by mounting a home.custom.md in /usr/share/nginx/html.

You can filter available tools by mounting tools-filter.json in /usr/share/nginx/html. It can contains the following filtering regex:

{
  "excludeCategoryFilterRegex": "",
  "includeCategoryFilterRegex": "",
  "excludeToolsFilterRegex": "",
  "includeToolsFilterRegex": ""
}

Category matches on category (English) names ; Tools matches on tools path/url.

See docker-tools-filter-and-home-content

Add custom external tools

You can add custom external tools (href or markdownContent) by mounting a external-tools.json in /usr/share/nginx/html with the following structure:

[
  {
    "name": "GitHub",
    "path": "/github",
    "description": "Link to Github",
    "keywords": ["github"],
    "category": "Links",
    "href": "https://github.com"
  },
  {
    "name": "Some text",
    "path": "/some-text",
    "description": "Some description",
    "keywords": ["some"],
    "category": "Links",
    "markdownContent": "Some useful **text**\n\nin *markdown*"
  }
]

See docker-tools-filter-and-home-content

Setting default tools parameters / default UI language at runtime

For a complete sample, see docker-with-services.

You can set default tool parameters by mounting a tools-settings.json in /usr/share/nginx/html.

It is a two level json, with the first level being for tool name and the second level for parameter name:

{
  "regex-tester": {
    "multi": true,
    "regex": "some regex",
    "global": false
  }
}

You can find tool name and parameter name in the tools source code src/tools subfolder :

  • example pattern for const global = useQueryParamOrStorage({ storageName: 'regex-tester:g', name: 'global', defaultValue: true });:
{
  "regex-tester": {
    "global": false
  }
}
  • example pattern for const value = useQueryParam({ tool: 'barcode-gen', name: 'text', defaultValue: '123456789' });:
{
  "barcode-gen": {
    "text": "4356"
  }
}
  • example pattern for const width = useITStorage('ascii-text-drawer:width', 80);:
{
  "ascii-text-drawer": {
    "width": 80
  }
}

To define the default UI language, add a default_locale key to json:

{
  "default_locale": "fr"
}

To build using a custom default language:

docker build -t it-tools-fr --build-arg VITE_LANGUAGE=fr .
docker run -d --name it-tools-fr --restart unless-stopped -p 8080:8080 it-tools-fr

Build container image for a custom subfolder

According to https://github.com/sharevb/it-tools/pull/461#issuecomment-1602506049 and https://github.com/CorentinTh/it-tools/pull/461:

docker build -t it-tools  --build-arg BASE_URL="/my-folder/" .
docker run -d --name it-tools --restart unless-stopped -p 8080:8080 it-tools

Then if you go to http://localhost:8080 you'll get a blank page, but opening the DevTools (& refreshing) you'll notice in the Network tab that the app is trying to fetch assets from /my-folder/...

So you would need to put another server in front of it, like Nginx Proxy Manager, Traefik, caddy etc. Then setup a reverse proxy pass using /my-folder

Docker compose for hosting in a /it-tools/ subfolder

For /it-tools/ subfolder, you can use baseurl-it-tools tag.

See sample of docker-compose.yml and nginx.conf, this docker image needs to have another reverse proxy in front of it, like Nginx Proxy Manager, Traefik, caddy etc.

Setup a reverse proxy pass using /it-tools/. And you should be able to access it-tools in /it-tools/ of your server.

An example of nginx reverse proxy configuration is available at: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample

To run the sample:

git clone https://github.com/sharevb/it-tools
cd it-tools/docker-subfolder-sample/
docker compose up

Then navigate to http://localhost:8080/it-tools/

To build using a custom folder:

  1. BASE_URL="/it-tools/" pnpm build
  2. Rename the generated dist folder to it-tools and serve on https://your-domain.com/it-tools

To build for GitHub Pages:

  1. Enable GitHub Pages build and deployment option in your fork, under Settings > Pages and select GitHub Actions as the source
  2. Add the following GitHub action to your repo: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/.github/workflows/sharevb-github-pages-publish.yml

To add authentication

Assuming you're already hosting it-tools behind a reverse proxy, you can configure forward-auth and enforce authentication from the reverse proxy

(thanks @jogerj)

Deploy as LXC container

In Proxmox VE, you can use docker image directly:

sudo lxc-create -n sharevb-it-tools -t oci -- --url docker://ghcr.io/sharevb/it-tools:latest

Contribute

To install VSCode in WSL2 (Windows), see: https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-vscode

VSCode with the following extensions:

with the following settings:

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "oxc.oxc-vscode",
  "editor.codeActionsOnSave": {
    "source.fixAll.oxc": "always"
  },
  "i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
  "i18n-ally.keystyle": "nested"
}

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Project Setup

pnpm install --ignore-scripts

Compile and Hot-Reload for Development

pnpm dev

Type-Check, Compile and Minify for Production

pnpm build

Run Unit Tests with Vitest

pnpm test:unit

Run End-to-End Tests with Playwright

Playwright starts pnpm preview itself, so build first:

pnpm build
pnpm test:e2e

To iterate against the dev server instead, leave pnpm dev running and point the tests at it. Playwright then leaves the server alone:

E2E_BASE_URL=http://localhost:5173 pnpm test:e2e

The dev server compiles routes on demand, so a first run against a cold one can blow past the assertion timeouts. Open the pages once, or just run it again.

Lint with Oxlint

pnpm lint

Format with Oxfmt

pnpm fmt

Ensure CI (lock, oxlint, typecheck) will succeed

Before submitting a PR, run:

pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck

Create a new tool

To create a new tool, there is a script that generate the boilerplate of the new tool, simply run:

pnpm run script:create:tool my-tool-name

It will create a directory in src/tools with the correct files. You will need to fill src/tools/_my-tool-name_/index.ts with tool name, category, description... and then develop the tool.

Installation methods

Local installation required installing first: python3 make g++

Container Image Local Installation
GitHub Container Registry: ghcr.io/sharevb/it-tools:latest
Docker Hub: sharevb/it-tools:latest
sudo apt-get install python3 make g++ && git clone -b chore/all-my-stuffs https://github.com/sharevb/it-tools.git && cd it-tools/ && pnpm i --ignore-scripts && pnpm dev
replace your current image with this image copy & paste oneliner (from github repo)
You may need to clear cache and hard reload to get new features loading Installing packages for the first time may take some time; please wait until it finishes
logo

License

This project is under the GNU GPLv3.

S
Description
No description provided
Readme GPL-3.0
54 MiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 42.6%
Vue 32.7%
TypeScript 23.7%
HTML 0.8%
CSS 0.1%