Commit Graph
232 Commits
Author SHA1 Message Date
salman 2e01232afd Exclude the archive lock marker from the downloaded results archive 2026-09-26 16:38:35 +02:00
salman 5a8bd70957 Harden singleTrimSP.cgi: traversal fix, watchdog, pruner, archive lock, caps
- P0 path-traversal fix: run-name class is dot-free with \z anchors, so
  '.', '..', and %0A-trailing values can never escape TRIMSP_TMPROOT. The
  deployed path allowlist is derived from the configured root instead of the
  old hardcoded /tmp prefix.
- Replacing external  with an alarm() watchdog that kills the
  engine's whole process group (setpgrp + kill KILL -pid), matching
  muSRFlow; describe_result maps -2/-1/signal to 124/127/128+sig.
- prune_stale_jobs() ages out dirs (TrimSP.cfg marker only), orphaned .tgz,
  and leaked per-request logs; safe in shared /tmp (symlinks skipped,
  remove_tree safe mode, never touches non-trimsp dirs).
- Archive is serialized per run with flock (.trimsp-lock); per-point engine
  runs stay concurrent.
- Symlink/non-dir run dirs refused; mode 0700 so results are not
  world-readable. read/download also reject symlinked targets.
- Request caps: MAX_REQUEST_LINES 20000, MAX_REQUEST_BYTES 4 MiB -> 413.
- action=health deployment self-check; env overrides TRIMSP_BIN, TMPROOT,
  CMD_TIMEOUT, JOB_MAXAGE (sed anchor for the binary path kept intact).
- Wire contract preserved: ok/phase/message/exitCode/archiveUrl/log JSON,
  text read, gzip download, real HTTP statuses. No TrimSPweb.js change.
- New tests/cgi-tests.sh drives the real CGI offline (18 cases: traversal,
  %0A, escaping round-trip, success/fail/hang engine, 124 watchdog, archive+-
  download, pruner, symlink refusal, 413). deploy-web.sh now verifies the
  sed substitution embedded the selected engine path.
2026-09-26 16:32:38 +02:00
salman 9d88fa5d65 Harden the scan pipeline: input validation, RNG freeze, and re-entrancy guard
- Expand From/Step/To scans count-based so descending (negative-step)
  scans work, reject zero/unreachable ranges, and cap points at 5000
- Give parse_formula an unbalanced-bracket guard instead of an infinite
  loop and use direct recursion
- Return {ok:false,error} from CreateInpFile and validate projectile,
  layer composition, density, and thickness instead of the erroneous
  ErrMsg/$ErrMsg path
- Freeze the RNG backend after prep_cfg refreshes All and pass it through
  writeAsciiFileAsync so scans never mix generators mid-flight
- Wrap startSequence with a run-in-progress guard, disable the Run button,
  and snapshot runWorkPath for all output writes
- Unify web/Electron readAsciiFileAsync to throw instead of returning 0
- Make checkDir synchronous (mkdirSync) and honor its return value
- Fix setValues/template substitution parsing and write web input files
  byte-identical to Electron
- Track deferred seed-validation and input-cap work in ToDo.txt
2026-09-26 16:08:44 +02:00
salman 0ad68e1e57 Exclude build-id links from rpm to avoid electron conflicts
Two Electron applications built from the identical electron binary set
package the same ELF build-id links under /usr/lib/.build-id, so
installing trimsp next to musrflow failed the transaction test. Define
_build_id_links none in the rpm spec so the package no longer claims
those paths, regardless of the el9 build host.
2026-09-24 14:46:48 +02:00
salman 737666cea7 Make cgi non-blocking and borrow more ideas from muSRFlow 2026-09-18 23:06:01 +02:00
salman 0f7ca5d7a7 Merge branch 'feature/ui-modernization' into master 2026-09-06 21:37:50 +02:00
salman 46dc388a56 Add Workbench citation, gitea link, and Quick Start contact 2026-09-06 21:37:27 +02:00
salman 64736e7520 Correct web application URL casing 2026-08-28 16:14:15 +02:00
salman 6a33f04a67 Fix shared link URL and notification placement 2026-08-28 16:13:56 +02:00
salman 3b34ce3175 Hide web-only status actions in Electron 2026-08-28 16:05:58 +02:00
salman 4236f9450a Release Workbench 1.5.0 with sharing help 2026-08-28 15:04:02 +02:00
salman 8792ed3541 Upgrade Electron and Forge tooling 2026-08-28 14:41:32 +02:00
salman 74cf36eeac Modernize application icon 2026-08-27 22:00:45 +02:00
salman 8061f389fe Improve web results and diagnostics 2026-08-27 21:42:31 +02:00
salman 1f6ecc7982 Modernize scan workflow and web deployment 2026-08-27 19:24:27 +02:00
salman 65aeddd0ef Modernize application layout 2026-08-27 17:25:33 +02:00
salman 19b9eacf53 Fixed small final bug. v1.4.0 2026-08-27 15:22:15 +02:00
salman aa82948bbd Updated software links and version. 2026-08-27 15:09:24 +02:00
salman 8700fd3a85 Add README for tests 2026-08-27 15:07:36 +02:00
salman 5ccfe34f31 Added changelog 2026-08-27 15:06:01 +02:00
salman 66fc296eca Add citation file 2026-08-27 15:04:29 +02:00
salman cae1271788 Update names following the modernized version and associated paper. 2026-08-14 16:03:27 +02:00
salman dffbd1f6ea Adapt the web backend for the rng selection. 2026-06-25 23:53:10 +02:00
salman e54a8e4f6d Bump up version with rng features. Include citation instructions. 2026-06-25 09:50:42 +02:00
salman d4cdb1dd65 Expose RNG selcetion from GUI 2026-06-25 09:42:41 +02:00
salman a19dd6b96b Tests from pcg32, twice as fast and almost the same as the original ranlux. 2026-06-19 18:20:56 +02:00
Zaher Salman c721259556 Forgottent seeded pcg32 2026-06-19 17:14:53 +02:00
Zaher Salman a44db47586 Add pcg32 and xoshiro as optional number generators to get 2X speedup. 2026-06-19 17:03:40 +02:00
salman b713740f02 Merged master into fortran-cleanup 2026-06-18 13:13:20 +00:00
salman e292afff59 Add comments to subroutines. 2026-06-18 15:12:34 +02:00
salman 965cc556e2 Keep a copy of version 1.3.2 2026-06-18 15:10:46 +02:00
salman 1f3fd44f98 style-cleaned the extracted input reader. 2026-06-18 15:07:16 +02:00
salman d075ce5cee Modernise style 2026-06-18 14:58:25 +02:00
salman c201d83604 Extract the final transmission matrix / energy-angular correlation section 2026-06-18 14:08:16 +02:00
salman e90cab41d5 Extract the backscattering matrix / energy-angular correlation block. 2026-06-18 13:29:17 +02:00
salman 8eb8d07a46 Extract the forward/transmission sputtering matrix / energy-angle correlation block. 2026-06-18 13:04:23 +02:00
salman d76d40ea4c Extract the backward sputtering matrix / energy-angle correlation block. 2026-06-18 11:54:52 +02:00
salman 97dc213bbf Extract the matrix table axis setup block 2026-06-18 11:51:19 +02:00
salman 82e656e1cd Extract the transmission sputtering angular-distribution block 2026-06-18 11:39:52 +02:00
salman aa56bad442 Extract the transmission sputtering yields and energies block 2026-06-18 11:35:49 +02:00
salman 9369266988 Extract the backward sputtering angular-distribution block 2026-06-18 11:30:55 +02:00
salman 1ded610f99 Extract the backward sputtering yields and energies 2026-06-18 11:23:27 +02:00
salman 8a6ead44a4 Extract the transmission report block 2026-06-18 11:13:59 +02:00
salman ad42541140 Extract the backscattering report block 2026-06-18 11:04:58 +02:00
salman aaeb7f969a Extract the implanted depth/profile table writer 2026-06-18 10:55:37 +02:00
salman 3f6a5640b6 Extract the next .out block into a new output subroutine. 2026-06-18 10:47:13 +02:00
salman cc1c2ca56c Extract the next .out block into a new output subroutine. 2026-06-18 10:38:45 +02:00
salman 4bc2697695 Extract the next .out output block into a new subroutine. 2026-06-18 10:29:31 +02:00
salman 6f5be23e67 Move GUI .seq summary output into a new subroutine 2026-06-18 10:24:06 +02:00
salman ad23a2bc30 Move input reading into a subroutine 2026-06-18 10:12:07 +02:00