From aaa389cc9b3550a875d6b190f97ef2ec77846c90 Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 24 Oct 2026 03:43:41 +0300 Subject: [PATCH] Release workflow, myTS avatars, host banner, hardware video decode setting, nickname-first tree layout, CI run #1 analysis; core raw-extras lifecycle --- .gitea/workflows/release.yml | 158 ++++++++++++++++++ app/main/main.js | 26 ++- app/main/prefs.js | 1 + app/preload/preload.js | 2 + app/renderer/index.html | 13 ++ app/renderer/js/app.js | 25 +++ app/renderer/js/media.js | 11 +- app/renderer/js/settings.js | 37 +++- app/renderer/js/tree.js | 4 +- app/renderer/styles/app.css | 10 +- docs/bridge.md | 28 +++- docs/evidence/ci-run1.md | 36 ++++ docs/evidence/core-runtime.md | 94 +++++++++++ .../40-tree-metadata.png | Bin 152980 -> 164957 bytes .../2026-10-24-tree-metadata/result.json | 2 +- scripts/elf-pagesize.mjs | 1 + 16 files changed, 425 insertions(+), 23 deletions(-) create mode 100644 .gitea/workflows/release.yml create mode 100644 docs/evidence/ci-run1.md create mode 100644 docs/evidence/core-runtime.md diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..e906802 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,158 @@ +# Release builds on the self-hosted Gitea runner (Linux x64 job containers). +# - workflow_dispatch: build + verify packages, keep them as run artifacts (no release). +# - tag v*: same, then publish a Gitea release with the packages, only if every build job succeeded. +# Windows x64 packages are built on a Windows machine and attached separately (see README). +name: release + +on: + push: + tags: ['v*'] + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux-x64: + runs-on: ubuntu-latest + container: + image: node:22-bookworm + env: + CARGO_TERM_COLOR: never + CARGO_BUILD_JOBS: "2" + steps: + - uses: actions/checkout@v4 + + - name: System packages (container only) + run: | + apt-get update + apt-get install -y --no-install-recommends build-essential cmake curl ca-certificates git \ + xvfb xauth libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 \ + libasound2 libxss1 libxshmfence1 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libpango-1.0-0 + + - name: Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - name: Tests + run: | + npm ci + npm test + cargo test --manifest-path core/Cargo.toml --locked + + - name: Core release build and checks + run: | + cargo build --manifest-path core/Cargo.toml --release --locked + node scripts/binary-arch.mjs core/target/release/teamspeach-core --expect linux-x64 + node scripts/core-smoke.mjs core/target/release/teamspeach-core + + - name: Electron UI smoke (Xvfb, offline) + env: + TEAMSPEACH_SMOKE_EXTRA_ARGS: --no-sandbox + run: xvfb-run -a node scripts/smoke-ui.mjs --out smoke-out + + - name: Package + run: node scripts/dist.mjs --os linux --arch x64 + + - name: Package report + run: | + ldd --version | head -n1 > dist/build-info-linux-x64.txt + node scripts/elf-pagesize.mjs dist/linux-unpacked --page 4096 --json dist/elf-report-linux-x64.json >> dist/build-info-linux-x64.txt + sha256sum dist/*.AppImage dist/*.tar.gz >> dist/build-info-linux-x64.txt + + - uses: actions/upload-artifact@v3 + with: + name: teamspeach-linux-x64 + path: | + dist/*.AppImage + dist/*.tar.gz + dist/build-info-linux-x64.txt + dist/elf-report-linux-x64.json + if-no-files-found: error + + linux-arm64: + runs-on: ubuntu-latest + container: + image: node:22-bookworm + env: + CARGO_TERM_COLOR: never + CARGO_BUILD_JOBS: "2" + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc + CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++ + AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar + steps: + - uses: actions/checkout@v4 + + - name: Cross toolchain and user-mode emulator (container only, no binfmt) + run: | + apt-get update + apt-get install -y --no-install-recommends build-essential cmake curl ca-certificates git \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user + + - name: Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --target aarch64-unknown-linux-gnu + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - name: Core cross build and checks + run: | + cargo build --manifest-path core/Cargo.toml --release --locked --target aarch64-unknown-linux-gnu + node scripts/binary-arch.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --expect linux-arm64 + node scripts/elf-pagesize.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --page 16384 + node scripts/core-smoke.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --wrapper "qemu-aarch64 -L /usr/aarch64-linux-gnu" + + - name: Package + run: | + npm ci + node scripts/dist.mjs --os linux --arch arm64 + + - name: 16 KiB page check of every ELF in the package (Asahi) + run: | + echo "glibc of build sysroot: $(dpkg-query -W -f='${Version}' libc6-dev-arm64-cross)" > dist/build-info-linux-arm64.txt + node scripts/elf-pagesize.mjs dist/linux-arm64-unpacked --page 16384 --json dist/elf-report-linux-arm64.json | tee -a dist/build-info-linux-arm64.txt + sha256sum dist/*.AppImage dist/*.tar.gz >> dist/build-info-linux-arm64.txt + + - uses: actions/upload-artifact@v3 + with: + name: teamspeach-linux-arm64 + path: | + dist/*.AppImage + dist/*.tar.gz + dist/build-info-linux-arm64.txt + dist/elf-report-linux-arm64.json + if-no-files-found: error + + publish: + needs: [linux-x64, linux-arm64] + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + container: + image: node:22-bookworm + permissions: + contents: write + steps: + - uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Create release and upload packages + env: + TOKEN: ${{ secrets.GITEA_TOKEN }} + API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }} + TAG: ${{ github.ref_name }} + run: | + set -eu + body="Linux x64 и Linux ARM64 (aarch64) собраны в CI: тесты, офлайн-проверка ядра, проверка страниц 16 КиБ для ARM64 (см. build-info-*.txt). ARM64 проверен только статически и под qemu, не на Apple Silicon. Пакеты не подписаны. Сборка Windows x64 прикладывается отдельно с пометкой local." + id=$(node -e ' + const [api, tag, token, body] = process.argv.slice(1); + fetch(`${api}/releases`, { method: "POST", headers: { Authorization: `token ${token}`, "Content-Type": "application/json" }, + body: JSON.stringify({ tag_name: tag, name: `TeamsPeach ${tag}`, body, prerelease: true }) }) + .then(async (r) => { const j = await r.json(); if (!r.ok) { console.error(r.status, JSON.stringify(j)); process.exit(1); } console.log(j.id); }); + ' "$API" "$TAG" "$TOKEN" "$body") + for f in artifacts/*/*; do + name=$(basename "$f") + curl --fail -sS -X POST -H "Authorization: token $TOKEN" -F "attachment=@$f" "$API/releases/$id/assets?name=$name" > /dev/null + echo "uploaded $name" + done diff --git a/app/main/main.js b/app/main/main.js index fd1d175..c66ff40 100644 --- a/app/main/main.js +++ b/app/main/main.js @@ -56,6 +56,11 @@ const MIME = { // The TS6 streamer is native libwebrtc; plain host candidates keep LAN viewing working even while the mic is off. app.commandLine.appendSwitch('disable-features', 'WebRtcHideLocalIpsWithMdns'); +// Hardware video decoding policy is a launch-time Chromium switch, so it is read from the saved +// preferences before the app is ready and only changes after a restart. +const hardwareVideoDecodeAtLaunch = new Prefs(prefsFile()).get().hardwareVideoDecode; +if (!hardwareVideoDecodeAtLaunch) app.commandLine.appendSwitch('disable-accelerated-video-decode'); + protocol.registerSchemesAsPrivileged([ { scheme: APP_SCHEME, privileges: { standard: true, secure: true, supportFetchAPI: true, codeCache: true } }, ]); @@ -130,8 +135,7 @@ function onCoreEvent(evt) { if (evt.event === 'state' && evt.state === 'disconnected') externalMedia.clear(); if (evt.event === 'snapshot' && Array.isArray(evt.clients)) { for (const c of evt.clients) { - if (typeof c.myts_avatar_url === 'string') allowExternalMedia(c.myts_avatar_url); - if (Array.isArray(c.myts_avatar_urls)) for (const v of c.myts_avatar_urls) allowExternalMedia(v && v.url); + if (Array.isArray(c.myts_avatars)) for (const v of c.myts_avatars) allowExternalMedia(v && v.url); } } sendToRenderer('core:event', evt); @@ -404,7 +408,11 @@ function registerIpc() { if (!core) return { ok: false, error: { code: 'core_unavailable', message: 'Ядро не запущено' } }; const hasArgs = Object.keys(clean).length > 0; const response = await core.request(cmd, hasArgs ? clean : undefined); - if (!response.ok && response.error.code === 'external_media' && response.error.detail) allowExternalMedia(response.error.detail.url); + if (!response.ok && response.error.code === 'external_media' && response.error.detail) { + const detail = response.error.detail; + allowExternalMedia(detail.url); + if (Array.isArray(detail.urls)) for (const v of detail.urls) allowExternalMedia(v && v.url); + } return response; }); @@ -464,6 +472,18 @@ function registerIpc() { return true; }); + ipcMain.handle('app:video-status', (event) => { + if (!trustedSender(event)) return null; + return { hardwareDecodeAtLaunch: hardwareVideoDecodeAtLaunch, gpu: app.getGPUFeatureStatus() }; + }); + + ipcMain.handle('app:relaunch', (event) => { + if (!trustedSender(event)) return false; + app.relaunch(); + app.quit(); + return true; + }); + ipcMain.handle('app:open-logs', async (event) => { if (!trustedSender(event)) return false; fs.mkdirSync(logsDir(), { recursive: true }); diff --git a/app/main/prefs.js b/app/main/prefs.js index 9629933..777518c 100644 --- a/app/main/prefs.js +++ b/app/main/prefs.js @@ -17,6 +17,7 @@ const SCHEMA = { noiseSuppression: { default: true, check: (v) => typeof v === 'boolean' }, autoGainControl: { default: true, check: (v) => typeof v === 'boolean' }, voiceVolume: { default: 100, check: (v) => Number.isInteger(v) && v >= 0 && v <= 200 }, + hardwareVideoDecode: { default: true, check: (v) => typeof v === 'boolean' }, streamVolume: { default: 100, check: (v) => Number.isInteger(v) && v >= 0 && v <= 100 }, }; diff --git a/app/preload/preload.js b/app/preload/preload.js index 3c5e87c..f0ce5ea 100644 --- a/app/preload/preload.js +++ b/app/preload/preload.js @@ -27,5 +27,7 @@ contextBridge.exposeInMainWorld('teamspeach', { copyText: (text) => ipcRenderer.invoke('clipboard:write', text), openLogs: () => ipcRenderer.invoke('app:open-logs'), fetchExternalMedia: (url) => ipcRenderer.invoke('media:external', url), + getVideoStatus: () => ipcRenderer.invoke('app:video-status'), + relaunch: () => ipcRenderer.invoke('app:relaunch'), log: (level, message) => ipcRenderer.send('app:log', level, String(message)), }); diff --git a/app/renderer/index.html b/app/renderer/index.html index 9916dc4..29f014a 100644 --- a/app/renderer/index.html +++ b/app/renderer/index.html @@ -83,6 +83,7 @@

Каналы появятся после подключения к серверу.

+