449 Commits
Author SHA1 Message Date
Lauri Ojansivu 5779499ef2 Fix npm 12 production bundle installs and audit generated build files 2026-09-23 10:35:01 +03:00
Lauri Ojansivu 7f781be34e Gate release builds on source and artifact telemetry checks
Preserve local instrumentation and security logging, opt out of Meteor package statistics, and audit release bundles and repackaged binaries before publication.

Thanks to xet7.
2026-09-23 10:20:04 +03:00
Lauri Ojansivu 19f740f509 Stabilize WeKan regression checks and macOS release jobs 2026-09-22 19:31:34 +03:00
Lauri Ojansivu b9ae16a443 Package separate macOS apps for Apple Silicon and Intel 2026-09-22 10:10:12 +03:00
Lauri Ojansivu ced5263a47 Repair macOS test and release workflow regressions 2026-09-22 09:46:48 +03:00
Lauri Ojansivu 9b213cdf48 Update WeKan runtime and build guidance to Node.js 26 2026-09-22 01:01:14 +03:00
copilot-swe-agent[bot]andxet7 47e007b1b1 Fix snap-variants upload path
Co-authored-by: xet7 <15545+xet7@users.noreply.github.com>
2026-09-20 23:10:53 +00:00
copilot-swe-agent[bot]andxet7 62cccae192 Unify snap upload retries for transient store 500 errors
Co-authored-by: xet7 <15545+xet7@users.noreply.github.com>
2026-09-20 20:43:18 +00:00
copilot-swe-agent[bot]andxet7 ef5ccf3fb0 Retry Snap Store HTTP 500 upload failures
Co-authored-by: xet7 <15545+xet7@users.noreply.github.com>
2026-09-20 20:35:40 +00:00
dependabot[bot] 2282789661 Bump docker/build-push-action from 7.3.0 to 7.4.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 7.3.0 to 7.4.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-19 20:33:56 +00:00
Lauri Ojansivu 5ed9fc944a Remove obsolete Summernote integration and editor configuration.
Use the Markdown textarea for every editor. Remove the retired environment and Snap options from server settings, all platform launchers, build scripts and current documentation. Keep released and archived changelog entries intact.

Keep notification HTML escaping independent of editor configuration, preserve attachment metadata and mention behavior, and cover Markdown and emoji round trips in browser tests. Also import the translator used by attachment error handlers.

Thanks to xet7 !
2026-09-19 14:32:29 +03:00
Lauri Ojansivu 29bd491e85 Fix Launchpad recovery, ref indexing and artifact downloads
Recover the project repository used for submission, retry recipe creation while Launchpad indexes main, and reject incomplete snaps before remote cleanup. Run the compatibility wrapper inside Snapcraft's own environment.

Verified all 1173 Node suites sequentially, workflow lint and script syntax. Regression coverage exercises delayed refs, unrelated errors, recovery paths, invalid downloads and launcher argument handling without remote writes.

Thanks to xet7 !
2026-09-18 20:08:50 +03:00
Lauri Ojansivu bc5881ff90 Recover interrupted Snap builds and bound release attachments
The v11.85 logs show ARMHF failing during Launchpad polling after TLS EOF,
PPC64EL and S390X reaching the six-hour job cap while queued, and AMD64
successfully publishing to the Snap Store before its GitHub attachment hung.

Recover existing recipes before considering a new submission, and share one
five-hour waiter budget across attempts on every architecture. Prepare an
isolated complete source snapshot with Git metadata and logs outside the
project hash, and distinguish architectures so matrix recipes stay separate.
Move downloaded artifacts out before retrying recovery.

Bound GitHub snap attachments and verify remote names and sizes. Exercise
these paths with fixture repositories and mocked network commands, covering
TLS failures, absent recipes, denied credentials, queue timeouts, invalid
artifacts and failed uploads. Workflow parsing, shell syntax and Actionlint
pass. The full 1,172 Node suite sweep is verified with corrected guards rerun.
Live remote builds and publishing have not been run.

Thanks to xet7 !
2026-09-18 07:36:20 +03:00
Lauri Ojansivu e6685eb0b4 Keep Docker publication available during Quay read-only outages 2026-09-15 10:12:39 +03:00
Lauri Ojansivu ccfceb7b77 Exclude binary provenance tables from release notes
Generate initial and refreshed release notes solely from the changelog. Retain checksum verification and build provenance artifacts separately. Update build entry points, release instructions and regression guards.

Thanks to xet7 !
2026-09-14 13:22:19 +03:00
copilot-swe-agent[bot]andxet7 05fbb6847b Fix build-amd64 node-gyp rewrite permission in release workflow
Co-authored-by: xet7 <15545+xet7@users.noreply.github.com>
2026-09-11 19:43:26 +00:00
Lauri Ojansivu 0001d09a8d Fix the Windows release legs: raise the bundle's node-gyp so it can see Visual Studio 2026.
build-win64 and build-win-arm64 both failed the v11.70 release run
(GitHub Actions run 93730167566) in "Rebuild native modules for Windows",
inside `npm install` in bundle/programs/server, while argon2's install
script compiled it:

    gyp info using node-gyp@10.2.0
    gyp ERR! find VS unknown version "undefined" found at
      "C:\Program Files\Microsoft Visual Studio\18\Enterprise"
    gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
    gyp ERR! stack Error: Could not find any Visual Studio installation to use

Why. On 2026-09-07 GitHub's `windows-latest` became the
`windows-2025-vs2026` image (runner image 20260907.229.1), which carries
Visual Studio 18 (2026) and no longer 17 (2022). The node-gyp that compiles
is not one this repository installs: Meteor's bundler writes
programs/server/package.json with `"node-gyp"` pinned to the copy inside
the Meteor tool - 10.2.0 in Meteor 3.5.2 - and that version knows the major
versions 15, 16 and 17 and nothing newer. The shrinkwrap beside it does not
list node-gyp at all, so the pin is the only thing `npm install` consults.
argon2 always compiles on Windows: the amd64 bundle's win32-x64 prebuild is
there, but node-gyp-build's `node-gyp-build-test` probe runs through the
Linux-made `.bin/` shims, which are not `.cmd` files, so the probe fails and
it falls through to `node-gyp rebuild`. With Visual Studio 2022 that worked;
with 2026 and node-gyp 10 it cannot.

What changed. releases/bump-bundle-node-gyp.mjs raises an exact node-gyp pin
below 13.0.2 in a built bundle's programs/server/package.json (12.1.0 added
Visual Studio 2026 support; 13.0.1/13.0.2 fixed its version detection,
nodejs/node-gyp#3338; 13.0.2's engines accept the Node.js 24 the runners
use). It runs ONCE, in build-amd64's "Install server npm modules" step
BEFORE the first `npm install`, because every other architecture - the
Windows legs, arm64, the extra arches - reinstalls programs/server from that
same package.json, so one rewrite travels to all of them. A pin already at
or above the minimum, a range, or a bundle without a pin is left as it is,
so a Meteor release that ships a newer node-gyp keeps its own.
releases/build-release-bundle.sh does the same before its install, so a
local release bundle is what a release ships.

tests/bumpBundleNodeGyp.test.cjs pins the script's decisions (bump, keep,
no pin, dry run, unreadable, read-only), that the minimum is a node-gyp
with the Visual Studio 2026 fix, that release-all.yml runs it in the amd64
install step before `npm install` and nowhere else, and (negative) that no
workflow leg hard-codes node-gyp 10.2.0 or a GYP_MSVS_VERSION workaround.
tests/buildScriptParity.test.cjs lists the script with its bundle-time
siblings.

Not fixable from here, in the same run: the three amd64 snap jobs died in
snapcraft's LXD base-instance creation (`apt-get install -y snapd` timed
out after 600 s; the arm64 twins passed), and snap-launchpad riscv64 was
still building on Launchpad when the job cap cancelled it.

Thanks to xet7 !
2026-09-11 21:17:32 +03:00
Lauri Ojansivu 5adc030bde AppImage: relocate its own mount from /tmp to WRITABLE_PATH/app.
Reported: checkmk warned "/tmp/.mount_wekan.OhaGOG ... 100% used"
because the AppImage runtime's own read-only squashfs mount landed on a
small /tmp (a squashfs mount always reports 100% used regardless of
size, so this was really "/tmp is too small for the AppImage", not a
leak).

The AppImage runtime mounts itself under $TMPDIR/.mount_<name>.<random>
(defaulting to /tmp) before AppRun ever runs, so the very first launch's
mount cannot be redirected from inside AppRun. AppRun now re-execs
itself once per launch with TMPDIR set to WRITABLE_PATH/app when the
caller has not already chosen a TMPDIR, so every launch from then on
mounts there instead - and, on that same first launch, sweeps out any of
WeKan's own orphaned .mount_*ekan* directories left in /tmp by an
earlier, uncleanly-killed run (a live one, matched against /proc/mounts,
is never touched).

AppImage-only: no other WeKan platform (Docker, snap, .deb, the bundle
zip) FUSE-mounts itself the way an AppImage does, so none of them are
touched. tests/appImageRuntime.test.cjs pins the relocation, the
once-per-launch/explicit-TMPDIR guards, and that only orphaned mounts
are removed.
2026-09-09 18:15:10 +03:00
Lauri Ojansivu 0c1b8a4ca4 Remove the Docker Hub/Quay.io registry-overview sync.
DOCKERHUB_AUTH/QUAY_AUTH are scoped for docker login/image push, and neither
registry grants a push-scoped token the rights a repository-description
write needs - v11.62's release-all.yml run already showed this step fails
with 403 even though the image itself publishes fine (the previous commit
turned that into a non-fatal warning rather than fixing the underlying
permission gap). The maintainer now updates both registries' overviews by
hand, so remove the step entirely rather than keep maintaining a permission
workaround for it. tests/dockerRegistryOverviewSync.test.cjs is removed with
it, and its curl -X PATCH/-X PUT exemption in
tests/releaseDownloads.test.cjs is reverted since no such calls remain.

This also resolves GitHub code scanning alerts #523-#525 ("Incomplete URL
substring sanitization"), which flagged the now-deleted test file's URL
substring assertions.

Thanks to xet7.
2026-09-08 23:03:22 +03:00
Lauri Ojansivu 063bb9d4eb Never let a Docker registry overview sync fail a release.
v11.62's release-all.yml run failed the whole "docker" job with 403 from both
Docker Hub and Quay.io on the repository-overview PATCH/PUT calls added
earlier, even though the image itself had already been built, pushed and
verified pullable by the steps before it. DOCKERHUB_AUTH/QUAY_AUTH are scoped
for `docker login`/image push, and neither registry grants a push-scoped
token the broader (account-owner / repo-admin) rights a description write
needs - so the sync step's own `exit 1` failed a job that had, in fact,
already published, which blocked every downstream job gated on
`needs.docker.result == 'success'` (the Helm chart update).

A stale repository description is not worth failing a release over: the sync
step now reports each registry's failure as ::warning:: rather than
::error::, drops the shared `fail` flag, and always exits 0. Each registry
is still attempted independently. Logs (.tools/wekan11) confirm the actual
image push, manifest verification and anonymous-pull checks all succeeded
for v11.62; only this cosmetic step was ever the problem.

Thanks to xet7.
2026-09-08 23:03:22 +03:00
Lauri Ojansivu 395aa2b400 Sync Docker Hub and Quay.io overviews from README.md on release.
Neither registry updates its long-form repository description on its own, so
the overview shown on the repository page had drifted from what README.md
documents. Add a step to release-all.yml's docker job, after the multi-arch
image is built, pushed and verified pullable, that pushes README.md as the
overview: Docker Hub via login-for-JWT then PATCH full_description, Quay.io
via PUT description, reusing the DOCKERHUB_AUTH and QUAY_AUTH secrets already
decoded for docker login. GHCR needs no call since a linked package mirrors
its repository's README automatically. Add
tests/dockerRegistryOverviewSync.test.cjs to pin the endpoints, request
bodies, ordering and that no token is ever echoed.

Thanks to xet7.
2026-09-08 19:20:56 +03:00
Lauri Ojansivu b34b036eb8 Fix the Windows single-EXE smoke test failing with no error message
.tools/wekan10's downloaded run logs showed "second run: WeKan answered
on port 8080 on its first attempt." print successfully, immediately
followed by "Process completed with exit code 1" - no thrown error
anywhere in between.

taskkill.exe (unlike a PowerShell cmdlet) sets $LASTEXITCODE, which
$ErrorActionPreference does not touch - that only governs PowerShell's
own errors, not a plain exe's exit code - and `pwsh -Command` exits with
whatever $LASTEXITCODE last held when the script itself never calls
`exit`. `taskkill /IM ferretdb.exe` (no matching process is a normal,
harmless outcome on the "second" run, once the first run's FerretDB is
already gone) was the LAST external command the whole step ran, so its
nonzero "no such process" exit code alone failed the step.

Reset $LASTEXITCODE after every taskkill call in this workflow whose own
exit code is not being checked - the same latent bug was present in the
"Free ports used by the packaged EXE" step's port-cleanup loop too,
which could fail the same way if the last PID it tried had already
exited between netstat and taskkill.

Thanks to xet7.
2026-09-08 19:03:49 +03:00
Lauri Ojansivu 1eb273bf1c Make workflow failures diagnosable 2026-09-05 23:51:02 +03:00
Lauri Ojansivu f2bb456be1 Verify all version references before releasing
Add a read-only release consistency gate after version.sh and before the workflow commits its bump. Reject stale package, lockfile, Docker, Snap, Stacker, Sandstorm, bundle URL, or Meteor metadata versions with explicit errors and regression coverage.

Thanks to xet7 !
2026-09-05 18:30:29 +03:00
Lauri Ojansivu abdd9750c6 Update Ondra and Gantt repositories during releases 2026-09-05 12:39:57 +03:00
Lauri Ojansivu c048f7ecef Trim the native prebuilds the target can never open
bcrypt and argon2 (Meteor's accounts-password) each ship one
prebuilds/<platform>-<arch>/ directory per platform they support: 21 native
binaries in every WeKan bundle, of which exactly one is ever opened. Their
loader is node-gyp-build, and its resolve() reads a single directory:

  var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)
  var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]

with platform and arch from os.platform() and os.arch(). This is the same
argument bundle-trim.mjs already makes about uWebSockets.js, so it is the same
code path: --trim-prebuilds keeps the directories node-gyp-build would match
and drops the rest. The tuple parsing here IS node-gyp-build's, multi-arch
names ("darwin-x64+arm64") included, and both libc flavours of the target are
kept because glibc versus musl is decided at runtime.

Three things make it safe rather than merely smaller, and all three are pinned
by tests:

  - It is off by default and REFUSES to run without an explicit --platform and
    --arch. The defaults are linux/x64, and a Windows or macOS bundle trimmed
    with those would lose the only addon it can load, which is precisely the
    fault the single EXE was just fixed for.
  - build-amd64 does NOT pass it. Every other bundle WeKan ships is that bundle
    repacked, so trimming there would take the prebuilds away from
    architectures that have not been built yet. Each final per-platform job
    passes its own target instead.
  - Every decision is made before anything is deleted, so a package whose
    prebuilds cannot be reasoned about is left whole rather than half-trimmed.
    Running it on a real bundle found bare-fs, bare-path and bare-url, which
    ship prebuilds/ of .bare files for the Bare runtime - a different loader
    with different rules. Those are left untouched, and say so.

On the mac-arm64 bundle: 19 of the 21 removed, the two for darwin-arm64 kept.
For the single Windows EXE that takes the files it has to unpack from 33 down
to about fifteen.

Two tests were counting a script named in a YAML comment as a script the job
runs, which the new comments in build-amd64 tripped. Both now drop comment
lines before looking, which is what they meant in the first place.

Thanks to xet7 !
2026-09-04 16:41:41 +03:00
Lauri Ojansivu 35cf025f07 Run the Windows single EXE from the archive instead of unpacking it
The EXE unpacked its whole bundle - 39,035 files, 685 MB - beside itself on
first run. It does not any more. It unpacks only what cannot be virtual, and
the server reads the rest out of the EXE in its own process.

What cannot be virtual, and why: node.exe and ferretdb.exe are separate
processes, so Windows needs a real path to start one; .node addons are loaded
with LoadLibrary, same reason; main.js is the entry Node resolves before any
hook could see it; start-wekan.bat is read by cmd.exe; and wekan-vfs.cjs is
read by node --require before anything is mounted. main.js also chdir()s into
programs/server, and a working directory is a kernel concept no hook can
answer, so that one directory is created for real. That is about thirty files
out of 39,035. releases/append-windows-payload.mjs --manifest computes the
list from the archive and writes it as a C header the launcher includes, so a
bundle that gains an addon or a database tool cannot silently lose it.

The mount itself is releases/single-exe/wekan-vfs.cjs. It needs two
mechanisms, because Node needs both:

  - module.registerHooks() for require(). Node's CJS loader resolves through
    internal C++ bindings, so patching fs cannot make require see a virtual
    file, and Module._stat is captured as a module-local inside
    Module._findPath, so replacing it does nothing either. Resolution is
    therefore reimplemented here - and checked against Node's own answer for
    every package in a real bundle: 1407 package directories and 1865 bare
    specifiers, all matching.
  - fs patching for everything that is not a module. Meteor's boot.js reads
    program.json and every server package with fs.readFileSync and runs them
    through vm.runInThisContext, and webapp serves the client files with
    fs.createReadStream.

And one thing below both: Meteor's runtime.js hands reify a resolver that
calls Module._resolveFilename directly. registerHooks sits above that call and
never sees it, so that layer is patched too.

Two traps, both hit while building this. A .node addon must be resolved with
NO format declared: saying "commonjs" for one makes Node compile the binary as
JavaScript and die with "SyntaxError: Invalid or unexpected token" on its own
header - the 11.48 crash reproduced from the other side. And a directory that
exists both really and in the archive has to merge both listings, or
wekan-app/programs/server would list the two unpacked files and hide the
entire server.

Verified end to end on a real bundle rather than by reading: with 23 real
files on disk and 38,931 served from the ZIP, WeKan boots, connects to
FerretDB and answers 200 on /sign-in and on its 6.9 MB client bundle. The
release smoke test now also counts what reached the disk, so a change that
quietly went back to unpacking everything fails the job instead of passing it.

Thanks to xet7 !
2026-09-04 16:16:15 +03:00
Lauri Ojansivu a12cc8142e Unpack the Windows single EXE instead of virtualising it
WeKan-11.48-win64.exe died on every start with a SyntaxError in
accounts-password's bcrypt/promises.js, whose first line read "MZ...This
program cannot be run in DOS mode." - the bytes of a PE file, not of the
1123-byte JavaScript file that is really there. Both published files were
correct: the win64 ZIP holds the real promises.js, and so does the EXE. In
its packed image bcrypt.node (195584 bytes) is entry 0x5c9c and promises.js
is 0x5c9d, stored back to back, each with the right bytes at its recorded
offset. What was wrong was the READ. Enigma Virtual Box served all 44,401
bundle files from a virtual filesystem inside the EXE, and once Node.js had
loaded the native addon out of it (bcrypt.js line 2), the next read -
require('./promises') on line 6, the blob immediately after that addon -
came back as the addon's own PE bytes.

So the packer is gone. The EXE is now the compiled launcher with the
published ZIP appended to it and an 80-byte trailer saying where that
payload starts, how long it is, its SHA-256 and which WeKan it is. On its
first run the launcher checks that SHA-256, unpacks the payload into a real
"wekan-app" directory beside itself with Windows' own tar.exe, and from
then on WeKan runs from ordinary files. Persistent data is untouched by
any of it: wekan-files stays a sibling, so unpacking a newer version never
reaches it. The download drops from 690 MB to about 232 MB, and a damaged
copy now stops at a checksum with a message instead of reaching Node.js as
a crash loop.

The workflow's smoke test is why this shipped at all. start-wekan.bat
restarts WeKan every three seconds, so a crash-looping EXE still answered
on port 8080 inside the poll window and the job went green. It now starts
the EXE twice - the run that unpacks and the run that must find wekan-app
already there - and fails on "WeKan exited; restarting" or "SyntaxError"
in either log.

Thanks to xet7 !
2026-09-04 13:11:24 +03:00
Lauri Ojansivu cc94828e85 Revert "Auto-detect packaged startup endpoints"
This reverts commit 0bf470c57e.
2026-08-31 04:31:20 +03:00
Lauri Ojansivu 6c39c6ad32 Keep Windows PDF and Snap release builds portable 2026-08-30 21:31:49 +03:00
Lauri Ojansivu b39d57bf78 Publish and use the WeKan version manifest
Read the newest component versions from the fixed wekan.fi/version.txt endpoint and render its strictly validated five lines as escaped preformatted text in the Admin Version pane.

Generate the same manifest and install-page block from the release's Dockerfile pins and latest validated FerretDB tag in both local and release-all website flows. Add positive, negative, workflow and UI coverage.

Thanks to xet7 !
2026-08-30 18:04:24 +03:00
Lauri Ojansivu 0bf470c57e Auto-detect packaged startup endpoints
Use the current network IPv4 address and an available web port when ROOT_URL is not configured, preferring port 80 and omitting its URL suffix. Keep bundled FerretDB on a separate loopback-only free port and report both resolved endpoints at startup across bundles, containers, AppImage, Windows and Snap.

Thanks to xet7 !
2026-08-30 18:04:24 +03:00
Lauri Ojansivu 7f9ed69159 Repair test sessions after HttpOnly token migration
Persist seeded browser-test credentials through the native HttpOnly cookie, classify the FerretDB preflight helper correctly, and keep Windows release commands self-contained when no git remote exists.\n\nThanks to xet7 !
2026-08-30 07:20:26 +03:00
Lauri Ojansivu 9129125f40 Fix release build races and packaged Windows startup
Make the AppImage workflow wait for its extra-architecture bundle inputs, let the riscv64 Launchpad waiter return its clean timeout status, and bypass Enigma's false legacy-Windows result before starting Node.js.\n\nThanks to xet7 !
2026-08-30 00:02:52 +03:00
copilot-swe-agent[bot]andxet7 f0ecb14341 ci: stop MongoDB service before Windows EXE smoke test to free ports 27017/8088
The GitHub Actions windows-latest runner ships MongoDB Server 7.0 as a
running Windows service. The bundled FerretDB inside the packaged WeKan EXE
tries to bind to 127.0.0.1:27017 and 127.0.0.1:8088 (debug handler). When
those ports are already occupied, FerretDB exits immediately, WeKan restarts
in a tight loop, and the smoke test times out with:

  The packaged EXE did not answer on port 8080.

Failing run: https://github.com/wekan/wekan/actions/runs/33253053694

Fix: add a "Free ports used by the packaged EXE before smoke test" step in
.github/workflows/windows.yml that stops the MongoDB (and mongod) Windows
service and kills any remaining process on ports 27017 and 8088 before the
smoke EXE is launched. This is CI-only and has no effect on end-user behavior.

Thanks to xet7 !

Co-authored-by: xet7 <15545+xet7@users.noreply.github.com>
2026-08-29 13:09:13 +00:00
Lauri Ojansivu 372f0a8889 Use the archived Enigma Virtual Box installer
Download the reviewed Enigma Virtual Box 11.30 installer from the WeKan v11.25 release and retain its pinned SHA256, so a vendor-side replacement cannot silently change the Windows packaging tool.\n\nThanks to xet7 !
2026-08-29 15:37:41 +03:00
Lauri Ojansivu 5ed46d1f2e Publish a portable Windows single-file WeKan
Wrap the verified win64 release bundle with Enigma Virtual Box FREEWARE, launch its existing start-wekan.bat so Node.js and FerretDB SQLite run together, and keep persistent data beside the executable in wekan-files. Smoke-test the final executable and integrate it with full and missing-asset releases.\n\nThanks to xet7 !
2026-08-29 15:33:38 +03:00
Lauri Ojansivu f011debe31 Fix remaining WeKan matrix regressions
Apply persisted profile languages reactively after login resume, give the speech-scroll regression a deterministic overflow region, and bound every job inside the reusable AppImage workflow while teaching the release guard about callable jobs.

Thanks to xet7 !
2026-08-28 11:45:50 +03:00
Lauri Ojansivu cfe73ab69e Publish AppImages in the full release workflow.
Call the reusable AppImage workflow after the core GitHub Release publishes its amd64 and arm64 bundles. Pin the exact release tag, grant release-asset write permission, keep downstream packaging parallel, and add regression coverage for the dependency and reusable-workflow interface.

Thanks to xet7 !
2026-08-27 04:08:06 +03:00
Lauri Ojansivu 404a79e007 Make rebuilt 32-bit AppImages start old bundles.
Set a 1 GiB V8 heap default in the generated AppRun for i686 and armhf while preserving explicit NODE_OPTIONS. This protects AppImages rebuilt around an already-published bundle whose launcher predates the 32-bit heap fix, which is why the v11.15 i686 rerun still died during snapshot deserialization. Extend regression coverage for the old-bundle boundary.\n\nThanks to xet7 !
2026-08-27 03:35:43 +03:00
Lauri Ojansivu e8b6003e71 Fix 32-bit AppImage startup checks.
Keep the automatically selected V8 heap within the address space of a 32-bit bundled Node binary, so i686 can deserialize its startup snapshot. Probe the inner bundled Node before smoke-testing an AppImage, so an armhf runner without the hard-float loader is reported as unchecked instead of as a broken application. Add plain-Node regression coverage for the heap limit, override, capability probe and HTTP test ordering.\n\nThanks to xet7 !
2026-08-27 03:02:04 +03:00
Lauri Ojansivu d11987fad0 Hand off queued riscv64 snap builds cleanly.
Keep the flattened Launchpad snapshot deterministic across retries, stop the local riscv64 waiter before GitHub's six-hour cap, and publish only after a validated snap was downloaded. Add positive and negative workflow regression coverage.

Thanks to xet7 !
2026-08-21 14:45:12 +03:00
Lauri Ojansivu 2be7aac2b4 Wait for bundles before Launchpad snap builds.
Keep a validated snap when Snapcraft only fails during post-download cleanup,
and skip optional Launchpad builds whose release bundle is absent.

Thanks to xet7 !
2026-08-19 17:07:03 +03:00
Lauri Ojansivu efa25f78d9 Sandstorm: pack the TRIMMED trees, instead of rebuilding them first.
v10.98's log shows the trim doing exactly what it was meant to and then being
thrown away:

  --- .meteor-spk/bundle: 856M total        (first pack, fails)
  bundle-trim: removed 5236 files, 355 MiB
  prune-unreachable-npm: removed 28 package(s), 49.9 MiB
  --- .meteor-spk/bundle: 424M total        (424M + 336M deps = 760M, under 1 GiB)
  Building Meteor app...                    <- pack rebuilds it
  App exceeds uncompressed size limit of 1 GiB

`meteor-spk pack` runs the Meteor build first, so the retry regenerated the
bundle and packed the untrimmed one.

I HAD THIS WRONG, and the comment in this file said so confidently: v10.95's
"pack REUSES the bundle" was inferred from a 852M -> 833M reading taken right
after the prune - the same point in the sequence as the 424M above - and never
checked against what the SECOND pack did. The trim never survived a pack.

Sandstorm's own `spk pack` does only the packing: it reads
sandstorm-pkgdef.capnp, whose sourceMap searchPath is exactly the two trees the
trim has just finished with, and signs with ~/.sandstorm-keyring. The retry uses
that when the binary is there - the job installs Sandstorm, so it is - and falls
back to meteor-spk with a ::warning:: saying the fallback undoes the trim,
rather than failing silently in a way that looks like the trim not working.

Unverified here: this sandbox has no spk binary, so the invocation is written
from the pkgdef's own contract rather than run. The next release either packs or
says which of the two paths it took.

Thanks to xet7 !
2026-08-16 15:45:22 +03:00
Lauri Ojansivu 71ff74c6d2 The reachability graph must read Meteor's module.link, not only require().
v10.97 shipped a bundle that crash-looped:

  Error: Cannot find module ".../nodemailer-openpgp/lib/nodemailer-openpgp.js"
    at packages/email.js:347

packages/email.js does not require() that package. Meteor compiles an ESM import
to its own linker call:

  module.link('nodemailer-openpgp',{openpgpEncrypt(v){openpgpEncrypt=v}},6);

and prune-unreachable-npm.mjs only ever looked for require(). So it missed every
ESM import in every Meteor package, which is most of them, and reported live
code as dead. The reachable count goes from 211 to 450 with the fix - the
measurement that entry was based on was badly wrong, not marginally.

Four forms count now: require(), module.link(), module.watch(require()) and
module.dynamicImport().

THE SAFETY WORKED, which is the one good part. With the corrected graph the
policy still named openpgp, the graph vetoed it, and the tool refused and said
so rather than deleting it. That entry is now removed outright rather than left
to be vetoed every run: the reason is what grants the permission, and this
reason - "reachable only through an optional plugin nothing requires" - was
never true. 61.3 MiB becomes 40.0 MiB, all of it typescript, @types/* and sinon.

AND THE CHECK THAT WAS MISSING BOTH TIMES. v10.96 died on a source map that had
been deleted but not un-named; v10.97 on this. Both were reasoned about by
reading the code, and reading the code is how both mistakes were made. So
releases/bundle-smoke-boot.sh starts the bundle with a database address that
cannot answer and requires it to get as far as trying to reach it - which proves
the whole server image loaded, because the database is the first thing WeKan
needs that the check does not provide. The amd64 build runs it after the trim
and the prunes, and every other architecture's bundle derives from that one.

It is verified against both real failures: a bundle with nodemailer-openpgp
removed, and a manifest naming maps that are not there. Each fails with its own
diagnosis, because the fix for each is a different one. A bundle that exits
quietly or hangs is not a pass either - a smoke test whose failure mode is
passing when it learned nothing is worth less than none.

Thanks to xet7 !
2026-08-16 13:27:51 +03:00
Lauri Ojansivu d6e21202f2 Prune what no require() in the server bundle can reach.
programs/server/npm/node_modules is 347 MB of an ~850 MB bundle, and measuring
its require graph says 206 MB of that is unreachable from any server entry
point. Two things cause it, neither a bug in Meteor:

  * the tree is OUTSIDE the bundler's graph. Meteor 3.5 compiles through rspack
    - the server output is minified and programs/server/app/app.js requires only
    76 bare specifiers, because rspack inlined the app's real dependencies into
    it - but this tree is what Atmosphere packages declare with Npm.depends() and
    load through Npm.require(), which rspack cannot follow. The tree is largely
    the INPUT to a build whose OUTPUT ships beside it;
  * it is a full `npm install`, devDependencies included.

Duplication is the smaller half: 586 distinct packages exist as 815 copies, but
the redundant copies are only ~28 MB, because Meteor keeps per-package
node_modules on purpose so packages can pin conflicting versions.

releases/prune-unreachable-npm.mjs removes 61.3 MiB of it, in four categories
whose reason is PROVABLE rather than merely plausible - the standard the
uWebSockets.js removal met:

  * typescript, 23.2 MiB - a devDependency of 196 packages here (the @aws-sdk
    family) and a runtime dependency of none;
  * openpgp + nodemailer-openpgp, 21.3 MiB - reachable only through an optional
    nodemailer plugin nothing in meteor/email requires;
  * @types/*, 9.6 MiB across 24 copies - verified to contain no .js at all, so
    no require() can resolve into one;
  * sinon, 7.2 MiB - a test framework inside meteor/ostrio_files.

The remaining 145 MB of unreachable packages STAYS. jquery, hotkeys-js and the
@azure storage adapters are almost certainly dead too, but "almost certainly" is
not the standard, and the tail of 590 packages is where a static scan is most
likely to be wrong.

Two independent safeties, because this is riskier than the uws removal was. The
reachable set is recomputed from the bundle every run and deliberately
OVER-approximated - once a package is reached, every file in it is scanned and
every require() string literal counts. The policy then only proposes; the graph
has a VETO, so an entry whose package is actually required is refused and said
out loud rather than applied. And after deleting, every path in the reachable
set must still exist or the run fails.

Verified on a real bundle: 473M -> 410M, and the reachable count is 211 before
and after - nothing that was reachable became unreachable. A second run finds
nothing left to do.

Thanks to xet7 !
2026-08-16 05:21:02 +03:00
Lauri Ojansivu c1e0f02979 Source maps go from every platform, not only the Sandstorm .spk.
The .zip bundles and the Docker image were trimmed with --keep-maps, so only
Sandstorm - which had a 1 GiB ceiling to get under - dropped them. Every
platform drops them now.

152 MiB per bundle, measured: 188 MiB of maps across 4766 files, less the 36 MiB
in web.browser.legacy that --drop-legacy-client already takes with it.

Nothing on any loading path reads one. A source map translates a position in
built code back to the source that produced it - this bundle's server side is
one 117 MiB programs/server/app/app.js, and its 58 MiB app.js.map is what turns
`app.js:1284531` into a file and a line. The two things that read it are browser
devtools, which fetch the .map only when they are open, and Node stack traces
through source-map-support. A released bundle has neither attached to it.

The `//# sourceMappingURL` comments stay behind, and are comments: a missing
target means devtools shows compiled positions and a server stack trace prints
bundle offsets. Debugging a production crash goes back to reproducing it against
a development build, which is where the maps still are.

Thanks to xet7 !
2026-08-16 03:49:55 +03:00
Lauri Ojansivu 33c867f4d8 Every platform talks sockjs, and no bundle ships uws or the legacy client.
uws is not reliable enough yet to be what a default points at, so nothing WeKan
ships selects it any more, and nothing carries the module.

DEFAULTS. Every docker-compose file, start-wekan.sh, start-wekan.bat, build.sh,
build.bat, the image's own ENV block, the snap config and the Sandstorm grain
now say sockjs. The commented-out `#- DDP_TRANSPORT=uws` alternatives beside
them are replaced by a note saying why there is no alternative, rather than
advertising a value that no longer works.

BUNDLES. Every place a built bundle is post-processed - the amd64 build, each
per-arch rebuild, the repack container, install-node-for-arch.sh and the
Dockerfile - now runs bundle-trim.mjs beside the prune it already ran:

  * --transport sockjs removes uWebSockets.js entirely. 121 MiB of prebuilt
    binaries for OS/CPU/ABI combinations one machine cannot use, and a sockjs
    server never requires the module at all: ddp-server's
    `Npm.require('uWebSockets.js')` is inside the uws transport's setup(), which
    runs only for the transport that was chosen.
  * --drop-legacy-client removes programs/web.browser.legacy, a whole second
    copy of the client for browsers without modern JS. 81 MiB measured. Meteor
    supports running with architectures excluded and says so in webapp's
    categorizeRequest(): "If our preferred arch is not available, it's better to
    use another client arch that is available than to guarantee the site won't
    work". An old browser is served web.browser; the 404 branch below that is
    reached only when NO arch matches, which cannot happen while web.browser is
    there, and autoupdate iterates the programs that actually loaded.

    The files are only half of it. The arch is NAMED in programs/server/config.json
    and star.json, and boot.js builds a dynamic-import root for every name in the
    first - so the name is removed with the files. Those manifests are mode 444
    as Meteor writes them, so they are made writable, rewritten, and set back:
    failing there would leave the one state that actually breaks a server, files
    gone and manifests still naming the arch.

UPGRADES. An existing docker-compose.yml that says DDP_TRANSPORT=uws would ask
the new image for a module it does not have and crash-loop on the require. So
wekan-entrypoint.sh and the bundle's start-wekan.sh coerce uws back to sockjs
before starting anything, and print why - a setting silently ignored is worse
than one that fails.

tests/sockjsEverywhere.test.cjs pins all three halves together, because each is
useless or harmful without the others: a default without the coercion is an
upgrade trap, a coercion without the trim is dead weight, and a trim without
both is a crash. tests/bundleTrim.test.cjs covers the legacy removal, the
manifest deregistration and the read-only rewrite.

Thanks to xet7 !
2026-08-16 03:40:57 +03:00
Lauri Ojansivu cdbd33b590 The Sandstorm .spk ships no uWebSockets.js at all: a grain talks sockjs.
Trimming uWebSockets.js down to the prebuilds a grain's own platform can open
freed 93M of its 121M. It can all go, because a grain loads NONE of it.

The uws transport is optional in Meteor 3. `ddp-server`'s transports/index.js
resolves the transport from `Meteor.settings.packages['ddp-server'].transport`,
then `DDP_TRANSPORT`, then `DISABLE_SOCKJS`, and DEFAULTS to sockjs - and
`Npm.require('uWebSockets.js')` sits inside the uws transport's `setup()`, which
runs only for the transport that was actually chosen. `sandstorm-pkgdef.capnp`
sets none of those, and its `environ` is by its own comment the app's ENTIRE
environment, so a grain has been running sockjs all along while carrying 121M of
a module it never required.

So the pkgdef now PINS `DDP_TRANSPORT=sockjs` - the removal should rest on a
stated fact, not on an upstream default staying put - and `bundle-trim.mjs`
takes `--transport sockjs`, which removes the module whole rather than thinning
its prebuilds. 120 MiB measured, 27 MiB more than the platform trim, and the
.spk is now ~860M against the 1 GiB limit.

It is a FLAG and not the default because WeKan asks for uws nearly everywhere
else - docker-compose, start-wekan.sh, build.sh - and those bundles keep the
module, trimmed to the prebuilds their own platform can open.

tests/bundleTrim.test.cjs ties the grain's pinned transport to the flag the .spk
is trimmed with. If they ever disagreed, the grain would require a module that
was left out and fail to boot, which is the one way this can go wrong.

Thanks to xet7 !
2026-08-16 03:20:46 +03:00
Lauri Ojansivu 0f374a0d41 Cancelling a release run stops it, and a stuck job no longer needs a human.
Pressing Cancel on a release-all run did not stop the `docker` job: it kept
going for another twenty minutes and would have pushed a multi-arch image for a
release that was being abandoned.

The cause is `always()`. It is true while a run is CANCELLING, which is exactly
why it was chosen in v10.80 — a `build-mac-x64` queued on a runner label GitHub
had retired sat for two hours, was cancelled by hand, and that cancellation
SKIPPED `charts`, `ucs` and `nextcloud`, so the Helm chart for a published WeKan
was never pushed. `always()` fixed that by ignoring cancellation entirely, and
ignoring cancellation is also what disabled the Cancel button on a job that
takes hours.

`!cancelled()` keeps the half that matters — do not skip me because a SIBLING
failed — and drops the half that overrides a person. Nine job-level conditions
across release-all.yml, release-all-missing.yml, Flatpak.yml and AppImage.yml
change; the 22 step-level `if: always()` reporting steps do not, because those
correctly print CANCELLED.

That alone would reopen v10.80, so the other half of the fix is that no job
needs a hand cancellation any more: the eight jobs that had no `timeout-minutes`
now have one, and every job in release-all.yml is bounded. A stuck job FAILS on
its own, and a failure satisfies `!cancelled()` the same way `always()` let it
through. Cancel is left meaning only what a person meant by it.

tests/releaseCancelSafeJobs.test.cjs records both incidents and now pins the
opposite of what it used to: no job-level `always()` anywhere, and a timeout on
every job.

Thanks to xet7 !
2026-08-16 03:08:47 +03:00