Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dbee0cc
Build the Linux ARM64 launcher on the Ubuntu 22.04 runner.
andersalm Nov 8, 2026
2f5da45
Merge origin/test/launcher-mac-dmg into the Jetson test branch.
andersalm Nov 8, 2026
e449e36
Use electron-builder's arm64 fpm for the Jetson package.
andersalm Nov 8, 2026
bb7d4b6
Read a 2.0.0 update check from the command text when the status file …
andersalm Nov 8, 2026
03d251c
Treat a Linux computer as glibc when its glibc loader is present.
andersalm Nov 8, 2026
e947b47
Revert "Read a 2.0.0 update check from the command text when the stat…
andersalm Nov 8, 2026
905198c
Merge origin/test/launcher-mac-dmg into the Jetson test branch.
andersalm Nov 8, 2026
7429483
Expect Linux Update to stop Home and start it again.
andersalm Nov 8, 2026
f1eff78
Start Linux Home with the update controller.
andersalm Nov 8, 2026
352e840
Count a Home child as the owner of port 8090.
andersalm Nov 8, 2026
1804f46
Merge origin/test/launcher-mac-dmg into the Jetson test branch.
andersalm Nov 8, 2026
a3e9355
Adopt a Linux Home only when its controller record still matches.
andersalm Nov 8, 2026
8607ddf
Read the launcher update check when Runtime 2.0.0 does not write one.
andersalm Nov 8, 2026
97cdeca
Signal a Linux Home only after the update controller still matches.
andersalm Nov 8, 2026
6aca8ea
Merge origin/test/launcher-mac-dmg into the Jetson test branch.
andersalm Nov 8, 2026
9360122
Pass the Home directory into the Linux controller read.
andersalm Nov 8, 2026
76d8f45
Record the darwin listener failure as a kernel-path command check.
andersalm Nov 8, 2026
1b3c790
Merge origin/test/launcher-mac-dmg into the Jetson test branch.
andersalm Nov 8, 2026
8d486e8
Signal a Linux Home controller through a pidfd opened before the proc…
andersalm Nov 8, 2026
b7483d1
Add a regression for a Stop that leaks the pidfd helper.
andersalm Nov 8, 2026
c31efcd
Release the pidfd helper when Stop fails or replaces its controller.
andersalm Nov 8, 2026
9d3b0ca
Remove test comments that only restate the helper count.
andersalm Nov 8, 2026
76a361b
Add a regression for a Stop that outlasts the pidfd idle alarm.
andersalm Nov 8, 2026
43e5cbe
Stop the pidfd helper from dying while Stop waits on health.
andersalm Nov 8, 2026
116f5d4
Merge remote-tracking branch 'origin/test/launcher-mac-dmg' into test…
andersalm Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ jobs:
dist-electron/*.deb
if-no-files-found: error

linux-arm64:
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/linux-arm64.yml

release:
needs: build
needs: [build, linux-arm64]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Linux ARM64 package

# Ubuntu 22.04 matches the Jetson glibc (2.35).
on:
pull_request:
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
package:
runs-on: ubuntu-22.04-arm
timeout-minutes: 90
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install dependencies
run: npm ci

- name: Build the arm64 AppImage and deb
run: npm run build:linux -- --arm64 --publish never

- name: Record checksums
run: |
set -euo pipefail
sha256sum dist-electron/*.AppImage dist-electron/*.deb
test -n "$(find dist-electron -maxdepth 1 -name '*arm64*.AppImage' -print)"
test -n "$(find dist-electron -maxdepth 1 -name '*arm64*.deb' -print)"

- name: Upload the arm64 packages
uses: actions/upload-artifact@v4
with:
name: ElastOS-linux-arm64
path: |
dist-electron/*.AppImage
dist-electron/*.deb
if-no-files-found: error
12 changes: 9 additions & 3 deletions .github/workflows/runtime-smoke.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Runtime smoke

# Linux x64, macOS arm64, and the ElastOS WSL2 distro are required.
# A red run fails the pull request. Each job verifies the selected channel
# against the maintainer DID and rollback floor. Failed verification means
# install stops. The job then checks gateway /healthz and
Expand All @@ -21,6 +20,8 @@ jobs:
platform: linux-x64
- os: macos-latest
platform: darwin-arm64
- os: ubuntu-22.04-arm
platform: linux-arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand All @@ -47,15 +48,20 @@ jobs:

electron-e2e:
name: e2e (${{ matrix.platform }})
timeout-minutes: 40
timeout-minutes: 50
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
platform: linux-x64
packages: xvfb libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2t64 libgtk-3-0t64 libxss1
- os: ubuntu-22.04-arm
platform: linux-arm64
packages: xvfb libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 libgtk-3-0 libxss1 libayatana-appindicator3-1
- os: macos-latest
platform: darwin-arm64
packages: ""
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand All @@ -75,7 +81,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2t64 libgtk-3-0t64 libxss1
sudo apt-get install -y ${{ matrix.packages }}

- name: Install dependencies
env:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A wrong signature or channel, version below the floor, changed metadata snapshot
- Home is `http://localhost:8090/home/`.
- Update offers require signed metadata. Runtime 2.0.0 needs a compatibility `update-check.json` record after a successful CLI check. Human-readable stdout never determines the offer. A 2.0.0 source with an unknown head uses the stored signed install record and matching binary version for rollback identity.
- A foreign listener on 8090 keeps running and its specific error reaches the window. A status probe that overlaps Start, Stop, or Update must honor the newer control phase.
- On Mac, the signed Home controller owns System update restarts. Re-read the verified host generation before Stop. Other platforms signal the gateway process group with `SIGTERM`, 15 seconds, then `SIGKILL`, and only after the pid has exited and `/healthz` has failed twice.
- On Mac, the signed Home controller owns System update restarts. Re-read the verified host generation before Stop. On Linux, Stop and Quit signal the update controller only, and only after a fresh read of its `/proc` start time, its exe, and the host lock generation. A mismatch sends no signal. A gateway on `127.0.0.1:8090` stays running and has no Stop control. A process the launcher spawned is signaled through its own process handle. Windows signals the gateway process group with `SIGTERM`, 15 seconds, then `SIGKILL`, and only after the pid has exited and `/healthz` has failed twice.
- Reset and uninstall remove only the ElastOS program, its data directory, and the launcher stage file. Other home directories stay on disk.
- IPC channel names are `elastos:*`. The preload object is `window.elastos`.
- `src/main/index.ts` does not import `./targets`.
Expand Down
4 changes: 2 additions & 2 deletions docs/RUNTIME_MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Uninstall on Windows removes the whole ElastOS WSL2 Linux environment with `wsl.

Remove PC2 is a separate action in `src/main/legacyPc2Removal.ts`. The button stays hidden until a legacy install is on disk: `~/.pc2`, `~/.elastos/node` when it is the old bundled Node 22.13.1 tree, a PC2 launch agent or autostart file, a sudoers file whose text matches the rules the old installer wrote (`/etc/sudoers.d/wireguard` with `wg-quick`, or `/etc/sudoers.d/amneziawg` with `NOPASSWD:SETENV`, `amneziawg-go`, and `/var/run/amneziawg/`) together with one of those installs, a `~/.pc2` folder inside another Windows Linux distro, or a Windows distro named `pc2` or `pc2-wsl` that itself contains that folder or Node tree. The old installer never wrote `/etc/sudoers.d/elastos` or `/etc/sudoers.d/pc2-wireguard`. This repo has no hash for the VPN programs it compiled, so those programs are not deleted by name. The ElastOS distro is never unregistered. The confirm dialog lists each path and its size. Removal deletes only the paths from that list. “Back up my PC2 data first” must write a backup before anything is deleted, including a Windows Linux folder or distro; if that backup cannot be saved, nothing is removed. One privileged prompt covers a matching sudoers rule. That prompt is pkexec. Cancelling it (exit 126), a missing authorization or a missing prompt (exit 127), and a missing pkexec program each have their own sentence. pkexec is not replaced with sudo. An exit after the prompt has started is the removal command's own result. The list of files still there is what that privileged script can see, including a sudoers file the app itself cannot stat. A failure says what is still there and saves a support bundle.

On Mac, Stop and Quit re-read the installed Home generation and signal its verified controller when present. The controller drains its children. Linux and Windows retain gateway process-group supervision with `SIGTERM`, 15 seconds, then `SIGKILL`, and two failed health probes after the pid exits. Quit waits through shutdown and its health probes. Reset and Uninstall, after the confirm dialog, adopt that gateway from the host lock and signal the pid they read. They do not ask again. On Windows they adopt only when the distro facts say the listener is ElastOS. A different listener, and a facts read that fails, is left running. On macOS and Linux the adopt itself checks the host lock, the command line, and the health socket. On Windows, an error asking whether that pid has exited is treated as still running. Exit 75 restarts only when the binary was replaced on disk.
On Mac and Linux, Stop and Quit re-read the installed Home and signal its verified controller when the host lock and the update-controller status agree. Linux reads the controller start time from /proc, the controller exe, and the host lock generation immediately before every signal. A reused pid, a stale status file, a wrong exe, or a generation mismatch is left running, and the window says to stop that Home with Ctrl+C. Linux does not signal a host pid, a process group, or a descendant, and it does not adopt a gateway on 127.0.0.1:8090. That gateway is shown as another ElastOS Home with no Stop control. A process the launcher spawned is signaled through its own process handle. The controller drains its children. Windows retains gateway process-group supervision with `SIGTERM`, 15 seconds, then `SIGKILL`, and two failed health probes after the pid exits. Quit waits through shutdown and its health probes. Reset and Uninstall, after the confirm dialog, adopt that gateway from the host lock and signal the pid they read. They do not ask again. On Windows they adopt only when the distro facts say the listener is ElastOS. A different listener, and a facts read that fails, is left running. On macOS and Linux the adopt itself checks the host lock, the command line, and the health socket. On Windows, an error asking whether that pid has exited is treated as still running. Exit 75 restarts only when the binary was replaced on disk.

The support bundle redacts labeled secrets (`password`, `token`, `api_key`, `attach_secret`, `cookie`, `authorization`, `seed`, `mnemonic`, `private_key`, `secret`, bearer tokens, and JWTs), the rest of a `seed`, `mnemonic`, `private_key`, or `secret` line, a run of 12 or more BIP39 words in any case, split by spaces, line breaks, commas, hyphens, quotes, or numbering such as `1.` or `2:`, known secret prefixes (AWS access key ids, `ghp_` tokens, and `sk-` keys), hex of 32 or more characters with or without `0x`, including a 64-character hex string unless that line is labelled sha256 or hash, hex wrapped over two or more lines that holds 32 or more characters together (a list of whole 40- or 64-character hashes stays), an unlabeled uppercase token of 16 or more characters that contains a digit and no underscore, a lowercase token of 32 or more characters with high entropy, and an unlabeled mixed-case token of 20 or more characters with high entropy. It keeps paths, a 40-character hex hash on its own line or beside a hash, cid, commit, or installer label, a 64-character hex string on a sha256 or hash line, CIDv0 and CIDv1, `did:key` values, versions, UUIDs, and `UPPER_SNAKE` names. An unlabeled secret shorter than that, or with low entropy, is not redacted. `secret-line` is a short phrase that stays.

Expand All @@ -95,6 +95,6 @@ Check these before the runtime on `main` is marketed as a live product and this
- [ ] No phone-home telemetry.
- [x] Uninstall and Reset remove only the exact runtime paths: `~/.local/bin/elastos`, `~/.local/share/elastos`, `~/Library/Application Support/elastos`, `~/.elastos-launcher/install-stage.json`, and `~/.elastos-launcher/resume-install.json`. Reset also removes `~/.elastos-launcher/resume-install.json.lock`. An XDG data directory under this home is included when it is empty or holds only the partial-install files, or when every entry is a runtime name and the signed install record verifies. A user file is refused by name even beside that record. Other folders stay on disk.
- [x] Remove PC2 is separate from Reset and Uninstall. It is shown only when a legacy install is detected, lists those known paths and their sizes, and refuses runtime paths, symlink escapes, and any other path.
- A foreign listener is left running. On Mac, Start, Stop, Restart and Quit can adopt the verified installed Home. Controller shutdown drains its child processes. Other platforms retain their existing gateway supervision path.
- A foreign listener is left running. On Mac and Linux, Start, Stop, Restart and Quit can adopt the verified installed Home. Controller shutdown drains its child processes. Windows retains its gateway supervision path.
- [ ] Diagnostics and the log panel do not contain `attach_secret` or the coordinate JSON files. Labeled secrets, AWS key ids, `ghp_` tokens, `sk-` keys, a run of 12 or more BIP39 words in any layout, wrapped hex, and hex that is not a 40-character hash or a 64-character hex string on a sha256 or hash line are redacted. An unlabeled short or low-entropy phrase is not.
- Live rollback of historical alpha releases is no longer a CI job. Stable 2.0.0's linked predecessor is Canary 2.0.0-rc.2; Runtime correctly refuses that channel change, and there is no prior Stable release within the 2.0.0 floor to exercise. Current signed install and health checks remain in smoke. Unit tests exercise the launcher's verified rollback CID and refusal paths. A future live rollback fixture must use releases on the subscribed channel and within the install floor.
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "AGPL-3.0",
"scripts": {
"dev": "electron .",
"build:ts": "node scripts/build-mac-process-info.js && tsc",
"build:ts": "node scripts/build-mac-process-info.js && node scripts/build-linux-pidfd.js && tsc",
"build": "npm run build:ts && electron-builder",
"build:mac": "npm run build:ts && electron-builder --mac",
"build:win": "npm run build:ts && electron-builder --win",
Expand Down Expand Up @@ -70,7 +70,21 @@
],
"category": "Utility"
},
"asarUnpack": ["dist/native/mac-process-info"],
"deb": {
"depends": [
"libgtk-3-0",
"libnotify4",
"libnss3",
"libxss1",
"libxtst6",
"xdg-utils",
"libatspi2.0-0",
"libuuid1",
"libsecret-1-0",
"libayatana-appindicator3-1"
]
},
"asarUnpack": ["dist/native/mac-process-info", "dist/native/linux-pidfd"],
"afterAllArtifactBuild": "scripts/notarize.js",
"extraResources": [
{
Expand Down
13 changes: 13 additions & 0 deletions scripts/build-linux-pidfd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { spawnSync } = require('node:child_process');
const fs = require('node:fs');
const path = require('node:path');

if (process.platform !== 'linux') process.exit(0);
const output = path.join(__dirname, '../dist/native/linux-pidfd');
fs.mkdirSync(path.dirname(output), { recursive: true });
const result = spawnSync('cc', [
'-Wall', '-Wextra', '-Werror', '-O2',
path.join(__dirname, '../src/native/linux-pidfd.c'), '-o', output,
], { stdio: 'inherit', timeout: 30000 });
if (result.error) throw result.error;
process.exit(result.status ?? 1);
7 changes: 6 additions & 1 deletion scripts/electron-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ async function main() {
executablePath: electronPath, cwd: root, args, env, timeout: 120000,
});
}
if (process.platform === 'linux') {
await require('./linux-lifecycle-e2e')(electronApp, page, home, {
executablePath: electronPath, cwd: root, args, env, timeout: 120000,
});
}
return;
}
if (errorVisible && errorText && /Set up ElastOS on Windows|Windows needs Linux support|Windows needs one step/.test(errorText)) {
Expand Down Expand Up @@ -299,7 +304,7 @@ async function main() {
}
}

const capMs = process.platform === 'win32' ? 50 * 60 * 1000 : 35 * 60 * 1000;
const capMs = process.platform === 'win32' ? 50 * 60 * 1000 : process.platform === 'linux' ? 45 * 60 * 1000 : 35 * 60 * 1000;
setTimeout(() => {
console.error(`e2e did not finish within ${capMs / 60000} minutes`);
process.exit(1);
Expand Down
Loading
Loading